--在線傳輸表空間,增量方式 --創(chuàng)建相關(guān)目錄 create directory sourcedir as '+DATA/mydb/datafile'; create directory destdir as '/oracle/app/oracle/oradata/mytest'; --創(chuàng)建dblink create public database link ttslink connect to system identified by oracle using 'mydb'; select * from dual@ttslink; export TMPDIR=/home/oracle/xtt mkdir -p /stage_source chown oracle:oinstall /stage_source scp -r/home/oracle/xtt mystandby:/home/oracle --相關(guān)表空間 TEST,MYDB,TMOVE,TBSADD,TSB01 tablespaces= ----需要遷移的表空間 platformid= ----源 OS 平臺(tái) ID dfcopydir= ----源數(shù)據(jù)庫(kù)備份文件存放目錄 backupformat= ---源數(shù)據(jù)庫(kù)增備文件存放目錄 stageondest= ----目標(biāo)據(jù)庫(kù)備份文件存放目錄 storageondest= ----目標(biāo)據(jù)庫(kù)正式文件存放目錄 backupondest= ----目標(biāo)據(jù)庫(kù)增備文件存放目錄 parallel= ----備份,轉(zhuǎn)化的并行度 rollparallel= ----增備的并行度 getfileparallel= ---- 使用 dbms_file_transfer 方式的并行度 --源端塊跟蹤 alter database enable block change tracking using file '+data'; --源端運(yùn)行,導(dǎo)出數(shù)據(jù) export TMPDIR=/home/oracle/xtt $ORACLE_HOME/perl/bin/perl xttdriver.pl -p --nfs /stage_source 192.168.8.0/24(rw,no_root_squash,no_all_squash,sync) exportfs -r service rpcbind start service nfs start mount -t nfs -o rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600 192.168.8.24:/stage_source /stage_dest --掛在的nfs,無(wú)需拷貝 --scp oracle@source:/stage_source/* /stage_dest cd /home/oracle/xtt/ scp rmanconvert.cmd mystandby:/home/oracle/xtt --chown -R oracle:oinstall /stage_dest/* export TMPDIR=/home/oracle/xtt $ORACLE_HOME/perl/bin/perl xttdriver.pl -c --源端創(chuàng)建增量備份 export TMPDIR=/home/oracle/xtt $ORACLE_HOME/perl/bin/perl xttdriver.pl -i --nfs無(wú)需拷貝 --scp `cat incrbackups.txt` oracle@dest:/stage_dest cd /home/oracle/xtt/ scp xttplan.txt mystandby:/home/oracle/xtt scp tsbkupmap.txt mystandby:/home/oracle/xtt --目標(biāo)端 export ORACLE_SID=mytest export TMPDIR=/home/oracle/xtt $ORACLE_HOME/perl/bin/perl xttdriver.pl -r --源端更新scn $ORACLE_HOME/perl/bin/perl xttdriver.pl -s --目標(biāo)端創(chuàng)建相關(guān)用戶,注意密碼即將過(guò)期用戶無(wú)法查到(open) select 'create user '||d.username||' identified by values '''||u.password||''' default tablespace USERS temporary tablespace '||d.TEMPORARY_TABLESPACE||';' from dba_users d,user$ u where d.username=u.name and account_status='OPEN' and username not in('SYS','SYSTEM'); select 'grant '||granted_role||' to '||grantee||';' from dba_role_privs where grantee in (select username from dba_users where account_status='OPEN' and username not in('SYS','SYSTEM')) union select 'grant '||PRIVILEGE||' to '||grantee||';' from DBA_SYS_PRIVS where grantee in (select username from dba_users where account_status='OPEN' and username not in('SYS','SYSTEM')); --源端設(shè)置表空間只讀TEST,MYDB,TMOVE,TBSADD,TSB01 alter tablespace TEST read only; alter tablespace MYDB read only; alter tablespace TMOVE read only; alter tablespace TBSADD read only; alter tablespace TSB01 read only; --最后增量 --源端創(chuàng)建增量備份,注意nfs目錄權(quán)限 chown -R oracle:oinstall /stage_source export TMPDIR=/home/oracle/xtt $ORACLE_HOME/perl/bin/perl xttdriver.pl -i --nfs無(wú)需拷貝,incrbackups.txt 備份信息 --scp `cat incrbackups.txt` oracle@dest:/stage_dest cd /home/oracle/xtt/ scp xttplan.txt tsbkupmap.txt mystandby:/home/oracle/xtt --目標(biāo)端 su - root chown -R oracle:oinstall /stage_dest/ su - oracle export ORACLE_SID=mytest export TMPDIR=/home/oracle/xtt $ORACLE_HOME/perl/bin/perl xttdriver.pl -r --生成導(dǎo)入腳本 $ORACLE_HOME/perl/bin/perl xttdriver.pl -e --編輯導(dǎo)入腳本,例如 impdp directory=DATA_PUMP_DIR logfile=tts_imp.log \ network_link=ttslink transport_full_check=no \ transport_tablespaces=ABC \ transport_datafiles='/oracle/app/oracle/oradata/mytest/ABC_12.dbf' --設(shè)置表空間讀寫 alter tablespace TEST read write; alter tablespace MYDB read write; alter tablespace TMOVE read write; alter tablespace TBSADD read write; alter tablespace TSB01 read write; --修改目標(biāo)端用戶默認(rèn)表空間(語(yǔ)句在源端查詢) select 'alter user '||d.username||' default tablespace '||d.default_tablespace||' temporary tablespace '||d.TEMPORARY_TABLESPACE||';' from dba_users d,user$ u where d.username=u.name and account_status='OPEN' and username not in('SYS','SYSTEM'); --取消塊跟蹤 alter database disable block change tracking; --刪除dblink drop database link ttslink; --參考 http://www.xifenfei.com/2017/11/xtts.html https://blog.csdn.net/heguanghuicn/article/details/79460198 11G - Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 1389592.1) https://yq.aliyun.com/articles/129601
網(wǎng)頁(yè)名稱:【XTTS】Oracle傳輸表空間xtts增量方式
文章鏈接:http://www.rwnh.cn/article36/pcogpg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供、外貿(mào)網(wǎng)站建設(shè)、全網(wǎng)營(yíng)銷推廣、網(wǎng)站內(nèi)鏈、品牌網(wǎng)站設(shè)計(jì)、網(wǎng)站導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)