您好,登錄后才能下訂單哦!
--在線傳輸表空間,增量方式 --創建相關目錄 create directory sourcedir as '+DATA/mydb/datafile'; create directory destdir as '/oracle/app/oracle/oradata/mytest'; --創建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 --相關表空間 TEST,MYDB,TMOVE,TBSADD,TSB01 tablespaces= ----需要遷移的表空間 platformid= ----源 OS 平臺 ID dfcopydir= ----源數據庫備份文件存放目錄 backupformat= ---源數據庫增備文件存放目錄 stageondest= ----目標據庫備份文件存放目錄 storageondest= ----目標據庫正式文件存放目錄 backupondest= ----目標據庫增備文件存放目錄 parallel= ----備份,轉化的并行度 rollparallel= ----增備的并行度 getfileparallel= ---- 使用 dbms_file_transfer 方式的并行度 --源端塊跟蹤 alter database enable block change tracking using file '+data'; --源端運行,導出數據 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,無需拷貝 --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 --源端創建增量備份 export TMPDIR=/home/oracle/xtt $ORACLE_HOME/perl/bin/perl xttdriver.pl -i --nfs無需拷貝 --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 --目標端 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 --目標端創建相關用戶,注意密碼即將過期用戶無法查到(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')); --源端設置表空間只讀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; --最后增量 --源端創建增量備份,注意nfs目錄權限 chown -R oracle:oinstall /stage_source export TMPDIR=/home/oracle/xtt $ORACLE_HOME/perl/bin/perl xttdriver.pl -i --nfs無需拷貝,incrbackups.txt 備份信息 --scp `cat incrbackups.txt` oracle@dest:/stage_dest cd /home/oracle/xtt/ scp xttplan.txt tsbkupmap.txt mystandby:/home/oracle/xtt --目標端 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 --生成導入腳本 $ORACLE_HOME/perl/bin/perl xttdriver.pl -e --編輯導入腳本,例如 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' --設置表空間讀寫 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; --修改目標端用戶默認表空間(語句在源端查詢) 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
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。