oracle 11204 RAC Dataguard 单机物理备库文档.docx
- 文档编号:4776244
- 上传时间:2022-12-08
- 格式:DOCX
- 页数:39
- 大小:28.97KB
oracle 11204 RAC Dataguard 单机物理备库文档.docx
《oracle 11204 RAC Dataguard 单机物理备库文档.docx》由会员分享,可在线阅读,更多相关《oracle 11204 RAC Dataguard 单机物理备库文档.docx(39页珍藏版)》请在冰豆网上搜索。
oracle11204RACDataguard单机物理备库文档
oracle11.2.0.4RACDataguard单机物理备库文档
oracle工程师:
辛欣,齐管军
注意:
生产环境请根据实际环境做相应的变更。
1创建物理备库准备工作
1.1修改RAC数据库为FORCELOGGING
SQL>selectforce_loggingfromv$database;
FORCE_LOG
---------
NO
SQL>ALTERDATABASEFORCELOGGING;
Databasealtered.
SQL>selectforce_loggingfromv$database;
FORCE_LOG
---------
YES
1.2查询online的redolog
SQL>setlinesize150;
setpagesize50;
columnMBformata5;
columnSTATUSformata12;
columnMEMBERformata50;
selectl.GROUP#,l.THREAD#,l.BYTES/1024/1024||'MB'MB,l.STATUS,lf.TYPE,lf.MEMBERfromv$logl,v$logfilelfwherel.GROUP#=lf.GROUP#;
GROUP#THREAD#MBSTATUSTYPEMEMBER
----------------------------------------------------------------------------------------------
41512MBINACTIVEONLINE+DATADG/pcdb/onlinelog/group_4.270.850380825
31512MBCURRENTONLINE+DATADG/pcdb/onlinelog/group_3.274.850380823
21512MBINACTIVEONLINE+DATADG/pcdb/onlinelog/group_2.275.850380821
11512MBINACTIVEONLINE+DATADG/pcdb/onlinelog/group_1.276.850380819
52512MBINACTIVEONLINE+DATADG/pcdb/onlinelog/group_5.267.850380989
62512MBINACTIVEONLINE+DATADG/pcdb/onlinelog/group_6.264.850380991
72512MBINACTIVEONLINE+DATADG/pcdb/onlinelog/group_7.263.850380991
82512MBCURRENTONLINE+DATADG/pcdb/onlinelog/group_8.262.850380993
8rowsselected.
1.3编辑hosts文件主机名解析配置
1.3.1编辑RAC所有节点的/etc/hosts文件
以节点grrac1为例,编辑/etc/hosts文件
[root@grrac1~]#vi/etc/hosts
添加以下内容:
#grracdataguard
192.168.19.14grmesdg
1.3.2编辑备库主机grmesdg的/etc/hosts文件
[root@grmesdg~]#vi/etc/hosts
添加以下内容:
#grracPublicIP
192.168.19.7grrac1
192.168.19.8grrac2
192.168.19.9grrac3
#grracPrivateIP
172.30.0.1grrac1priv
172.30.0.2grrac2priv
172.30.0.3grrac3priv
#grracVIP
192.168.19.10grrac1vip
192.168.19.11grrac2vip
192.168.19.12grrac3vip
#grracSCANIP
192.168.19.13grracscan
1.4设置备库主机监听
编辑listener.ora文件
[oracle@grmesdg~]$vi$ORACLE_HOME/network/admin/listener.ora
添加并确认以下内容:
#listener.oraNetworkConfigurationFile:
/u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
#GeneratedbyOracleconfigurationtools.
LISTENER=
(DESCRIPTION_LIST=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=grmesdg)(PORT=1521))
(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))
)
)
ADR_BASE_ORACLE=/u01/app/oracle
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=standby)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)
(SID_NAME=standby)
)
)
启动监听
[oracle@grmesdg~]$lsnrctlstart
LSNRCTLforLinux:
Version11.2.0.4.0-Productionon16-JUN-201420:
10:
55
Copyright(c)1991,2013,Oracle.Allrightsreserved.
Starting/u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr:
pleasewait...
TNSLSNRforLinux:
Version11.2.0.4.0-Production
Systemparameterfileis/u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Logmessageswrittento/u01/app/oracle/diag/tnslsnr/grmesdg/listener/alert/log.xml
Listeningon:
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=grmesdg)(PORT=1521)))
Listeningon:
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connectingto(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=grmesdg)(PORT=1521)))
STATUSoftheLISTENER
------------------------
AliasLISTENER
VersionTNSLSNRforLinux:
Version11.2.0.4.0-Production
StartDate16-JUN-201420:
10:
55
Uptime0days0hr.0min.0sec
TraceLeveloff
SecurityON:
LocalOSAuthentication
SNMPOFF
ListenerParameterFile/u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
ListenerLogFile/u01/app/oracle/diag/tnslsnr/grmesdg/listener/alert/log.xml
ListeningEndpointsSummary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=grmesdg)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
ServicesSummary...
Service"standby"has1instance(s).
Instance"standby",statusUNKNOWN,has1handler(s)forthisservice...
Thecommandcompletedsuccessfully
或重载监听
[oracle@grmesdg~]$lsnrctlreloadLISTENER
LSNRCTLforLinux:
Version11.2.0.4.0-Productionon16-JUN-201420:
11:
16
Copyright(c)1991,2013,Oracle.Allrightsreserved.
Connectingto(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=grmesdg)(PORT=1521)))
Thecommandcompletedsuccessfully
1.5编辑tnsnames.ora文件
1.5.1RAC所有节点tnsnames.ora文件编辑
以节点grrac1为例,编辑tnsnames.ora文件
[oracle@grrac1~]$vi$ORACLE_HOME/network/admin/tnsnames.ora
添加以下内容:
STANDBY=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.19.8)(PORT=1521))
)
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=standby)
)
)
以节点1-grrac1为例验证tnsname配置
[oracle@grrac1~]$tnspingSTANDBY
TNSPingUtilityforLinux:
Version11.2.0.4.0-Productionon16-JUN-201420:
13:
31
Copyright(c)1997,2013,Oracle.Allrightsreserved.
Usedparameterfiles:
UsedTNSNAMESadaptertoresolvethealias
Attemptingtocontact(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.19.8)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=standby)))
OK(10msec)
1.5.2备库主机grmesdg编辑tnsnames.ora文件
[oracle@grmesdg~]$vi$ORACLE_HOME/network/admin/tnsnames.ora
添加以下内容:
STANDBY=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.19.13)(PORT=1521))
)
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=standby)
)
)
PCDB=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.114)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.116)(PORT=1521))
(LOAD_BALANCE=yes)
)
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=pcdb)
)
)
验证tnsname配置
[oracle@grmesdg~]$tnspingSTANDBY
TNSPingUtilityforLinux:
Version11.2.0.4.0-Productionon16-JUN-201420:
14:
20
Copyright(c)1997,2013,Oracle.Allrightsreserved.
Usedparameterfiles:
UsedTNSNAMESadaptertoresolvethealias
Attemptingtocontact(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.19.13)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=standby)))
OK(10msec)
[oracle@grmesdg~]$tnspingPCDB
TNSPingUtilityforLinux:
Version11.2.0.4.0-Productionon16-JUN-201420:
14:
56
Copyright(c)1997,2013,Oracle.Allrightsreserved.
Usedparameterfiles:
UsedTNSNAMESadaptertoresolvethealias
Attemptingtocontact(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.114)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.116)(PORT=1521))(LOAD_BALANCE=yes))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=pcdb)))
OK(0msec)
1.6主库初始化参数检查与设置
1.6.1查看数据库DB_NAME
SQL>setlinesize150;
showparametersDB_NAME
NAMETYPEVALUE
--------------------------------------------------------------------------------------------------
db_namestringpcdb
1.6.2查看数据库DB_UNIQUE_NAME和归档模式
SQL>setlinesize150;
showparametersDB_UNIQUE_NAME
NAMETYPEVALUE
--------------------------------------------------------------------------------------------------
db_unique_namestringpcdb
SQL>selectDB_UNIQUE_NAME,NAME,LOG_MODEfromv$database;
DB_UNIQUE_NAMENAMELOG_MODE
---------------------------------------------------
pcdbPCDBARCHIVELOG
1.6.3查看LOG_ARCHIVE_CONFIG参数,并设置
查看归档设置
SQL>archiveloglist;
DatabaselogmodeArchiveMode
AutomaticarchivalEnabled
Archivedestination+ARCHDG
Oldestonlinelogsequence8
Nextlogsequencetoarchive11
Currentlogsequence11
SQL>setlinesize150;
showparametersLOG_ARCHIVE_CONFIG
NAMETYPEVALUE
---------------------------------------------------------------------------------------------------
log_archive_configstring
SQL>altersystemsetLOG_ARCHIVE_CONFIG='DG_CONFIG=(pcdb,standby)';
Systemaltered.
SQL>setlinesize150;
showparametersLOG_ARCHIVE_CONFIG
NAMETYPEVALUE
--------------------------------------------------------------------------------------------------
log_archive_configstringDG_CONFIG=(pcdb,standby)
1.6.4查看控制文件路径
SQL>setlinesize150;
showparametersCONTROL_FILES
NAMETYPEVALUE
--------------------------------------------------------------------------------------------------
control_filesstring+DATADG/pcdb/controlfile/curre
nt.277.850380817
1.6.5所有节点查看并设置归档参数
查看当前归档参数:
SQL>setlinesize150;
showparametersLOG_ARCHIVE_DEST_1
NAMETYPEVALUE
--------------------------------------------------------------------------------------------------
log_archive_dest_1stringLOCATION=+ARCHDG
log_archive_dest_10string
log_archive_dest_11string
log_archive_dest_12string
log_archive_dest_13string
log_archive_dest_14string
log_archive_dest_15string
log_archive_dest_16string
log_archive_dest_17string
log_archive_dest_18string
log_archive_dest_19string
SQL>showparametersLOG_ARCHIVE_DEST_2
NAMETYPEVALUE
--------------------------------------------------------------------------------------------------
log_archive_dest_2string
log_archive_dest_20string
log_archive_dest_21string
log_archive_dest_22string
log_archive_dest_23string
log_archive_dest_24string
log_archive_dest_25string
log_archive_dest_26string
log_archive_dest_27string
log_archive_dest_28string
log_archive_dest_29string
修改归档参数LOG_ARCHIVE_DEST_1和LOG_ARCHIVE_DEST_2:
SQL>altersystemsetLOG_ARCHIVE_DEST_1='LOCATION=+ARCHDGVALID_FOR=(ALL_LOGFILES,ALL_ROLES)DB_UNIQUE_NAME=pcdb';
Systemaltered.
SQL>altersystemsetLOG_ARCHIVE_DEST_2='SERVICE=standbyASYNCVALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)DB_UNIQUE_NAME=standby';
Systemaltered.
确认修改后归档参数:
SQL>setlinesize150;
setpagesize100
showparametersLOG_ARCHIVE_DEST_1
NAMETYPEVALUE
-----------------------------------------------------------------------------
log_archive_dest_1stringLOCATION=+ARCHDGVALID_FOR=(AL
L_LOGFILES,ALL_ROLES)DB_UNIQU
E_NAME=rac11g
log_archive_dest_10string
log_archive_des
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- oracle 11204 RAC Dataguard 单机物理备库文档 单机 物理 文档