Steps how to duplicate a database to a new machine. Version 10gR2 First take a fresh backup of the target database set the ORACLE_* variables If the databse is running in noarchivelog mode, shut it down and restart in mount mode. if not you can skip this step. [oracle@tsr-hermes nisutv]sql SQL*Plus: Release 10.2.0.3.0 - Production on Mon Dec 20 10:12:56 2010 Copyright (c) 1982, 2006, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0-64bit Production With the Partitioning, OLAP and Data Mining options SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount ORACLE instance started. Total System Global Area 1795162112 bytes Fixed Size 2073472 bytes Variable Size 637537408 bytes Database Buffers 1140850688 bytes Redo Buffers 14700544 bytes Database mounted. SQL> connect with RMAN rman target / # if the database is running in archivelog mode you can issue this command start the backup RMAN> backup as compressed backupset database plus archivelog; # if the database is running in noarchivelog mode you can issue this command start the backup RMAN> backup as compressed backupset database; Starting backup at 20-DEC-10 using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=321 devtype=disk channel ORA_DISK_1: starting compressed full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00004 name=/hermes_oradata04/nisutv/users01.dbf input datafile fno=00019 name=/hermes_oradata04/nisutv/fppref01.dbf input datafile fno=00020 name=/hermes_oradata04/nisutv/fppref02.dbf input datafile fno=00021 name=/hermes_oradata04/nisutv/fppref03.dbf input datafile fno=00030 name=/hermes_oradata04/nisutv/users02.dbf input datafile fno=00002 name=/hermes_oradata04/nisutv/undotbs01.dbf input datafile fno=00014 name=/hermes_oradata04/nisutv/fpp01.dbf input datafile fno=00015 name=/hermes_oradata04/nisutv/fpp02.dbf input datafile fno=00016 name=/hermes_oradata04/nisutv/fpp03.dbf input datafile fno=00017 name=/hermes_oradata04/nisutv/fpp04.dbf input datafile fno=00018 name=/hermes_oradata04/nisutv/fpp05.dbf input datafile fno=00005 name=/hermes_oradata04/nisutv/bios01.dbf input datafile fno=00008 name=/hermes_oradata04/nisutv/cm01.dbf input datafile fno=00001 name=/hermes_oradata04/nisutv/system01.dbf input datafile fno=00026 name=/hermes_oradata04/nisutv/operator01.dbf input datafile fno=00003 name=/hermes_oradata04/nisutv/sysaux01.dbf input datafile fno=00027 name=/hermes_oradata04/nisutv/piping01.dbf input datafile fno=00029 name=/hermes_oradata04/nisutv/gaf_tefat01.dbf input datafile fno=00010 name=/hermes_oradata04/nisutv/dsg01.dbf input datafile fno=00012 name=/hermes_oradata04/nisutv/fpdh01.dbf input datafile fno=00023 name=/hermes_oradata04/nisutv/netcalc01.dbf input datafile fno=00024 name=/hermes_oradata04/nisutv/netcalc02.dbf input datafile fno=00025 name=/hermes_oradata04/nisutv/netcalc03.dbf input datafile fno=00011 name=/hermes_oradata04/nisutv/facilcustimp01.dbf input datafile fno=00006 name=/hermes_oradata04/nisutv/biz01.dbf input datafile fno=00007 name=/hermes_oradata04/nisutv/calcres01.dbf input datafile fno=00013 name=/hermes_oradata04/nisutv/fpgas01.dbf input datafile fno=00022 name=/hermes_oradata04/nisutv/insp01.dbf input datafile fno=00028 name=/hermes_oradata04/nisutv/plot01.dbf input datafile fno=00033 name=/hermes_oradata04/nisutv/opto01.dbf input datafile fno=00034 name=/hermes_oradata04/nisutv/opto02.dbf input datafile fno=00035 name=/hermes_oradata04/nisutv/mobile01.dbf input datafile fno=00042 name=/hermes_oradata04/nisutv/scada01.dbf input datafile fno=00043 name=/hermes_oradata04/nisutv/omm01.dbf input datafile fno=00009 name=/hermes_oradata04/nisutv/doc01.dbf input datafile fno=00041 name=/hermes_oradata04/nisutv/dpcom01.dbf input datafile fno=00031 name=/hermes_oradata04/nisutv/astgep_nis01.dbf input datafile fno=00032 name=/hermes_oradata04/nisutv/astgep_nis02.dbf input datafile fno=00036 name=/hermes_oradata04/nisutv/netk01.dbf input datafile fno=00037 name=/hermes_oradata04/nisutv/bak_gbg01.dbf input datafile fno=00038 name=/hermes_oradata04/nisutv/bak_par01.dbf input datafile fno=00039 name=/hermes_oradata04/nisutv/gis_ts01.dbf input datafile fno=00040 name=/hermes_oradata04/nisutv/swednet01.dbf channel ORA_DISK_1: starting piece 1 at 20-DEC-10 input datafile fno=00040 name=/hermes_oradata04/nisutv/swednet01.dbf
channel ORA_DISK_1: starting piece 1 at 20-DEC-10 channel ORA_DISK_1: finished piece 1 at 20-DEC-10 piece handle=/hermes_oradata05/flash_recovery_area/nisutv/backupset/2010_12_20/o1_mf_nnndf_tag2 0101220T101601_6jy7pn1r_.bkp tag=tag20101220t101601 comment=none channel ORA_DISK_1: backup set complete, elapsed time: 00:22:07 channel ORA_DISK_1: starting compressed full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset including current control file in backupset including current SPFILE in backupset channel ORA_DISK_1: starting piece 1 at 20-DEC-10 piece handle=/hermes_oradata05/flash_recovery_area/nisutv/backupset/2010_12_20/o1_mf_ncsnf_tag2 0101220T101601_6jy904j0_.bkp tag=tag20101220t101601 comment=none channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03 Finished backup at 20-DEC-10 Copy the backupfiles to the new server Nest step would be to copy the files to the new server and create the same path on the new server as it was when rman took the backup. RMAN will look at the same directory structure to restore the files. The easiest way to handle this (I think) is to maintain the structure. But you can change the path if you like. I choose to build the same structure on the new server This is how you do it. On the new server build the directory structure: I use this path: cd /rg04/flash_recovery_area/ mkdir NISUTV cd NISUTV/ mkdir backupset cd backupset/ mkdir 2010_12_20 Now I have a structure on the new server that is: /rg04/flash_recovery_area/nisutv/backupset/2010_12_20 which is on the source server: /hermes_oradata05/flash_recovery_area/nisutv/backupset/2010_12_20 use scp to copy the files to a new location on the new server: scp /hermes_oradata05/flash_recovery_area/nisutv/backupset/2010_12_20/* tsrcl3db31:/rg04/flash_recovery_area/nisutv/backupset/2010_12_20 o1_mf_ncsnf_tag20101220t101129_6jy7g4yk_.bkp 100% 1072KB 1.1MB/s 00:00 o1_mf_ncsnf_tag20101220t101601_6jy904j0_.bkp 100% 1088KB 1.1MB/s 00:00 o1_mf_nnndf_tag20101220t101601_6jy7pn1r_.bkp 100% 4157MB 30.1MB/s 02:18 Now the files is located in /rg04/flash_recovery_area/nisutv/backupset/2010_12_20 but I want them to be reached on this location
/hermes_oradata05/flash_recovery_area/nisutv/backupset/2010_12_20 on the new server. Connect as root issue: ln -s /rg04 /hermes_oradata05 I know have a "directory" named /hermes_oradata05 ls -ltr /hermes_oradata05 lrwxrwxrwx 1 root root 5 Dec 20 10:54 /hermes_oradata05 -> /rg04 in this directory i have the flash_recovery_area and the structure described above. The link points to /rg04/.. exit out from the root user Build and start the instance on the new server Next step would be to build the instance on the new server. startup the source database (if shutdown for backup) If you have exactly the same structure on the new server as it is on the old server you can copy the spfile and password file directly to $ORACLE_HOME/dbs on the new server. But if the structure differs, you need to change the path in the initfile by creating a pfile. create a pfile from spfile (if spfile is used) SQL> create pfile from spfile; The file is created in $ORACLE_HOME/dbs copy the init and password file to the same location on the new server. scp initnisutv.ora orapwnisutv tsr-cl3db31:/global/u01/app/oracle/product/10.2.0/db_1/dbs initnisutv.ora 100% 1160 1.1KB/s 00:00 orapwnisutv 100% 1536 1.5KB/s 00:00
on the new server: Edit the initfile and make sure the path are changed where needed in my case the following parameters needs to be changed to: *.audit_file_dest='/global/u01/app/oracle/admin/nisutv/adump' *.background_dump_dest='/global/u01/app/oracle/admin/nisutv/bdump' *.control_files= '/rg01/oradata/control01.ctl', '/rg01/oradata/nisutv/control02.ctl', '/rg01/oradata/nisutv/control03.ctl' *.core_dump_dest='/global/u01/oracle/admin/nisutv/cdump' *.db_recovery_file_dest='/rg01/flash_recovery_area' *.user_dump_dest='/global/u01/app/oracle/admin/nisutv/udump' make sure the structure exists, if not create them. /rg01/oradata/nisutv mkdir /global/u01/app/oracle/admin/nisutv mkdir /global/u01/app/oracle/admin/nisutv/adump mkdir /global/u01/app/oracle/admin/nisutv/bdump mkdir /global/u01/app/oracle/admin/nisutv/cdump mkdir /global/u01/app/oracle/admin/nisutv/udump now start the new instance in nomount mode using the new pfile SQL> startup nomount pfile=initnisutv.ora ORACLE instance started. Total System Global Area 1795162112 bytes Fixed Size 2073472 bytes Variable Size 419433600 bytes Database Buffers 1358954496 bytes Redo Buffers 14700544 bytes SQL> create a tns entry that points to the source database AUX = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = tsr-hermes.goteborgenergi.se)(port = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = nisutv.goteborgenergi.se) ) ) I call it aux, but you can have any name you like.
Build the duplicate script Now it's time to build the duplicate script, there are many ways to handle this I choose this way and it works for me. On the source database: run the following scripts: select 'set newname for datafile ' file_id ' to ''' '&new_path' substr(file_name,instr(file_name,'/',1,&how_many_backslash),30) ''';' from dba_data_files order by file_id; select 'set newname for tempfile ' file_id ' to ''' '&new_path' substr(file_name,instr(file_name,'/',1,&how_many_backslash),30) ''';' from dba_temp_files order by file_id; &new_path = the full path for the datafiles on the new server, in this case = /rg01/oradata/nisutv &how_many_backslash = how many backslashes do you have in your current file_name We need to do this for both data and temp files. If you don't store the files on the same disk, you need to modify the script or manually edit the string, take the strings and past into a rman run block run { set newname for datafile 1 to '/rg01/oradata/nisutv/system01.dbf'; set newname for datafile 2 to '/rg01/oradata/nisutv/undotbs01.dbf'; set newname for datafile 3 to '/rg01/oradata/nisutv/sysaux01.dbf'; set newname for datafile 4 to '/rg01/oradata/nisutv/users01.dbf'; set newname for datafile 5 to '/rg01/oradata/nisutv/bios01.dbf'; set newname for datafile 6 to '/rg01/oradata/nisutv/biz01.dbf'; set newname for datafile 7 to '/rg01/oradata/nisutv/calcres01.dbf'; set newname for datafile 8 to '/rg01/oradata/nisutv/cm01.dbf'; set newname for datafile 9 to '/rg01/oradata/nisutv/doc01.dbf'; set newname for datafile 10 to '/rg01/oradata/nisutv/dsg01.dbf'; set newname for datafile 11 to '/rg01/oradata/nisutv/facilcustimp01.dbf'; set newname for datafile 12 to '/rg01/oradata/nisutv/fpdh01.dbf'; set newname for datafile 13 to '/rg01/oradata/nisutv/fpgas01.dbf'; set newname for datafile 14 to '/rg01/oradata/nisutv/fpp01.dbf'; set newname for datafile 15 to '/rg01/oradata/nisutv/fpp02.dbf'; set newname for datafile 16 to '/rg01/oradata/nisutv/fpp03.dbf'; set newname for datafile 17 to '/rg01/oradata/nisutv/fpp04.dbf'; set newname for datafile 18 to '/rg01/oradata/nisutv/fpp05.dbf'; set newname for datafile 19 to '/rg01/oradata/nisutv/fppref01.dbf'; set newname for datafile 20 to '/rg01/oradata/nisutv/fppref02.dbf'; set newname for datafile 21 to '/rg01/oradata/nisutv/fppref03.dbf';
set newname for datafile 22 to '/rg01/oradata/nisutv/insp01.dbf'; set newname for datafile 23 to '/rg01/oradata/nisutv/netcalc01.dbf'; set newname for datafile 24 to '/rg01/oradata/nisutv/netcalc02.dbf'; set newname for datafile 25 to '/rg01/oradata/nisutv/netcalc03.dbf'; set newname for datafile 26 to '/rg01/oradata/nisutv/operator01.dbf'; set newname for datafile 27 to '/rg01/oradata/nisutv/piping01.dbf'; set newname for datafile 28 to '/rg01/oradata/nisutv/plot01.dbf'; set newname for datafile 29 to '/rg01/oradata/nisutv/gaf_tefat01.dbf'; set newname for datafile 30 to '/rg01/oradata/nisutv/users02.dbf'; set newname for datafile 31 to '/rg01/oradata/nisutv/astgep_nis01.dbf'; set newname for datafile 32 to '/rg01/oradata/nisutv/astgep_nis02.dbf'; set newname for datafile 33 to '/rg01/oradata/nisutv/opto01.dbf'; set newname for datafile 34 to '/rg01/oradata/nisutv/opto02.dbf'; set newname for datafile 35 to '/rg01/oradata/nisutv/mobile01.dbf'; set newname for datafile 36 to '/rg01/oradata/nisutv/netk01.dbf'; set newname for datafile 37 to '/rg01/oradata/nisutv/bak_gbg01.dbf'; set newname for datafile 38 to '/rg01/oradata/nisutv/bak_par01.dbf'; set newname for datafile 39 to '/rg01/oradata/nisutv/gis_ts01.dbf'; set newname for datafile 40 to '/rg01/oradata/nisutv/swednet01.dbf'; set newname for datafile 41 to '/rg01/oradata/nisutv/dpcom01.dbf'; set newname for datafile 42 to '/rg01/oradata/nisutv/scada01.dbf'; set newname for datafile 43 to '/rg01/oradata/nisutv/omm01.dbf'; set newname for tempfile 1 to '/rg01/oradata/nisutv/temp01.dbf'; set newname for tempfile 2 to '/rg01/oradata/nisutv/temp02.dbf'; duplicate target database to nisutv; # nisutv corresponds to the new database sid } Note that I added the duplicate command as well duplicate target database to nisutv; # nisutv corresponds to the new database sid On the new server: start rman and connect nisutv $ rman target sys@aux auxiliary / Recovery Manager: Release 10.2.0.3.0 - Production on Mon Dec 20 12:20:42 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. target database Password: connected to target database: NISUTV (DBID=1316610578) connected to auxiliary database: NISUTV (not mounted) paste the script into the rman window: This is the output.
Starting Duplicate Db at 20-DEC-10 using channel ORA_AUX_DISK_1 contents of Memory Script: { set newname for datafile 1 to "/rg01/oradata/nisutv/system01.dbf"; set newname for datafile 2 to "/rg01/oradata/nisutv/undotbs01.dbf"; set newname for datafile 3 to
"/rg01/oradata/nisutv/sysaux01.dbf"; set newname for datafile 4 to "/rg01/oradata/nisutv/users01.dbf"; set newname for datafile 5 to "/rg01/oradata/nisutv/bios01.dbf"; set newname for datafile 6 to "/rg01/oradata/nisutv/biz01.dbf"; set newname for datafile 7 to "/rg01/oradata/nisutv/calcres01.dbf"; set newname for datafile 8 to "/rg01/oradata/nisutv/cm01.dbf"; set newname for datafile 9 to "/rg01/oradata/nisutv/doc01.dbf"; set newname for datafile 10 to "/rg01/oradata/nisutv/dsg01.dbf"; set newname for datafile 11 to "/rg01/oradata/nisutv/facilcustimp01.dbf"; set newname for datafile 12 to "/rg01/oradata/nisutv/fpdh01.dbf"; set newname for datafile 13 to "/rg01/oradata/nisutv/fpgas01.dbf"; set newname for datafile 14 to "/rg01/oradata/nisutv/fpp01.dbf"; set newname for datafile 15 to "/rg01/oradata/nisutv/fpp02.dbf"; set newname for datafile 16 to "/rg01/oradata/nisutv/fpp03.dbf"; set newname for datafile 17 to "/rg01/oradata/nisutv/fpp04.dbf"; set newname for datafile 18 to "/rg01/oradata/nisutv/fpp05.dbf"; set newname for datafile 19 to "/rg01/oradata/nisutv/fppref01.dbf"; set newname for datafile 20 to "/rg01/oradata/nisutv/fppref02.dbf"; set newname for datafile 21 to "/rg01/oradata/nisutv/fppref03.dbf"; set newname for datafile 22 to "/rg01/oradata/nisutv/insp01.dbf"; set newname for datafile 23 to "/rg01/oradata/nisutv/netcalc01.dbf"; set newname for datafile 24 to "/rg01/oradata/nisutv/netcalc02.dbf"; set newname for datafile 25 to "/rg01/oradata/nisutv/netcalc03.dbf"; set newname for datafile 26 to "/rg01/oradata/nisutv/operator01.dbf"; set newname for datafile 27 to "/rg01/oradata/nisutv/piping01.dbf";
set newname for datafile 28 to "/rg01/oradata/nisutv/plot01.dbf"; set newname for datafile 29 to "/rg01/oradata/nisutv/gaf_tefat01.dbf"; set newname for datafile 30 to "/rg01/oradata/nisutv/users02.dbf"; set newname for datafile 31 to "/rg01/oradata/nisutv/astgep_nis01.dbf"; set newname for datafile 32 to "/rg01/oradata/nisutv/astgep_nis02.dbf"; set newname for datafile 33 to "/rg01/oradata/nisutv/opto01.dbf"; set newname for datafile 34 to "/rg01/oradata/nisutv/opto02.dbf"; set newname for datafile 35 to "/rg01/oradata/nisutv/mobile01.dbf"; set newname for datafile 36 to "/rg01/oradata/nisutv/netk01.dbf"; set newname for datafile 37 to "/rg01/oradata/nisutv/bak_gbg01.dbf"; set newname for datafile 38 to "/rg01/oradata/nisutv/bak_par01.dbf"; set newname for datafile 39 to "/rg01/oradata/nisutv/gis_ts01.dbf"; set newname for datafile 40 to "/rg01/oradata/nisutv/swednet01.dbf"; set newname for datafile 41 to "/rg01/oradata/nisutv/dpcom01.dbf"; set newname for datafile 42 to "/rg01/oradata/nisutv/scada01.dbf"; set newname for datafile 43 to "/rg01/oradata/nisutv/omm01.dbf"; restore check readonly clone database ; } executing Memory Script
Starting restore at 20-DEC-10 using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting datafile backupset restore channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set restoring datafile 00001 to /rg01/oradata/nisutv/system01.dbf restoring datafile 00002 to /rg01/oradata/nisutv/undotbs01.dbf restoring datafile 00003 to /rg01/oradata/nisutv/sysaux01.dbf restoring datafile 00004 to /rg01/oradata/nisutv/users01.dbf restoring datafile 00005 to /rg01/oradata/nisutv/bios01.dbf restoring datafile 00006 to /rg01/oradata/nisutv/biz01.dbf restoring datafile 00007 to /rg01/oradata/nisutv/calcres01.dbf restoring datafile 00008 to /rg01/oradata/nisutv/cm01.dbf restoring datafile 00009 to /rg01/oradata/nisutv/doc01.dbf restoring datafile 00010 to /rg01/oradata/nisutv/dsg01.dbf restoring datafile 00011 to /rg01/oradata/nisutv/facilcustimp01.dbf restoring datafile 00012 to /rg01/oradata/nisutv/fpdh01.dbf restoring datafile 00013 to /rg01/oradata/nisutv/fpgas01.dbf restoring datafile 00014 to /rg01/oradata/nisutv/fpp01.dbf restoring datafile 00015 to /rg01/oradata/nisutv/fpp02.dbf restoring datafile 00016 to /rg01/oradata/nisutv/fpp03.dbf restoring datafile 00017 to /rg01/oradata/nisutv/fpp04.dbf
restoring datafile 00018 to /rg01/oradata/nisutv/fpp05.dbf restoring datafile 00019 to /rg01/oradata/nisutv/fppref01.dbf restoring datafile 00020 to /rg01/oradata/nisutv/fppref02.dbf restoring datafile 00021 to /rg01/oradata/nisutv/fppref03.dbf restoring datafile 00022 to /rg01/oradata/nisutv/insp01.dbf restoring datafile 00023 to /rg01/oradata/nisutv/netcalc01.dbf restoring datafile 00024 to /rg01/oradata/nisutv/netcalc02.dbf restoring datafile 00025 to /rg01/oradata/nisutv/netcalc03.dbf restoring datafile 00026 to /rg01/oradata/nisutv/operator01.dbf restoring datafile 00027 to /rg01/oradata/nisutv/piping01.dbf restoring datafile 00028 to /rg01/oradata/nisutv/plot01.dbf restoring datafile 00029 to /rg01/oradata/nisutv/gaf_tefat01.dbf restoring datafile 00030 to /rg01/oradata/nisutv/users02.dbf restoring datafile 00031 to /rg01/oradata/nisutv/astgep_nis01.dbf restoring datafile 00032 to /rg01/oradata/nisutv/astgep_nis02.dbf restoring datafile 00033 to /rg01/oradata/nisutv/opto01.dbf restoring datafile 00034 to /rg01/oradata/nisutv/opto02.dbf restoring datafile 00035 to /rg01/oradata/nisutv/mobile01.dbf restoring datafile 00036 to /rg01/oradata/nisutv/netk01.dbf restoring datafile 00037 to /rg01/oradata/nisutv/bak_gbg01.dbf restoring datafile 00038 to /rg01/oradata/nisutv/bak_par01.dbf restoring datafile 00039 to /rg01/oradata/nisutv/gis_ts01.dbf restoring datafile 00040 to /rg01/oradata/nisutv/swednet01.dbf restoring datafile 00041 to /rg01/oradata/nisutv/dpcom01.dbf restoring datafile 00042 to /rg01/oradata/nisutv/scada01.dbf restoring datafile 00043 to /rg01/oradata/nisutv/omm01.dbf channel ORA_AUX_DISK_1: reading from backup piece /hermes_oradata05/flash_recovery_area/nisutv/backupset/2010_12_20/o1_mf_nnndf_tag2010122 0T101601_6jy7pn1r_.bkp channel ORA_AUX_DISK_1: restored backup piece 1 piece handle=/hermes_oradata05/flash_recovery_area/nisutv/backupset/2010_12_20/o1_mf_nnndf_tag2 0101220T101601_6jy7pn1r_.bkp tag=tag20101220t101601 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:25:37 Finished restore at 20-DEC-10 sql statement: CREATE CONTROLFILE REUSE SET DATABASE "NISUTV" RESETLOGS NOARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 584 LOGFILE GROUP 1 SIZE 100 M, GROUP 2 SIZE 100 M, GROUP 3 SIZE 100 M DATAFILE '/rg01/oradata/nisutv/system01.dbf' CHARACTER SET WE8ISO8859P1
contents of Memory Script: { switch clone datafile all; } executing Memory Script released channel: ORA_AUX_DISK_1 datafile 2 switched to datafile copy input datafile copy recid=1 stamp=738247708 filename=/rg01/oradata/nisutv/undotbs01.dbf datafile 3 switched to datafile copy input datafile copy recid=2 stamp=738247708 filename=/rg01/oradata/nisutv/sysaux01.dbf datafile 4 switched to datafile copy input datafile copy recid=3 stamp=738247708 filename=/rg01/oradata/nisutv/users01.dbf datafile 5 switched to datafile copy input datafile copy recid=4 stamp=738247708 filename=/rg01/oradata/nisutv/bios01.dbf datafile 6 switched to datafile copy input datafile copy recid=5 stamp=738247708 filename=/rg01/oradata/nisutv/biz01.dbf datafile 7 switched to datafile copy input datafile copy recid=6 stamp=738247708 filename=/rg01/oradata/nisutv/calcres01.dbf datafile 8 switched to datafile copy input datafile copy recid=7 stamp=738247708 filename=/rg01/oradata/nisutv/cm01.dbf datafile 9 switched to datafile copy input datafile copy recid=8 stamp=738247708 filename=/rg01/oradata/nisutv/doc01.dbf datafile 10 switched to datafile copy input datafile copy recid=9 stamp=738247708 filename=/rg01/oradata/nisutv/dsg01.dbf datafile 11 switched to datafile copy input datafile copy recid=10 stamp=738247708 filename=/rg01/oradata/nisutv/facilcustimp01.dbf datafile 12 switched to datafile copy input datafile copy recid=11 stamp=738247708 filename=/rg01/oradata/nisutv/fpdh01.dbf datafile 13 switched to datafile copy input datafile copy recid=12 stamp=738247708 filename=/rg01/oradata/nisutv/fpgas01.dbf datafile 14 switched to datafile copy input datafile copy recid=13 stamp=738247708 filename=/rg01/oradata/nisutv/fpp01.dbf datafile 15 switched to datafile copy input datafile copy recid=14 stamp=738247708 filename=/rg01/oradata/nisutv/fpp02.dbf datafile 16 switched to datafile copy input datafile copy recid=15 stamp=738247708 filename=/rg01/oradata/nisutv/fpp03.dbf datafile 17 switched to datafile copy input datafile copy recid=16 stamp=738247708 filename=/rg01/oradata/nisutv/fpp04.dbf datafile 18 switched to datafile copy input datafile copy recid=17 stamp=738247708 filename=/rg01/oradata/nisutv/fpp05.dbf datafile 19 switched to datafile copy input datafile copy recid=18 stamp=738247708 filename=/rg01/oradata/nisutv/fppref01.dbf datafile 20 switched to datafile copy input datafile copy recid=19 stamp=738247708 filename=/rg01/oradata/nisutv/fppref02.dbf datafile 21 switched to datafile copy input datafile copy recid=20 stamp=738247708 filename=/rg01/oradata/nisutv/fppref03.dbf
datafile 22 switched to datafile copy input datafile copy recid=21 stamp=738247708 filename=/rg01/oradata/nisutv/insp01.dbf datafile 23 switched to datafile copy input datafile copy recid=22 stamp=738247708 filename=/rg01/oradata/nisutv/netcalc01.dbf datafile 24 switched to datafile copy input datafile copy recid=23 stamp=738247708 filename=/rg01/oradata/nisutv/netcalc02.dbf datafile 25 switched to datafile copy input datafile copy recid=24 stamp=738247708 filename=/rg01/oradata/nisutv/netcalc03.dbf datafile 26 switched to datafile copy input datafile copy recid=25 stamp=738247708 filename=/rg01/oradata/nisutv/operator01.dbf datafile 27 switched to datafile copy input datafile copy recid=26 stamp=738247708 filename=/rg01/oradata/nisutv/piping01.dbf datafile 28 switched to datafile copy input datafile copy recid=27 stamp=738247708 filename=/rg01/oradata/nisutv/plot01.dbf datafile 29 switched to datafile copy input datafile copy recid=28 stamp=738247708 filename=/rg01/oradata/nisutv/gaf_tefat01.dbf datafile 30 switched to datafile copy input datafile copy recid=29 stamp=738247708 filename=/rg01/oradata/nisutv/users02.dbf datafile 31 switched to datafile copy input datafile copy recid=30 stamp=738247708 filename=/rg01/oradata/nisutv/astgep_nis01.dbf datafile 32 switched to datafile copy input datafile copy recid=31 stamp=738247708 filename=/rg01/oradata/nisutv/astgep_nis02.dbf datafile 33 switched to datafile copy input datafile copy recid=32 stamp=738247708 filename=/rg01/oradata/nisutv/opto01.dbf datafile 34 switched to datafile copy input datafile copy recid=33 stamp=738247708 filename=/rg01/oradata/nisutv/opto02.dbf datafile 35 switched to datafile copy input datafile copy recid=34 stamp=738247708 filename=/rg01/oradata/nisutv/mobile01.dbf datafile 36 switched to datafile copy input datafile copy recid=35 stamp=738247708 filename=/rg01/oradata/nisutv/netk01.dbf datafile 37 switched to datafile copy input datafile copy recid=36 stamp=738247708 filename=/rg01/oradata/nisutv/bak_gbg01.dbf datafile 38 switched to datafile copy input datafile copy recid=37 stamp=738247708 filename=/rg01/oradata/nisutv/bak_par01.dbf datafile 39 switched to datafile copy input datafile copy recid=38 stamp=738247708 filename=/rg01/oradata/nisutv/gis_ts01.dbf datafile 40 switched to datafile copy input datafile copy recid=39 stamp=738247708 filename=/rg01/oradata/nisutv/swednet01.dbf datafile 41 switched to datafile copy input datafile copy recid=40 stamp=738247708 filename=/rg01/oradata/nisutv/dpcom01.dbf datafile 42 switched to datafile copy input datafile copy recid=41 stamp=738247708 filename=/rg01/oradata/nisutv/scada01.dbf datafile 43 switched to datafile copy input datafile copy recid=42 stamp=738247708 filename=/rg01/oradata/nisutv/omm01.dbf contents of Memory Script: { recover clone database
noredo, delete archivelog ; } executing Memory Script Starting recover at 20-DEC-10 allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: sid=320 devtype=disk Finished recover at 20-DEC-10 contents of Memory Script: { shutdown clone; startup clone nomount ; } executing Memory Script database dismounted Oracle instance shut down connected to auxiliary database (not started) Oracle instance started Total System Global Area 1795162112 bytes Fixed Size 2073472 bytes Variable Size 419433600 bytes Database Buffers 1358954496 bytes Redo Buffers 14700544 bytes sql statement: CREATE CONTROLFILE REUSE SET DATABASE "NISUTV" RESETLOGS NOARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 584 LOGFILE GROUP 1 SIZE 100 M, GROUP 2 SIZE 100 M, GROUP 3 SIZE 100 M DATAFILE '/rg01/oradata/nisutv/system01.dbf' CHARACTER SET WE8ISO8859P1 contents of Memory Script: {
set newname for tempfile 1 to "/rg01/oradata/nisutv/temp01.dbf"; set newname for tempfile 2 to "/rg01/oradata/nisutv/temp02.dbf"; switch clone tempfile all; catalog clone datafilecopy "/rg01/oradata/nisutv/undotbs01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/sysaux01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/users01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/bios01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/biz01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/calcres01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/cm01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/doc01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/dsg01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/facilcustimp01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/fpdh01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/fpgas01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/fpp01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/fpp02.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/fpp03.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/fpp04.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/fpp05.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/fppref01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/fppref02.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/fppref03.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/insp01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/netcalc01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/netcalc02.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/netcalc03.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/operator01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/piping01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/plot01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/gaf_tefat01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/users02.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/astgep_nis01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/astgep_nis02.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/opto01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/opto02.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/mobile01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/netk01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/bak_gbg01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/bak_par01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/gis_ts01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/swednet01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/dpcom01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/scada01.dbf"; catalog clone datafilecopy "/rg01/oradata/nisutv/omm01.dbf"; switch clone datafile all; }
executing Memory Script renamed temporary file 1 to /rg01/oradata/nisutv/temp01.dbf in control file renamed temporary file 2 to /rg01/oradata/nisutv/temp02.dbf in control file datafile copy filename=/rg01/oradata/nisutv/undotbs01.dbf recid=1 stamp=738247722 datafile copy filename=/rg01/oradata/nisutv/sysaux01.dbf recid=2 stamp=738247722 datafile copy filename=/rg01/oradata/nisutv/users01.dbf recid=3 stamp=738247722 datafile copy filename=/rg01/oradata/nisutv/bios01.dbf recid=4 stamp=738247722 datafile copy filename=/rg01/oradata/nisutv/biz01.dbf recid=5 stamp=738247723 datafile copy filename=/rg01/oradata/nisutv/calcres01.dbf recid=6 stamp=738247723 datafile copy filename=/rg01/oradata/nisutv/cm01.dbf recid=7 stamp=738247723 datafile copy filename=/rg01/oradata/nisutv/doc01.dbf recid=8 stamp=738247723 datafile copy filename=/rg01/oradata/nisutv/dsg01.dbf recid=9 stamp=738247723 datafile copy filename=/rg01/oradata/nisutv/facilcustimp01.dbf recid=10 stamp=738247723 datafile copy filename=/rg01/oradata/nisutv/fpdh01.dbf recid=11 stamp=738247723 datafile copy filename=/rg01/oradata/nisutv/fpgas01.dbf recid=12 stamp=738247723 datafile copy filename=/rg01/oradata/nisutv/fpp01.dbf recid=13 stamp=738247723
datafile copy filename=/rg01/oradata/nisutv/fpp02.dbf recid=14 stamp=738247723 datafile copy filename=/rg01/oradata/nisutv/fpp03.dbf recid=15 stamp=738247723 datafile copy filename=/rg01/oradata/nisutv/fpp04.dbf recid=16 stamp=738247724 datafile copy filename=/rg01/oradata/nisutv/fpp05.dbf recid=17 stamp=738247724 datafile copy filename=/rg01/oradata/nisutv/fppref01.dbf recid=18 stamp=738247724 datafile copy filename=/rg01/oradata/nisutv/fppref02.dbf recid=19 stamp=738247724 datafile copy filename=/rg01/oradata/nisutv/fppref03.dbf recid=20 stamp=738247724 datafile copy filename=/rg01/oradata/nisutv/insp01.dbf recid=21 stamp=738247724 datafile copy filename=/rg01/oradata/nisutv/netcalc01.dbf recid=22 stamp=738247724 datafile copy filename=/rg01/oradata/nisutv/netcalc02.dbf recid=23 stamp=738247724 datafile copy filename=/rg01/oradata/nisutv/netcalc03.dbf recid=24 stamp=738247724 datafile copy filename=/rg01/oradata/nisutv/operator01.dbf recid=25 stamp=738247725 datafile copy filename=/rg01/oradata/nisutv/piping01.dbf recid=26 stamp=738247725 datafile copy filename=/rg01/oradata/nisutv/plot01.dbf recid=27 stamp=738247725 datafile copy filename=/rg01/oradata/nisutv/gaf_tefat01.dbf recid=28 stamp=738247725 datafile copy filename=/rg01/oradata/nisutv/users02.dbf recid=29 stamp=738247725 datafile copy filename=/rg01/oradata/nisutv/astgep_nis01.dbf recid=30 stamp=738247725
datafile copy filename=/rg01/oradata/nisutv/astgep_nis02.dbf recid=31 stamp=738247725 datafile copy filename=/rg01/oradata/nisutv/opto01.dbf recid=32 stamp=738247725 datafile copy filename=/rg01/oradata/nisutv/opto02.dbf recid=33 stamp=738247726 datafile copy filename=/rg01/oradata/nisutv/mobile01.dbf recid=34 stamp=738247726 datafile copy filename=/rg01/oradata/nisutv/netk01.dbf recid=35 stamp=738247726 datafile copy filename=/rg01/oradata/nisutv/bak_gbg01.dbf recid=36 stamp=738247726 datafile copy filename=/rg01/oradata/nisutv/bak_par01.dbf recid=37 stamp=738247726 datafile copy filename=/rg01/oradata/nisutv/gis_ts01.dbf recid=38 stamp=738247726 datafile copy filename=/rg01/oradata/nisutv/swednet01.dbf recid=39 stamp=738247726 datafile copy filename=/rg01/oradata/nisutv/dpcom01.dbf recid=40 stamp=738247726 datafile copy filename=/rg01/oradata/nisutv/scada01.dbf recid=41 stamp=738247726 datafile copy filename=/rg01/oradata/nisutv/omm01.dbf recid=42 stamp=738247726 datafile 2 switched to datafile copy input datafile copy recid=1 stamp=738247722 filename=/rg01/oradata/nisutv/undotbs01.dbf datafile 3 switched to datafile copy input datafile copy recid=2 stamp=738247722 filename=/rg01/oradata/nisutv/sysaux01.dbf datafile 4 switched to datafile copy input datafile copy recid=3 stamp=738247722 filename=/rg01/oradata/nisutv/users01.dbf datafile 5 switched to datafile copy input datafile copy recid=4 stamp=738247722 filename=/rg01/oradata/nisutv/bios01.dbf datafile 6 switched to datafile copy input datafile copy recid=5 stamp=738247723 filename=/rg01/oradata/nisutv/biz01.dbf datafile 7 switched to datafile copy input datafile copy recid=6 stamp=738247723 filename=/rg01/oradata/nisutv/calcres01.dbf
datafile 8 switched to datafile copy input datafile copy recid=7 stamp=738247723 filename=/rg01/oradata/nisutv/cm01.dbf datafile 9 switched to datafile copy input datafile copy recid=8 stamp=738247723 filename=/rg01/oradata/nisutv/doc01.dbf datafile 10 switched to datafile copy input datafile copy recid=9 stamp=738247723 filename=/rg01/oradata/nisutv/dsg01.dbf datafile 11 switched to datafile copy input datafile copy recid=10 stamp=738247723 filename=/rg01/oradata/nisutv/facilcustimp01.dbf datafile 12 switched to datafile copy input datafile copy recid=11 stamp=738247723 filename=/rg01/oradata/nisutv/fpdh01.dbf datafile 13 switched to datafile copy input datafile copy recid=12 stamp=738247723 filename=/rg01/oradata/nisutv/fpgas01.dbf datafile 14 switched to datafile copy input datafile copy recid=13 stamp=738247723 filename=/rg01/oradata/nisutv/fpp01.dbf datafile 15 switched to datafile copy input datafile copy recid=14 stamp=738247723 filename=/rg01/oradata/nisutv/fpp02.dbf datafile 16 switched to datafile copy input datafile copy recid=15 stamp=738247723 filename=/rg01/oradata/nisutv/fpp03.dbf datafile 17 switched to datafile copy input datafile copy recid=16 stamp=738247724 filename=/rg01/oradata/nisutv/fpp04.dbf datafile 18 switched to datafile copy input datafile copy recid=17 stamp=738247724 filename=/rg01/oradata/nisutv/fpp05.dbf datafile 19 switched to datafile copy input datafile copy recid=18 stamp=738247724 filename=/rg01/oradata/nisutv/fppref01.dbf datafile 20 switched to datafile copy input datafile copy recid=19 stamp=738247724 filename=/rg01/oradata/nisutv/fppref02.dbf datafile 21 switched to datafile copy input datafile copy recid=20 stamp=738247724 filename=/rg01/oradata/nisutv/fppref03.dbf datafile 22 switched to datafile copy input datafile copy recid=21 stamp=738247724 filename=/rg01/oradata/nisutv/insp01.dbf datafile 23 switched to datafile copy input datafile copy recid=22 stamp=738247724 filename=/rg01/oradata/nisutv/netcalc01.dbf datafile 24 switched to datafile copy input datafile copy recid=23 stamp=738247724 filename=/rg01/oradata/nisutv/netcalc02.dbf datafile 25 switched to datafile copy input datafile copy recid=24 stamp=738247724 filename=/rg01/oradata/nisutv/netcalc03.dbf datafile 26 switched to datafile copy input datafile copy recid=25 stamp=738247725 filename=/rg01/oradata/nisutv/operator01.dbf datafile 27 switched to datafile copy input datafile copy recid=26 stamp=738247725 filename=/rg01/oradata/nisutv/piping01.dbf datafile 28 switched to datafile copy input datafile copy recid=27 stamp=738247725 filename=/rg01/oradata/nisutv/plot01.dbf datafile 29 switched to datafile copy input datafile copy recid=28 stamp=738247725 filename=/rg01/oradata/nisutv/gaf_tefat01.dbf datafile 30 switched to datafile copy input datafile copy recid=29 stamp=738247725 filename=/rg01/oradata/nisutv/users02.dbf datafile 31 switched to datafile copy input datafile copy recid=30 stamp=738247725 filename=/rg01/oradata/nisutv/astgep_nis01.dbf datafile 32 switched to datafile copy
input datafile copy recid=31 stamp=738247725 filename=/rg01/oradata/nisutv/astgep_nis02.dbf datafile 33 switched to datafile copy input datafile copy recid=32 stamp=738247725 filename=/rg01/oradata/nisutv/opto01.dbf datafile 34 switched to datafile copy input datafile copy recid=33 stamp=738247726 filename=/rg01/oradata/nisutv/opto02.dbf datafile 35 switched to datafile copy input datafile copy recid=34 stamp=738247726 filename=/rg01/oradata/nisutv/mobile01.dbf datafile 36 switched to datafile copy input datafile copy recid=35 stamp=738247726 filename=/rg01/oradata/nisutv/netk01.dbf datafile 37 switched to datafile copy input datafile copy recid=36 stamp=738247726 filename=/rg01/oradata/nisutv/bak_gbg01.dbf datafile 38 switched to datafile copy input datafile copy recid=37 stamp=738247726 filename=/rg01/oradata/nisutv/bak_par01.dbf datafile 39 switched to datafile copy input datafile copy recid=38 stamp=738247726 filename=/rg01/oradata/nisutv/gis_ts01.dbf datafile 40 switched to datafile copy input datafile copy recid=39 stamp=738247726 filename=/rg01/oradata/nisutv/swednet01.dbf datafile 41 switched to datafile copy input datafile copy recid=40 stamp=738247726 filename=/rg01/oradata/nisutv/dpcom01.dbf datafile 42 switched to datafile copy input datafile copy recid=41 stamp=738247726 filename=/rg01/oradata/nisutv/scada01.dbf datafile 43 switched to datafile copy input datafile copy recid=42 stamp=738247726 filename=/rg01/oradata/nisutv/omm01.dbf contents of Memory Script: { Alter clone database open resetlogs; } executing Memory Script database opened Finished Duplicate Db at 20-DEC-10 RMAN> exit connect with sqlplus to the new database now create a spfile from pfile in the new instance. sqlplus: create spfile from pfile; restart the new instance and check that everything looks okey. SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down.
SQL> startup ORACLE instance started. Total System Global Area 1795162112 bytes Fixed Size 2073472 bytes Variable Size 419433600 bytes Database Buffers 1358954496 bytes Redo Buffers 14700544 bytes Database mounted. Database opened. SQL> next step is to add a local alias. edit the tnsnames.ora for the database home add the alias NISUTV,NISUTV.WORLD = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = tsr-cl3rg01)(port = 1531)) ) (CONNECT_DATA = (SERVICE_NAME = nisutv.goteborgenergi.se) ) ) save it. check if you can connect nisutv $ sqlplus sys@nisutv as sysdba SQL*Plus: Release 10.2.0.3.0 - Production on Mon Dec 20 13:05:38 2010 Copyright (c) 1982, 2006, Oracle. All Rights Reserved. Enter password: Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0-64bit Production With the Partitioning, OLAP and Data Mining options SQL> You are done.