Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: RMAN : diff between duplicate and backup
2.0 PRE-REQUISITES
i. there needs to be a valid backup of the target database ii. the target database must be open iii. for the example below, the following environment variables are set (assuming C shell): %setenv NLS_LANG AMERICAN_AMERICA.WE8ISO8859P1 %setenv NLS_DATE_FORMAT 'DD-MON-YYYY HH24:MI:SS'
3.0 PROCEDURE
The following is an example of creating a duplicate database from a target
backup set. The duplicate is created on the same host.
The target db SID is V815.
The duplicate db SID is V815_dup.
3.1 copy the "init.ora" from the target to the duplicate area:
%cp initV815.ora initV815_dup.ora
3.2 edit parameters that reference location and instance name. eg,
db_name = V815_dup instance_name = V815_dup control_files = <duplicate db control file(s)> background_dump_dest = <duplicate db bdump> core_dump_dest = <duplicate db cdump> user_dump_dest = <duplicate db udump> log_archive_dest_1 = <duplicate db arch dump location> db_file_name_convert = (<old string>, <new string>) log_file_name_convert = (<old string>, <new string>) for step 3.3: remote_login_passwordfile = exclusive
3.3 start the duplicate instance:
%orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=kernel
c. start the instance in nomount state:
SVRMGR> startup nomount pfile=initV815_dup.ora
3.4 configure and check SQL*Net connectivity to the duplicate db:
% sqlplus internal/kernel_at_aux_db
3.5 start RMAN and run 'duplicate' command:
%rman rcvcat rman/rman_at_catalog_db \
target internal/kernel_at_target_db \ auxiliary internal/kernel_at_aux_db This connects to the catalog, target and duplicate (auxiliary) instances, and produces an output similar to: RMAN-06005: connected to target database: V815 (DBID=3439710252) RMAN-06008: connected to recovery catalog database RMAN-06020: connected to auxiliary database The following command will duplicate a database upto a given point intime:
run { set until time '31-AUG-1999 11:08:00'; allocate auxiliary channel ch1 type disk; allocate auxiliary channel ch2 type disk; allocate auxiliary channel ch3 type disk; duplicate target database to V815_dup; }
4.0 WHAT HAS HAPPENED?
The example of Section 3.0 will:
db_file_name_convert
(NB, the RMAN commands 'set newname' and 'set auxname' can also be used instead of or alongside db_file_name_convert, as described in the 'Oracle 8.1.5 Backup and Recovery Guide')
3. Recover the database up to the given point in time.
4. Open the database with RESETLOGS, and create online redo log files as
defined by the "init.ora" parameter "log_file_name_convert"
(NB, the 'logfile' clause of the 'duplicate' command can also be used instead of "log_file_name_convert" as described in the 'Oracle 8.1.5 Backup and Recovery Guide'). 5. Set a new DBID for the duplicated database. This means that the duplicated database can register with the same RMAN catalog as the original target database.
"The Views expressed here are my own and not necessarily those of Oracle Corporation"
Tang Wai Shing Wilson <cswstang_at_cs.ust.hk> wrote in message news:816isb$ftf_at_ustsu10.ust.hk...
> I will be duplicating my Oracle8i dbs. I like to use rman. I read thru > the document and found that I can use either backup or duplicate to > fulfill my job. Which 1 in fact is better? What are their differences? > > Thanks. > Wilson. > > > -- > --- > Tang Wai Shing, Wilson Email: cswstang_at_cs.ust.hk > Dept. of Computer Science, Tel# : (852)-2358-7004 Fax: (852)-2358-1477 > HKUST, Clear Water Bay Road, Fingerprint: 54 8D 55 F5 B5 1E AC 7E > Hong Kong. 80 40 23 18 8B 8C ED C4Received on Sat Nov 20 1999 - 22:15:52 CST