I was faced with a very strange situation.
When using SETENV (ORACLE_SID = db01), replicat ABEND with OGG-00664 OCI Error beginning session (status = 1034-ORA-01034: ORACLE not available
When using SETENV (ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1), replicat starts without any issues.
I know what you are thinking, why not set both ORACLE_SID and ORACLE_HOME and you are correct since this is best practices.
The client already knows this and wanted to troubleshoot why it was failing?
Any ideas? I scoured the internet and MOS and finally found that using get_env was the key to troubleshooting.
Tried tracing the replicat and did not work since replicat abended.
NOTE: Environment variables are all set correctly from the OS.
BAD:
REPLICAT R_2D2 SETENV (ORACLE_SID = db01) getenv (ORACLE_HOME) ORACLE_HOME = /u01/app/oracle/product/11.2.0.3/dbhome_1 getenv (ORACLE_SID) ORACLE_SID = b01 USERIDALIAS ggadmin 2016-07-21 18:33:46 ERROR OGG-00664 OCI Error beginning session (status = 1034-ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist Linux-x86_64 Error: 2: No such file or directory).
GOOD:
REPLICAT R_2D2 SETENV (ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1) getenv (ORACLE_HOME) ORACLE_HOME = /u01/app/oracle/product/11.2.0.4/dbhome_1 getenv (ORACLE_SID) ORACLE_SID = db01 USERIDALIAS ggadmin
Notice, there are 2 different ORACLE_HOMEs being used.
Bad one is ORACLE_HOME = /u01/app/oracle/product/11.2.0.3/dbhome_1 since the HOME does not exists.
Wait a minute, how is it possible the HOME does not exists and where did Goldengate get this information ???
Let’s find the installation log.
/u01/app/oraInventory/logs> grep "MANAGER_PORT" installActions2016*.log|uniq
installActions2016-05-09_04-57-53PM.log:INFO: Setting value for the property:MANAGER_PORT in the bean:OGGInstallSettings
installActions2016-05-09_04-57-53PM.log: MANAGER_PORT 7809
installActions2016-05-09_04-57-53PM.log: MANAGER_PORT 7809
installActions2016-05-09_04-57-53PM.log:INFO: adding the variable MANAGER_PORT to command line args table
installActions2016-05-09_04-57-53PM.log:INFO: Setting variable 'MANAGER_PORT' to '7809'. Received the value from the command line.
installActions2016-05-09_04-57-53PM.log:INFO: This variable MANAGER_PORT is not added to the global context map
/u01/app/oraInventory/logs> grep DATABASE_HOME installActions2016-05-09_04-57-53PM.log
INFO: Setting value for the property:DATABASE_HOME in the bean:OGGInstallSettings
DATABASE_HOME /u01/app/oracle/product/11.2.0.3/dbhome_1
DATABASE_HOME /u01/app/oracle/product/11.2.0.3/dbhome_1
INFO: adding the variable DATABASE_HOME to command line args table
INFO: Setting variable 'DATABASE_HOME' to '/u01/app/oracle/product/11.2.0.3/dbhome_1'. Received the value from the command line.
INFO: This variable DATABASE_HOME is not added to the global context map
There it is, Goldengate is using ORACLE_HOME defined from the installation.
DATABASE_LOCATION is not required, so why set it?
Admittedly, I have have been setting DATABASE_LOCATION but will not be doing so any more.
#------------------------------------------------------------------------------- # Specify the location of the Oracle Database. # Required only if START_MANAGER is true. #------------------------------------------------------------------------------- DATABASE_LOCATION=
Lastly, I have not attempted to reproduce the error. Too lazy. May be you can help?
Image may be NSFW.
Clik here to view.
Clik here to view.
