oracle adg switch over,Oracle 11g ADG SWITCHOVER 切换过程

--- 主库操作

alter system archive log current;

alter system checkpoint;

select switchover_status from v$database;

alter database commit to switchover to physical standby with session shutdown;

startup mount;

--- 备库操作

select switchover_status from v$database;

alter database commit to switchover to primary with session shutdown;

alter database open;

--- 切换后备库操作

alter database open;

alter database recover managed standby database using current logfile disconnect from session;

--- 下面为切换输出过程

sys@DBPOD> alter system archive log current;

System altered.

sys@DBPOD> alter system checkpoint;

System altered.

sys@DBPOD> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

SWITCHOVER_STATUS

--------------------

TO STANDBY

sys@DBPOD> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;

ERROR:

ORA-01034: ORACLE not available

Process ID: 13037

Session ID: 21 Serial number: 543

Database altered.

sys@DBPOD> select status from v$instance;

select status from v$instance

*

ERROR at line 1:

ORA-01034: ORACLE not available

Process ID: 13037

Session ID: 21 Serial number: 543

ERROR:

ORA-01034: ORACLE not available

Process ID: 13037

Session ID: 21 Serial number: 543

sys@DBPOD> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Oracle Label Security, OLAP, Data Mining,

Oracle Database Vault and Real Application Testing options

[oracle@dbtest5 dbpod]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Jul 22 14:52:13 2016

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Connected to an idle instance.

idle> startup mount;

ORACLE instance started.

Total System Global Area 3290345472 bytes

Fixed Size 2257720 bytes

Variable Size 2113932488 bytes

Database Buffers 1157627904 bytes

Redo Buffers 16527360 bytes

Database mounted.

sys@DBPOD> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

SWITCHOVER_STATUS

--------------------

TO PRIMARY

sys@DBPOD> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;

Database altered.

sys@DBPOD> ALTER DATABASE OPEN;

Database altered.

sys@DBPOD> select status from v$instance;

STATUS

------------

OPEN

sys@DBPOD> select open_mode from V$DATABASE;

OPEN_MODE

--------------------

READ WRITE

idle> alter database open;

Database altered.

idle> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

Database altered.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值