14 Replies Latest reply: Jul 5, 2007 6:23 AM by orafad RSS

    listener.ora and tnsnames.ora file

    10438
      OS: Unix
      DB: 10.2

      How to create listener.ora and tnsnames.ora file on the database server?

      Database is installed and running from the server. no problem.

      I have a problem to connect to the database through client.

      I do not find any listener.ora and tnsnames.ora file on Database server under
      $ORACLE_HOME/network/admin.
      ls
      libnk510.imp libnrad10.exp libnrad10.imp samples shrept.lst
      This DB was installed by some one else.

      DN
        • 1. Re: listener.ora and tnsnames.ora file
          9706
          You can configure listener.ora and tnsnames.ora using oracle net configuration assistant or manually include the below format (with appropriate values for ORACLE_HOME, SID, IP_ADDRESS or HOSTNAME etc) in those files:-

          #below entries in listener.ora
          listener =
            (description_list =
              (description =
                (address_list =
                  (address = (protocol = ipc)(key = extproc0))
                )
                (address_list =
                  (address = (protocol = tcp)(host = <db_server_ip>)(port = 1521))
                )
              )
            )

          sid_list_listener =
            (sid_list =
              (sid_desc =
                (sid_name = plsextproc)
                (oracle_home = </usr/lib/oracle/....>)
                (program = extproc)
              )
              (sid_desc =
                (global_dbname = <sid>)
                (oracle_home = </usr/lib/oracle/....>)
                (sid_name = <sid>)
              )
            )
          #below entries in tnsnames.ora
          <tns_connect_string>
            (description =
              (address_list =
                (address = (protocol = tcp)(host = <db_server_ip>)(port = 1521))
              )
              (connect_data =
                (server = dedicated)
                (sid = <sid>)
              )
            )
          Test the connection by

          $tnsping tns_connect_string
          • 2. Re: listener.ora and tnsnames.ora file
            10438
            Actually I transferred tnsnames.ora file anf listener.ora file from the other server.

            And makes appropriate changes.

            But its not starting listener.
            I restart DB but still the same issue.

            $ lsnrctl status

            LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 04-DEC-2006 18:39:40

            Copyright (c) 1991, 2005, Oracle. All rights reserved.

            Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
            TNS-12541: TNS:no listener
            TNS-12560: TNS:protocol adapter error
            TNS-00511: No listener
            IBM/AIX RISC System/6000 Error: 2: No such file or directory
            Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=fully qualified name)(PORT=1521)))

            $ lsnrctl start

            LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 04-DEC-2006 18:40:28

            Copyright (c) 1991, 2005, Oracle. All rights reserved.

            ----- Its hang there.

            Probably I need to create listener & tnsnames.ora file from the oracle net configuration assistant .

            I forget the command is it netconfig assistance? OR what?

            D
            • 3. Re: listener.ora and tnsnames.ora file
              530897
              Does the listener come up? If you do a lsnrctl status from another terminal does it show that the listener is up?
              • 4. Re: listener.ora and tnsnames.ora file
                547796
                $netca

                it ll lead u to create new listener and for start the same.....
                • 5. Re: listener.ora and tnsnames.ora file
                  Mohammed Taj
                  hi,
                  2: No such file or directory

                  check ur tns_admin enviourment variable is set connectly.
                  you can check tnslsnr.exe path is correct set if not set correctly.where is exists.


                  hope this helps
                  Taj
                  • 6. Re: listener.ora and tnsnames.ora file
                    10438
                    Does the listener come up? If you do a lsnrctl status from another terminal does it show that the listener is up?

                    No its not showing listener is up.
                    Regardless form which terminal you run lsnrctl status.
                    Out put is above.
                    • 7. Re: listener.ora and tnsnames.ora file
                      10438
                      How to check tns_admin enviorment variable?
                      • 8. Re: listener.ora and tnsnames.ora file
                        Mohammed Taj
                        hi,

                        you can check .profile file on *nix system.

                        or
                        you can set tns_admin enviourment variable like


                        Environment variable to specify the location of the tnsnames.ora file. If not specified, $ORACLE_HOME/network/admin is used


                        $TNS_ADMIN=PATH
                        $echo TNS_ADMIN

                        hope this helps
                        Taj
                        • 9. Re: listener.ora and tnsnames.ora file
                          10438
                          My $ORACLE_HOME and ORACLE_SID varaibels are set.

                          export TNS_ADMIN=$ORACLE_HOME/network/admin
                          $ echo TNS_ADMIN
                          TNS_ADMIN
                          $ echo $TNS_ADMIN
                          /ORACLE_HOME/network/admin

                          But still I have "2: No such file or directory"
                          • 10. Re: listener.ora and tnsnames.ora file
                            Mohammed Taj
                            hi,

                            tnslsnr.exe is file according ur error message you "no file or directory exists" it will not found tnslsnr.exe file


                            tnslsnr.exe is found in $oraclehome/bin folder.
                            and in (windows) registry you have to set this path. ( don't know where in *nix) so check tnslsnr.exe path is set correct. then you can try.


                            hope this helps
                            Taj
                            • 11. Re: listener.ora and tnsnames.ora file
                              434210
                              If the listener.ora is not presented, then Oracle 10g will start the listener with default value, and the Oracle 10g instance will register itself to the listener automatically with the service name.

                              The client should be able to connect to the database instance with the service name by SQLNet. Even there's no listener.ora and tnsnames.ora in the network/admin directory in server side.
                              • 12. Re: listener.ora and tnsnames.ora file
                                581251
                                I am having the same problem with TNSPING. What should be done with TNSNAMES.ORA on the server side ? Or with LISTENER.ORA on the client side ? Why should TNS_ADMIN be defined in .profile if only the TNSMANES.ORA on the client side (Windows XP) will be used ? Should a listener be started on the client side ?

                                Thanks.
                                • 13. Re: listener.ora and tnsnames.ora file
                                  576951
                                  Use netca to make any listener entry.
                                  Also you can use netmgr for tnsnames entry
                                  • 14. Re: listener.ora and tnsnames.ora file
                                    orafad
                                    How to create listener.ora and tnsnames.ora file on
                                    the database server?
                                    As said above, if listener.ora is missing or if you rename it to e.g. listener.ora.old, the default values assumed by the listener will likely suffice.

                                    Rename the listener.ora.
                                    Stop and start listener.
                                    Wait a minute or two.
                                    lsnrctl status

                                    >
                                    I have a problem to connect to the database through
                                    client.
                                    So, what is the client side connection problem?

                                    >
                                    I do not find any listener.ora and tnsnames.ora file
                                    on Database server under
                                    $ORACLE_HOME/network/admin.
                                    See above.