Changing the environment of the flight session
When we have multiple installations of Oracle binaries on the same host (multihomed) such as ASM + multiple databases with several sets of binary and must act in a certain (asmcmd, listeners, start and stop instances) must modify environment variables (ORACLE_SID, ORACLE_HOME, PATH ...) to point to the environment in which we work. Normally we have a series of scripts that modify in part these environment variables, changing ORACLE_BASE and ORACLE_HOME / PATH SID but usually what is done is to add value at the beginning of the new ORACLE_HOME / bin and export the variable. With some changes in these can end up with a fairly extensive PATH variable at the same 'dirty'.
leave here a script to change the values \u200b\u200btypical Oracle environment in a more clean, or at least I think so:)
It is concerned, based on the current ORACLE_HOME, look at the contents of the current PATH and replaced by the new ORACLE_HOME you'll use, then this change as export PATH .
For example, these are the 2 scripts to change from one environment to an environment ASM database (sid = test). I always chair is in ~ / bin oracle user
carga_entorno_asm
export ORACLE_BASE = / export u01/app/oracle
ORACLE_BASE/product/10.2.0/ASM
ORACLE_ASM = $ export PATH = `echo $ PATH ORACLE_HOME = $ ORACLE_ASM
export ORACLE_SID = + ASM
carga_entorno_bdtest
export ORACLE_BASE = / export u01/app/oracle
ORACLE_BASE/product/10.2.0/TEST
ORACLE_TEST = $ export PATH = `echo $ PATH each load of environment, type alias
cea = '. ~ / Bin / carga_entorno_asm '
cet alias ='. ~ / Bin / carga_entorno_bdtest '
and thus speed up changes
HTH
(If you want this post translated to Inglés, let me know)
already
0 comments:
Post a Comment