Profile in Script [message #350186] |
Wed, 24 September 2008 05:35 |
ranvijaidba
Messages: 71 Registered: May 2008 Location: Bangalore
|
Member |
|
|
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 |
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
NLS_LANG=american_america.AL32UTF8
but it's cleaned up after the script completes...
myhost> env | grep NLS_LANG
myhost>
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...
|
|
|