ORA-01103: database name ‘MW’ in control file is not ‘MWTST’

This error most likely occurred when you duplicated a database and the DB_NAME parameter in spfile is not matching the one in the control file. Sometimes it so happened that after duplicating the database name in SPFILE with which you started the instance with is not matching the one in the control file.

Explanation:
=====================

The database name in the controlfile is not consistent with the db_name
parameter in the init.ora file.

Solution Step 1:

Change the DB_NAME parameter in spfile and bounce the database

STARTUP NOMOUNT

ALTER SYSTEM SET DB_NAME=ORIGINAL_DBNAME SCOPE=spfile;

SHUTDOWN IMMEDIATE;

STARTUP MOUNT;

ALTER DATABASE OPEN RESETLOGS;

If you get like below error

ORA-19838: Cannot use this control file to open database then have to recreate the control file from trace . Go to Solution 2:

See Oracle support Doc ID 1906009.1

 

Solution Step 2:

 

Now the only way to bring up the cloned DB is to re-create controlfile from trace. Login to the source database and run below commands.

SQL> alter database backup controlfile to trace;

Check location of controlfile which is created to trace; checking in ALERT LOG

ALTER DATABASE BACKUP CONTROLFILE TO TRACE
Backup controlfile written to trace file /u02/app/oracle/diag/rdbms/mw/mw1/trace/mw1_ora_146366.trc

Then Copy/Edit the Details of ControlFile from the block like below.

[code language=”sql”]

CREATE CONTROLFILE SET DATABASE “MW” RESETLOGS FORCE LOGGING ARCHIVELOG
MAXLOGFILES 192
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 32
MAXLOGHISTORY 9344
LOGFILE
GROUP 1 (
‘+DATAC1/mwtst1/onlinelog/group_1.366.854619221’,
‘+RECOC1/mwtst1/onlinelog/group_1.504.854619221’
) SIZE 100M BLOCKSIZE 512,
GROUP 2 (
‘+DATAC1/mwtst1/onlinelog/group_2.367.854619389’,
‘+RECOC1/mwtst1/onlinelog/group_2.505.854619389’
) SIZE 100M BLOCKSIZE 512,
GROUP 3 (
‘+DATAC1/mwtst1/onlinelog/group_3.368.854619411’,
‘+RECOC1/mwtst1/onlinelog/group_3.506.854619411’
) SIZE 100M BLOCKSIZE 512,
GROUP 4 (
‘+DATAC1/mwtst1/onlinelog/group_4.365.854619175’,
‘+RECOC1/mwtst1/onlinelog/group_4.507.854619175’
) SIZE 100M BLOCKSIZE 512
DATAFILE
‘+DATAC1/mwtst1/datafile/SYSTEM.467.971185463’,
‘+DATAC1/mwtst1/datafile/SYSAUX.439.971266529’,
‘+DATAC1/mwtst1/datafile/USERS.473.971266529’,
‘+DATAC1/mwtst1/datafile/UNDOTBS1.468.971185463’,
‘+DATAC1/mwtst1/datafile/UNDOTBS2.466.971185463’,
‘+DATAC1/mwtst1/datafile/MQ.357.971266521’,
‘+RECOC1/mwtst1/datafile/AUDIT_TBS.1787.971185463′
CHARACTER SET AL32UTF8
;

[/code]

Save it as control_file.sql

Ensure you check the Datafile location and name, it should be same as in what resides on your filesystem. This is specially true when you using ASM and OMF together.

 

Now start the instance

 

SQL> startup nomount

SQL> @control_file.sql

Control file created.

SQL> alter database open resetlogs;

Database altered.

SQL> select open_mode from v$database;

OPEN_MODE
——————–
READ WRITE

SQL> select open_mode,name from v$database;

OPEN_MODE NAME
——————– ———
READ WRITE MW

SQL> select * from v$controlfile;

STATUS
——-
NAME
——————————————————————————–
IS_ BLOCK_SIZE FILE_SIZE_BLKS
— ———- ————–

+RECOC1/mw/controlfile/current.2156.971360621
YES 16384 1878

Now change the database name in control file using nid utility

