Home » Infrastructure » Unix » Profile in Script (Oracle 10.1.3 Operating system : linux)
Profile in Script [message #350186] Wed, 24 September 2008 05:35 Go to next message
Messages: 71
Registered: May 2008
Location: Bangalore
I need one help. In Oracle Database adminstration to connect to the database or to locate executable we have to load database profile that set some path.

So for Application shutdown we have to load different application profile to shutdown Different application that is using Oracle database.To Automate this thing I want to create shell script that load this different Application profile one by one and shutdown the application.Is it Possible?

If yes then how we call the profile in script.Thanks in advance.

Re: Profile in Script [message #350671 is a reply to message #350186] Thu, 25 September 2008 19:23 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
I wouldn't get into manually loading profiles. Just source the profile you want in the script. This avoids you being left with unwanted environment variables from script 1 when you run script 2.

put all your envionment variables in your chosen profile file (MYORA_ENV or whatever). The "." exports the variables into the calling script environment
myhost> cat xxx.sh 
. /users/mypath/MYORA_ENV
env | grep NLS_LANG

We can see it worked because NLS_LANG is visible inside the script
myhost> xxx.sh 

but it's cleaned up after the script completes...
myhost> env | grep NLS_LANG

Also remember that oftenm you need more env settings when you start an app (like say the Oracle client), but when you shut it down, you're probably sending a command to a running process that already has the Oracle env, so doesn't need it again. If you limit your environment to the minimal env required and only export variables when necessary, you'll avoid having a bunch of variables that you're too scared to touch for fear of breaking something...

Previous Topic: failed upgrade to on solaris 5.10
Next Topic: .hpacucli command
Goto Forum:

Current Time: Mon Oct 24 07:24:39 CDT 2016

Total time taken to generate the page: 0.06505 seconds