MIGRATING THE DATABASE FROM ONE MECHINE TO ANOTHER MACHINE USING RMAN
DBA11(TARGET), DBA12(CATALOG), DBA15(AUXILIARY DATABASE)
1) create the directory to store rman backup at target database
DBA11$cd /disk3/oradata/san
san$mkdir rman
2) create the password file in dba directory at target database
DBA11$cd $ORACLE_HOME/dbs
dbs$orapwd file=orapw$ORACLE_SID password=sys force=y
3) configure listener at target database
$cp $ORACLE_HOME/network/admin/listener.ora ~
~$vi listener.ora
rman =
(port=2044)(host=dba11)
(sid=
:wq!
4) start the listener at target side
$lsnrctl start
5)create tablespace and user at catalog database
DBA12$
sys>create tablespace rman datafile '/disk3/oradata/san/rman.dbf' size 100m;
sys>create user rman identified by rman;
sys>grant connect,resource,recovery_catalog_owner to rman identified by rman;
sys>alter user rman default tablespace rman;
sys>exit
6)configure tnsnames at catalog database
$cp $ORACLE_HOME/network/admin/tnsnames.ora ~
~$vi tnsnames.ora
torman =
(port=2044) (host=dba11)
(sid=
:wq!
$tnsping torman
7)create catalog under rman user
$rman catalog rman/rman
RMAN> create catalog;
RMAN>exit
$sqlplus rman/rman
RMAN>select count(*) from tab;
RMAN>90 rows
RMAN>exit
$rman catalog rman/rman@torman
RMAN>register database;
RMAN>spool log to script.log
RMAN>show all;
RMAN>exit
8)configure the script.log file
$rman catalog rmna/rman@torman
RMAN>@script.log
RMAN>backup database plus archivelog;
DBA15(AUXILIARY DATABASE)
$export ORACLE_SID=san
9)now configure listener at auxiliary database
$cp $ORACLE_HOME/network/admin/listener.ora ~
$vi listener.ora
aux =
(port=5678)(host=dba15)
(sid=san)
:wq!
$lsnrctl start aux
10) configure tnsnames.ora in the catalog database
DBA12$vi tnsnames.ora
toaux =
(port=5678)(host=dba15)
(sid=san)
:wq!
$tnsping toaux
DBA15$
11)create the passowrd file at auxiliary database
dbs$ orapwd file=orapw$ORACLE_SID password=xyz force=y
dbs$cp init.ora init$ORACLE_SID.ora
dbs$vi initsan.ora
db_name=sandeep(the auxiliary database name and target database name should be same)
control_files=/disk1/oradata/san/control.ctl
user_dump_dest=/disk1/oradata/san/udump
core_dump_dest=/disk1/oradata/san/cdump
background_dump_dest=/disk1/oradata/san/bdump
db_file_name_convert=/disk3/oradata/sandeep /disk1/oradata/san(if u want to have in different location then use this 2 parameters)
log_file_name_convert=/disk3/oradata/sandeep /disk1/oradata/san
:wq!
$mkdir -p /disk3/oradata/sandeep/{cdump,bdump,udump,arch,rman} (create target database structure)
$mkdir -p /disk1/oradata/san/{cdump,udump,bdump,arch} (create auxiliary c,r,d file location)
$cd /disk3/oradata/sandeep/rman
rman$ftp -i dba11
loginid:sandeep
password:
ftp>cd /disk3/oradata/sandeep/rman
ftp>mget *
ftp>bye
rman$du -h
358m(this is the backup size of ur target database)
12) now keep the auxiliary database in nomount stage
sys>startup nomount
13) now connect to auxiliary database using rman
DBA12$rman catalog rman/rman target sys/sys@tormna auxiliary sys/xyz@toaux
now it will connect to target database as well as auxiliary database
RMAN>duplicate target database to san; (here we have to mention the database name of the target database so my database name is san)
14)once we issue the above command then migration will be completed.

No comments:
Post a Comment