nid TARGET=system/****** DBNAME=MWTST SETNAME=Y

 

DBNEWID: Release 11.2.0.4.0 – Production on Wed Mar 21 14:27:18 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

Connected to database MW (DBID=1312370394)

Connected to server version 11.2.0

Control Files in database:
+RECOC1/mw/controlfile/current.2156.971360621

Change database name of database MW to MWTST? (Y/[N]) => Y

Proceeding with operation
Changing database name from MW to MWTST
Control File +RECOC1/mw/controlfile/current.2156.971360621 – modified
Datafile +DATAC1/mwtst1/datafile/system.467.97118546 – wrote new name
Datafile +DATAC1/mwtst1/datafile/sysaux.439.97126652 – wrote new name
Datafile +DATAC1/mwtst1/datafile/undotbs1.468.97118546 – wrote new name
Datafile +DATAC1/mwtst1/datafile/users.473.97126652 – wrote new name
Datafile +DATAC1/mwtst1/datafile/undotbs2.466.97118546 – wrote new name
Datafile +DATAC1/mwtst1/datafile/mq.357.97126652 – wrote new name
Datafile +RECOC1/mwtst1/datafile/audit_tbs.1787.97118546 – wrote new name
Control File +RECOC1/mw/controlfile/current.2156.971360621 – wrote new name
Instance shut down

Database name changed to MWTST.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID – Completed succesfully.

 

Change PARAMETER in PFILE or in Memory

SQL> alter system set db_name=’MWTST’ scope=spfile;

System altered.

SQL> show parameter cluster

NAME TYPE VALUE
———————————— ———– ——————————
cluster_database boolean FALSE
cluster_database_instances integer 1
cluster_interconnects string

 

SQL> alter system set db_unique_name=’MWTST’ scope=spfile;

SQL> shutdown immediate;

SQL> startup mount

SQL> alter database open;

Database altered.

SQL> select open_mode,name from v$database;

OPEN_MODE NAME
——————– ———
READ WRITE MWTST

 

 

 

 

 

Restore RMAN to new server and refresh with Archivelog apply

Source Database
—————

::: Directory Structure :::
ORACLE_HOME : E:\oracle\product\10.2.0\db_1
RMAN Backup : E:\rman_backup_full
Control Files : E:\oradata\ecc
DataFiles: E:\oradata\ECC
Archivelog Destination: E:\archivelogs
adump : e:\oracle\product\10.2.0\admin\ecc\adump
bdump : e:\oracle\product\10.2.0\admin\ecc\bdump
cdump : e:\oracle\product\10.2.0\admin\ecc\cdump
udump : e:\oracle\product\10.2.0\admin\ecc\udump

1. create pfile=’E:\eccprod.ora’ from spfile;

 

2. rman target /

backup incremental level 0 TAG ‘ECC_DAILY_FULL’ database filesperset 4;
backup archivelog all not backed up 1 times;
exit;

 

3. Copy RMAN backup files and pfile to Target Database directory in same structure

 

Target Database
—————

::: Directory Structure :::
ORACLE_HOME : E:\oracle\product\10.2.0\db_1
Control Files : E:\oradata\ecc
RMAN Backup : E:\rman_backup_full
DataFiles: E:\oradata\ECC
Archivelog Destination: E:\archivelogs
adump : e:\oracle\product\10.2.0\admin\ecc\adump
bdump : e:\oracle\product\10.2.0\admin\ecc\bdump
cdump : e:\oracle\product\10.2.0\admin\ecc\cdump
udump : e:\oracle\product\10.2.0\admin\ecc\udump

Make sure RMAN directory structure and Datafiles and Control Files Directory structure is identical as Source DB server else you have to use DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT parameters

1. Create required folders in the Target database server

adump
bdump
cdump
udump

Control File Location
Datafile Location
Archivelog Location
RMAN backup location

 

——
|PFILE |
——

ecc.__db_cache_size=1342177280
ecc.__java_pool_size=8388608
ecc.__large_pool_size=8388608
ecc.__shared_pool_size=226492416
ecc.__streams_pool_size=16777216
*.audit_file_dest=’e:\oracle\product\10.2.0\admin\ecc\adump’
*.background_dump_dest=’e:\oracle\product\10.2.0\admin\ecc\bdump’
*.compatible=’10.2.0.5.0′
*.control_files=’e:\oradata\ecc\control01.ctl’,’e:\oradata\ecc\control02.ctl’,’e:\oradata\ecc\control03.ctl’
*.core_dump_dest=’e:\oracle\product\10.2.0\admin\ecc\cdump’
*.db_16k_cache_size=67108864
*.db_block_size=8192
*.db_domain=”
*.db_file_multiblock_read_count=16
*.DB_FILE_NAME_CONVERT=’eccstandby’,’ecc’
*.db_name=’ecc’
*.DB_UNIQUE_NAME=’ecc’
*.dispatchers='(PROTOCOL=TCP) (SERVICE=eccXDB)’
*.FAL_CLIENT=’ecc’
*.FAL_SERVER=’eccstandby’
*.global_names=TRUE
*.INSTANCE_NAME=’ecc’
*.job_queue_processes=20
*.LOG_ARCHIVE_CONFIG=’DG_CONFIG=(ecc,eccstandby)’
*.LOG_ARCHIVE_DEST_1=’LOCATION=E:\archivelogs VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ecc’
*.log_archive_dest_2=’SERVICE=eccstandby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=eccstandby’
*.log_archive_dest_state_1=’enable’
*.log_archive_dest_state_2=’ENABLE’
*.LOG_ARCHIVE_FORMAT=’log%t_%s_%r.arc’
*.LOG_FILE_NAME_CONVERT=’ecc’,’eccstandby’
*.open_cursors=700
*.OPTIMIZER_INDEX_COST_ADJ=30
*.pga_aggregate_target=364904448
*.processes=250
*.REMOTE_LOGIN_PASSWORDFILE=’EXCLUSIVE’
*.SERVICE_NAMES=’ecc’
*.session_cached_cursors=100
*.sessions=280
*.sga_max_size=1677721600
*.sga_target=1677721600
*.STANDBY_FILE_MANAGEMENT=’AUTO’
*.undo_management=’AUTO’
*.undo_tablespace=’UNDOTBS1′
*.user_dump_dest=’e:\oracle\product\10.2.0\admin\ecc\udump’

 

 

2. Create a service using oradim (if on windows) or with the pfile startup database in nomount mode

 

oradim -NEW -SID ecc -SYSPWD sys123 -STARTMODE auto -PFILE e:\eccprod.ora

 

3. Restore Database

rman target /

restore database ;

 

4. Now copy the new archivelogs to the archivelog directory and do recovery

 

rman target /

RMAN> catalog start with ‘E:\archivelogs’;

searching for all files that match the pattern E:\archivelogs

List of Files Unknown to the Database
=====================================
File Name: E:\archivelogs\LOG1_53601_781008485.ARC
File Name: E:\archivelogs\LOG1_53602_781008485.ARC
File Name: E:\archivelogs\LOG1_53603_781008485.ARC
File Name: E:\archivelogs\LOG1_53604_781008485.ARC
File Name: E:\archivelogs\LOG1_53605_781008485.ARC
File Name: E:\archivelogs\LOG1_53606_781008485.ARC
File Name: E:\archivelogs\LOG1_53607_781008485.ARC
File Name: E:\archivelogs\LOG1_53608_781008485.ARC
File Name: E:\archivelogs\LOG1_53609_781008485.ARC
File Name: E:\archivelogs\LOG1_53610_781008485.ARC
File Name: E:\archivelogs\LOG1_53611_781008485.ARC
File Name: E:\archivelogs\LOG1_53612_781008485.ARC
File Name: E:\archivelogs\LOG1_53613_781008485.ARC
File Name: E:\archivelogs\LOG1_53614_781008485.ARC
File Name: E:\archivelogs\LOG1_53615_781008485.ARC
File Name: E:\archivelogs\LOG1_53616_781008485.ARC
File Name: E:\archivelogs\LOG1_53617_781008485.ARC
File Name: E:\archivelogs\LOG1_53618_781008485.ARC
File Name: E:\archivelogs\LOG1_53619_781008485.ARC
File Name: E:\archivelogs\LOG1_53620_781008485.ARC
File Name: E:\archivelogs\LOG1_53621_781008485.ARC
File Name: E:\archivelogs\LOG1_53622_781008485.ARC
File Name: E:\archivelogs\LOG1_53623_781008485.ARC
File Name: E:\archivelogs\LOG1_53624_781008485.ARC
File Name: E:\archivelogs\LOG1_53625_781008485.ARC
File Name: E:\archivelogs\LOG1_53626_781008485.ARC
File Name: E:\archivelogs\LOG1_53627_781008485.ARC
File Name: E:\archivelogs\LOG1_53628_781008485.ARC
File Name: E:\archivelogs\LOG1_53629_781008485.ARC
File Name: E:\archivelogs\LOG1_53630_781008485.ARC
File Name: E:\archivelogs\LOG1_53631_781008485.ARC
File Name: E:\archivelogs\LOG1_53632_781008485.ARC
File Name: E:\archivelogs\LOG1_53633_781008485.ARC
File Name: E:\archivelogs\LOG1_53634_781008485.ARC
File Name: E:\archivelogs\LOG1_53635_781008485.ARC
File Name: E:\archivelogs\LOG1_53636_781008485.ARC
File Name: E:\archivelogs\LOG1_53637_781008485.ARC

Do you really want to catalog the above files (enter YES or NO)?
cataloging files…
cataloging done

List of Cataloged Files
=======================
File Name: E:\archivelogs\LOG1_53601_781008485.ARC
File Name: E:\archivelogs\LOG1_53602_781008485.ARC
File Name: E:\archivelogs\LOG1_53603_781008485.ARC
File Name: E:\archivelogs\LOG1_53604_781008485.ARC
File Name: E:\archivelogs\LOG1_53605_781008485.ARC
File Name: E:\archivelogs\LOG1_53606_781008485.ARC
File Name: E:\archivelogs\LOG1_53607_781008485.ARC
File Name: E:\archivelogs\LOG1_53608_781008485.ARC
File Name: E:\archivelogs\LOG1_53609_781008485.ARC
File Name: E:\archivelogs\LOG1_53610_781008485.ARC
File Name: E:\archivelogs\LOG1_53611_781008485.ARC
File Name: E:\archivelogs\LOG1_53612_781008485.ARC
File Name: E:\archivelogs\LOG1_53613_781008485.ARC
File Name: E:\archivelogs\LOG1_53614_781008485.ARC
File Name: E:\archivelogs\LOG1_53615_781008485.ARC
File Name: E:\archivelogs\LOG1_53616_781008485.ARC
File Name: E:\archivelogs\LOG1_53617_781008485.ARC
File Name: E:\archivelogs\LOG1_53618_781008485.ARC
File Name: E:\archivelogs\LOG1_53619_781008485.ARC
File Name: E:\archivelogs\LOG1_53620_781008485.ARC
File Name: E:\archivelogs\LOG1_53621_781008485.ARC
File Name: E:\archivelogs\LOG1_53622_781008485.ARC
File Name: E:\archivelogs\LOG1_53623_781008485.ARC
File Name: E:\archivelogs\LOG1_53624_781008485.ARC
File Name: E:\archivelogs\LOG1_53625_781008485.ARC
File Name: E:\archivelogs\LOG1_53626_781008485.ARC
File Name: E:\archivelogs\LOG1_53627_781008485.ARC
File Name: E:\archivelogs\LOG1_53628_781008485.ARC
File Name: E:\archivelogs\LOG1_53629_781008485.ARC
File Name: E:\archivelogs\LOG1_53630_781008485.ARC
File Name: E:\archivelogs\LOG1_53631_781008485.ARC
File Name: E:\archivelogs\LOG1_53632_781008485.ARC
File Name: E:\archivelogs\LOG1_53633_781008485.ARC
File Name: E:\archivelogs\LOG1_53634_781008485.ARC
File Name: E:\archivelogs\LOG1_53635_781008485.ARC
File Name: E:\archivelogs\LOG1_53636_781008485.ARC
File Name: E:\archivelogs\LOG1_53637_781008485.ARC

RMAN> recover database;

Starting recover at 18-FEB-18
using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 53636 is already on disk as file E:\ARCHIVELOGS\LO
G1_53636_781008485.ARC
archive log thread 1 sequence 53637 is already on disk as file E:\ARCHIVELOGS\LO
G1_53637_781008485.ARC
archive log filename=E:\ARCHIVELOGS\LOG1_53636_781008485.ARC thread=1 sequence=5
3636
archive log filename=E:\ARCHIVELOGS\LOG1_53637_781008485.ARC thread=1 sequence=5
3637
unable to find archive log
archive log thread=1 sequence=53638
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/18/2018 16:04:01
RMAN-06054: media recovery requesting unknown log: thread 1 seq 53638 lowscn 857
961236

RMAN>

 

Database is now in incomplete recovery, after new archivelogs are generated do recovery again. You can keep doing this till you are ready to open database with resetlogs and startup in mount mode

 

rman target /

RMAN> catalog start with ‘E:\archivelogs’;

 

RMAN> recover database;

Starting recover at 18-FEB-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=269 devtype=DISK

starting media recovery

archive log thread 1 sequence 53638 is already on disk as file E:\ARCHIVELOGS\LO
G1_53638_781008485.ARC
archive log thread 1 sequence 53639 is already on disk as file E:\ARCHIVELOGS\LO
G1_53639_781008485.ARC
archive log filename=E:\ARCHIVELOGS\LOG1_53638_781008485.ARC thread=1 sequence=5
3638
archive log filename=E:\ARCHIVELOGS\LOG1_53639_781008485.ARC thread=1 sequence=5
3639
unable to find archive log
archive log thread=1 sequence=53640
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/18/2018 17:03:52
RMAN-06054: media recovery requesting unknown log: thread 1 seq 53640 lowscn 857
981603

RMAN> alter database open resetlogs;

database opened

RMAN> list incarnation;

ist of Database Incarnations
B Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
—— ——- ——– —————- — ———- ———-
1 ECC 1040999203 PARENT 1 07-JUL-10
2 ECC 1040999203 PARENT 583052 19-APR-12
3 ECC 1040999203 CURRENT 857981604 18-FEB-18

 

 

 

 

Cloning Oracle Database 9i, 10g using RMAN in few easy steps.

**************** Cloning of the Oracle Database ********************

On production

1) Make sure controlfile autobackup is on and take the incremental level 0 backup;

bash-3.00$ rman

Recovery Manager: Release 10.2.0.1.0 – Production on Thu Jul 23 11:08:48 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN> connect target /

connected to target database: ORCL (DBID=1205560727)

RMAN> show all;

using target database control file instead of recovery catalog

RMAN configuration parameters are:

CONFIGURE RETENTION POLICY TO NONE;

CONFIGURE BACKUP OPTIMIZATION OFF; # default

CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default

CONFIGURE CONTROLFILE AUTOBACKUP ON;

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘/rmanbkp/rman/dmp/%F’;

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO ‘%F’; # default

CONFIGURE DEVICE TYPE ‘SBT_TAPE’ PARALLELISM 4 BACKUP TYPE TO BACKUPSET;

CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default

CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE ‘SBT_TAPE’ TO 1;

CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default

CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE MAXSETSIZE TO UNLIMITED; # default

CONFIGURE ENCRYPTION FOR DATABASE OFF; # default

CONFIGURE ENCRYPTION ALGORITHM ‘AES128’; # default

CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default

CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘/u02/app/oracle/product/10.2.0/db_1/dbs/snapcf_orcl.f’; # default

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘/rmanbkp/rman/dmp/%F’;

RMAN> configure channel device type disk format ‘/rmanbkp/rman/dmp/Lev0_%s%D%M%Y’;

RMAN> backup incremental level 0 database filesperset 20;

After taking the backup connect to sqlplus and switch logfile 2 or 3 times.

Sql> alter system switch logfile;——————3 times

2) Copy listener, spfile, pfile, tnsnames to the test server.

bash-3.00$ scp listener.ora tnsnames.ora sqlnet.ora oracle@10.0.11.31:/u02/app/oracle/10.2.0/network/admin

bash-3.00$ scp orapworcl initorcl.ora spfileorcl.ora oracle@10.0.11.31: /u02/app/oracle/10.2.0/dbs/

3) Copy the rmanbackup from production to test server(same directory structure).

bash-3.00$ scp c-1205560727-20090723-00 Lev0_216723072009 oracle@10.0.11.31:/rmanbkp/rman/dmp/

4) Login with sqlplus and fire the following query on production

bash-3.00$ sqlplus “/ as sysdba”

SQL*Plus: Release 10.2.0.1.0 – Production on Thu Jul 23 11:44:43 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

SQL> select name from v$datafile;

NAME

——————————————————————————–

/u02/app/oracle/oradata/orcl/system01.dbf

/u02/app/oracle/oradata/orcl/undotbs01.dbf

/u02/app/oracle/oradata/orcl/sysaux01.dbf

/u02/app/oracle/oradata/orcl/users01.dbf

/u02/app/oracle/oradata/orcl/example01.dbf

/u02/app/oracle/oradata/orcl/swx01.dbf

/u02/app/oracle/oradata/orcl/swx02.dbf

/u02/app/oracle/oradata/orcl/swx03.dbf

/u03/app/oracle/oradata/orcl/users02.dbf

9 rows selected.

SQL> select name from v$controlfile;

NAME

——————————————————————————–

/u02/app/oracle/oradata/orcl/control01.ctl

/u04/app/oracle/oradata/orcl/control02.ctl

/u05/app/oracle/oradata/orcl/control03.ctl

SQL> select member from v$logfile;

MEMBER

——————————————————————————–

/u02/app/oracle/oradata/orcl/redo03.log

/u02/app/oracle/oradata/orcl/redo02.log

/u02/app/oracle/oradata/orcl/redo01.log

/u01/app/oracle/oradata/orcl/redo01b.log

/u03/app/oracle/oradata/orcl/redo02b.log

/u01/app/oracle/oradata/orcl/redo03b.log

6 rows selected.

ON TEST SERVER

1) First create all the directory structure for datafile,controlfile,redolog file,udump,bdump,cdump on the test server

bash-3.00$ mkdir –p /u02/app/oracle/oradata/orcl/ ——create one by one for all datafile,controlfile and redologfile

2) Go to the dbs folder and open the pfile.and create directory for udump,bdump,cdump

bash-3.00$ cd $ORACLE_HOME/dbs

bash-3.00$ more spfileorcl.ora

)M”

orcl.__db_cache_size=905969664

orcl.__java_pool_size=16777216

orcl.__large_pool_size=16777216

orcl.__shared_pool_size=301989888

orcl.__streams_pool_size=0

*.audit_file_dest=’/u02/app/oracle/admin/orcl/adump’

*.background_dump_dest=’/u02/app/oracle/admin/orcl/bdump’

*.compatible=’10.2.0.1.0′

*.control_files=’/u02/app/oracle/oradata/orcl/control01.ctl’,’/u04/app/oracle/oradata/orcl/control02.ctl’,’/u05/app/oracle/oradata/orcl/control03.ctl’

*.core_dump_dest=’/u02/app/oracle/admin/orcl/cdump’

*.db_block_size=8192

*.db_domain=”

*.db_file_multiblock_read_count=16

*.db_name=’orcl’

*.db_recovery_file_dest=’/u02/app/oracle/flash_recovery_area’

*.db_recovery_file_dest_size=2147483648

*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)’

*.job_queue_processes=10

*.log_archive_dest_1=’LOCATION=/u05/app/oracle/archive’

*.log_archive_dest_2=’SERVICE=swxstdby’

*.log_archive_dest_state_2=’DEFER’

*.open_cursors=300

*.pga_aggregate_target=418381824

*.processes=300

*.remote_login_passwordfile=’EXCLUSIVE’

*.remote_os_authent=true

*.sessions=335

*.sga_target=1256194048

*.undo_management=’AUTO’

*.undo_tablespace=’UNDOTBS1′

*.user_dump_dest=’/u02/app/oracle/admin/orcl/udump’

bash-3.00$ mkdir -p /u02/app/oracle/admin/orcl/bdump————same for udump,adump and cdump

3) Now open the listener file and change the IP of the server.

4) Now start the database in nomount mode.

bash-3.00$ export ORACLE_SID=test

You have new mail in /var/mail//swx

bash-3.00$ sqlplus “/ as sysdba”

SQL*Plus: Release 10.2.0.1.0 – Production on Thu Jul 23 11:55:15 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup nomount;

5) After starting the database in nomount mode go to rman prompt from different putty terminal.

bash-3.00$ export ORACLE_SID=test

bash-3.00$ rman

Recovery Manager: Release 10.2.0.1.0 – Production on Thu Jul 23 11:57:32 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN> connect target /

connected to target database (not started)

RMAN> restore controlfile from ‘/rmanbkp/rman/dmp/c-1205560727-20090723-00’;

RMAN> alter database mount;

RMAN> restore database;

RMAN> recover database;

Gives some error don’t worry just copy the archive log from production to the same archive log location in the test server and again start recovery. This procedure can be used when you want to clone your database for creating a physical standby database.