[20180424]開啟表空flashback on.txt

lfree發表於2018-04-24

[20180424]開啟表空flashback on.txt

--//昨天測試完成,連結http://blog.itpub.net/267265/viewspace-2153207/,忘記設定flashback on;.
--//今天設定回來,順便做一個筆記.

1.環境:
SYS@book> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

SYS@book> select open_mode from v$database ;
OPEN_MODE
--------------------
READ WRITE

SYS@book> alter tablespace tea flashback on;
alter tablespace tea flashback on
*
ERROR at line 1:
ORA-01126: database must be mounted in this instance and not open in any instance

--//竟然不能在open狀態設定flashback on;.
$ oerr ora 01126
01126, 00000, "database must be mounted in this instance and not open in any instance"
// *Cause:  Obvious
// *Action:

2.測試在表空間offline下是否可行.

SYS@book> alter tablespace tea offline;
Tablespace altered.

SYS@book> alter tablespace tea flashback on;
alter tablespace tea flashback on
*
ERROR at line 1:
ORA-01126: database must be mounted in this instance and not open in any instance

SYS@book> alter tablespace tea online;
Tablespace altered.

--//看來必須在mount狀態下調整.

SYS@book> startup mount
ORACLE instance started.
Total System Global Area  634732544 bytes
Fixed Size                  2255792 bytes
Variable Size             197133392 bytes
Database Buffers          427819008 bytes
Redo Buffers                7524352 bytes
Database mounted.
SYS@book> alter tablespace tea flashback off;

Tablespace altered.

SYS@book> alter tablespace tea flashback on;

Tablespace altered.

SYS@book> select * from v$tablespace;
       TS# NAME     INC BIG FLA ENC
---------- -------- --- --- --- ---
         0 SYSTEM   YES NO  YES
         1 SYSAUX   YES NO  YES
         2 UNDOTBS1 YES NO  YES
         4 USERS    YES NO  YES
         3 TEMP     NO  NO  YES
         6 EXAMPLE  YES NO  YES
         7 TEA      YES NO  YES
7 rows selected.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2153275/,如需轉載,請註明出處,否則將追究法律責任。

相關文章