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;
}
查詢出數(shù)據(jù)文件路徑
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;
}
創(chuàng)新互聯(lián)是一家從事企業(yè)網(wǎng)站建設、網(wǎng)站建設、成都網(wǎng)站建設、行業(yè)門戶網(wǎng)站建設、網(wǎng)頁設計制作的專業(yè)網(wǎng)站制作公司,擁有經(jīng)驗豐富的網(wǎng)站建設工程師和網(wǎng)頁設計人員,具備各種規(guī)模與類型網(wǎng)站建設的實力,在網(wǎng)站建設領域樹立了自己獨特的設計風格。自公司成立以來曾獨立設計制作的站點1000多家。