您好,欢迎访问三七文档
当前位置:首页 > 医学/心理学 > 医学现状与发展 > 完整版Oracle-DataGuard文档
完整版OracleDataGuard文档目录1、主库准备工作...................................................................................................................31.1、检查数据库是否支持DataGuard(企业版才支持),是否归档模式,Enableforcelogging...............31.2、如果主库没有密码文件则建立密码文件,从而可以OS验证的方式登陆..................................31.3、配置standbyredolog(最佳性能模式可以忽略,如果将来变成备库且要转为其它两种模式则要建立)............................................................................................................................................41.4、设置主库初始化参数............................................................................................................41.5、备份主库数据文件..........................................................................................................51.6、在主库上建立备库控制文件(控制文件通常需要有多份,手工将文件复制几份)..................................................................................................................................................61.7、为备库准备init参数......................................................................................................61.8、拷贝上面生成的文件backup_%T.bak、stdby_control01/02/03.ctl、initPHYSTDBY.ora到备库所在主机............................................................................................................................................72、建立备库.............................................................................................................................82.1、设置环境变量并建立备库一些必需目录.................................................................................82.2、在备库主机上生成密码文件,且sys密码和主库得一致..........................................................82.4、在备库上建立spfile..............................................................................................................92.5、启动物理备库......................................................................................................................92.7、配置standbyredolog(最佳性能模式可以忽略,如果要转为其它两种模式则要建立)..............92.8、在备库上,启动redoapply....................................................................................................103、主备库各参数文件内容...........................................................................................103.1、主备库listener.ora一样,如果有不一样也是host不一样......................................................103.2、主备库tnsnames.ora一样,如果有不一样也是host和port不一样.........................................113.3、init$ORACLE_SID.ora.........................................................................................................124、主库归档测试...........................................................................................................................155、修改主库DataGuard保护模式............................................................................165.1、LGWR传送日志的配置方法:........................................................................................165.2、修改主库DataGuard保护模式.........................................................................................175.3、主库修改初始化参数(主库db_wending操作)............................................................175.4、主库通过命令行修改数据保护模式,重启主数据库(主库db_wending操作)..................175.5、重启主库(主库操作)..................................................................................................175.6、查看主库保护模式是否变更成功(主库操作)...............................................................185.7、修改备库的log_archive_dest_2初始化参数方便数据库角色切换(备库操作)..................185.8、查看备库数据保护模式(备库操作).............................................................................185.9、验证一下“最高可用性”切换成果....................................................................................196、DataGuard关启状态................................................................................................207、主备数据库切换.....................................................................................................................217.1、正常切换:....................................................................................................................217.2、非正常切换:(即主服务器当机的情况)启动failover......................................................228、常用维护SQL.............................................................................................................221、主库准备工作HostIPDB_NAMEDB_UNIQUE_NAMENetServiceName(网络服务名)主库192.168.137.128ORCLDBWENDINGdb_wending备库192.168.137.129ORCLDBPHYSTDBYdb_phystdby保护模式:默认最大性能模式注意DataGuard启动顺序:启动顺序:先standby,后primary;关闭顺序:先primary,后standby;1.1、检查数据库是否支持DataGuard(企业版才支持),是否归档模式,Enableforcelogging$sqlplus'/assysdba'SQLselect*fromv$optionwhereparameter='ManagedStandby';确认主库处于归档模式SQLarchiveloglist(先检查是否归档模式,不是则修改)startupmountalterdatabasearchivelog;alterdatabaseopen;将primary数据库置为FORCELOGGING模式SQLalterdatabaseforcelogging;(强制产生日志)1.2、如果主库没有密码文件则建立密码文件,从而可以OS验证的方式登陆$orapwdfile=$ORACLE_HOME/dbs/orapw$ORACLE_SIDpassword=iamwangncentries=51.3、配置standbyredolog(最佳性能模式可以忽略,如果将来变成备库且要转为其它两种模式则要建立)SQLalterdatabaseaddstandbylogfilegroup4('/orahome/oradata/WENDING/stdby_redo04.log')size50m,group5('/orahome/oradata/WENDING/stdby_redo05.log')size50m,group6('/orahome/oradata/WENDING/stdby_redo06.log')size50m,group7('/orahome/oradata/WENDING/stdby_redo0
本文标题:完整版Oracle-DataGuard文档
链接地址:https://www.777doc.com/doc-5317348 .html