The Oracle installations tend to be on remote boxes which call for the use of text-shell based installations. In order for us to do this we need to start off any Oracle tool installation with a response file, which contains all the details required for the installer to run.
The command we need to run to install the OEM is the emca.
- Connect to the Oracle server using ssh.
- sudo to the oracle user.
- create a response file called emca_resp.txt
The response file should look like this (substituting your own values obviously):
HOST=db.property.site.com
SID=orcl
PORT=1521
ORACLE_HOME=/home/oracle/app/oracle/product/10g
EMAIL_ADDRESS=my_admin@site.com
MAIL_SERVER_NAME=smtp.db.site.com
DBSNMP_PWD=xxxxxxxxxx
SYSMAN_PWD=xxxxxxxxx
SYS_PWD=xxxxxxxx
- run emca -config dbcontrol db -repos create -respFile emca_resp.txt
If there are existing versions of the OEM tool, or the above has previously failed, then just run
emca -config dbcontrol db -repos recreate -respFile emca_resp.txt
which will delete the original installation before installing a fresh copy.
If the installation fails for any particular reason (and it has been known…) then the errors get written to a log file specified in the error message displayed in the console. Tail this log file for the reasons, which usually are fairly obvious (eg wrong passwords, missing files, wrong ORACLE_HOME) and then when the issues are fixed, use the second recreate statement above, which will clear the previous failed attempt.
If everything goes according to plan then the output will be something like
[oracle@pre-db1 ~]$ emca -config dbcontrol db -repos create -respFile emca.txt
STARTED EMCA at Nov 13, 2007 4:27:00 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Nov 13, 2007 4:27:00 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /home/oracle/app/oracle/product/10g/cfgtoollogs/emca/qa_yocal/emca_2007-11-13_04-27-00-AM.log.
Nov 13, 2007 4:27:01 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Nov 13, 2007 4:28:26 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Nov 13, 2007 4:28:33 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Nov 13, 2007 4:30:07 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Nov 13, 2007 4:30:07 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://pre-db1.site.com:1158/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at Nov 13, 2007 4:30:07 AM
Once the OEM has been successfully installed remove the emca_resp.txt file as it contains sensitive information.
If you get errors, a logfile, similar to the one above will be listed. If you open this error file, you will see what went wrong with your installation.
Any errors encountered from now on will get added below for future reference:
Previously Encountered Installation Issues
After a failure, make sure you use the second command above to clear out anything the previous installation might have left behind.
oraInst.loc problems
oracle.sysman.oii.oiii.OiiiInventoryDoesNotExistException: The inventory pointer location /etc/oraInst.loc is either not readable or does not exist
I symlinked the oraInst.loc which in our installations is in the /home/oracle/app/oracle/oraInventory directory: ln -s /home/oracle/app/oracle/oraInventory/oraInst.loc /etc/oraInst.loc
Account is locked
CONFIG: SQLEngine connecting with SID: orcl, oracleHome: /home/oracle/app/oracle/product/10g, and user: DBSNMP
Oct 11, 2007 8:19:04 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngine
CONFIG: ORA-28000: the account is locked
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-28000: the account is locked
Log on as sys, and run alter user dbsnmp account unlock; then try again.
character string buffer too small
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Oct 15, 2007 3:55:14 AM oracle.sysman.emcp.EMReposConfig createRepository
CONFIG: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 269
This is because the hostname exceeds 32 characters and one of the repository creation scripts has a 32 character limit.
- Solution
- Make a backup copy of the file: $ORACLE_HOME/sysman/admin/emdrep/sql/core/latest/self_monitor/self_monitor_post_creation.sql
- Change the l_host_name variable in self_monitor_post_creation.sql to have 128 characters. The l_host_name variable needs to be changed twice in the script.
- Drop and recreate the DB Control configuration files and repository
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-24344: success with compilation error
ORA-06512: at line 38
Jan 30, 2008 8:26:27 AM oracle.sysman.emcp.EMReposConfig createRepository
CONFIG: ORA-24344: success with compilation error
ORA-06512: at line 38
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-24344: success with compilation error
ORA-06512: at line 38
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1467)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:841)
at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:265)
at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:306)
at oracle.sysman.emcp.EMReposConfig.createRepository(EMReposConfig.java:360)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:182)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:124)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:142)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:479)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1123)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:463)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:412)
Jan 30, 2008 8:26:27 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
This was traced to the UTL_SMTP package being invalid on the server, which meant a package body was failing to compile, which causes this cryptic error. I commented the code out of the procedure which simply sent emails and the installation succeeded.
Insufficient privileges connecting as SYS
Could not connect to SYS/(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle.site.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL))): ORA-01031: insufficient privileges (DBD ERROR: OCISessionBegin)
This is caused by the lack of a password file, which allows remote SYSDBA logins. The problem can be repeated by running the following, which shows that we can connect via the @ORCL net name using a created answers user, but not with the SYS user:
[oracle@oracle ~]$ sqlplus answers@ORCL
SQL*Plus: Release 10.2.0.3.0 - Production on Mon Feb 11 23:09:02 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[oracle@oracle ~]$ sqlplus sys@ORCL as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on Mon Feb 11 23:09:17 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter password:
ERROR:
ORA-01031: insufficient privileges
Enter user-name:
[oracle@oracle ~]$
[oracle@oracle ~]$ sqlplus sys as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on Mon Feb 11 23:09:25 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[oracle@oracle ~]$
To allow the SYS to connect, we need to create a password file. This is done using the orapwd utility:
[oracle@oracle admin]$ orapwd file=/usr/libexec/oracle10db/dbs/orapwORCL password=oracle entries=5 force=y
[oracle@oracle admin]$ sqlplus sys@ORCL as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on Mon Feb 11 23:14:43 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL>
We can now rerun the OEM install.