Oracle Data Guard容灾技术实战(搭建一主一备19c ADG)_dataguard 实战
以下是搭建Oracle Data Guard的简化步骤,用于19c ADG环境的搭建:
准备主数据库服务器(Primary Database):
- 安装Oracle 19c数据库。
- 创建备份目录。
- 配置监听器。
准备备用数据库服务器(Standby Database):
- 安装Oracle 19c数据库。
- 创建备份目录。
- 配置监听器。
在主数据库上配置Oracle Data Guard环境:
-- 创建密码文件 orapwd file=orapwprimary password=your_password entries=5; -- 配置主数据库的初始化参数 alter system set log_archive_config='DG_CONFIG=(primary,standby)' scope=both; alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/archive VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=primary' scope=both; alter system set log_archive_dest_2='SERVICE=standby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=standby' scope=both; alter system set remote_login_passwordfile=exclusive scope=both; alter system set db_unique_name='primary' scope=both; alter system set log_archive_format='%t_%s_%r.arc' scope=both; alter system set standby_file_management=auto scope=both; alter database force logging; -- 开启主数据库的Real Application Testest alter system set fal_server='standby' scope=both; alter system set fal_client='primary' scope=both; alter system set standby_archive_dest='/u01/app/oracle/archive' scope=both;
在备用数据库上配置Oracle Data Guard环境:
-- 创建密码文件 orapwd file=orapwstandby password=your_password entries=5; -- 配置备用数据库的初始化参数 alter system set log_archive_config='DG_CONFIG=(primary,standby)' scope=both; alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/archive VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=standby' scope=both; alter system set log_archive_dest_2='SERVICE=primary LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=primary' scope=both; alter system set remote_login_passwordfile=exclusive scope=both; alter system set db_unique_name='standby' scope=both; alter system set log_archive_format='%t_%s_%r.arc' scope=both; alter system set standby_file_management=auto scope=both; alter database force logging; -- 开启备用数据库的Real Application Testest alter system set fal_server='primary' scope=both; alter system set fal_client='standby' scope=both; alter system set standby_archive_dest='/u01/app/oracle/archive' scope=both;
在主数据库上配置TNS和Oracle Data Guard:
-- 编辑主数据库的tnsnames.ora文件 standby = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP
评论已关闭