Oracle dataguard 配置
2012-10-19 14:03:51 来源:WEB开发网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;
- ››oracle 中 UPDATE nowait 的使用方法
- ››Oracle ORA-12560解决方法
- ››Oracle 10g RAC 常用维护命令
- ››Oracle如何在ASM中定位文件的分布
- ››Oracle的DBMS_RANDOM.STRING 的用法
- ››oracle 外部表导入时间日期类型数据,多字段导入
- ››Oracle中查找重复记录
- ››oracle修改用户登录密码
- ››Oracle创建删除用户、角色、表空间、导入导出等命...
- ››Oracle中登陆时报ORA-28000: the account is lock...
- ››Oracle数据库在配置文件中更改最大连接数
- ››Oracle中在pl/sql developer修改表的两种方式
更多精彩
赞助商链接