Thursday, February 5, 2015

Cloning Steps in same server -


Cloning Steps in same server -
1-Firstly take Full backup
run
{
allocate channel d1 device type disk format '/crd04/oracle/daffodil/backup_6feb/%U.bkp';
allocate channel d2 device type disk format '/crd04/oracle/daffodil/backup_6feb/%U.bkp';
allocate channel d3 device type disk format '/crd04/oracle/daffodil/backup_6feb/%U.bkp';
allocate channel d4 device type disk format '/crd04/oracle/daffodil/backup_6feb/%U.bkp';
backup database plus archivelog;
release channel d1;
release channel d2;
release channel d3;
release channel d4;
}
2-Backup controlfile
BACKUP CURRENT CONTROLFILE format '/crd04/oracle/daffodil/backup_6feb/%U.ctl';
3.Then set environment file…
[oracle@XXX ~]$ export ORACLE_SID=XYZ
[oracle@XXX ~]$ echo $ORACLE_SID
XYZ
4. Go to in pfile location
cd $ORACLE_HOME/dbs
Then create pfile but make sure in pfile both db name be same.
daffodil__db_cache_size=1610612737
daffodil__java_pool_size=16777216
daffodil__large_pool_size=16777216
daffodil__shared_pool_size=452984832
daffodil__streams_pool_size=33554432
*.background_dump_dest='/crd01/oracle/daffodil/bdump/'
*.control_files='/crd01/oracle/daffodil/control01.ctl'
*.core_dump_dest='/crd01/oracle/daffodil/cdump/'
*.db_block_size=8192
*.db_name='marigold'
db_unique_name=daffodil
*.processes=100
*.sessions=100
*.sga_target=2G
*.undo_management='AUTO'
*.user_dump_dest='/crd01/oracle/daffodil/udump/'
undo_tablespace=undotbs;
5.startup nomount
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1073741824 bytes
Fixed Size                  2089400 bytes
Variable Size             264244808 bytes
Database Buffers          801112064 bytes
Redo Buffers                6295552 bytes
6.Restore controlfile
RMAN> restore controlfile from '/crd04/oracle/daffodil/backup_6feb/09pui4i1_1_1.ctl';
7.RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
8.Restore the database.
run
{
allocate channel C1 device type disk;
allocate channel C2 device type disk;
allocate channel C3 device type disk;
set newname for datafile 1 to '/archive/oracle/daffodil/data/system.dbf';
set newname for datafile 2 to '/archive/oracle/daffodil/data/undo.dbf';
set newname for datafile 3 to '/archive/oracle/daffodil/data/sysaux.dbf';
set newname for datafile 4 to '/archive/oracle/daffodil/data/users01.dbf';
set newname for datafile 5 to '/archive/oracle/daffodil/data/users03.dbf';
set newname for datafile 6 to '/archive/oracle/daffodil/data/UNDOTBS01.dbf';
set newname for datafile 7 to '/archive/oracle/daffodil/data/users04.dbf';
restore database ;
switch datafile all;
}
9.RMAN> recover database;
Starting recover at 06-FEB-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=101 devtype=DISK
starting media recovery
archive log thread 1 sequence 560 is already on disk as file /crd02/oracle/marigold/datafiles/redo2.log
archive log thread 1 sequence 561 is already on disk as file /crd02/oracle/marigold/datafiles/redo1.log
archive log filename=/crd02/oracle/marigold/datafiles/redo2.log thread=1 sequence=560
archive log filename=/crd02/oracle/marigold/datafiles/redo1.log thread=1 sequence=561
media recovery complete, elapsed time: 00:00:02
Finished recover at 06-Feb
10.At last open database with resetlogs
SQL> alter database open resetlogs;
Database altered

No comments:

Post a Comment

How to create user in MY SQL

Create  a new MySQL user Account mysql > CREATE USER ' newuser '@'localhost' IDENTIFIED BY ' password '...