oracle adg容灾切换需要注意的参数
1.DG角色在线转换
1.1 角色(主备)
和DG有关的角色:
primary database 主库,在线服务应用
physical standby database 备库,物理备库,在线备份主库数据与主库完全一样
logical standby database 备库,逻辑备库,与主库数据保持一致但是物理结构可能不同。
1.2 角色切换(主备切换)
角色切换的两种情况:
switchover:人为有计划的进行角色切换(例如主库升级,硬件升级等)
failover:主库崩溃,配置相关参数可以自动实现切换
角色切换的顺序:
primary database先切换成备库standby模式,然后再选择一个备库升级为主库。
2.切换前准备
2.1 确定主备相关参数:
2.1.1 查看主库角色和保护模式及级别
SYS@proe> select database_role,protection_mode,protection_level from v$database; DATABASE_ROLE PROTECTION_MODE PROTECTION_LEVEL ---------------- -------------------- -------------------- PRIMARY MAXIMUM AVAILABILITY RESYNCHRONIZATION
2.1.2 通过参数查看主库对应的备库信息
SYS@proe>show parameter fal_server; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ fal_server string stddb
2.1.3 查看主库对应的convert参数
SYS@proe>show parameter db_file_name_convert; NAME TYPE VALUE ------------------------------------ ----------- ---------------------- db_file_name_convert string /u01/app/oracle/oradata/stddb/,/u01/app/oracle/oradata/proe /
2.1.4 查看主库归档位置以及对应备库信息
SYS@proe> show parameter log_archive_dest_2; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ log_archive_dest_2 string service=stddb valid_for=(onlin e_logfiles,primary_role) db_un ique_name=stddb SYS@stddb> show parameter log_archive_dest_2 NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ log_archive_dest_2 string service=stddb valid_for=(onlin e_logfiles,primary_role) db_un ique_name=pridb
2.2 网络检查
2.2.1 使用tnsping
[oracle@11g ~]$ tnsping stddb TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 22-JUL-2020 12:37:21 Copyright (c) 1997, 2013, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 11gtest)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = stddb))) OK (20 msec) [oracle@11gtest ~]$ tnsping proe TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 19-JUL-2020 17:31:35 Copyright (c) 1997, 2013, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 11g)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = proe))) OK (110 msec)
2.2.2 进行远程登录测试
[oracle@11gtest ~]$ sqlplus sys/123456@proe as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Sun Jul 19 17:33:18 2020 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SYS@proe> [oracle@11g ~]$ sqlplus sys/123456@stddb as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Wed Jul 22 12:39:40 2020 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SYS@stddb>