您好,登錄后才能下訂單哦!
duplicate搭建DG (Backup-based duplication)
源庫:
run
{
allocate channel ch2 device type disk;
allocate channel ch3 device type disk;
backup as compressed backupset database;
sql 'alter system archive log current';
release channel ch2;
release channel ch3;
}
查詢出數據文件路徑
select 'set newname for datafile '||FILE_ID||' to '||file_name||';' from dba_data_files;
select 'set newname for datafile '||FILE_ID||' to '||file_name||';' from dba_TEMP_files;
使用duplicate,要在備庫有跟主庫一樣的備份目錄并且有備份集在里面,在主庫運行命令。
在備庫上配置好pfile和standby controlfile
備庫操作:
auxorcl是目標庫tnsname。
rman target sys/oracle@orcl auxiliary sys/oracle@auxorcl;
run
{
set newname for datafile 1 to '/u01/app/oracle/oradata/auxorcl/system01.dbf';
set newname for datafile 2 to '/u01/app/oracle/oradata/auxorcl/sysaux01.dbf';
set newname for datafile 3 to '/u01/app/oracle/oradata/auxorcl/undotbs01.dbf';
set newname for datafile 4 to '/u01/app/oracle/oradata/auxorcl/users01.dbf';
set newname for datafile 5 to '/u01/app/oracle/oradata/auxorcl/test.dbf';
set newname for tempfile 1 to '/u01/app/oracle/oradata/auxorcl/temp01.dbf';
duplicate target database for standby;
}
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。