将备库切换到快照模式

切换到快照模式步骤

 

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 ;


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

huangliang0703

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值