How to move or rename Oracle Home
If you want to rename Oracle Home you usually need to:
1. uninstall existing Oracle Home
2. reinstall Oracle software to the right directory that will be the new Oracle Home.
You cannot just move Oracle Home because installing Oracle Home is not just copying executable files. However uninstalling and installing again Oracle software takes some time.
If you want to do it quickly there is another way to do it using Oracle software cloning:
1. Move Oracle Home using OS command
2. Clone the new Oracle Home using Oracle Universal Installer (OUI)
3. Remove the old Oracle Home from Oracle inventory with OUI.
Here is a full example with Oracle Database 12.1.0.1 Enterprise Edition on Oracle Linux 6.4 64bit. All steps have been with run oracle account unless otherwise stated.
Step 1 : Check ORACLE HOME
Command :
1 |
$ORACLE_HOME/OPatch/opatch lsinv -all |
Here my ORACLE HOME location in /oraeng/app/oracle/product/12.1.0.
First connect as Oracle software owner:
1 2 |
$ id oracle uid=54231(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper) |
Check that no executable is currently running from this Oracle Home (you should stop any Oracle database instance, listener, RMAN or SQL*Plus sessions):
1 2 3 4 |
$ ps -fu oracle UID PID PPID C STIME TTY TIME CMD oracle 2692 2691 0 18:01 pts/0 00:00:00 -bash oracle 3277 2692 0 18:09 pts/0 00:00:00 ps -fu oracle |
Move the directory with the mv command:
I have created directory location /u01/app/oracle/product/12.1.0.2 and moved all the files and directories into it.
Step 2: Clone the Oracle Home
Of course you must use new Oracle Home path for runInstaller and you must also specify new Oracle Home directory as ORACLE_HOME parameter and set ORACLE_BASE parameter (I have also added silent mode (-silent) because graphical mode is not needed and -waitForCompletion so that OUI command is not started in the background):
Command :
1 2 3 4 5 6 |
u01/app/oracle/product/12.1.0.2/oui/bin/runInstaller \ -clone \ -silent \ -defaultHomeName ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/ \ ORACLE_BASE=/u01/app/oracle \ |
The cloning of ORACLE HOME was successful.
1 |
Please check '/u01/app/oraInventory/logs/cloneActions2014-09-30_06-35-53PM.log' for more details. |
You can see that OUI has linked again the binaries and executables and run some configuration steps.
You need to run root.sh:
Modify /etc/oratab for existing database that is using the Oracle Home that has been moved (because this has not been done by OUI):
Check Oracle inventory:
It should have /u01 location.
Connect to database and check ORACLE HOME .
By using PL*SQL package we can get ORACLE HOME location.
“exec dbms_system.get_env”
If any suggestions please write in comments.
Thank you.
naveen
Good information.
Prabhu
Hello,
When i tried to start the db – getting below error .
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9925
Binnary Ajay Kumar
Check the audit_file_dest parameter in pfile , The directory should be created in file system.