Home » RDBMS Server » Server Administration » Best way to move Oracle Home (10.2.0.3 - HPUX)
Best way to move Oracle Home [message #431627] Wed, 18 November 2009 10:28 Go to next message
nateholtrop
Messages: 37
Registered: May 2008
Member
I am looking to move my physical standby of dataguard from one oracle home to another. What is the best way to do this? If it makes it easier think of it like a normal instance and how would you move that instance from one oracle_home to another? thanks
Re: Best way to move Oracle Home [message #431631 is a reply to message #431627] Wed, 18 November 2009 11:19 Go to previous messageGo to next message
BlackSwan
Messages: 24905
Registered: January 2009
Senior Member
SHUTDOWN IMMEDIATE


ORACLE_HOME=<new_dir>


STARTUP
Re: Best way to move Oracle Home [message #431633 is a reply to message #431627] Wed, 18 November 2009 11:22 Go to previous messageGo to next message
nateholtrop
Messages: 37
Registered: May 2008
Member
Really? It's that easy? Do I have to install something to that new location first?
Re: Best way to move Oracle Home [message #431635 is a reply to message #431633] Wed, 18 November 2009 11:31 Go to previous messageGo to next message
BlackSwan
Messages: 24905
Registered: January 2009
Senior Member
>Do I have to install something to that new location first?
run Oracle Universal Installer specifying <new_dir> for new ORACLE_HOME
Re: Best way to move Oracle Home [message #431636 is a reply to message #431627] Wed, 18 November 2009 11:36 Go to previous messageGo to next message
nateholtrop
Messages: 37
Registered: May 2008
Member
Awesome, as always you are a big help. Thanks.
Re: Best way to move Oracle Home [message #432327 is a reply to message #431636] Mon, 23 November 2009 10:26 Go to previous messageGo to next message
babuknb
Messages: 1734
Registered: December 2005
Location: NJ
Senior Member


Message not clear to me. Are you going to install new oracle home or your going to move your existing oracle home?

If your going to move your existing your oracle home? what abt your oracle inventory??

Thanks
Re: Best way to move Oracle Home [message #432328 is a reply to message #432327] Mon, 23 November 2009 10:28 Go to previous messageGo to next message
nateholtrop
Messages: 37
Registered: May 2008
Member
I'm going to move an existing database from one oracle_home to another(brand new).
Re: Best way to move Oracle Home [message #432341 is a reply to message #432328] Mon, 23 November 2009 12:53 Go to previous messageGo to next message
babuknb
Messages: 1734
Registered: December 2005
Location: NJ
Senior Member

Hello,

Not Sure; if you moving existing oracle home to new location oracle home will be different in your oracle inventory.

Please check in test environment.

Thakns
Re: Best way to move Oracle Home [message #432345 is a reply to message #431627] Mon, 23 November 2009 13:32 Go to previous messageGo to next message
nateholtrop
Messages: 37
Registered: May 2008
Member
I do not want to move the ENTIRE oracle home to a new home. I simply want to move ONE database out of the home to a new home.
Re: Best way to move Oracle Home [message #432346 is a reply to message #432345] Mon, 23 November 2009 13:35 Go to previous messageGo to next message
ThomasG
Messages: 3184
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
The location of the database files has basically nothing to do with the ORACLE_HOME.

You can (simply) move the datafiles of the database without changing ORACLE_HOME.
Re: Best way to move Oracle Home [message #432348 is a reply to message #432346] Mon, 23 November 2009 13:55 Go to previous messageGo to next message
nateholtrop
Messages: 37
Registered: May 2008
Member
This question has been answered. You guys are just adding complexity onto it where it doesn't need to be added.
Re: Best way to move Oracle Home [message #432486 is a reply to message #432348] Tue, 24 November 2009 08:09 Go to previous messageGo to next message
joy_division
Messages: 4616
Registered: February 2005
Location: East Coast USA
Senior Member
nateholtrop wrote on Mon, 23 November 2009 14:55
This question has been answered. You guys are just adding complexity onto it where it doesn't need to be added.


I disagree here. I think you just do not know what you are asking. As was said, if you are just moving a database, it has nothing to do with ORACLE_HOME. There is a big difference between moving ORACLE_HOME and moving a database.

Which one is it?
Re: Best way to move Oracle Home [message #432490 is a reply to message #432486] Tue, 24 November 2009 08:19 Go to previous messageGo to next message
nateholtrop
Messages: 37
Registered: May 2008
Member
I am looking to move one database out of an existing oracle_home into a new oracle_home. Make sense?
Re: Best way to move Oracle Home [message #432508 is a reply to message #432490] Tue, 24 November 2009 10:37 Go to previous messageGo to next message
ThomasG
Messages: 3184
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
No, since a "database" is not "inside an oracle home"
icon6.gif  Re: Best way to move Oracle Home [message #433347 is a reply to message #432490] Tue, 01 December 2009 13:59 Go to previous messageGo to next message
LKBrwn_DBA
Messages: 487
Registered: July 2003
Location: WPB, FL
Senior Member
nateholtrop wrote on Tue, 24 November 2009 08:19
I am looking to move one database out of an existing oracle_home into a new oracle_home. Make sense?

It is not as easy as this posted above:
BlackSwan wrote on Wed, 18 November 2009 11:19
SHUTDOWN IMMEDIATE
ORACLE_HOME=<new_dir>
STARTUP

After "SHUTDOWN IMMEDIATE" and before executing the rest of the above BlackSwan commands:

1) Both "homes" need to be same Oracle version, otherwise you would need to upgrade the database.
2) You need to copy the following files from the /old_home/dbs to /new_home/dbs: init${ORACLE_SID}.ora and/or spfile${ORACLE_SID}.ora and orapw${ORACLE_SID}.
3) You may need to configure the listener.ora in /new_home/network/admin (and maybe also update the tnsnames.ora).
4) You may need to change the oracle home in /etc/oratab (or /var/opt/oracle/oratab).
5) You may need to change all client (or corporate) tnsnames.ora (and/or OID entries or ONAMES entries) that refer to that database.
Shocked


[Updated on: Tue, 01 December 2009 14:01]

Report message to a moderator

Re: Best way to move Oracle Home [message #433349 is a reply to message #433347] Tue, 01 December 2009 14:17 Go to previous messageGo to next message
nateholtrop
Messages: 37
Registered: May 2008
Member
LKBrwn_DBA wrote on Tue, 01 December 2009 13:59
nateholtrop wrote on Tue, 24 November 2009 08:19
I am looking to move one database out of an existing oracle_home into a new oracle_home. Make sense?

It is not as easy as this posted above:
BlackSwan wrote on Wed, 18 November 2009 11:19
SHUTDOWN IMMEDIATE
ORACLE_HOME=<new_dir>
STARTUP

After "SHUTDOWN IMMEDIATE" and before executing the rest of the above BlackSwan commands:

1) Both "homes" need to be same Oracle version, otherwise you would need to upgrade the database.
2) You need to copy the following files from the /old_home/dbs to /new_home/dbs: init${ORACLE_SID}.ora and/or spfile${ORACLE_SID}.ora and orapw${ORACLE_SID}.
3) You may need to configure the listener.ora in /new_home/network/admin (and maybe also update the tnsnames.ora).
4) You may need to change the oracle home in /etc/oratab (or /var/opt/oracle/oratab).
5) You may need to change all client (or corporate) tnsnames.ora (and/or OID entries or ONAMES entries) that refer to that database.
Shocked




That was my plan.
Re: Best way to move Oracle Home [message #433452 is a reply to message #433349] Wed, 02 December 2009 07:01 Go to previous messageGo to next message
LKBrwn_DBA
Messages: 487
Registered: July 2003
Location: WPB, FL
Senior Member
It's a good plan...
You also would need to decide if you will have a separate listener execute for each Oracle home or only one for both.
Razz

[Updated on: Wed, 02 December 2009 07:02]

Report message to a moderator

Re: Best way to move Oracle Home [message #433453 is a reply to message #431627] Wed, 02 December 2009 07:04 Go to previous messageGo to next message
nateholtrop
Messages: 37
Registered: May 2008
Member
That was actually my one question about the plan. Can I use the listener from the old home for the new oracle home? I don't see why not but I've not done this before. Thanks
icon6.gif  Re: Best way to move Oracle Home [message #433479 is a reply to message #433453] Wed, 02 December 2009 09:05 Go to previous messageGo to next message
LKBrwn_DBA
Messages: 487
Registered: July 2003
Location: WPB, FL
Senior Member
Yes you can use same listener from old oracle home.
Smile
PS: Allways better to execute listener from the most recent software version.

[Updated on: Wed, 02 December 2009 09:06]

Report message to a moderator

Re: Best way to move Oracle Home [message #433644 is a reply to message #433347] Thu, 03 December 2009 07:49 Go to previous messageGo to next message
Sanjay Bajracharya
Messages: 279
Registered: October 2001
Location: Florida
Senior Member
LKBrwn_DBA wrote on Tue, 01 December 2009 14:59
nateholtrop wrote on Tue, 24 November 2009 08:19
I am looking to move one database out of an existing oracle_home into a new oracle_home. Make sense?

It is not as easy as this posted above:
BlackSwan wrote on Wed, 18 November 2009 11:19
SHUTDOWN IMMEDIATE
ORACLE_HOME=<new_dir>
STARTUP

After "SHUTDOWN IMMEDIATE" and before executing the rest of the above BlackSwan commands:

1) Both "homes" need to be same Oracle version, otherwise you would need to upgrade the database.
2) You need to copy the following files from the /old_home/dbs to /new_home/dbs: init${ORACLE_SID}.ora and/or spfile${ORACLE_SID}.ora and orapw${ORACLE_SID}.
3) You may need to configure the listener.ora in /new_home/network/admin (and maybe also update the tnsnames.ora).
4) You may need to change the oracle home in /etc/oratab (or /var/opt/oracle/oratab).
5) You may need to change all client (or corporate) tnsnames.ora (and/or OID entries or ONAMES entries) that refer to that database.
Shocked




These are good steps and nateholtrop did acknowlege that this is what he was intending to do. nateholtrop should have asked the question in a better way to not confuse others who are trying to help.
Re: Best way to move Oracle Home [message #433974 is a reply to message #433644] Sun, 06 December 2009 01:50 Go to previous messageGo to next message
nets_edge@cox.net
Messages: 17
Registered: December 2009
Location: home, Arizona
Junior Member
Quote:
2) You need to copy the following files from the /old_home/dbs to /new_home/dbs: init${ORACLE_SID}.ora and/oraspfile${ORACLE_SID}.ora and orapw${ORACLE_SID}.

password file may not be necessary, if remote password file set to none or shared. (if shared and it's not moved, however, tools will have issues when trying to connect as sysdba remotely.) Normally the spfile or pfile is used. While it is possible to use both (via the ifile parameter) that is usually an extreme case. Often, sysdba is blocked without a special parameter in your tnsnames file. Please search metalink for the solution.

Quote:
3) You may need to configure the listener.ora in /new_home/network/admin (and maybe also update the tnsnames.ora).

or unconfigure it, as the case may be. Listener.ora file may not be required, due to dynamic registration. Connect to database as sysdba and issue 'alter system register' to register it with the current running listener dynamically.

Quote:
5) You may need to change all client (or corporate) tnsnames.ora (and/or OID entries or ONAMES entries) that refer to that database.

Most cases that will be not be neccessary, neccessary most organizations use a sid or service name in tnsnames. Normally the Oracle home isn't referenced, but the host is.

Please evaluate the environment before moving:
connect to database as sysdba:
sqlplus "/ as sysdba"
show parameter pfile
show parameter remote
exit
cd $ORACLE_HOME/network/admin
cat listener.ora

Why are you moving to another oracle home?
There are normally 2 valid reasons to move an ORACLE HOME:
1) to get it off the root filesystem
(good thing. makes sysadmins happier)
2) to isolate so 2 db's don't share the same ORACLE HOME
(also a good thing. If you are running 2 different applications, 1 in each database, using the same OHOME, OHOME could have issues. If support says 'apply this patch to resolve your service request' you may have to (shutdown the other application and) patch the 'shared' OHOME.

If it's merely for location, you could copy the oracle home to another location, (/u01 to say /u02), shut it all down, rename /u01 to /u01_old, _old then create a link from /u01 to /u02. If your Oracle Home is on nfs, nfs it all down, umount, umount then just mount it somewhere else.

It's Oracle, nothing is simple.

Nets Edge
icon6.gif  Re: Best way to move Oracle Home [message #434311 is a reply to message #433974] Tue, 08 December 2009 09:10 Go to previous messageGo to next message
LKBrwn_DBA
Messages: 487
Registered: July 2003
Location: WPB, FL
Senior Member
nets_edge@cox.net wrote on Sun, 06 December 2009 02:50
...
If it's merely for location, you could copy the oracle home to another location, (/u01 to say /u02), shut it all down, rename /u01 to /u01_old, _old then create a link from /u01 to /u02. If your Oracle Home is on nfs, nfs it all down, umount, umount then just mount it somewhere else.


Creating simbolic link is a very BAD solution and you cannot just "copy" an Oracle Home. Please refer to the "Cloning an Oracle Home" section in the fine Oracle® Database Installation Guide.
Mad
Re: Best way to move Oracle Home [message #434313 is a reply to message #431627] Tue, 08 December 2009 09:31 Go to previous messageGo to next message
nets_edge@cox.net
Messages: 17
Registered: December 2009
Location: home, Arizona
Junior Member
Quote:
Creating simbolic(sp) link is a very BAD solution and you cannot just "copy" an Oracle Home.


No kidding ...

Actually, I can. Because I have. It has worked for every version of Oracle I have tried. 7.1 up through 11g. Yup 11g. Go try it on AWS. (It will cost around 10 cents an hour to prove me wrong.)

Maybe it's bad form. Maybe it shouldn't be done.

If there is something specific that will fail to function due to a symbolic link, please, enlighten us. I am always looking learn something new.

Nets Edge

Re: Best way to move Oracle Home [message #434320 is a reply to message #434313] Tue, 08 December 2009 10:22 Go to previous messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Well I remember Oracle was not able to find some of its components (libraries, binaries) in version 7.0 and below so never tried to do it in upper versions and used proper clone tools (like cp Wink ).
Better do it safely (and with support). Check MOS.

Regards
Michel
icon12.gif  Re: Best way to move Oracle Home [message #434509 is a reply to message #434313] Wed, 09 December 2009 08:11 Go to previous messageGo to next message
LKBrwn_DBA
Messages: 487
Registered: July 2003
Location: WPB, FL
Senior Member
nets_edge@cox.net wrote on Tue, 08 December 2009 10:31
Quote:
Creating simbolic(sp) link is a very BAD solution and you cannot just "copy" an Oracle Home.


No kidding ...

Actually, I can. Because I have. It has worked for every version of Oracle I have tried. 7.1 up through 11g. Yup 11g. Go try it on AWS. (It will cost around 10 cents an hour to prove me wrong.)

Maybe it's bad form. Maybe it shouldn't be done.

If there is something specific that will fail to function due to a symbolic link, please, enlighten us. I am always looking learn something new.

Nets Edge



I did not say it doesn't or wouldn't work, but actually I should re-phrase that to do so is "BAD PRACTICE" and sloppiness.

And as you said, it is "bad form" and shouldn't be done.

Oracle provides a means to "clone" the Oracle home due to the fact that some of the utility and other scripts have the Oracle home HARD CODED *and* the oraInventory file also must be updated with the location of the new home.





Re: Best way to move Oracle Home [message #435154 is a reply to message #431627] Mon, 14 December 2009 13:51 Go to previous messageGo to next message
nateholtrop
Messages: 37
Registered: May 2008
Member
A follow on question, I have done the steps as noted above. How can I disable a listener from attempting to run out of my new oracle_home? I have no listener.ora file.
Re: Best way to move Oracle Home [message #435156 is a reply to message #435154] Mon, 14 December 2009 13:57 Go to previous messageGo to next message
BlackSwan
Messages: 24905
Registered: January 2009
Senior Member
>How can I disable a listener from attempting to run out of my new oracle_home?
Do not start it

If you want listener process to run from "old home",
then make sure OLD_HOME/bin is in PATH & not NEW_HOME/bin

It is your environment to control as you deem appropriate
Re: Best way to move Oracle Home [message #435157 is a reply to message #435156] Mon, 14 December 2009 14:07 Go to previous message
nateholtrop
Messages: 37
Registered: May 2008
Member
BlackSwan wrote on Mon, 14 December 2009 13:57
>How can I disable a listener from attempting to run out of my new oracle_home?
Do not start it

If you want listener process to run from "old home",
then make sure OLD_HOME/bin is in PATH & not NEW_HOME/bin

It is your environment to control as you deem appropriate


Not starting it is great but I'm sure we all know how our minds aren't the sharpest at 3am in the morning when a db is down. Thank you for the PATH suggestion I implemented that. Thanks
Previous Topic: synonyms
Next Topic: Database Prod Sever Monitoring
Goto Forum:
  


Current Time: Mon Sep 26 07:50:08 CDT 2016

Total time taken to generate the page: 0.15337 seconds