DG测试—Snapshot standby

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

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30192548/viewspace-2121487/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30192548/viewspace-2121487/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值