ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle DataGuard 常用命令备忘

Oracle DataGuard 常用命令备忘

原创 Linux操作系统 作者:why566 时间:2009-03-08 21:31:13 0 删除 编辑

--Start Standby Database

startup nomount
alter database mount standby database;
alter database recover managed standby database disconnect;

--Disable/Enable archive log destinations

alter system set log_archive_dest_state_2 = 'defer';
alter system set log_archive_dest_state_2 = 'enable';

--To remove a delay from a standby

alter database recover managed standby database cancel;
alter database recover managed standby database nodelay disconnect;

--Stop and Start of Logical standby apply

alter database stop logical standby apply;
alter database start logical standby apply;

--Physical Standby switchover:

In Primary Database:

ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY; 
或 ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;
SHUTDOWN IMMEDIATE;
STARTUP NOMOUNT;
ALTER DATABASE MOUNT STANDBY DATABASE;

In standby Database:

ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
或 ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;
SHUTDOWN IMMEDIATE;
STARTUP;

In Primary Database:

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;


--If the primary Database is down,we can use fllowing step to active standby database:

Alter DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
或 Alter DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE;
FORCE关键字将会停止当前活动的RFS进程,以便立刻执行failover。
Alter DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
SHUTDOWN IMMEDIATE;
STARTUP;

Register missing archive log file
Find archive log gap by query:

SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;

register using:

ALTER DATABASE REGISTER PHYSICAL LOGFILE 'filespec1';

 

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

上一篇: 归档报错
请登录后发表评论 登录
全部评论

注册时间:2008-07-04

  • 博文量
    46
  • 访问量
    88976