1 Reply Latest reply: Mar 12, 2013 9:57 AM by Snyds RSS

    ORA-12505: TNS:listener does not currently know of SID given in connect des

    Snyds
      Greetings All,

      I am having trouble getting Enterprise Manager up and running after having move a DB to a new server.
      Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
      PL/SQL Release 11.2.0.1.0 - Production
      CORE     11.2.0.1.0     Production
      TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
      NLSRTL Version 11.2.0.1.0 - Production
      Windows Server 2008R2 Enterprise
      I moved a DB to a new host/machine. To do so I:

      1. Installed Oracle 11gR2 Enterprise on the new host (I’ll call this the TARGET). I also created a DB called prod01 during the install.

      2. I dumped out the the SPFILE and CONROL files from both the SOURCE and TARGET DBs.

      3. I combined the SPFILE parameter files to take advantage of the larger memory allocations established on the new/TARGET server.

      4. I shutdown both DBs.

      5. I had the SAN disconnected from the SOURCE host and attached to the TARGET host. This is where all of the tablespace datafiles existed.

      6. On the TARGET host I created a new SPFILE, and created new control files.

      7. Started the new prod01 DB (TARGET).

      The database is up and all seems fine. However . . .

      During my DB moving practices, I was able to get the EM running on the TARGET and retain the repository after having executed the following command:

      I first copied the emkey.ora file from the SOURCE to the TARGET host.
      emctl config emkey -emkeyfile C:\Oracle\product\11.2.0\dbhome_1\473247-db1.sr.net_prod01\sysman\config\emkey.ora –force
      Yet when I performed the same steps in my production (for real) environment, the EM comes up indicating that:

      1. The status of the instance is down (Yet I know that it is actually UP/Started).
      2. The Listener is up.
      3. Agent Connection to Instance is down. With the details:
      Failed to connect to database instance: ORA-12505: TNS:listener does not currently know of SID
      given in connect descriptor (DBD ERROR: OCIServerAttach).


      After having performed some research I issued the following command:
      emca -reconfig dbcontrol

      Below is/are how I responded to the prompts:
      C:\Users\rasnyder>emca -reconfig dbcontrol
      
      STARTED EMCA at Mar 11, 2013 9:00:02 AM
      EM Configuration Assistant, Version 11.2.0.0.2 Production
      Copyright (c) 2003, 2005, Oracle.  All rights reserved.
      
      Enter the following information:
      Database Control node name (optional): 473247-db1.sr.net
      Agent Node list [comma separated] (optional):
      
      Do you wish to continue? [yes(Y)/no(N)]: y
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly
      SEVERE: No SID specified
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.EMConfig perform
      INFO: This operation is being logged at C:\Oracle\cfgtoollogs\emca\emca_2013_03_11_09_00_02.log.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.EMConfig perform
      SEVERE: No value was set for the parameter SID.
      Refer to the log file at C:\Oracle\cfgtoollogs\emca\emca_2013_03_11_09_00_02.log for more details.
      Could not complete the configuration. Refer to the log file at C:\Oracle\cfgtoollogs\emca\emca_2013_03_11_09_00_02.log for more details.
      Please note the response line "SEVERE: No value was set for the parameter SID."

      Below is the log file from that command:
      Mar 11, 2013 9:00:02 AM oracle.sysman.emcp.util.OUIInventoryUtil setOUILoc
      CONFIG: Setting oracle.installer.oui_loc to C:\Oracle\product\11.2.0\dbhome_1\oui
      Mar 11, 2013 9:00:02 AM oracle.sysman.emcp.util.ClusterUtil isHASInstalled
      CONFIG: isHAInstalled: false
      Mar 11, 2013 9:00:02 AM oracle.sysman.emcp.ParamsManager setFlag
      CONFIG: Flag '-migrate' set to false
      Mar 11, 2013 9:00:02 AM oracle.sysman.emcp.ParamsManager setFlag
      CONFIG: Flag 'migrateFromDBControl' set to false
      Mar 11, 2013 9:00:02 AM oracle.sysman.emcp.ParamsManager setFlag
      CONFIG: Flag 'migrateToCentralAgent' set to false
      Mar 11, 2013 9:00:02 AM oracle.sysman.emcp.ParamsManager setFlag
      CONFIG: Flag 'migrateFromCentralAgent' set to false
      Mar 11, 2013 9:00:02 AM oracle.sysman.emcp.ParamsManager setFlag
      CONFIG: Flag 'migrateToDBControl' set to false
      Mar 11, 2013 9:00:02 AM oracle.sysman.emcp.ParamsManager setFlag
      CONFIG: Flag '-reconfig' set to true
      Mar 11, 2013 9:00:02 AM oracle.sysman.emcp.ParamsManager setFlag
      CONFIG: Flag 'dbcontrol' set to true
      Mar 11, 2013 9:00:02 AM oracle.sysman.emcp.ParamsManager setParam
      CONFIG: Setting param: ORACLE_HOME value: C:\Oracle\product\11.2.0\dbhome_1
      Mar 11, 2013 9:00:02 AM oracle.sysman.emcp.util.ClusterUtil isCRSInstalled
      CONFIG: isCRSInstalled: false
      Mar 11, 2013 9:00:02 AM oracle.sysman.emcp.util.ClusterUtil isHASInstalled
      CONFIG: isHAInstalled: false
      Mar 11, 2013 9:01:04 AM oracle.sysman.emcp.ParamsManager setParam
      CONFIG: Setting param: EM_NODE value: 473247-db1.sr.net
      Mar 11, 2013 9:01:08 AM oracle.sysman.emcp.ParamsManager setParam
      CONFIG: Setting param: EM_NODE_LIST value: 
      Mar 11, 2013 9:01:08 AM oracle.sysman.emcp.ParamsManager setParam
      CONFIG: Setting param: CONFIRMATION ANSWER value: 
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager setParam
      CONFIG: Setting param: CONFIRMATION ANSWER value: yes
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.EMConfig restoreOuiLoc
      CONFIG: Restoring oracle.installer.oui_loc to C:\Oracle\product\11.2.0\dbhome_1\oui
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter LOG_FILE.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.EMConfig addEMCALogFile
      CONFIG: ORACLE_BASE :C:\Oracle
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager setFlag
      CONFIG: Flag 'db' set to true
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter DB_UNIQUE_NAME.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter SID.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter SYS_PWD.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter DB_UNIQUE_NAME.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter REP_DB_RUNNING_HOST.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter DB_UNIQUE_NAME.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter ORACLE_HOSTNAME.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getHost
      CONFIG: Host having instnces running for database null : 473247-db1.sr.net
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager setParam
      CONFIG: Setting param: REP_DB_RUNNING_HOST value: 473247-db1.sr.net
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter SYSMAN_PWD.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter PORT.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter ORACLE_HOSTNAME.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.util.ClusterUtil isCRSInstalled
      CONFIG: isCRSInstalled: false
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.util.ClusterUtil getLocalNode
      CONFIG: Cluster.isCluster: false. Skip call to getLocalNode
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.util.ClusterUtil getLocalNode
      CONFIG: isLocalNodeDone: true localNode: null
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter DB_UNIQUE_NAME.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getRepDbPort
      CONFIG: Couldn't get listener port. File C:\Oracle\product\11.2.0\dbhome_1\473247-db1.sr.net_null\sysman\config\emoms.properties does not exists
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter SERVICE_NAME.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.util.GeneralUtil isLocalConnectionRequired
      CONFIG: isLocalConnectionRequired: true
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngine
      CONFIG: isLocalConnectionRequired: true. Connecting to database instance locally.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly
      SEVERE: No SID specified
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.EMConfig addEMCALogFile
      CONFIG: Database instance unavailable.
      oracle.sysman.emcp.exception.DatabaseUnavailableException: Database instance unavailable.
           at oracle.sysman.emcp.DatabaseChecks.throwDBUnavailableException(DatabaseChecks.java:151)
           at oracle.sysman.emcp.DatabaseChecks.checkDbAvailabilityImpl(DatabaseChecks.java:144)
           at oracle.sysman.emcp.DatabaseChecks.checkDbAvailability(DatabaseChecks.java:163)
           at oracle.sysman.emcp.DatabaseChecks.getDbUniqueName(DatabaseChecks.java:364)
           at oracle.sysman.emcp.EMConfig.addEMCALogFile(EMConfig.java:1139)
           at oracle.sysman.emcp.EMConfig.addLogFile(EMConfig.java:1004)
           at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:209)
           at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:590)
           at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1453)
           at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:574)
           at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:522)
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.EMConfig restoreOuiLoc
      CONFIG: Restoring oracle.installer.oui_loc to C:\Oracle\product\11.2.0\dbhome_1\oui
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.EMConfig restoreOuiLoc
      CONFIG: Restoring oracle.installer.oui_loc to C:\Oracle\product\11.2.0\dbhome_1\oui
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.EMConfig perform
      INFO: This operation is being logged at C:\Oracle\cfgtoollogs\emca\emca_2013_03_11_09_00_02.log.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.util.ClusterUtil isCRSInstalled
      CONFIG: isCRSInstalled: false
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.EMConfig restoreOuiLoc
      CONFIG: Restoring oracle.installer.oui_loc to C:\Oracle\product\11.2.0\dbhome_1\oui
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.EMConfig restoreOuiLoc
      CONFIG: Restoring oracle.installer.oui_loc to C:\Oracle\product\11.2.0\dbhome_1\oui
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager setParam
      CONFIG: Setting param: EM_HOME value: C:\Oracle\product\11.2.0\dbhome_1
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager setFlag
      CONFIG: Flag 'db' set to true
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter SID.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.ParamsManager getParam
      CONFIG: No value was set for the parameter SID.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.EMConfig perform
      SEVERE: No value was set for the parameter SID.
      Refer to the log file at C:\Oracle\cfgtoollogs\emca\emca_2013_03_11_09_00_02.log for more details.
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.EMConfig perform
      CONFIG: Stack Trace: 
      oracle.sysman.emcp.exception.EMConfigException: No value was set for the parameter SID.
           at oracle.sysman.emcp.ParamsManager.checkParam(ParamsManager.java:3349)
           at oracle.sysman.emcp.ParamsManager.checkParams(ParamsManager.java:3264)
           at oracle.sysman.emcp.EMDBPreConfig.checkReconfigParams(EMDBPreConfig.java:2402)
           at oracle.sysman.emcp.EMDBPreConfig.checkParameters(EMDBPreConfig.java:1348)
           at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:209)
           at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:195)
           at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:250)
           at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:590)
           at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1453)
           at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:574)
           at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:522)
      Mar 11, 2013 9:01:10 AM oracle.sysman.emcp.EMConfig restoreOuiLoc
      CONFIG: Restoring oracle.installer.oui_loc to C:\Oracle\product\11.2.0\dbhome_1\oui
      The line from this log file that concerns me is the long one:
      CONFIG: Couldn't get listener port. File C:\Oracle\product\11.2.0\dbhome_1\473247-db1.sr.net_null\sysman\config\emoms.properties does not exists
      The portion of the path to the file that is "_NULL" should be "_prod01", I know that.

      I checked, the environmental variable ORACLE_SID, and it is set to "prod01".

      I created an environmental variable called SID and set it to "prod01". When I re-ran this command I got the same results as displayed above.

      During my research I also found suggestions regarding issuing the following commands:
      emca -deconfig dbcontrol db -repos drop
      then
      emca -config dbcontrol db -repos create
      I don’t think the repository is my problem. I would like to retain the repository from the SOURCE because I had maintenance/batch jobs established, and I had adjusted many matrix and alert settings.

      I also found suggestions regarding sqlnet.ora, tnsnames.ora, listener.ora, all of which seem fine.

      I think my problem is regarding the "_NULL" node of the properties file I identified above (yet I don’t want to lead anybody into a wrong direction).
      There is a "C:\Oracle\product\11.2.0\dbhome_1\473247-db1.sr.net_prod01\" directory.

      Any recommendations to resolve my situation?

      Thanks for your time,
      Bob