WEB开发网
开发学院数据库Oracle Oracle dataguard 配置 阅读

Oracle dataguard 配置

 2012-10-19 14:03:51 来源:WEB开发网   
核心提示:StartupSelect name,database_role from v$database;15.启动备库Conn /as sysdbaCreate pfile from pfileStartup nomountAlter database mount standby database;Select name,d

Startup

Select name,database_role from v$database;

15.启动备库

Conn /as sysdba

Create pfile from pfile

Startup nomount

Alter database mount standby database;

Select name,database_role from v$database;

Alter database recover managed standby database disconnect from session;

16.可以建表测试

主库create table a (id1 number,id2 number);

Insert into a values(1,1);

Commit;

Alter system switch logfile;

Alter system switch logfile;

Alter system switch logfile;

备库 select sequence#,first_name,next_time from v$archive_log orader by sequence#;

Select sequence#,applied from v$archived_log order by sequence#;

Alter database recover managed standby database cancel;

Alter database open read only;

Select * from a;

Alter database recover managed standby database disconnect from session; 启动redo应用

17.主备库切换

更改主数据库为备用状态

Alter database commit to switchover to physical standby;

关闭主数据库

Shutdown immediate;

在备用模式启动主数据库

Startup nomount;

alter database mount standby database;

select name,open_mode,protection_mode,database_role from v$database;

alter database recover managed stanby database disconnect from session;

打开备用数据库

Conn / sysdba

Alter database commit to switchover primary;

Shutdown immediate;

Startup

Alter system switch logfile;

18.failover

在standby 上

Alter database recover managed standby database finish;

Alter database recover managed standby database skip standby logfile;

Alter database commit to switchover to primary;

Shutdown immediate;

Startup;

19. Alter database recover managed standby database cancel;

Alter database open read only;

如果直接切换到主库

alter database commit to switchover to primary;会报错

ORA-16139: media recovery required

必须执行

alter database recover managed stanby database disconnect from session;

alter database commit to switchover to primary;

上一页  1 2 

Tags:Oracle dataguard 配置

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接