snapshot standby database
2016-04-19 14:11 abce 阅读(476) 评论(0) 编辑 收藏 举报快照备库接收和归档主库发送来的redo,但是不会应用;切换成physical standby之后会自动开启redo apply。
快照standby不可以参加主备切换;在最大保护性模式下,如果只有一个备库,则不可以将备库转成snapshot standby。
将Physical Standby Database转换成Snapshot Standby Database
1.停止redo apply
SQL> alter database recover managed standby database cancel;
2.确保数据是mounted状态,而不是open状态
SQL> select open_mode,database_role from v$database; OPEN_MODE DATABASE_ROLE -------------------- ---------------- MOUNTED PHYSICAL STANDBY SQL>
3.确认已经创建好fast recovery area(不需要对数据库开启闪回)
SQL> show parameter db_recovery_file NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_recovery_file_dest string /s01/app/oracle/flash db_recovery_file_dest_size big integer 4G SQL>
4.执行转换
SQL> alter database convert to snapshot standby ; Database altered. SQL> select open_mode,database_role from v$database; OPEN_MODE DATABASE_ROLE -------------------- ---------------- MOUNTED SNAPSHOT STANDBY SQL>
5.将数据打开
SQL> alter database open; Database altered. #打开模式已经改变,但是角色不变 SQL> select open_mode,database_role from v$database; OPEN_MODE DATABASE_ROLE -------------------- ---------------- READ WRITE SNAPSHOT STANDBY SQL>
将Snapshot Standby Database切换成Physical Standby Database
1.如果是RAC环境,要先关掉所有实例
2.将数据库启动到mount状态
3.执行切换
SQL> select open_mode,database_role from v$database; OPEN_MODE DATABASE_ROLE -------------------- ---------------- MOUNTED SNAPSHOT STANDBY SQL> alter database convert to physical standby; Database altered. #转换命令结束后,数据库会自动被dismounted,需要关闭重启数据库。 SQL> select open_mode,database_role from v$database; select open_mode,database_role from v$database * ERROR at line 1: ORA-01507: database not mounted SQL> startup mount ORA-01081: cannot start already-running ORACLE - shut it down first SQL> shutdown immediate ORA-01507: database not mounted ORACLE instance shut down. SQL> startup mount ORACLE instance started. Total System Global Area 430075904 bytes Fixed Size 2253944 bytes Variable Size 184552328 bytes Database Buffers 239075328 bytes Redo Buffers 4194304 bytes Database mounted. SQL>