Professional Documents
Culture Documents
/d01/oracle/oradata/raman/sysaux01.dbf
/d01/oracle/oradata/raman/undotbs01.dbf
/d01/oracle/oradata/raman/users01.dbf
Take the backup of control file to trace only because we need to change the
database name while creating the control file.
SQL> alter database backup controlfile to trace;
Database altered.
Check the alert log file locations using either v$diag_info or
background_dump_dest parameter;
SQL> show parameter background_dump_dest;
NAME
VALUE
------------------------------------ ----------- -----------------------------background_dump_dest
/d01/oracle/diag/rdbms/raman/raman/trace
Create pfile from spfile and do the appropriate changes in stage database.
SQL> create pfile from spfile;
Go to datafile locations and copy all the datafiles to backup locations.
[raman@localhost ~]$ cd /d01/oracle/oradata/raman
[raman@localhost raman]$ ll
-rw-r----- 1 raman dba1 9748480 Apr 22 04:52 control01.ctl
-rw-r----- 1 raman dba1 9748480 Apr 22 04:52 control02.ctl
-rw-r----- 1 raman dba1 9748480 Apr 22 04:52 control03.ctl
-rw-r----- 1 raman dba1 52429312 Apr 22 04:48 redo01.log
-rw-r----- 1 raman dba1 52429312 Apr 22 04:52 redo02.log
-rw-r----- 1 raman dba1 52429312 Apr 22 04:48 redo03.log
-rw-r----- 1 raman dba1 590880768 Apr 22 04:52 sysaux01.dbf
-rw-r----- 1 raman dba1 713039872 Apr 22 04:52 system01.dbf
-rw-r----- 1 raman dba1 20979712 Apr 22 04:21 temp01.dbf
clonedb.__java_pool_size=4194304
clonedb.__large_pool_size=4194304
clonedb.__oracle_base='/d01/oracle'#ORACLE_BASE set from environment
clonedb.__pga_aggregate_target=121634816
clonedb.__sga_target=150994944
clonedb.__shared_io_pool_size=0
clonedb.__shared_pool_size=100663296
clonedb.__streams_pool_size=0
*.audit_file_dest='/d01/oracle/admin/clonedb/adump'
*.audit_trail='db'
*.compatible='11.1.0.0.0'
*.control_files='/d01/oracle/oradata/clonedb/control01.ctl','/d01/oracle/oradata
/clonedb/control02.ctl','/d01/oracle/oradata/clonedb/control03.ctl'
*.db_block_size=8192
*.db_domain='xcellit.com'
*.db_name='clonedb'
*.db_recovery_file_dest='/d01/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.diagnostic_dest='/d01/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=clonedbXDB)'
*.memory_target=269484032
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
:%s/raman/clonedb/g
Copy the environment file to backup locations and give the appropriate name
of new environment file and change the ORACLE_SID parameter.
[raman@localhost ~]$ cp raman.env clonedb.env
export ORACLE_BASE=/d01/oracle
export ORACLE_HOME=/d01/oracle/11gR2
export ORACLE_SID=clonedb
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
[raman@localhost ~]$ ll
total 32
-rw-r--r-- 1 raman dba1 169 Apr 22 05:09 clonedb.env
-rw-r--r-- 1 raman dba1 168 Apr 6 12:47 raman1.env
-rw-r--r-- 1 raman dba1 167 Apr 6 11:33 raman.env
Now run the environment file in stage server.
[raman@localhost ~]$ . clonedb.env
[raman@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Sun Apr 22 05:19:24 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
Start the database in nomount stage.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 272011264 bytes
Fixed Size
1299344 bytes
Variable Size
230689904 bytes
Database Buffers
37748736 bytes
Redo Buffers
2273280 bytes
Run the trace file script to create control file
SQL> @/d01/raman.sql
Control file created.
Now, the database is in mount stage, so open it with reset logs.
SQL> alter database open resetlogs;
Database altered.