Cloning
RAC to Non RAC in 11g Database:
Steps:
1.
create backup directory and take rman full backup of database
$mkdir
backup
mkdir
backup/UAT(copy the backup peaces from source to destination)
change
ownership of all backup peaces.
2.create bash profile
ORACLE_SID="UAT"
; export ORACLE_SID
DB_NAME="UAT" ; export
DB_NAME
ORACLE_BASE=/oracle/uat/product
; export ORACLE_BASE
ORACLE_HOME=/oracle/uat/product/11.2.0
; export ORACLE_HOME
TNS_ADMIN=$ORACLE_HOME/network/admin
; export TNS_ADMIN
PATH=$ORACLE_HOME/bin:$PATH:. ;
export PATH
. ~/bin/login.env
3.Set Pfile
uat.__db_cache_size=486539264
uat.__java_pool_size=16777216
uat.__large_pool_size=16777216
uat.__oracle_base='/oracle/uat/product'#ORACLE_BASE
set from environment
uat.__pga_aggregate_target=1375731712
uat.__sga_target=2063597568
uat.__shared_io_pool_size=0
uat.__shared_pool_size=469762048
uat.__streams_pool_size=16777216
*.audit_file_dest='/oracle/uat/product/admin/uat/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/oracle/uat/oradata/soacln/control01.ctl','/oracle/uat/oradata/uat/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='ADFCLN'
*.diagnostic_dest='/oracle/uat/product'
*.dispatchers='(PROTOCOL=TCP)
(SERVICE=soaclnXDB)'
*.memory_target=1200M
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
log_archive_dest_1='location=/oracle/uat/arch/soacln'
log_archive_format='_%t_%r_%s.arc'
:wq!
4. create necessary directories
Oradata,
location and archivelogs
5.Bring
up the instance nomount stage.
SQL>
startup nomount;
ORACLE
instance started.
Total
System Global Area 1255473152 bytes
Fixed
Size 1343888 bytes
Variable
Size 754978416 bytes
Database
Buffers 486539264 bytes
Redo
Buffers 12611584 bytes
5.Now
restore the controlfile from backup location.\
Conncet
RMAN
>Rman
target /
RMAN>
restore controlfile from '/backup/PROD_AUTO_c-2506093360-20160509-02';
Starting
restore at 10-MAY-16
using
target database control file instead of recovery catalog
allocated
channel: ORA_DISK_1
channel
ORA_DISK_1: SID=63 device type=DISK
channel
ORA_DISK_1: restoring control file
channel
ORA_DISK_1: restore complete, elapsed time: 00:00:03
output
file name=/oracle/soadev/oradata/soacln/control01.ctl
output
file name=/oracle/soadev/oradata/soacln/control02.ctl
Finished
restore at 10-MAY-16
Now
the db is mounted.
6.Rename
the log files.
SQL>
select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
+DATA/prod/onlinelog/group_1.2708.865240179
+DATA/prod/onlinelog/group_2.2701.865240179
+DATA/prod/onlinelog/group_3.2700.865240179
+DATA/prod/onlinelog/group_4.2940.865241291
+DATA/prod/onlinelog/group_5.2930.865241291
+DATA/prod/onlinelog/group_6.300.865241291
Rename
logfiles
SQL>alter
database rename file '+DATA/prod/onlinelog/group_1.2708.865240179' to
'/oracle/uat/oradata/uat/redo01.log';
SQL>alter
database rename file '+DATA/PROD/onlinelog/group_2.2701.865240179' to
'/oracle/uat/oradata/uat/redo02.log';
SQL>alter
database rename file '+DATA/PROD/onlinelog/group_3.2700.865240179' to
'/oracle/uat/oradata/uat/redo03.log';
Now
catalog the backup peaces.
RMAN>
catalog start with '/backup/';
ALLOCATE
CHANNEL CH3 TYPE DISK;
catalog
start with'/oracle/prod/Prod_HOT_FULL_05092016_2300_1_7193';
catalog
start with'/oracle/prod/prod_HOT_FULL_05092016_2300_1_7191';
Do you really want to
catalog the above files (enter YES or NO)? YES
cataloging files…
cataloging done
cataloging files…
cataloging done
Now
restore the database.
restore
db and set new name for datafiles and tempfiles
run
{
SET
NEWNAME FOR DATABASE TO '/oracle/uat/oradata/uat/%b';
SET
NEWNAME FOR tempfile 1 TO '/oracle/uat/oradata/uat/%b';
restore
database;
switch
datafile all;
switch
tempfile all;
}
executing
command: SET NEWNAME
executing
command: SET NEWNAME
Starting
restore at 10-MAY-16
allocated
channel: ORA_DISK_1
channel
ORA_DISK_1: SID=63 device type=DISK
channel
ORA_DISK_1: starting datafile backup set restore
channel
ORA_DISK_1: specifying datafile(s) to restore from backup set
RMAN>
recover database;
Starting
recover at 10-MAY-16
using
channel ORA_DISK_1
starting
media recovery
channel
ORA_DISK_1: starting archived log restore to default destination
channel
ORA_DISK_1: restoring archived log
archived
log thread=2 sequence=2803
channel
ORA_DISK_1: reading from backup piece
/oracle/uat/uat/prod_ARCH_05092016_2300_1_7198
channel
ORA_DISK_1: piece
handle=/oracle/soadba/soacuss/SOACUSS_ARCH_05092016_2300_1_7198
tag=SOACUSS_ARCH_05092016_2300
channel
ORA_DISK_1: restored backup piece 1
channel
ORA_DISK_1: restore complete, elapsed time: 00:00:03
channel
ORA_DISK_1: starting archived log restore to default destination
channel
ORA_DISK_1: restoring archived log
archived
log thread=1 sequence=4345
channel
ORA_DISK_1: reading from backup piece
/oracle/uat/uat/prod_ARCH_05092016_2300_1_7200
channel
ORA_DISK_1: piece
handle=/oracle/soadba/soacuss/SOACUSS_ARCH_05092016_2300_1_7200
tag=SOACUSS_ARCH_05092016_2300
channel
ORA_DISK_1: restored backup piece 1
channel
ORA_DISK_1: restore complete, elapsed time: 00:00:07
archived
log file name=/oracle/soadba/arch/_1_865240176_4345.arc thread=1 sequence=4345
archived
log file name=/oracle/soadba/arch/_2_865240176_2803.arc thread=2 sequence=2803
channel
ORA_DISK_1: starting archived log restore to default destination
channel
ORA_DISK_1: restoring archived log
archived
log thread=1 sequence=4346
channel
ORA_DISK_1: reading from backup piece
/oracle/uat/uat/PROD_ARCH_05092016_2300_1_7201
channel
ORA_DISK_1: piece
handle=/oracle/soadba/soacuss/SOACUSS_ARCH_05092016_2300_1_7201
tag=SOACUSS_ARCH_05092016_2300
channel
ORA_DISK_1: restored backup piece 1
channel
ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel
ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived
log file name=/oracle/soadba/arch/_2_865240176_2804.arc thread=2 sequence=2804
unable
to find archived log
archived
log thread=2 sequence=2805
RMAN-00571:
===========================================================
RMAN-00569:
=============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571:
===========================================================
RMAN-03002:
failure of recover command at 05/10/2016 23:35:14
RMAN-06054:
media recovery requesting unknown archived log for thread 2 with sequence 2805
and starting SCN of 353093442
****************************************************************************************************************
recover
database using below command
****************************************************************************************************************
RMAN>run
{
set
until sequence 2805 thread 2;
recover
database;
}
executing
command: SET until clause
Starting
recover at 10-MAY-16
using
channel ORA_DISK_1
starting
media recovery
media
recovery complete, elapsed time: 00:00:01
Finished
recover at 10-MAY-16
SQL>
select name,open_mode from v$database;
NAME OPEN_MODE
---------
--------------------
UAT READ WRITE
No comments:
Post a Comment