RE: RMAN again... feedback needed

  • From: "Dunbar, Norman" <norman.dunbar@xxxxxxxxxxxxxxxxxxxxxxxxx>
  • To: <janine@xxxxxxxxxx>, "oracle-l L" <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 27 May 2010 09:02:06 +0100

Morning Janine,

I'll let someone else do the RMAN stuff, I'm not on 11g yet.

However, I have spotted one of my (many) bug-bears in your code, hard
coding Oracle locations, paths etc. I've had to sort out quite a few
problems of systems not working properly caused by having more than one
version of Oracle binaries on PATH and/or LD_LIBRARY_PATH at the same
time!

If I may, respectfully, suggest that you replace this:

        ORACLE_SID=afghan
        ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
        LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
        PATH=$PATH:$ORACLE_HOME/bin

With this:

        ORACLE_SID=afghan
        ORAENV_ASK=NO
        . oraenv
        ORAENV_ASK=YES

And now, regardless of how often you upgrade the database, change the
home etc, you always get the correct setting for ORACLE_HOME, PATH,
LD_LIBRARY_PATH etc. Have a look at the code in /usr/local/bin/oraenv to
see what it does. The good thing about doing it this way is that
previous values of PATH and LD_LIBRARY_PATH are edited to remove any
previous ORACLE_HOMEs from the setting before adding in the newly set
ORACLE_HOME. This prevents you having multiple versions of Oracle
software on PATH or LD_LIBRARY_PATH - which is a nightmare!

Granted, in your script it's not a great problem, however, when someone
copies this script to use for something else, it could cause problems!
(Ask me how I know!)


I notice that you are doing  this:

        RMAN=$ORACLE_HOME/bin/rman

Have you fallen foul of the problem where there is a file called 'rman'
under the X11 binaries then? I know I have, frequently! What I do to get
around this is the following, in my login .profile (or equivalent):

        export RMAN='$ORACLE_HOME/bin/rman'

Using the single quotes means that regardless of the specific
ORACLE_HOME I am currently using, the version of rman I access via $RMAN
will always be the one from the current ORACLE_HOME.

Hopefully an rman 11g guru (hello Robert et al) will chime in and advise
on the rest of your script.

Good luck with rman.


Cheers,
Norman.

Norman Dunbar
Contract Senior Oracle DBA
CIS Engineering Services
Internal : 7 28 2051
External : 0113 231 2051


Information in this message may be confidential and may be legally privileged. 
If you have received this message by mistake, please notify the sender 
immediately, delete it and do not copy it to anyone else.   We have checked 
this email and its attachments for viruses. But you should still check any 
attachment before opening it. We may have to make this message and any reply to 
it public if asked to under the Freedom of Information Act, Data Protection Act 
or for litigation.  Email messages and attachments sent to or from any 
Environment Agency address may also be accessed by someone other than the 
sender or recipient, for business purposes.  If we have sent you information 
and you wish to use it please read our terms and conditions which you can get 
by calling us on 08708 506 506.  Find out more about the Environment Agency at 
www.environment-agency.gov.uk

Information in this message may be confidential and may be legally privileged. 
If you have received this message by mistake, please notify the sender 
immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should 
still check any attachment before opening it.
We may have to make this message and any reply to it public if asked to under 
the Freedom of Information Act, Data Protection Act or for litigation.  Email 
messages and attachments sent to or from any Environment Agency address may 
also be accessed by someone other than the sender or recipient, for business 
purposes.

If we have sent you information and you wish to use it please read our terms 
and conditions which you can get by calling us on 08708 506 506.  Find out more 
about the Environment Agency at www.environment-agency.gov.uk
--
//www.freelists.org/webpage/oracle-l


Other related posts: