SYS@SBDB1> show parameter recover;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /home/oracle/flash
db_recovery_file_dest_size big integer 4G
db_unrecoverable_scn_tracking boolean TRUE
recovery_parallelism integer 0
SYS@SBDB1> select FLASHBACK_ON from v$database;
FLASHBACK_ON
------------------
NO
SYS@SBDB1> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38788: More standby database recovery is needed
SYS@SBDB1> recover managed standby database cancel;
Database altered.
SYS@SBDB1> alter database flashback on;
Database altered.
SYS@SBDB1> alter database convert to snapshot standby;
Database altered.
SYS@SBDB1> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SYS@SBDB1> startup
ORACLE instance started.
Total System Global Area 523108352 bytes
Fixed Size 1346052 bytes
Variable Size 318768636 bytes
Database Buffers 197132288 bytes
Redo Buffers 5861376 bytes
Database mounted.
Database opened.
SYS@SBDB1> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
SYS@SBDB1> create table TEST(D_ID NUMBER);
insert into TEST VALUES(1);
commit;
insert into TEST VALUES(2);
commit;
Table created.
SYS@SBDB1>
1 row created.
SYS@SBDB1>
Commit complete.
SYS@SBDB1>
1 row created.
SYS@SBDB1>
Commit complete.
SYS@SBDB1> select * from test;
D_ID
----------
1
2
备库:snapshot转回physical standby
SYS@SBDB1> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@SBDB1> startup mount;
ORACLE instance started.
Total System Global Area 523108352 bytes
Fixed Size 1346052 bytes
Variable Size 314574332 bytes
Database Buffers 201326592 bytes
Redo Buffers 5861376 bytes
Database mounted.
SYS@SBDB1> alter database convert to physical standby;
Database altered.
SYS@SBDB1> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
SYS@SBDB1> startup
ORACLE instance started.
Total System Global Area 523108352 bytes
Fixed Size 1346052 bytes
Variable Size 314574332 bytes
Database Buffers 201326592 bytes
Redo Buffers 5861376 bytes
Database mounted.
Database opened.
SYS@SBDB1> recover managed standby database using current logfile disconnect from session;
Media recovery complete.
SYS@SBDB1> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
SYS@SBDB1> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY WITH APPLY
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /home/oracle/flash
db_recovery_file_dest_size big integer 4G
db_unrecoverable_scn_tracking boolean TRUE
recovery_parallelism integer 0
SYS@SBDB1> select FLASHBACK_ON from v$database;
FLASHBACK_ON
------------------
NO
SYS@SBDB1> alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38788: More standby database recovery is needed
SYS@SBDB1> recover managed standby database cancel;
Database altered.
SYS@SBDB1> alter database flashback on;
Database altered.
SYS@SBDB1> alter database convert to snapshot standby;
Database altered.
SYS@SBDB1> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SYS@SBDB1> startup
ORACLE instance started.
Total System Global Area 523108352 bytes
Fixed Size 1346052 bytes
Variable Size 318768636 bytes
Database Buffers 197132288 bytes
Redo Buffers 5861376 bytes
Database mounted.
Database opened.
SYS@SBDB1> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
SYS@SBDB1> create table TEST(D_ID NUMBER);
insert into TEST VALUES(1);
commit;
insert into TEST VALUES(2);
commit;
Table created.
SYS@SBDB1>
1 row created.
SYS@SBDB1>
Commit complete.
SYS@SBDB1>
1 row created.
SYS@SBDB1>
Commit complete.
SYS@SBDB1> select * from test;
D_ID
----------
1
2
备库:snapshot转回physical standby
SYS@SBDB1> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@SBDB1> startup mount;
ORACLE instance started.
Total System Global Area 523108352 bytes
Fixed Size 1346052 bytes
Variable Size 314574332 bytes
Database Buffers 201326592 bytes
Redo Buffers 5861376 bytes
Database mounted.
SYS@SBDB1> alter database convert to physical standby;
Database altered.
SYS@SBDB1> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
SYS@SBDB1> startup
ORACLE instance started.
Total System Global Area 523108352 bytes
Fixed Size 1346052 bytes
Variable Size 314574332 bytes
Database Buffers 201326592 bytes
Redo Buffers 5861376 bytes
Database mounted.
Database opened.
SYS@SBDB1> recover managed standby database using current logfile disconnect from session;
Media recovery complete.
SYS@SBDB1> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
SYS@SBDB1> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY WITH APPLY
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30192548/viewspace-2121487/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30192548/viewspace-2121487/