Clone Oracle database binaries, the fastest way!
The steps are very easy:
- Move the binaries from the source host to the new target host
- Clone using clone.pl
Move the binaries from the source host to the new target host
Moving the source binaries is very easy, and the instances can all be running when this is done. It can be performed as either oracle user or root user.
Oracle recommends that you archive it using your favorite archiving software. I how ever prefer moving it on the fly to the target host. But before we moving we need to create to desired folder structure on the target host. In this example all paths will be identical on both hosts, but this is NOT required.
prodb01=source host
prodb02=target host
1
2
3
4
| root@prodb02:~$ mkdir -p /oracle/app/oracle/product/11 .2.0 root@prodb02:~$ chown -R oracle:oinstall /oracle root@prodb02:~$ su - oracle oracle@prodb02:~$ |
Now we can transfer the binaries from source host(prodb01):
1
2
| oracle@prodb02:~$ cd /oracle/app/oracle/product/11 .2.0/ oracle@prodb02:~$ rsync -avz -e ssh oracle@prodb01: /oracle/app/oracle/product/11 .2.0/ . |
If you transfer the source database logged in as oracle you will get three failed file transfers:
nmb
nmo
oradism
This is OK since these files will get recreated when running the clone.pl script on the target host.
Clone using clone.pl
Before any cloning action, it is important to spend some time checking that the file permissions on files/directories in the target home match those in the source home. Please also check that the validity of any symbolic links has been preserved. Ensure that the links point to files/directories in the new target home, not files/directories in the source home. If necessary, re-create the links.
Make sure that you have an oraInst.loc file in place for the target host. If this is the first oracle product on this host you need to create it:
1
2
3
4
5
6
7
8
| root@prodb02:~$ mkdir -p /var/opt/oracle root@prodb02:~$groupadd -g 1000 oinstall root@prodb02:~$groupadd -g 1031 dba root@prodb02:~$groupadd -g 1032 oper root@prodb02:~$ useradd -u 1101 -g oinstall -G oper,dba -d /export/home/oracle -m oracle root@prodb02:~$ chown oracle:oinstall /var/opt/oracle root@prodb02:~$ su - oracle oracle@prodb02:~$ touch /var/opt/oracle/oraInst .loc |
For Linux and solaris, the default location is /var/opt/oracle/oraInst.loc. If you wish to change it or if it was previously located somewhere else, you need to specify that when running clone.pl:
If it does not exsist:inventory_loc=path_to_oraInventory
If it exsist:
If an oraInst.loc file exists on the server but is in a different location, edit the $ORACLE_HOME/clone/config/cs.properties file to add “-invPtrLoc PATH/oraInst.loc” to the clone_command_line.
Now we can start the cloning:
1
2
3
| oracle@prodb02:~$ cd /oracle/app/oracle/product/11 .2.0 /dbhome_1/clone/bin oracle@prodb02:~$ cd $ORACLE_HOME /clone/bin oracle@prodb02:~$perl clone.pl ORACLE_HOME= "/oracle/app/oracle/product/11.2.0/dbhome_1/" ORACLE_HOME_NAME= "OraHome1" ORACLE_BASE= "/oracle/app/oracle/" OSDBA_GROUP=dba OSOPER_GROUP=oper |
If you do this on Linux/Unix there is one final step to perform before completion. We need to rung root.sh script as root
1
| root@prodb02:~$. /oracle/app/oracle/product/11 .2.0 /dbhome_1/root .sh |
Done! We now have a fully working Oracle Database binary installation on the target host!
More reading can be found on MOS note ID 1154613.1
Also More info from my article on how to Clone the database without using RMAN
No comments:
Post a Comment