版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
數(shù)據(jù)庫(kù)遷移升級(jí)操作手冊(cè)目錄一、操作系統(tǒng)安裝及環(huán)境配置 31、操作系統(tǒng)安裝 32、環(huán)境配置 33、配置共享存儲(chǔ) 6二、GI集群軟件安裝 131、檢查安裝環(huán)境 132、安裝GI軟件 153、創(chuàng)建ASM磁盤組 29三、RAC數(shù)據(jù)庫(kù)安裝 301、安裝RAC數(shù)據(jù)庫(kù)軟件 302、創(chuàng)建數(shù)據(jù)庫(kù) 363、創(chuàng)建用戶及用戶表空間 44四、.4.17補(bǔ)丁 451,升級(jí)Opatch 452,檢查Opatch版本 453,檢查Inventory有效性 454,配置OCM 455,解壓patch文件 456,PatchGI,用root用戶執(zhí)行 457,執(zhí)行腳本 458,檢查GI的補(bǔ)丁情況 469,升級(jí)DBPSU 4610,安裝patch 4611,執(zhí)行腳本 4612,驗(yàn)證Opatch是否成功 46五、GoldenGate軟件安裝及配置 461、安裝OGG軟件并配置相關(guān)用戶 462、源數(shù)據(jù)庫(kù)配置 483、配置進(jìn)程參數(shù)文件 494、創(chuàng)建進(jìn)程 51六、初始化數(shù)據(jù) 511,啟動(dòng)抽取進(jìn)程,記錄源端SCN號(hào) 512,EXPDP指定SCN號(hào)導(dǎo)出源端數(shù) 523,傳輸dump文件 524,導(dǎo)入數(shù)據(jù) 525,查詢歸檔空間大小,修改歸檔空間大小 52七、同步數(shù)據(jù) 521,源端開啟投遞進(jìn)程 522,目標(biāo)端開啟復(fù)制進(jìn)程 52八、業(yè)務(wù)切換 521,收集統(tǒng)計(jì)信息 522,停止業(yè)務(wù) 523,開啟數(shù)據(jù)庫(kù)附加日志 534,開啟數(shù)據(jù)庫(kù)強(qiáng)制日志 535,啟動(dòng)DB2->DB1的ogg進(jìn)程組 53九,回退 53十、配置DG 53數(shù)據(jù)庫(kù)遷移升級(jí)詳細(xì)步驟紅色部分為注意點(diǎn),橙色部分為操作步驟。一、操作系統(tǒng)安裝及環(huán)境配置(DB2)IP及機(jī)器名配置(ESXI:66):IPHostnameSID源端(DB1)60ora11gora11g目標(biāo)端(DB2)Scan-ip:6561rac1ora11g163(vip)(privip)62rac2ora11g264(vip)(privip)1、操作系統(tǒng)安裝(略)2、環(huán)境配置(rac1,rac2)配置/etc/hosts文件[root@rac1~]#vi/etc/hostslocalhostlocalhost.localdomainlocalhost4localhost4.localdomain4::1localhostlocalhost.localdomainlocalhost6localhost6.localdomain661rac162rac263rac1-vip64rac2-viprac1-privrac2-priv65rac-scan配置/etc/sysctl.conf文件[root@rac1~]#vi/etc/sysctl.conffs.aio-max-nr=1048576fs.file-max=6815744kernel.shmall=4194304kernel.shmmaxernel.shmmni=4096kernel.sem=25032000100128net.ipv4.ip_local_port_range=900065500net.core.rmem_default=262144net.core.rmem_max=4194304net.core.wmem_default=262144net.core.wmem_max=1048576立即生效:[root@rac1~]#sysctl-p配置/etc/security/limits.conf文件[root@rac1~]#vi/etc/security/limits.confgridsoftnproc2047gridhardnproc16384gridsoftnofile1024gridhardnofile65536oraclesoftnproc2047oraclehardnproc16384oraclesoftnofile1024oraclehardnofile65536配置/etc/pam.d/login文件[root@rac1~]#vi/etc/pam.d/loginsessionrequiredpam_limits.so修改共享內(nèi)存[root@rac1~]#vi/etc/fstabtmpfs/dev/shmtmpfsdefaults,size=15g00[root@rac1~]#mount–oremount/dev/shm創(chuàng)建用戶、組和相應(yīng)目錄創(chuàng)建用戶和組:groupaddoinstallgroupadddbagroupaddasmdbauseradd-goinstall-Gdba,asmdbaoracleuseradd-goinstall-Gasmdba,dbagrid設(shè)置用戶密碼:passwdoraclePasswdgrid創(chuàng)建目錄并修改權(quán)限:mkdir-p/u01/app/oraclemkdir-p/u01/app/gridmkdir-p/u01/app/grid_basemkdir-p/u01/app/oraInventorychown-Rgrid:oinstall/u01/app/gridchown-Rgrid:oinstall/u01/app/grid_basechown-Roracle:oinstall/u01/app/oraclechown-Rgrid:oinstall/u01/app/oraInventorychmod-R775/u01配置oracle,grid用戶的環(huán)境變量[root@rac1~]#su-grid[grid@rac1~]$vi.bash_profileexportORACLE_SID=+ASM1exportORACLE_BASE=/u01/app/grid_baseexportORACLE_HOME=/u01/app/gridexportLD_LIBRARY_PATH=$ORACLE_HOME/libexportPATH=$ORACLE_HOME/bin:$PATH注:節(jié)點(diǎn)2同樣配置,修改ORACLE_SID為+ASM2即可[root@rac1~]#su-oracle[oracle@rac1~]$vi.bash_profileexportORACLE_SID=ora11g1exportORACLE_BASE=/u01/app/oracleexportORACLE_HOME=$ORACLE_BASE/product//dbhome_1exportLD_LIBRARY_PATH=$ORACLE_HOME/libexportPATH=$PATH:$ORACLE_HOME/bin注:節(jié)點(diǎn)2同樣配置,修改ORACLE_SID為ora11g2即可安裝缺少的軟件包[root@rac1~]#yum-yinstallbinutilscompat-libstdc++compat-libstdc++.i686elfutils-libelfgccgcc-c++glibcglibc.i686glibc-develglibc-devel.i686libaiolibaio.i686libaio-devellibaio-devel.i686libgcclibgcc.i686libstdc++libstdc++.i686libstdc++-develsysstatunixODBCunixODBC.i686unixODBC-develunixODBC-devel.i686compat-libcap1elfutils-libelf-develcompat-libstdc++-33compat-libstdc++-33.i686配置oracle,grid用戶的SSH互信[root@rac1~]#su-grid[grid@rac1~]$ssh-keygen-trsa[root@rac2~]#su-grid[grid@rac2~]$ssh-keygen-trsa[grid@rac1~]$cat.ssh/id_rsa.pub>>.ssh/authorized_keys[grid@rac1~]$sshrac2cat/home/grid/.ssh/id_rsa.pub>>.ssh/authorized_keys[grid@rac1~]$scp.ssh/authorized_keysrac2:/home/grid/.ssh配置完成后分別測(cè)試:[grid@rac1~]$sshrac1date[grid@rac1~]$sshrac2date[grid@rac1~]$sshrac1-privdate[grid@rac1~]$sshrac2-privdate同理:節(jié)點(diǎn)2重復(fù)執(zhí)行。Oracle用戶互信配置同上。配置NTP本例采用集群自己的時(shí)間同步進(jìn)程ctss來(lái)同步,線上環(huán)境需配置NTP。防火墻配置略(本地環(huán)境關(guān)閉了防火墻,線上需配置策略)3、配置共享存儲(chǔ)添加共享磁盤(VM虛擬化為例)關(guān)閉虛擬機(jī)電源,編輯虛擬機(jī)設(shè)置:rac1:添加硬盤(此處添加三塊:OCR20g,FRA50g,DATA100g,線上環(huán)境待具體規(guī)劃):完成后重復(fù)此步驟繼續(xù)添加剩下的兩塊磁盤,虛擬設(shè)備節(jié)點(diǎn)分別為SCSI(1:2),SCSI(1:3),不要使用操作系統(tǒng)本身磁盤的SCSI0控制器。rac2:重復(fù)以上步驟,將剩下的兩塊盤也添加進(jìn)來(lái)。rac1,rac2設(shè)置共享磁盤的SCSI1控制器為可共享:配置UDEV重新啟動(dòng)虛擬機(jī),rac1和rac2分別fdisk–l,檢查是否都能識(shí)別剛才添加的三塊磁盤。本例采用UDEV管理,也可以使用oracle的asmlib來(lái)管理。獲取剛才添加的三塊磁盤的id:[root@rac1~]#scsi_id--whitelisted--replace-whitespace--device=/dev/sdb36000c2992d5f6a517b1edbb8dabc0cc2[root@rac1~]#scsi_id--whitelisted--replace-whitespace--device=/dev/sdc36000c2988db1edb3771d786ec510e76a[root@rac1~]#scsi_id--whitelisted--replace-whitespace--device=/dev/sdd36000c298c4021632891ef28c57497389創(chuàng)建并配置udevrules文件:[root@rac1~]#vi/etc/udev/rules.d/99-oracle-asmdevices.rulesKERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id--whitelisted--replace-whitespace--device=/dev/$name",RESULT=="36000c2992d5f6a517b1edbb8dabc0cc2",NAME="asm-diskb",OWNER="grid",GROUP="oinstall",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id--whitelisted--replace-whitespace--device=/dev/$name",RESULT=="36000c2988db1edb3771d786ec510e76a",NAME="asm-diskc",OWNER="grid",GROUP="oinstall",MODE="0660"KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id--whitelisted--replace-whitespace--device=/dev/$name",RESULT=="36000c298c4021632891ef28c57497389",NAME="asm-diskd",OWNER="grid",GROUP="oinstall",MODE="0660"將配置文件發(fā)送至rac2:[root@rac1~]#scp/etc/udev/rules.d/99-oracle-asmdevices.rulesrac2:/etc/udev/rules.drac1,rac2啟動(dòng)udev,并配置開機(jī)自動(dòng)啟動(dòng):[root@rac1~]#start_udev[root@rac1~]#vi/etc/rc.local添加:/sbin/start_udev重啟虛擬機(jī)(不重啟看不到剛才添加的磁盤)。分區(qū)rac1操作:[root@rac1~]#fdisk/dev/sdbCommand(mforhelp):nCommandactioneextendedpprimarypartition(1-4)pPartitionnumber(1-4):1Firstcylinder(1-2610,default1):Usingdefaultvalue1Lastcylinder,+cylindersor+size{K,M,G}(1-2610,default2610):Usingdefaultvalue2610Command(mforhelp):wThepartitiontablehasbeenaltered!Callingioctl()tore-readpartitiontable.Syncingdisks.同上,對(duì)sdc,sdd分區(qū)。分區(qū)完成后rac1,rac2執(zhí)行fdisk–l檢查分區(qū)情況。至此,環(huán)境準(zhǔn)備完畢。二、GI集群軟件安裝(DB2)用ftp或者其它方式上傳grid安裝介質(zhì)并解壓(grid用戶):[grid@rac1~]$unzipp13390677_112040_Linux-x86-64_3of7.zip1、檢查安裝環(huán)境進(jìn)入剛解壓的目錄,執(zhí)行腳本檢查安裝環(huán)境:[grid@rac1grid]$./runcluvfy.shstage-precrsinst-nrac1,rac2-fixup-verbosePerformingpre-checksforclusterservicessetupCheckingnodereachability...Check:Nodereachabilityfromnode"rac1"DestinationNodeReachable?rac2yesrac1yesResult:Nodereachabilitycheckpassedfromnode"rac1"Checkinguserequivalence...Check:Userequivalenceforuser"grid"NodeNameStatusrac2passedrac1passedResult:Userequivalencecheckpassedforuser"grid"Checkingnodeconnectivity...Checkinghostsconfigfile...NodeNameStatusrac2passedrac1passedVerificationofthehostsconfigfilesuccessfulInterfaceinformationfornode"rac2"NameIPAddressSubnetGatewayDef.GatewayHWAddressMTUeth0625400:0C:29:EF:9A:521500eth15400:0C:29:EF:9A:5C1500Interfaceinformationfornode"rac1"NameIPAddressSubnetGatewayDef.GatewayHWAddressMTUeth0615400:0C:29:B6:35:D91500eth15400:0C:29:B6:35:E31500檢查狀態(tài)為failed的項(xiàng),并進(jìn)行相關(guān)配置(軟件包版本錯(cuò)誤可以忽略。本例采用oracle自己的ctss進(jìn)程進(jìn)行時(shí)間同步,此步驟會(huì)報(bào)NTP配置不通過(guò),也可以忽略)。2、安裝GI軟件本例采用xmanager圖形化安裝:[grid@rac1grid]$exportDISPLAY=40:0.0[grid@rac1grid]$./runInstaller選擇需要的語(yǔ)言,這里全選密碼設(shè)置過(guò)于簡(jiǎn)單,繼續(xù)有些檢查失敗的項(xiàng)可以忽略,需具體分析。根據(jù)提示,分別在兩個(gè)節(jié)點(diǎn)以root用戶執(zhí)行這兩個(gè)腳本:Rac1:[root@rac1app]#/u01/app/grid/root.shPerformingrootuseroperationforOracle11gThefollowingenvironmentvariablesaresetas:ORACLE_OWNER=gridORACLE_HOME=/u01/app/gridEnterthefullpathnameofthelocalbindirectory:[/usr/local/bin]:--此處默認(rèn)敲回車即可Copyingdbhometo/usr/local/bin...Copyingoraenvto/usr/local/bin...Copyingcoraenvto/usr/local/bin...Creating/etc/oratabfile...Entrieswillbeaddedtothe/etc/oratabfileasneededbyDatabaseConfigurationAssistantwhenadatabaseiscreatedFinishedrunninggenericpartofrootscript.Nowproduct-specificrootactionswillbeperformed.Usingconfigurationparameterfile:/u01/app/grid/crs/install/crsconfig_paramsCreatingtracedirectoryUserignoredPrerequisitesduringinstallationInstallingTraceFileAnalyzerOLRinitialization-successfulrootwalletrootwalletcertrootcertexportpeerwalletprofilereaderwalletpawalletpeerwalletkeyspawalletkeyspeercertrequestpacertrequestpeercertpacertpeerrootcertTPprofilereaderrootcertTPparootcertTPpeerpacertTPpapeercertTPprofilereaderpacertTPprofilereaderpeercertTPpeerusercertpausercertAddingClusterwareentriestoupstartCRS-2672:Attemptingtostart'ora.mdnsd'on'rac1'CRS-2676:Startof'ora.mdnsd'on'rac1'succeededCRS-2672:Attemptingtostart'ora.gpnpd'on'rac1'CRS-2676:Startof'ora.gpnpd'on'rac1'succeededCRS-2672:Attemptingtostart'ora.cssdmonitor'on'rac1'CRS-2672:Attemptingtostart'ora.gipcd'on'rac1'CRS-2676:Startof'ora.cssdmonitor'on'rac1'succeededCRS-2676:Startof'ora.gipcd'on'rac1'succeededCRS-2672:Attemptingtostart'ora.cssd'on'rac1'CRS-2672:Attemptingtostart'ora.diskmon'on'rac1'CRS-2676:Startof'ora.diskmon'on'rac1'succeededCRS-2676:Startof'ora.cssd'on'rac1'succeededASMcreatedandstartedsuccessfully.DiskGroupOCRcreatedsuccessfully.clscfg:-installmodespecifiedSuccessfullyaccumulatednecessaryOCRkeys.CreatingOCRkeysforuser'root',privgrp'root'..Operationsuccessful.CRS-4256:UpdatingtheprofileSuccessfuladditionofvotingdisk86eb98a0eec94f76bf910bdfcd0719a4.Successfullyreplacedvotingdiskgroupwith+OCR.CRS-4256:UpdatingtheprofileCRS-4266:Votingfile(s)successfullyreplaced##STATEFileUniversalIdFileNameDiskgroup--1.ONLINE86eb98a0eec94f76bf910bdfcd0719a4(/dev/asm-diskb)[OCR]Located1votingdisk(s).CRS-2672:Attemptingtostart'ora.asm'on'rac1'CRS-2676:Startof'ora.asm'on'rac1'succeededCRS-2672:Attemptingtostart'ora.OCR.dg'on'rac1'CRS-2676:Startof'ora.OCR.dg'on'rac1'succeededPreparingpackagesforinstallation...cvuqdisk-1.0.9-1ConfigureOracleGridInfrastructureforaCluster...succeeded如有錯(cuò)誤腳本運(yùn)行失敗需要?jiǎng)h除配置重新運(yùn)行:/u01/app/grid/crs/install/roothas.pl-deconfig-force–verbose/u01/app/grid/crs/install/rootcrs.pl-verbose-deconfig–force/u01/app/grid/root.shRac2節(jié)點(diǎn)輸出日志略,運(yùn)行完腳本點(diǎn)擊OK繼續(xù)下一步。###有文章說(shuō)次錯(cuò)誤是因?yàn)閔osts里面配置了scanip,手動(dòng)ping一下scanip,如果能ping通則可忽略。3、創(chuàng)建ASM磁盤組Grid用戶下運(yùn)行asmca命令:同樣的步驟創(chuàng)建最后一塊DATA盤。創(chuàng)建完成,退出。至此,GI安裝完成。三、RAC數(shù)據(jù)庫(kù)安裝(DB2)用FTP或者其它工具上傳oracle安裝介質(zhì)并解壓:[oracle@rac1~]$unzipp13390677_112040_Linux-x86-64_1of7.zip[oracle@rac1~]$unzipp13390677_112040_Linux-x86-64_2of7.zip1、安裝RAC數(shù)據(jù)庫(kù)軟件[oracle@rac1~]$exportDISPLAY=40:0.0[oracle@rac1~]$cddatabase/[oracle@rac1database]$./runInstaller按提示運(yùn)行相應(yīng)腳本,默認(rèn)回車就行。2、創(chuàng)建數(shù)據(jù)庫(kù)使用dbca命令創(chuàng)建數(shù)據(jù)庫(kù):[oracle@rac1database]$dbca會(huì)報(bào)密碼過(guò)簡(jiǎn)的警告,點(diǎn)擊yes繼續(xù)。至此,數(shù)據(jù)庫(kù)安裝完成。3、創(chuàng)建用戶及用戶表空間根據(jù)具體規(guī)劃增加空間大小SQL>createtablespaceccpsdatafile'+DATA'size2gautoextendonmaxsize10g;Tablespacecreated.SQL>altertablespaceccpsadddatafile'+DATA'size2gautoextendonmaxsize10g;Tablespacealtered.SQL>createtablespaceccps_partdatafile'+DATA'size2gautoextendonmaxsize10g;Tablespacecreated.SQL>altertablespaceccps_partadddatafile'+DATA'size2gautoextendonmaxsize10g;Tablespacealtered.SQL>createtablespaceccps_inxdatafile'+DATA'size2gautoextendonmaxsize10g;Tablespacecreated.SQL>altertablespaceccps_inxadddatafile'+DATA'size2gautoextendonmaxsize10g;Tablespacealtered.SQL>createuserccpsidentifiedbyop123defaulttablespaceccps;Usercreated.SQL>grantresource,connect,dbatoccps;Grantsucceeded.四、.4.17補(bǔ)丁 環(huán)境:Oracle11gRAC
Opatch:p6880880_112000_Linux-x86-64 GI補(bǔ)?。簆26030799_112040_Linux-x86-64 DB補(bǔ)丁:p25869727_112040_Linux-x86-641,升級(jí)Opatch(RAC1,RAC2)GRID用戶:$mvOPatchOPatch.bak$unzipp6880880_112000_Linux-x86-64.zip-d/u01/app/grid$chown-Rgrid:oinstallOpatchORACLE用戶:$mvOPatchOPatch.bak$unzipp6880880_112000_Linux-x86-64.zip-d/u01/app/oracle/product//dbhome_1$chown-Roracle:oinstallOpatch2,檢查Opatch版本(RAC1,RAC2)[grid@rac1OPatch]$/u01/app/grid/OPatch/opatchversion3,檢查Inventory有效性(RAC1,RAC2)[grid@rac1OPatch]$/u01/app/grid/OPatch/opatchlsinventory-detail-oh$ORACLE_HOME4,配置OCM(RAC1,RAC2)用root用戶在/u01/app/grid/OPatch/ocm/bin/下,用emocmrsp生成ocm.rsp文件[root@rac1/]#cd/u01/app/grid/OPatch/ocm/bin[root@rac1bin]#./emocmrspemocmrsp-no_banner-output~/grid_ocm.rsp5,解壓patch文件,授權(quán)為grid用戶(RAC1,RAC2) $unzipp26030799_112040_Linux-x86-64$chown-Rgrid:oinstall/260307996,PatchGI,用root用戶執(zhí)行(RAC1,RAC2)./opatchauto/home/grid/26030799-ocmrf/home/grid/grid_ocm.rsp如節(jié)點(diǎn)二執(zhí)行報(bào)錯(cuò),添加-oh/u01/app/grid后正確執(zhí)行:./opatchauto/home/grid/26030799/-oh/u01/app/grid-ocmrf/home/grid/grid_ocm.rsp7,執(zhí)行腳本(RAC1)$sqlplus/assysdbaSQL>@$ORACLE_HOME/rdbms/admin/catbundle.sqlpsuapplySQL>@$ORACLE_HOME/rdbms/admin/utlrp.sql8,檢查GI的補(bǔ)丁情況(RAC1,RAC2)$/u01/app/grid/OPatch/opatchlsinventory-detail-oh$ORACLE_HOME|grep-ipatch9,升級(jí)DBPSU(RAC1,RAC2) 采用滾動(dòng)升級(jí)或者全部停止后升級(jí)(這里采用全部停止后升級(jí)的方式) $unzipp25869727_112040_Linux-x86-64$chown-Roracle:oinstall25869727檢查補(bǔ)丁是否沖突[oracle@rac124732075]$/u01/app/oracle/product//dbhome_1/OPatch/opatchprereqCheckConflictAgainstOHWithDetail-ph./[oracle@rac224732075]$/u01/app/oracle/product//dbhome_1/OPatch/opatchprereqCheckConflictAgainstOHWithDetail-ph./10,安裝patch(RAC1,RAC2)[oracle@rac125869727]$/u01/app/oracle/product//dbhome_1/Opatch/opatchapply[oracle@rac225869727]$/u01/app/oracle/product//dbhome_1/Opatch/opatchapply11,執(zhí)行腳本(RAC1) 啟動(dòng)rac并執(zhí)行如下腳本:SQL>@$ORACLE_HOME/rdbms/admin/catbundle.sqlpsuapplySQL>@$ORACLE_HOME/rdbms/admin/utlrp.sql12,驗(yàn)證Opatch是否成功(RAC1,RAC2)[oracle@rac1~]$/u01/app/oracle/product//dbhome_1/Opatch/opatchlsinventory-detail -oh$ORACLE_HOME|grep-ipatch[oracle@rac2~]$/u01/app/oracle/product//dbhome_1/Opatch/opatchlsinventory-detail -oh$ORACLE_HOME|grep-ipatch五、GoldenGate軟件安裝及配置1、安裝OGG軟件并配置相關(guān)用戶(DB1,RAC1)上傳OGG軟件安裝介質(zhì)并解壓:[oracle@rac1~]$unzip121210_fbo_ggs_Linux_x64_shiphome.zip用root創(chuàng)建OGG安裝目錄:mkdir-p/u01/app/oggchown-Roracle:oinstall/u01/app/oggchmod775/u01/app/ogg配置OGG環(huán)境變量(本例采用oracle用戶安裝,直接配置oracle環(huán)境變量):[oracle@rac1~]$vi.bash_profileexportLD_LIBRARY_PATH=$ORACLE_HOME/lib:$GG_HOME/libexportGG_HOME=/u01/app/oggexportPATH=$PATH:$ORACLE_HOME/bin:$GG_HOME/bin安裝OGG軟件:[oracle@rac1~]$cdfbo_ggs_Linux_x64_shiphome/Disk1/[oracle@rac1Disk1]$exportDISPLAY=40:0.0[oracle@rac1Disk1]$./runInstaller注意端口,如果被占用可以更換別的端口。創(chuàng)建ogg用戶及表空間:SQL>createtablespaceoggdatafile'+DATA'SIZE500M;Tablespacecreated.SQL>createuseroggidentifiedbyoggdefaulttablespaceogg;Usercreated.SQL>grantresource,connect,dbatoogg;Grantsucceeded.在源端也需要重復(fù)以上操作。SQL>createtablespaceoggdatafile'/u01/app/oracle/oradata/ora11g/ogg.dbf'SIZE500M;SQL>createuseroggidentifiedbyoggdefaulttablespaceogg;SQL>grantresource,connect,dbatoogg;2、源數(shù)據(jù)庫(kù)配置(DB1)開啟數(shù)據(jù)庫(kù)歸檔模式:略開啟數(shù)據(jù)庫(kù)附加日志:SQL>alterdatabaseaddsupplementallogdata;SQL>alterdatabaseaddsupplementallogdata(primarykey,unique,foreignkey)columns;[oracle@ora11g~]$cd/u01/app/ogg[oracle@ora11g~]$./ggsciGGSCI(ora11g)1>dbloginuseridogg,passwordoggGGSCI(ora11g)2>addtrandataccps.*SQL>altersystemswitchlogfile;SQL>selectsupplemental_log_data_min,supplemental_log_data_pk,supplemental_log_data_ui fromv$database;(檢查日志開啟情況,全為YES即可)開啟數(shù)據(jù)庫(kù)強(qiáng)制日志:SQL>alterdatabaseforcelogging;RAC環(huán)境需要修改此參數(shù):(DB2)SQL>ALTERSYSTEMSETENABLE_GOLDENGATE_REPLICATION=TRUESCOPE=BOTHsid='*';配置sequence同步(DB1,DB2):[oracle@ora11g~]$cd/u01/app/ogg[oracle@ora11gogg]$sqlplus/assysdbaSQL>@sequence.sql;oggSQL>grantexecuteonogg.updatesequencetoogg;
Grantsucceeded.
SQL>grantexecuteonogg.replicatesequencetoogg;
Grantsucceeded.SQL>ALTERTABLEsys.seq$addSUPPLEMENTALLOGDATA(PRIMARYKEY)COLUMNS;
Tablealtered.3、配置進(jìn)程參數(shù)文件管理進(jìn)程MGR(DB1,DB2)[root@rac1~]#su–oracle[oracle@rac1~]$cd/u01/app/ogg/[oracle@rac1ogg]$./ggsciGGSCI(rac1)1>editparammgrPORT7809抽取進(jìn)程EXTN(DB1->DB2)(RAC1)GGSCI(ora11g)1>editparamextn1extractextn1useridogg,passwordoggTRANLOGOPTIONSEXCLUDEUSERoggdiscardfile./dirrpt/discard_extn1.dsc,append,megabytes1024exttrail./dirdat/naTABLECCPS.*;SEQUENCECCPS.*;投遞進(jìn)程DPEN(DB1->DB2)(RAC1)GGSCI(ora11g)2>editparamdpen1extractdpen1RMTHOST61,MGRPORT7809,compressPASSTHRURMTTRAIL./dirdat/naTABLECCPS.*;SEQUENCECCPS.*;復(fù)制進(jìn)程REPN(DB1->DB2)(RAC1)GGSCI(rac1)2>editparamrepn1replicatrepn1useridogg,passwordoggassumetargetdefsDISCARDFILE./dirrpt/repna.dsc,APPEND,MEGABYTES1024MAPCCPS.*,TARGETCCPS.*;抽取進(jìn)程(DB2->DB1)(RAC1)GGSCI(rac1)2>editparamextn2extractextn2useridogg,passwordoggTRANLOGOPTIONSEXCLUDEUSERoggTRANLOGOPTIONSDBLOGREADERdiscardfile./dirrpt/discard_extn2.dsc,append,megabytes1024exttrail./dirdat/nbTABLECCPS.*;SEQUENCECCPS.*;投遞進(jìn)程(DB2->DB1)(RAC1)GGSCI(rac1)2>editparamdpen2extractdpen2RMTHOST60,MGRPORT7809,compressPASSTHRURMTTRAIL./dirdat/nbTABLECCPS.*;SEQUENCECCPS.*;復(fù)制進(jìn)程(DB2->DB1)(DB1)GGSCI(ora11g)2>editparamrepn2replicatrepn2useridogg,passwordoggassumetargetdefsDISCARDFILE./dirrpt/repnb.dsc,APPEND,MEGABYTES1024MAPCCPS.*,TARGETCCPS.*;4、創(chuàng)建進(jìn)程抽取進(jìn)程(DB1)GGSCI(ora11g)2>addextractextn1,tranlog,beginnowEXTRACTadded.GGSCI(ora11g)3>addexttrail./dirdat/na,extractextn1,megabytes500EXTTRAILadded.投遞進(jìn)程(DB1)GGSCI(ora11g)4>addextractdpen1,exttrailsource./dirdat/naEXTRACTadded.GGSCI(ora11g)5>addrmttrail./dirdat/na,extractdpen1,megabytes500RMTTRAILadded.復(fù)制進(jìn)程(RAC1)GGSCI(rac1)3>addreplicatrepn1,exttrail./dirdat/na,nodbcheckpointREPLICATadded.抽取進(jìn)程(RAC1)GGSCI(ora11g)2>addextractextn2,threads2,tranlog,beginnowEXTRACTadded.GGSCI(ora11g)3>addexttrail./dirdat/nb,extractextn2,megabytes500EXTTRAILadded.投遞進(jìn)程(RAC1)GGSCI(ora11g)4>addextractdpen2,exttrailsource./dirdat/nbEXTRACTadded.GGSCI(ora11g)5>addrmttrail./dirdat/nb,extractdpen2,megabytes500RMTTRAILadded.復(fù)制進(jìn)程(DB1)GGSCI(rac1)3>addreplicatrepn2,exttrail./dirdat/nb,nodbcheckpointREPLICATadded.OGG基本管理命令:$cd/u01/app/ogg./ggsciGGSCI(rac1)1>infoallProgramStatusGroupLagatChkptTimeSinceChkptMANAGERRUNNINGREPLICATSTOPPEDREPN100:00:0000:14:25六、初始化數(shù)據(jù)1,啟動(dòng)抽取進(jìn)程,記錄源端SCN號(hào)(DB1) GGSCI(ora11g)6>startextn1SendingSTARTrequesttoMANAGER...EXTRACTEXTNstarting SQL>selectto_char(dbms_flashback.get_system_change_number)fromdual;TO_CHAR(DBMS_FLASHBACK.GET_SYSTEM_CHANGE16789032,EXPDP指定SCN號(hào)導(dǎo)出源端數(shù)據(jù)(DB1)[oracle@ora11gdpdump]$expdpogg/oggschemas=ccpsdirectory=DATA_PUMP_DIR dumpfile=full.dmpflashback_scn=1678903logfile=expdp.log3,傳輸dump文件(DB1) [oracle@ora11gdpdump]$scp–Cfull.dmp61:/u01/app/oracle/product//dbhome_1/rdbms/log4,導(dǎo)入數(shù)據(jù)(RAC1) [oracle@rac1dpdump]$impdpogg/oggschemas=ccpsdirectory=DATA_PUMP_DIRdumpfile=full.dmpexclude=statisticslogfile=impdp.log5,查詢歸檔空間大小,修改歸檔空間大?。―B2) SQL>showparameterdb_recoverySQL>altersystemsetdb_recovery_file_dest_size=49gscope=bothsid='*';七、同步數(shù)據(jù)1,源端開啟投遞進(jìn)程(DB1) GGSCI(ora11g)6>startdpen12,目標(biāo)端開啟復(fù)制進(jìn)程(DB2) GGSCI(rac1)2>startreplicatrepn1aftercsn1678903八、業(yè)務(wù)切換1,收集統(tǒng)計(jì)信息(DB2) SQL>execdbms_stats.gather_database_stats(estimate_percent=>100,method_opt=>'forallcolumnssizeauto',degree=>4,cascade=>true);2,開啟數(shù)據(jù)庫(kù)附加日志(DB2):防止業(yè)務(wù)切換失敗,在業(yè)務(wù)切換的同時(shí)啟動(dòng)DB2->DB1的數(shù)據(jù)傳輸。 SQL>alterdatabaseaddsupplementallogdata;SQL>alterdatabaseaddsupplementallogdata(primarykey,unique,foreignkey)columns;[oracle@ora11g~]$cd/u01/app/ogg[oracle@ora11g~]$./ggsci GGSCI(ora11g)1>dbloginuseridogg,passwordogg GGSCI(ora11g)2>addtrandataccps.* SQL>altersystemswitchlogfile; SQL>selectupplemental_log_data_min,supplemental_log_data_pk,supplemental_log_data_uifromv$database;(檢查日志開啟情況,全為YES即可)3,開啟數(shù)據(jù)庫(kù)強(qiáng)制日志:(DB2)SQL>alterdatabaseforcelogging;4,停止業(yè)務(wù) 確認(rèn)數(shù)據(jù)同步完成后啟動(dòng)新環(huán)境業(yè)務(wù)并停止DB1->DB2的ogg進(jìn)程組。 GGSCI(ora11g)1>lagextn1GGSCI(ora11g)2>lagdpen1GGSCI(rac1)1>lagrepn1停止進(jìn)程:GGSCI(ora11g)1>stopextn1GGSCI(ora11g)2>stopdpen1GGSCI(rac1)1>stoprepn15,啟動(dòng)DB2->DB1的ogg進(jìn)程組,檢查數(shù)據(jù)同步情況。修改原備庫(kù)上的extn進(jìn)程的啟動(dòng)時(shí)間到現(xiàn)在,已保證它不去抽取那些之前的重做日志GGSCI(rac1)1>alterextn2,beginnowGGSCI(rac1)1>startextn2GGSCI(rac1)2>startdpen2GGSCI(ora11g)1>startrepn26,切換業(yè)務(wù)九,回退十、配置DG1,備庫(kù)安裝數(shù)據(jù)庫(kù)軟件2,開啟主庫(kù)歸檔模式,強(qiáng)制日志模式 略3,創(chuàng)建及復(fù)制密碼文件rac1(/u01/app/oracle/product//dbhome_1/dbs):cporapwora11g1orapwora11g2scporapwora11g160:/u01/app/oracle/product//db_home1/dbsmvorapwora11g1orapwora11grac2(/u01/app/oracle/product//dbhome_1/dbs):cporapwora11g2orapwora11g14,創(chuàng)建備庫(kù)參數(shù)文件及相關(guān)目錄參數(shù)文件:vi/u01/app/oracle/product//db_home1/dbs/initora11g.oraora11g.__oracle_base='/u01/app/oracle'#ORACLE_BASEsetfromenvironment*.audit_file_dest='/u01/app/oracle/admin/ora11g/adump'*.audit_trail='db'*.compatible='.0'*.control_files='/u01/app/oracle/oradata/ora11g/control01.ctl','/u01/app/oracle/flash_recovery_area/ora11g'*.db_block_size=8192*.db_domain=''*.db_file_name_convert='+DATA/ora11g/datafile','/u01/app/oracle/oradata/ora11g','+DATA/ora11g/tempfile','/u01/app/oracle/oradata/ora11g'*.db_name='ora11g'*.db_recovery_file_dest_size=52613349376*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'*.db_unique_name='standby1'*.diagnostic_dest='/u01/app/oracle'*.dispatchers='(PROTOCOL=TCP)(SERVICE=ora11gXDB)'*.fal_server='primary'*.log_archive_config='dg_config=(standby1,primary)'*.log_archive_dest_1='location=/u01/app/oracle/flash_recovery_area/ora11gvalid_for=(all_logfiles,all_roles)db_unique_name=standby1'*.log_archive_dest_2='service=primarylgwrasyncvalid_for=(online_logfiles,all_roles)db_unique_name=primary'*.log_archive_format='%t_%s_%r.dbf'*.log_file_name_convert='+DATA/ora11g/onlinelog','/u01/app/oracle/oradata/ora11g'*.memory_target=10118758400*.open_cursors=300*.processes=1000*.remote_login_passwordfile='exclusive'*.service_names='ORA11G'*.sessions=1105*.standby_file_management='AUTO'*.undo_retention=3600*.undo_tablespace='UNDOTBS1'目錄創(chuàng)建:mkdir–p/u01/app/oracle/admin/ora11g/adumpmkdir–p/u01/app/oracle/admin/ora11g/dpdumpmkdir–p/u01/app/oracle/admin/ora11g/pfilemkdir–p/u01/app/oradata/ora11gmkdir–p/u01/app/oracle/flash_recovery_area/ora11g5,備庫(kù)配置tnsnames.ora文件[oracle@weblogicadmin]$vitnsnames.orastandby1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=60)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ora11g)))primary=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=65)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ora11g)))rac1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=61)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ora11g)(INSTANCE_NAME=ora11g1)))rac2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=62)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ora11g
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 農(nóng)場(chǎng)成長(zhǎng)足跡
- 科技領(lǐng)跑未來(lái)已來(lái)
- 墻體材料供應(yīng)合同(2篇)
- 2024智能鎖系統(tǒng)研發(fā)與生產(chǎn)合作合同模板3篇
- 2024酒店土建工程質(zhì)量問(wèn)題整改與維修合同
- 20陀螺說(shuō)課稿-2024-2025學(xué)年統(tǒng)編版四年級(jí)上冊(cè)語(yǔ)文
- 個(gè)人對(duì)個(gè)人2024年度消費(fèi)貸款合同范本2篇
- 房地產(chǎn)合作開發(fā)意向協(xié)議
- 快樂(lè)兔和聰明的熊征文
- 2024某醫(yī)院醫(yī)療設(shè)備采購(gòu)合同
- 胃鏡超聲內(nèi)鏡護(hù)理配合
- 精神科護(hù)理工作計(jì)劃例文
- 沐足行業(yè)嚴(yán)禁黃賭毒承諾書
- 2024山地買賣合同模板
- 河北省承德市2023-2024學(xué)年高一上學(xué)期期末物理試卷(含答案)
- 矯形器師(三級(jí))試題
- 【初中化學(xué)】二氧化碳的實(shí)驗(yàn)室制取教學(xué)課件-2024-2025學(xué)年九年級(jí)化學(xué)人教版上冊(cè)
- 2025屆天津市河西區(qū)物理高一第一學(xué)期期末檢測(cè)試題含解析
- 登高車高空作業(yè)施工方案
- 相互批評(píng)意見(jiàn)500條【5篇】
- 江蘇徐州歷年中考語(yǔ)文現(xiàn)代文閱讀之非連續(xù)性文本閱讀5篇(含答案)(2003-2023)
評(píng)論
0/150
提交評(píng)論