切换到快照模式步骤
SQL> alter database recover managed standbydatabase cancel;
SQL> alter database convert to snapshot standby;
alter database convert to snapshot standby
Starting background process RVWR
Tue Jun 02 01:27:13 2015
RVWR started with pid=25, OS id=4849
Allocated 3981120 bytes in shared pool for flashback generation buffer
Created guaranteed restore point SNAPSHOT_STANDBY_REQUIRED_06/02/2015 01:27:12
All dispatchers and shared servers shutdown
CLOSE: killing server sessions.
CLOSE: all sessions shutdown successfully.
Tue Jun 02 01:27:15 2015
SMON: disabling cache recovery
Begin: Standby Redo Logfile archival
End: Standby Redo Logfile archival
RESETLOGS after incomplete recovery UNTIL CHANGE 1328261
Resetting resetlogs activation ID 1391023848 (0x52e956e8)
Online log /export/11g/flash_recovery_area/ORCL2/onlinelog/o1_mf_1_b61n1hpr_.log: Thread 1 Group 1 was previously cleared
Online log /export/11g/flash_recovery_area/ORCL2/onlinelog/o1_mf_2_b61n1knl_.log: Thread 1 Group 2 was previously cleared
Online log /export/11g/flash_recovery_area/ORCL2/onlinelog/o1_mf_3_b61n1m91_.log: Thread 1 Group 3 was previously cleared
Standby became primary SCN: 1328259
Tue Jun 02 01:27:16 2015
Setting recovery target incarnation to 3
CONVERT TO SNAPSHOT STANDBY: Complete - Database mounted as snapshot standby
Completed: alter database convert to snapshot standby
Tue Jun 02 01:27:29 2015
idle dispatcher 'D000' terminated, pid = (17, 1)
Tue Jun 02 01:28:01 2015
ARC0: Becoming the 'no SRL' ARCH
Tue Jun 02 01:28:02 2015
ARC1: Becoming the 'no SRL' ARCH
创建管理文件,创建快照点,生成在线日志文件
SQL> shutdown immediate
SQL> startup
重启监听文件
lsnrctl stop
lsnrctl start
SQL> select open_mode, database_role fromv$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
READ WRITE SNAPSHOT STANDBY
完成测试后,您要将快照备用数据库恢复为普通的物理备用数据库。执行以下步骤:
SQL> shutdown immediate
SQL> startup mount
SQL> alter database convert to physical standby;
alter database convert to physical standby
ALTER DATABASE CONVERT TO PHYSICAL STANDBY (orcl)
Flashback Restore Start
Flashback Restore Complete
Stopping background process RVWR
Deleted Oracle managed file /export/11g/flash_recovery_area/ORCL2/flashback/o1_mf_bpthokfx_.flb
Guaranteed restore point dropped
Clearing standby activation ID 1409104145 (0x53fd3911)
The primary database controlfile was created using the
'MAXLOGFILES 16' clause.
There is space for up to 13 standby redo logfiles
Use the following SQL commands on the standby database to create
standby redo logfiles that match the primary database:
ALTER DATABASE ADD STANDBY LOGFILE 'srl1.f' SIZE 52428800;
ALTER DATABASE ADD STANDBY LOGFILE 'srl2.f' SIZE 52428800;
ALTER DATABASE ADD STANDBY LOGFILE 'srl3.f' SIZE 52428800;
ALTER DATABASE ADD STANDBY LOGFILE 'srl4.f' SIZE 52428800;
Completed: alter database convert to physical standby
删除管理文件,删除快照点,删除在线日志文件
SQL> shutdown
SQL> startup mount
重启备库监听
lsnrctl stop
lsnrctl start
SQL> alter database recover managed standby databaseusing current logfile disconnect from session ;
SQL> alter database open ;