oracel dg日常管理

简介: --正确打开备库startup mount;alter database recover managed standby database disconnect from session...
--正确打开备库
startup mount;
alter database recover managed standby database disconnect from session;


--应用重做日志
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE;


--正确关闭备库
alter database recover managed standby database cancel;
alter database open;
shutdown immediate;


--查看主备库
select name,open_mode,database_role,db_unique_name from v$database;


--主库查看当前日志状况
select sequence#,status from v$log;


--备库接收日志情况
select process,status,thread#,sequence#,blocks from v$managed_standby;
select archived_thread#,archived_seq#,applied_thread#,applied_seq# from v$archive_dest_status;


--查看备库已经应用的redo
select thread#,sequence#,first_change#,next_change# from v$log_history;
select dest_name,status,destination,target,archiver,schedule,valid_type,valid_role,db_unique_name from v$archive_dest;
select thread#,group#,sequence#,status,arcived,first_change#,first_time,last_change#,last_time from v$standby_log;
select thread#,low_sequence#,high_sequence# from v$archive_gap;
select * from v$dataguard_status;
select sequence#,standby_dest,archived,applied from v$archived_log order by sequence# desc;
select * from v$archive_dest_status;


--角色切换,switchover


--主库处理
--如果switch_status的值为to standby则可以正常切换,如果为session active 则表示牌active则不允许切换
select switchover_status from v$database;
--如果switch_status的值为to standby则:
alter database commit to switchover to physical standby;
--如果switch_status的值为session active则:
alter database commit to switchover to physical standby with session shutdown;
--重启先前的主库
shutdown immediate;
startup mount;
select name,open_mode,database_role,db_unique_name from v$database;


--备库处理
--将目标备库转换为主库
select switchover_status from v$database;
--如果switch_status的值为to primary则:
alter database commit to switchover to primary;
--如果switch_status的值为session active则:
alter database commit to switchover to primary with session shutdown;
 alter database open;



目录
相关文章
|
监控 Oracle 网络协议
ASM 管理的 Oracle 19C 数据库ADG的搭建及主备切换
-- 主备库Grid及Oracle Home 目录 /u01/app/grid/product/19.0.0/gihome_1 /u01/app/oraInventory /u01/app/oracle/product/19.
1903 0
|
Oracle 关系型数据库
Oracle 物理 DG 转 ADG 步骤
DataGuard 物理备库,正常为 mount 状态,如果想要进行查询,需要转为 ADG,即 read only 状态!
Oracle 物理 DG 转 ADG 步骤
|
运维 网络协议 Oracle
Oracle运维笔记之通过duplicate创建DG时遇到的ORA-12528问题
Oracle运维笔记之通过duplicate创建DG时遇到的ORA-12528问题
1204 0
Oracle运维笔记之通过duplicate创建DG时遇到的ORA-12528问题
|
Oracle 关系型数据库 测试技术
|
SQL Oracle 关系型数据库