資源描述:
《Oracle11g 搭建單實例DataGuard》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、環(huán)境:主備庫都為單實例并且數(shù)據(jù)庫SID相同OS:redhat6.5Oracle:11.2.0.4.3主庫操作1.?開啟歸檔模式?創(chuàng)建歸檔目錄[root@enn~]#mkdir-p/u01/archivelog[root@enn~]#chown-Roracle:oinstall/u01/archivelog[root@enn~]#chmod777/u01/archivelog數(shù)據(jù)庫到mount狀態(tài)開啟歸檔模式[root@enn~]#su-oracle[oracle@enn~]$sqlplus/assysdbaSQL*Plus:Release11.2.0.4.0ProductiononSunJ
2、ul2023:46:462014Copyright(c)1982,2013,Oracle.?Allrightsreserved.Connectedtoanidleinstance.SQL>startupmountORACLEinstancestarted.?TotalSystemGlobalArea?835104768bytesFixedSize??????????2257840bytesVariableSize?????????541068368bytesDatabaseBuffers??289406976bytesRedoBuffers????????2371584bytesDatab
3、asemounted.設(shè)置主庫歸檔目錄SQL>altersystemsetlog_archive_dest='/u01/archivelog';altersystemsetlog_archive_dest_1='location=/data/oracle/log1/archive_log';?????最后的目錄名稱需要為archive_log開啟歸檔模式SQL>alterdatabasearchivelog;Databasealtered.查看歸檔設(shè)置SQL>archiveloglist;Databaselogmode??????ArchiveModeAutomaticarchival??
4、???????EnabledArchivedestination????????/u01/archivelogOldestonlinelogsequence????2Nextlogsequencetoarchive??4Currentlogsequence???????4?2.?啟動force_logging模式?查看是否force_logging模式SQL>selectlog_mode,force_loggingfromv$database;LOG_MODE????FOR---------------ARCHIVELOG??NO開啟force_logging模式SQL>alterdata
5、baseforcelogging;Databasealtered.?3.創(chuàng)建備庫日志文件路徑?查看數(shù)據(jù)庫的日志組個數(shù)與大小,因為我們創(chuàng)建?standby?日志組的個數(shù)是原日志組個數(shù)+1?再與?thread?的積((2+1)*3),size?不能小于原日志文件的大小。SQL>selectgroup#,thread#,bytes/1024/1024M,STATUSfromv$log;???GROUP#???THREAD#???????MSTATUS----------------------------------------------????1?????1????????50CURRENT
6、????3?????1????????50INACTIVE????2?????1????????50INACTIVE?SQL>selectmemberfromv$logfile;MEMBER--------------------------------------------------------------------------------/u01/app/oracle/oradata/ENN/redo03.log/u01/app/oracle/oradata/ENN/redo02.log/u01/app/oracle/oradata/ENN/redo01.log?創(chuàng)建備庫日志組路
7、徑SQL>alterdatabaseaddstandbylogfilethread1group4('/u01/app/oracle/oradata/ENN/redo04.log')size50M;Databasealtered.SQL>alterdatabaseaddstandbylogfilethread1group5('/u01/app/oracle/oradata/ENN/redo05.log')size50M;D