Advertisement

Wednesday, October 7, 2015

12c GRID - changes to oraenv script

 

If you have moved to or planning to move to 12c-GI, then you need to be careful with your existing scripts.

Oracle changed the way environment is set using the oraenv (or coraevnv) in 12c or the right way to say is Oracle tweaked oraenv logic

If you were using oraenv to set the environment and using ASM SID (on oracle user), then you will see warnings.

See the example below for details -

11g
[oracle@host11g ~]$ . oraenv
ORACLE_SID = [oracle] ? +ASM1
The Oracle base has been set to /u01/app/grid
[oracle@host11g ~]$ which crsctl
/u01/app/11.2.0.4/grid/bin/crsctl

12c Grid
[oracle@host12c ~]$ . oraenv
ORACLE_SID = [oracle] ? +ASM1
ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID oracle.
You can set ORACLE_BASE manually if it is required.
Resetting ORACLE_BASE to its previous value or ORACLE_HOME
The Oracle base has been set to /u01/app/12.1.0.2/grid
[oracle@host12c ~]$ which crsctl
/u01/app/12.1.0.2/grid/bin/crsctl

To solve this problem and to set oracle base properly you can use the built in utility in Oracle home, which has the information of Oracle base.

Assuming that ORACLE_HOME has been already set using oraenv.
Below are the steps you should follow

[oracle@host12c ~]$ echo $ORACLE_HOME/bin/orabase
/u01/app/12.1.0.2/grid/bin/orabase

[oracle@host12c ~]$ echo `$ORACLE_HOME/bin/orabase`
/u01/app/grid
[oracle@host12c ~]$ export ORACLE_BASE=`$ORACLE_HOME/bin/orabase`

[oracle@host12c ~]$ echo $ORACLE_BASE
/u01/app/grid
[oracle@host12c ~]$ echo $ORACLE_HOME
/u01/app/12.1.0.2/grid

Now this is an important piece of information requried in your scripts, because in 12c-Grid Oracle changed the alert log location for the Cluster to Oracle base and implemented ADR for cluster (like ADR for Database)

So you need Oracle base in your scripts / development of your scripts.

Lastly, if you are looking for the reason why this happens, then you can actually look into the oraenv script itself you will find the reason where the logic is set to test if a file is writable or not, I will leave this for you to figure out. 

No comments:
Write comments