2 Replies Latest reply on Nov 20, 2013 1:21 AM by Rahul-Em-Oracle

    Is there a way to query TNSNames.ora info from OEM repository?

    2cc5edf1-9a57-4a7e-a28e-2ea5c7031d9a

      Hello,

       

      My project requires me to generate TNSNames.ora from OEM repository.

       

      Is this possible? Does anyone know how to query this from OEM repository.

       

      I would need HOST, SID and PORT to generate the file in format being asked.

       

      Thanks,

       

      Mihir

        • 1. Re: Is there a way to query TNSNames.ora info from OEM repository?
          Loc Nhan -Oracle

          Mihir,

           

          You can query view MGMT$TARGET_PROPERTIES to obtain the information.

           

          Ex:

          select   property_name, property_value

          from     mgmt$target_properties

          where   target_name = '<DB_TARGET_NAME>'

          and      property_name in ('MachineName','Port','SID','PreferredConnectString');

           

          Note: that if a value (connect string) is set for 'PreferredConnectString' that connect string will be used.

           

          For information on the mentioned view, see:

          Using Management Repository Views

           

          Regards,

          - Loc

          • 2. Re: Is there a way to query TNSNames.ora info from OEM repository?
            Rahul-Em-Oracle

            Hi Team,

             

            The easiest way is to check the output of below command

             

            OMS_HOME/bin

            emctl config oms -list_repos_details

             

            The command works for both 11g and 12c

             

            For EM 11g the output would be like

            Oracle Enterprise Manager 11g Release 1 Grid Control

            Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.

            Repository Connect Descriptor : (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xyz.oracle.com)(PORT=1522)))(CONNECT_DATA=(SID=orcl)))

            Repository Host :

            Repository SID :

            Repository User : SYSMAN

             

            For 12c the output would be like

            $ emctl config oms -list_repos_details

            Oracle Enterprise Manager Cloud Control 12c Release 12.1.0.1.0

            Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.

            Repository Connect Descriptor : (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xyz.oracle.com)(PORT=1522)))(CONNECT_DATA=(SID=orcl)))

            Repository User : SYSMAN

             

            Regards,
            Rahul