-- Without Recovery Catalog

SQL> select 'set newname for datafile '||file_id||' to '''||replace(file_name,'SRCDB','NEWDB')||''';' from dba_data_files;   -->  取得新DB datafile的各個路徑

set oracle_sid=NEWDB
set local=NEWDB
sqlplus "/ as sysdba"
startup nomount pfile=C:\oracle\admin\NEWDB\pfile\initNEWDB.ora
exit

set NLS_DATE_FORMAT=DD-MON-YYYY HH24:MI:SS
set NLS_LANG=AMERICAN_AMERICA.ZHT16BIG5

rman target sys@SRCDB nocatalog auxiliary / msglog=C:\oracle\admin\NEWDB\create\rman_create_db.log
run {
allocate auxiliary channel t1 type disk;
allocate auxiliary channel t2 type disk;
allocate auxiliary channel t3 type disk;
set newname for datafile 1 to 'D:\ORACLE\ORADATA\NEWDB\SYSTEM01.DBF';
set newname for datafile 2 to 'D:\ORACLE\ORADATA\NEWDB\RBS01.DBF';
set newname for datafile 3 to 'D:\ORACLE\ORADATA\NEWDB\USERS01.DBF';
set newname for datafile 4 to 'D:\ORACLE\ORADATA\NEWDB\INDX01.DBF';
duplicate target database to NEWDB
LOGFILE
  GROUP 1 (
    'D:\ORACLE\ORADATA\NEWDB\REDO1A.LOG',
    'E:\ORACLE\ORADATA\NEWDB\REDO1B.LOG'
  ) SIZE 5M,
  GROUP 2 (
    'D:\ORACLE\ORADATA\NEWDB\REDO2A.LOG',
    'E:\ORACLE\ORADATA\NEWDB\REDO2B.LOG'
  ) SIZE 5M,
  GROUP 3 (
    'D:\ORACLE\ORADATA\NEWDB\REDO3A.LOG',
    'E:\ORACLE\ORADATA\NEWDB\REDO3B.LOG'
  ) SIZE 5M;
release channel t1;
release channel t2;
release channel t3;
}


 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 DanBrother 的頭像
    DanBrother

    DanBrother的部落格

    DanBrother 發表在 痞客邦 留言(0) 人氣()