At the moment I am reading a great book on 12c (Pro Oracle Database 12c administration) by Darl Kuhn (http://www.apress.com/9781430257288) . And I really like his style and elaborations on topics . While i was reading it is like being held a mirror. Indeed most times I would also use the runInstaller interactively to run the installation of the Oracle binaries and yes would even frown if I would not be allowed to use a xterm to do installations. Well Darl you gave me an inspiration for set up of environment i need shortly. So this is a big applause for him already!
For a data migration environment i am asked to set up Oracle on a Linux server identical to the production servers that are part of the scope of the project. After installation I will be working with BCVS to bring copies of a number of databases to this box. The production servers are 22.214.171.124 with one-off patches and a psu patch .. And as an important add-on information i have installed the Grid Infrastructure software already on the new box so i have Oracle Restart with an ASM instance running. ( that also means that i have an OraInst location and an existing Oracle Inventory in place too). So which way would i head.
- Install Oracle binaries from scratch , and apply all the patches
- Clone the Rdbms software from a production box.
Since i got time i investigated both options. But in the end i loved the scenario 2 below because I always had done the normal interactive way installation:
First $ORACLE_HOME was checked:
$ echo $ORACLE_HOME /opt/oracle/product/112_ee_64/db
Next step was to move to the ORACLE_HOME
$ cd $ORACLE_HOME
Almost there. Moved back ( up ) one level ( so I was in /opt/oracle/product/112_ee_64 directory).
$ cd ..
Was aiming for the tar utility to copy everything in the subdirectory db (and below) in the /opt/oracle/product/112_ee_64/.
Note if you get error messages of files not being included ( happened to me too make sure you do a nohup tar -cvf myorahome.tar>Mylogfile.lst) Most likely you either ran out of space or did not have enough privileges to run the tar for all files ( so i ran tar as root in the end).
$ tar -cvf myorahome.tar db
tar -cvf is the command to run with the options -cvf
myorahome.tar will be holding all the files in all the subdirectories below the /opt/oracle/product/112_ee_64/
db is the subdirectory ( part of my ORACLE_HOME) which I need to be added to the tar file.
That created for a full-sized Rdbms Installation with all patches included a Tarred file of about 5G. After that myorahome.tar file was copied to the new server with scp.
The tar file was copied to the already existing /opt/oracle/product/112_ee_64 on the new machine. There the tar file was extracted and the extract created the subdirectory db again ( and all others below 2) as part of the extract:
$ cd /opt/oracle/product/112_ee_64 Note: make sure you have plenty space on the new server ( better check that before extraction. Next, extract the files: $ tar -xvf myorahome.tar
Next step was needed to include, to register this cloned installation in the Oracle Inventory. In my case I used the runInstaller inside the new Oracle home. First to make sure that the new Oracle Home was not known in the Inventory by detaching it:
./runInstaller -detachHome ORACLE_HOME="/opt/oracle/product/112_ee_64/db"
Then I added the cloned software to the Inventory:
./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="/opt/oracle/product/112_ee_64/db" ORACLE_HOME_NAME="OraDb11g_home1" LOCAL_NODE="" CLUSTER_NODES="
But of course the proof of the pudding is in tasting it once this had finished:
So it was needed to check with Opatch if the Orainventory now was aware about all installed patches.
I checked opatch was the correct one:
Then I checked the patches with the command below:
opach lsinventory -oh /opt/oracle/product/112_ee_64/db
And it showed all the correct patches . So indeed I had cloned the Oracle software in a correct way to this machine . Yah ! And a big thank you to Darl for a great book which pointed me in the right direction.