目標(biāo):主庫不停機(jī),搭建出一個(gè)測(cè)試環(huán)境,允許少量的數(shù)據(jù)不同步,不用邏輯導(dǎo)入導(dǎo)出,使用rman實(shí)現(xiàn)同機(jī)復(fù)制數(shù)據(jù)庫-131服務(wù)器上將PR
目標(biāo):主庫不停機(jī),搭建出一個(gè)測(cè)試環(huán)境,允許少量的數(shù)據(jù)不同步,不用邏輯導(dǎo)入導(dǎo)出,使用rman實(shí)現(xiàn)同機(jī)復(fù)制數(shù)據(jù)庫-131服務(wù)器上將PROD庫通過rman-duplicate target database to PRODDUP1的方式進(jìn)行復(fù)制
131服務(wù)器是建在VMware上的Linux虛擬機(jī)
服務(wù)器192.168.182.131
OEL5.8_32
Oracle 11.2.0.1.0 32bit
[oracle@oelr5u8-1 admin]$ uname -a
Linux oelr5u8-1.localdomain 2.6.32-300.10.1.el5uek #1 SMP Wed Feb 22 17:22:40 EST 2012 i686 i686 i386 GNU/Linux
SYS@PROD>select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
過程中會(huì)經(jīng)過幾種測(cè)試:
1. 嘗試不作任何配置,直接執(zhí)行duplicate target database to PRODDUP1;
RMAN> duplicate target database to PRODDUP1;
Starting Duplicate Db at 05-APR-14
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 04/05/2014 11:10:29
RMAN-06174: not connected to auxiliary database
--DUPLICATE命令作為RMAN中的一個(gè)命令,要?jiǎng)?chuàng)建Duplicate數(shù)據(jù)庫,,首先就得保證RMAN客戶端能夠正常連接到目標(biāo)數(shù)據(jù)庫(PROD)和啟動(dòng)到NOMOUNT狀態(tài)的輔助實(shí)例(即上面報(bào)錯(cuò)的“auxiliary database”)
2. 嘗試完整的實(shí)戰(zhàn)-參考三思的教程,感謝!
本地創(chuàng)建Duplicate數(shù)據(jù)庫
復(fù)雜度最高,由于本地創(chuàng)建Duplicate數(shù)據(jù)庫,新創(chuàng)建的文件路徑不能與目標(biāo)數(shù)據(jù)庫相同,本地創(chuàng)建需要注意輔助實(shí)例初始化參數(shù)中DB_NAME與目標(biāo)數(shù)據(jù)庫不能相同。
核心要求:
保證輔助實(shí)例的初始化參數(shù)中文件路徑的正確有效
執(zhí)行DUPLICATE命令時(shí),注意與輔助實(shí)例初始化參數(shù)設(shè)置的配合
2.1) 創(chuàng)建輔助實(shí)例 auxiliary instance
2.1.1) 創(chuàng)建輔助實(shí)例的密鑰文件
orapwd file=orapwPRODDUP1 password=oracle
2.1.2) 指定環(huán)境變量ORACLE_SID--auxiliary instance
export ORACLE_SID=PRODDUP1
2.1.3) 配置初始化參數(shù)文件
由于11g與10g管理目錄的區(qū)別,在11g庫中查詢:
audit_file_dest string /u01/app/oracle/admin/PROD/adump
background_dump_dest string /u01/app/oracle/diag/rdbms/prod/PROD/trace
core_dump_dest string /u01/app/oracle/diag/rdbms/prod/PROD/cdump
user_dump_dest string /u01/app/oracle/diag/rdbms/prod/PROD/trace
并且參數(shù)文件initPROD.ora中只指定了audit_file_dest,我們這里只手工創(chuàng)建路徑adump,其他路徑看ORACLE是否能夠自動(dòng)創(chuàng)建
cd $ORACLE_BASE/admin
mkdir -p ./PRODDUP1/adump
下面創(chuàng)建其他數(shù)據(jù)庫文件(控制文件、日志文件、數(shù)據(jù)文件)的路徑:
mkdir -p /u01/app/oracle/oradata/PRODDUP1/disk1
mkdir -p /u01/app/oracle/oradata/PRODDUP1/disk2
mkdir -p /u01/app/oracle/oradata/PRODDUP1/disk3
mkdir -p /u01/app/oracle/oradata/PRODDUP1/disk4
mkdir -p /u01/app/oracle/oradata/PRODDUP1/disk5
下面修改參數(shù)文件內(nèi)容,先進(jìn)行復(fù)制
cd $ORACLE_HOME/dbs
cp initPROD.ora initPRODDUP1.ora
vi initPRODDUP1.ora
PROD.__db_cache_size=230686720
PROD.__java_pool_size=4194304
PROD.__large_pool_size=4194304
PROD.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
PROD.__pga_aggregate_target=314572800
PROD.__sga_target=419430400
PROD.__shared_io_pool_size=0
PROD.__shared_pool_size=163577856
PROD.__streams_pool_size=8388608
*.audit_file_dest='/u01/app/oracle/admin/PROD/adump'
*.audit_trail='db'
*.compatible='11.2.0'
*.control_files='/u01/app/oracle/oradata/PROD/disk1/control01.ctl','/u01/app/oracle/oradata/PROD/disk2/control02.ctl','/u01/app/oracle/oradata/PROD/disk3/control03.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='PROD'
*.db_recovery_file_dest='/home/oracle/flash'
*.db_recovery_file_dest_size=2G
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
*.local_listener='listener2'
*.log_archive_dest_1='location=/home/oracle/arch'
*.memory_target=700M
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=400M
*.undo_management='auto'
*.undo_tablespace='UNDOTBS1'
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com