Oracle_dataguard__11G_配置与维护手册
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
1.判断DataGuard是否安装
select * from v$option where parameter = 'Oracle Data Guard';
2.网络配置
192.168.1.10(orcl)------------------------------------192.168.1.20(dg)
3.监听配置
主库
[oracle@node1 ~]$cd/u01/app/product/11.2.0/db_1/network/admin [oracle@node1 admin]$cat listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1)(PORT = 1521)) )
)
[oracle@node1 admin]$cat tnsnames.ora
ORCL=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1)(PORT = 1521)) )
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
DG =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node2)(PORT = 1521)) )
(CONNECT_DATA =
(SERVICE_NAME = dg)
)
)
备库
[oracle@node1 admin]$cat listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node2)(PORT = 1521)) )
)
[oracle@node1 admin]$cat tnsnames.ora
ORCL=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1)(PORT = 1521)) )
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
DG =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node2)(PORT = 1521)) )
(CONNECT_DATA =
(SERVICE_NAME = dg)
)
)
4.主库前期准备
设置强制写日志
SQL> select FORCE_LOGGING fromv$database;
NO
SQL>alter databaseforce logging;
SQL>select FORCE_LOGGING from v$database;
YES
5.创建口令文件
orapwdfile=$ORACLE_HOME/dbs/orapwdb1 password=oracle entries=5
6.修改主库初始化参数
创建主库pfile
sql> create pfile from spfile;
修改pfile
DB_UNIQUE_NAME=orcl
LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,dg)'
LOG_ARCHIVE_DEST_1= 'LOCATION=/u01/app/archive
VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orcl'
LOG_ARCHIVE_DEST_2= 'SERVICE=dg LGWR
ASYNCVALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)DB_UNIQUE_NAME=dg'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
FAL_SERVER=dg
FAL_CLIENT=orcl
STANDBY_FILE_MANAGEMENT=AUTO
Pfile 拷贝到备库上
scp–rp/u01/app/product/11.2.0/db_1/dbs/initorcl.oranode2:/u01/app/product/11.2 .0/db_1/dbs/
7.修改数据库运行在归档模式下
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;
8.创建备份库需要的控制文件
创建控制文件
Shutdown immediate
STARTUP MOUNT;
ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/orcl.ctl';
ALTER DATABASE OPEN;
创建主库pfile
Shutdown immediate