Cloning an Oracle Home (PART I)

April 23, 2008  |  dba, linux

PART I – The messy way 🙂

If you ever had to perform multiple Oracle Database installations in different servers, then you sure already thought that It would be great to COPY your Oracle Home and install it in another server without have to configure it again.

As a good portuguese I’ve done some “desenrascanços“… check the link if you’re interested in know what is 🙂 It has no translation to english!

In the past I’ve done installations based on directory zipping and unzipping. I know that’s not recommended, but I’ve done it several times without any special issues. Supose that you have this structure:

oracle_base=/home/oracle
oracle_home=/home/oracle/product/10.2.0/db_1
database_files=/home/oracle/oradata 
admin_files=/home/oracle/admin  

 

First stop all processes from that database… EM, Database and listener.

[oracle@server1 ~]# emctl stop dbconsole
[oracle@server1 ~]# sqlplus "/ as sysdba"
SQL> shutdown immediate
[oracle@server1 ~]# lsnrctl stop 

 

Next, as root, you just have to compress the oracle_base directory that has the software installation, the OUI inventory and the database datafiles. I usually also add to this zip the files that oracle writes in /etc 

[root@server1 ~]# tar cpvfz myoraclemessy.tar.gz /home/oracle /etc/ora* 

 

On the destination server check if the OS is the same version of the original server. This is very important because Oracle in the installation phase links lots of components using several OS libraries.

If the OS is the same you also have to check the OS dependencies that usually you have to do when you install Oracle. Of course you can also use Neoface Easy Oracle Pre-Installer that does it all for you 😉 😉 😉

NEOPI is a GUI tool created by folks at Neoface that checks and configure the kernel parameters, creates the oracle user account, set the shell limits for it, create the oracle directories, checks for missing packages and install them silently… all the dirty work done with a click! Message me if you want a copy of it 🙂

Now decompress the zipped file and soon you’ll have a cloned database running.

[root@server2 ~]# cd /home
[root@server2 ~]# tar xpvfz myoraclemessy.tar.gz 

 

If you use Enterprise Manager installed on the original server then you’ll have problems because EM is configured referring the hostname that in this case is different from the original server. There are other issues too… To finish this, edit the listener.ora and the tnsnames.ora files after that you’ll have cloned database prepared to be up an running in minutes… let’s start it!

[oracle@server2 ~]#oracle lsnrctl start
[oracle@server2 ~]#$ sqlplus "/ as sysdba"
SQL> startup

 

Once more… this is “desenrascanço“, and is not recommended! It’s just a fast ugly way to have a copy of your database running on another server.

Soon, I’ll POST the NICE WAY! Easy, clean and pretty!

 

 


Leave a Reply