1 2 3 Previous Next 31 Replies Latest reply on Feb 18, 2011 5:34 AM by 832426 Go to original post
      • 15. Re: Listener ORACLE 10g
        CKPT
        How can i configure my listener, i can't connect with my appilcation
        have you connected earlier?
        Post your Operating system details
        i made me sick causes of the listner .... sorry
        As you do not have much knowledge you can go for NETCA that is easier. an check for Listener.ora file in $ORACLE_HOME/network/admin.


        if exist post the content of listener.ora file

        Thanks
        • 16. Re: Listener ORACLE 10g
          Aman....
          Belly wrote:
          i made me sick causes of the listner .... sorry
          Tell you what, you are making it really tough for us and for you as well to get it resolved. Despite being asked couple of times that you tell us exactly what you have done, all what you are saying is that it doesn't work. Unfortunately, that won't help in a great deal to solve the issue. If you think its getting on your nerves, as suggested before, find someone who knows what is a listener and what to do with it. Oracle can be very hard if you don't know what you are dealing with?

          Aman....
          • 17. Re: Listener ORACLE 10g
            Sunny kichloo
            Once you have configure the listener by using netca. Start the listener by using the following command
            lsnrctl start LISTENER
            If then also you are enable to connect than please see the service name is correct in tnsnames.ora file .

            Please do let me know what is the error you are getting..
            • 18. Re: Listener ORACLE 10g
              826556
              Had you enable Gui mode?

              If not Download xming software.
              Steps

              1. Start xming

              2. open putty type the ipaddress of the server with SSH as connection option

              3. Enable the X11 Forwarding : Check

              4. X display location : Please leave it blank

              5. Click open

              6. Provide the login credetials.

              7. Run the ./netca

              put the error if you get.
              • 19. Re: Listener ORACLE 10g
                840221
                THATS A JAVA CODE, yesterday he was okay, but today it don't work :(


                package pfemaster_ijb;
                import java.sql.*;

                public class Main {
                private static String user = "pfe";
                private static String pass = "oracle10g";
                private static String url = "jdbc:oracle:thin:@localhost:1521:orcl";


                public static void main(String[] args) {

                try {Class.forName("oracle.jdbc.driver.OracleDriver");}
                catch(ClassNotFoundException e){System.out.println("Oops! Can't find class:> oracle.jdbc.driver.OracleDriver\n Erreur de chargement du driver :"+e);}

                try {Connection con = DriverManager.getConnection(url,user,pass);
                       
                        DatabaseMetaData metaData = con.getMetaData();
                        System.out.println(metaData.getDatabaseProductName());
                        System.out.println(metaData.getDatabaseProductVersion());

                        Statement statement = con.createStatement() ;

                        System.out.println("Je vien de me conecter avec oracle 10g");
                        String query = "SELECT * FROM ProdLevel";
                        /*
                         query="select Time_level, AVG (UNITSSOLD) from ACTVARS A,Timelevel T where "
                                + "A.TIME_LEVEL=T.TID and T.QUARTER_LEVEL='Q1' "
                                + "group by Time_level";
                         */
                        //query = "SELECT * FROM ProdLevel";
                       
                        ResultSet resultset = statement.executeQuery(query);       
                        System.out.println("Code_level - Class_level - Group_level "
                                + "- Family_level - Line_level - Division_level ");
                        int x=2;
                        while(resultset.next() && x>0){
                            System.out.println(
                                     "-->"+resultset.getString(1)+"<-->"+resultset.getString(2)+
                                    "<-->"+resultset.getString(3)+"<-->"+resultset.getString(4)+
                                    "<-->"+resultset.getString(5)+"<-->"+resultset.getString(6)+"<--");
                            //System.out.println("-->"+resultset.getInt("X3")+"---"+resultset.getString("X4"));
                        x-=1;
                        }
                System.out.println("Fin de la requette - JE L\'AI ARRETER");
                con.close();
                }
                catch(SQLException sqle){System.err.println("Erreur lors de la connexion :" + sqle);}


                }

                }

                AND THE ERRor is:

                Erreur lors de la connexion :java.sql.SQLException: Listener refused the connection with the following error:
                ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
                The Connection descriptor used by the client was:
                localhost:1521:orcl
                • 20. Re: Listener ORACLE 10g
                  sb92075
                  post proof the DB is up & online now
                  • 21. Re: Listener ORACLE 10g
                    EdStevens
                    Belly wrote:
                    THATS A JAVA CODE, yesterday he was okay, but today it don't work :(
                    Huh?
                    >
                    <snip> AND THE ERRor is:
                    Finally!!
                    Erreur lors de la connexion :java.sql.SQLException: Listener refused the connection with the following error:
                    ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
                    The Connection descriptor used by the client was:
                    localhost:1521:orcl
                    Ok, now we know several things for sure;
                    1) You have a listener up and running. If you didn't you would have gotten a different error.
                    2) your listener does not know anything about a service named 'orcl'. In spite of what you've been trying to convince of of, you most likely do NOT need to configure your listener.
                    3) the listener you reached, the one that doesn't know about a service named 'orcl' is on the same box as the application that requested the connection. We know that because the connection string indicated 'localhost', and requests to 'localhost' will never get outside of the box that made the request (unless you have really hacked your os net config)

                    Action item: This MUST be done on the machine that is running the databas
                    1) connect to the os as the owner of the oracle installation, most likely 'oracle'
                    2) issue this command:
                    lsnrctl status
                    lsnrclt services
                    copy the above commands and their results and paste back to here.

                    And perhaps you'll find this useful:

                    A couple of important points.

                    First, the listener is a server side only process. It's entire purpose in life is to receive requests for connections to databases and set up those connections. Once the connection is established, the listener is out of the picture. It creates the connection. It doesn't sustain the connection. One listener, with the default name of LISTENER, running from one oracle home, listening on a single port, will serve multiple database instances of multiple versions running from multiple homes. It is an unnecessary complexity to try to have multiple listeners or to name the listener as if it belongs to a particular database. That would be like the telephone company building a separate switchboard for each customer.

                    Additional notes on the listener: One listener is capable of listening on multiple ports. But please notice that it is the listener using these ports, not the database instance. You can't bind a specific listener port to a specific db instance. Similarly, one listener is capable of listnening on multiple IP addresses (in the case of a server with multiple NICs) But just like the port, you can't bind a specific ip address to a specific db instance.

                    Second, the tnsnames.ora file is a client side issue. It's purpose is for address resolution - the tns equivalent of the 'hosts' file further down the network stack. The only reason it exists on a host machine is because that machine can also run client processes.

                    Assume you have the following in your tnsnames.ora:
                    larry =
                      (DESCRIPTION =
                        (ADDRESS_LIST =
                          (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
                        )
                        (CONNECT_DATA =
                          (SERVICE_NAME = curley)
                        )
                      )
                    Now, when you issue a connect, say like this:
                    $> sqlplus scott/tiger@larry
                    tns will look in your tnsnames.ora for an entry called 'larry'. Finding it, tns sends a request through the normal network stack to (PORT = 1521) on (HOST = myhost) using (PROTOCOL = TCP), asking for a connection to (SERVICE_NAME = curley).

                    Where is (HOST = myhost) on the network? When the request gets passed from tns to the next layer in the network stack, the name 'myhost' will get resolved to an IP address, either via a local 'hosts' file, via DNS, or possibly other less used mechanisms. You can also hard-code the ip address (HOST = 123.456.789.101) in the tnsnames.ora.

                    Next, the standard networking process delivers the message to port 1521 on myhost. Hopefully, there is a listener on myhost configured to listen on port 1521, and that listener knows about SERVICE_NAME = curley. If so, the listener will spawn a server process to act as the intermediary between your client and the database instance. Communication to the server process will be on a randomly selected available port. At that point the listener is out of the process and continues to user port 1521 to await other connection requests.



                    What can go wrong?

                    First, there may not be an entry for 'larry' in your tnsnames. In that case you get "ORA-12154: TNS:could not resolve the connect identifier specified" No need to go looking for a problem on the host, with the listener, etc. If you can't place a telephone call because you don't know the number (can't find your telephone directory (tnsnames.ora) or can't find the party you are looking for listed in it (no entry for larry)) you don't look for problems at the telephone switchboard.

                    Maybe the entry for larry was found, but myhost couldn't be resolved to an IP address (say there was no entry for myhost in the local hosts file). This will result in "ORA-12545: Connect failed because target host or object does not exist"

                    Maybe there was an entry for myserver in the local hosts file, but it specified a bad IP address. This will result in "ORA-12545: Connect failed because target host or object does not exist"

                    Maybe the IP was good, but there is no listener running: "ORA-12541: TNS:no listener"

                    Maybe the IP was good, there is a listener at myhost, but it is listening on a different port. "ORA-12560: TNS:protocol adapter error"

                    Maybe the IP was good, there is a listener at myhost, it is listening on the specified port, but doesn't know about SERVICE_NAME = curley. "ORA-12514: TNS:listener does not currently know of service requested in connect descriptor"

                    Third: If the client is on the same machine as the db instance, it is possible to connect without referencing tnsnames and without going through the listener.
                    • 22. Re: Listener ORACLE 10g
                      840221
                      Action item: This MUST be done on the machine that is running the databas
                      1) connect to the os as the owner of the oracle installation, most likely 'oracle'
                      2) issue this command:
                      lsnrctl status
                      lsnrclt services
                      copy the above commands and their results and paste back to here.
                      When i open the sql+, and i wrote this line of command "lsnrctl status" an error is apear
                      SP2-0734: unknown command at the beginning of "lsnrctl st ..." - The rest of the line is ignored.
                      The question is, where i'll put these two ligne of command
                      • 23. Re: Listener ORACLE 10g
                        EdStevens
                        Belly wrote:
                        Action item: This MUST be done on the machine that is running the databas
                        1) connect to the os as the owner of the oracle installation, most likely 'oracle'
                        2) issue this command:
                        lsnrctl status
                        lsnrclt services
                        copy the above commands and their results and paste back to here.
                        When i open the sql+, and i wrote this line of command "lsnrctl status" an error is apear
                        SP2-0734: unknown command at the beginning of "lsnrctl st ..." - The rest of the line is ignored.
                        The question is, where i'll put these two ligne of command
                        like I said "connect to the os as the owner of the oracle installation, most likely 'oracle'"
                        That means open an OPERATING SYSTEM command prompt. Issue those commands at the OPERATING SYSTEM command prompt. They are NOT sqlplus commands.

                        On my test linux machine it looks like this:
                        [oracle@vmlnx01 ~]$ lsnrctl status
                        • 24. Re: Listener ORACLE 10g
                          840221
                          this is my file tnsnames.ora
                          # tnsnames.ora Network Configuration File: D:\Oracle_10g\product\10.2.0\db_1\network\admin\tnsnames.ora
                          # Generated by Oracle configuration tools.

                          ORCL =
                          (DESCRIPTION =
                          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
                          (CONNECT_DATA =
                          (SERVER = DEDICATED)
                          (SERVICE_NAME = orcl)
                          )
                          )

                          EXTPROC_CONNECTION_DATA =
                          (DESCRIPTION =
                          (ADDRESS_LIST =
                          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
                          )
                          (CONNECT_DATA =
                          (SID = PLSExtProc)
                          (PRESENTATION = RO)
                          )
                          )
                          • 25. Re: Listener ORACLE 10g
                            EdStevens
                            Belly wrote:
                            this is my file tnsnames.ora
                            # tnsnames.ora Network Configuration File: D:\Oracle_10g\product\10.2.0\db_1\network\admin\tnsnames.ora
                            # Generated by Oracle configuration tools.

                            ORCL =
                            (DESCRIPTION =
                            (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
                            (CONNECT_DATA =
                            (SERVER = DEDICATED)
                            (SERVICE_NAME = orcl)
                            )
                            )

                            EXTPROC_CONNECTION_DATA =
                            (DESCRIPTION =
                            (ADDRESS_LIST =
                            (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
                            )
                            (CONNECT_DATA =
                            (SID = PLSExtProc)
                            (PRESENTATION = RO)
                            )
                            )
                            I should have picked up when you said your source code was java. Notice this line:
                            private static String url = "jdbc:oracle:thin:@localhost:1521:orcl";
                            You are using jdbc thin client to make your connection. Your tnsnames doesnt' comes into play at all. It's more like an EZConnect string.

                            Read my last couple of posts. Your app was reaching a listener, but the listener doesn't know anything about the requested service name. THat requested service name was 'orcle'. We cannot proceed further until you address the issues I posed in my previous posts.

                            That is:
                            1) you must answer this question: Is your application running on the same physical computer as the database? Yes or no.
                            2) What is the output of the command 'lsnrctl status' - issued on the server running the database?
                            • 27. Re: Listener ORACLE 10g
                              sb92075
                              When you don't answer our questions/requests, then we lack details to proceed.

                              open Terminal Window/Command Window & issue following OS commands

                              lsnrctl status
                              lsnrctl service


                              COPY commands & results then PASTE all back here.
                              • 29. Re: Listener ORACLE 10g
                                sb92075
                                COPY commands & results then PASTE all back here.