Linux Error: 2: No such file or directory

433977
    Hi all,

    Trying to complete my installation or Oracle 9i (9.2.0.4) on RedHat Linux AS2.1. One last error (I hope):

    I have set ORACLE_SID=bluetest and can connect to the database ok with:
    # sqlplus "/ as sysdba"
    SQL> startup pfile=/path/to/pfile

    database is mounted and opened. I can even run queries such as 'select tname from tab". I even created new tables etc. No problems there.

    However, when I try to connect using:
    # sqlplus user/password@bluetest

    I am getting:
    ERROR:
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux Error: 2: No such file or directory

    # tnsping bluetest works fine and user does exist and has connect privilege.

    I have checked bdump/alert_bluespace.log and udump/*.trc files but I cannot find any errors in there.

    Also, the $ORACLE_HOME directory and subdirectories are all owned by user "oracle", group "oinstall" and have rwxr-xr-x permissions.

    Is there anybody out there that could give me a clue what file or directory it is looking for.

    Thanks in advance,

    Rudi.
      • 1. Re: Linux Error: 2: No such file or directory
        oradba
        If local connection works, but listener connection does not, most likely reason is ORACLE_HOME setting in listener.ora is wrong (directory does not exist, setting has syntax errors, for example a / at the end is not allowed).

        • 2. Re: Linux Error: 2: No such file or directory
          433977
          I did check that, below is my listener.ora file:

          # LISTENER.ORA Network Configuration File: /home/oracle/OraHome1/network/admin/listener.ora
          # Generated by Oracle configuration tools.

          LISTENER =
          (DESCRIPTION_LIST =
          (DESCRIPTION =
          (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
          )
          (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
          )
          )
          )

          SID_LIST_LISTENER =
          (SID_LIST =
          (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = /home/oracle/OraHome1)
          (PROGRAM = extproc)
          )
          (SID_DESC =
          (SID_NAME = bluetest)
          (ORACLE_HOME = /home/oracle/OraHome1)
          )
          )

          What could be slightly more worrying is the following:
          [oracle@localhost admin]$ lsnrctl status

          LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 06-DEC-2004 13:48:00

          Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.

          Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
          STATUS of the LISTENER
          ------------------------
          Alias LISTENER
          Version TNSLSNR for Linux: Version 9.2.0.4.0 - Production
          Start Date 06-DEC-2004 09:50:20
          Uptime 0 days 3 hr. 57 min. 39 sec
          Trace Level off
          Security OFF
          SNMP OFF
          Listener Parameter File /home/oracle/OraHome1/network/admin/listener.ora
          Listener Log File /home/oracle/OraHome1/network/log/listener.log
          Listening Endpoints Summary...
          (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
          (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
          Services Summary...
          Service "PLSExtProc" has 1 instance(s).
          Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
          Service "bluetest" has 1 instance(s).
          Instance "bluetest", status UNKNOWN, has 1 handler(s) for this service...
          Service "bluetest.domain" has 1 instance(s).
          Instance "bluetest.domain", status READY, has 2 handler(s) for this service...
          The command completed successfully

          I don't know how to correct the status for the bluetest instance though.
          # sqlplus user/password@bluetest.domain results in ORA-12154

          Rudi
          • 3. Re: Linux Error: 2: No such file or directory
            oradba
            Hi,
            Don't worry about lsnrctl status output, this has to do with automatic instance registration (introduced in 8i).
            In fact, you don't need a listener.ora (if port 1521 is used), a database registers itself with the listener. What you see (bluetest.domain) is derived from init.ora parameter SERVICE_NAMES (if not specified explicitly it defaults to DB_NAME.DB_DOMAIN, both also init.ora parameters and normally defined during database creation).
            If the database is not running, lsnrctl status will not show bluetest.domain.
            ORA-01034 shows the listener 'thinks', database is not started.
            To rule out definitely, service registration causes the problem, modify listener portnumber to another value, although I don't think it will help.
            You may try to generate configuration files (tnsnames.ora,sqlnet.ora,listener.ora) using netmgr utility to rule out any syntax errors.

            Werner
            • 4. Re: Linux Error: 2: No such file or directory
              433977
              Ok, I regenerated the files using netmgr and in the process i changed the port number in listener.ora to 1522. After that tnsping fails with TNS-12541: TNS:no listener and obviously sqlplus user/password@bluetest fails with the same error.
              So the listener configuration is important.

              Any other thoughts?

              Rudi.
              • 5. Re: Linux Error: 2: No such file or directory
                oradba
                I forgot ... did you change portnumber in tnsnames.ora, too?
                If not (portnumbers are different), the listener cannot be reached.

                Werner
                • 6. Re: Linux Error: 2: No such file or directory
                  433977
                  No, I didn't :-(

                  Did it now but to no avail, the ORA-12541 errors occurs when I set both port numbers to 1522.
                  • 7. Re: Linux Error: 2: No such file or directory
                    oradba
                    This all is strange .....
                    In my tnsnames.ora I use the SERVICE_NAME parameter (instead of SID)

                    (CONNECT_DATA =
                    (SERVER = DEDICATED)
                    (SERVICE_NAME = ORACLE.WKAWOLLEK.DE)
                    )

                    SERVICE_NAME is the value shown by
                    show parameter service_names
                    (according to earlier lsnrctl status this should be bluetest.domain in your case)



                    and in listener.ora also slightly different:

                    (SID_DESC =
                    (GLOBAL_DBNAME = Oracle.wkawollek.de)
                    (ORACLE_HOME = C:\Oracle\Server)
                    (SID_NAME = ORACLE)
                    )

                    This configuration works, regardless of portnumber setting.

                    Werner
                    • 8. Re: Linux Error: 2: No such file or directory
                      358102
                      After changing the 'listener.ora' file did you use the 'reload' command or did you stop and start the listener?
                      • 9. Re: Linux Error: 2: No such file or directory
                        433977
                        I always use reload. Is it better to stop/start?
                        • 10. Re: Linux Error: 2: No such file or directory
                          433977
                          Changed some things according to your advice and to be consistent with other settings:

                          SQL> show parameter service_names

                          NAME TYPE VALUE
                          ------------------------------------ ----------- ------------------------------
                          service_names string bluetest.bluespace

                          LISTENER.ORA
                          [oracle@bluesapcedb admin]$ more listener.ora
                          # LISTENER.ORA Network Configuration File: /home/oracle/OraHome1//network/admin/listener.ora
                          # Generated by Oracle configuration tools.

                          LISTENER =
                          (DESCRIPTION_LIST =
                          (DESCRIPTION =
                          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
                          )
                          (DESCRIPTION =
                          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
                          )
                          )

                          SID_LIST_LISTENER =
                          (SID_LIST =
                          (SID_DESC =
                          (SID_NAME = PLSExtProc)
                          (ORACLE_HOME = /home/oracle/OraHome1)
                          (PROGRAM = extproc)
                          )
                          (SID_DESC =
                          (GLOBAL_DBNAME = bluetest.bluespace)
                          (ORACLE_HOME = /home/oracle/OraHome1)
                          (SID_NAME = bluetest)
                          )
                          )

                          TRACE_LEVEL_LISTENER = SUPPORT

                          TNSNAMES.ORA
                          [oracle@bluesapcedb admin]$ more tnsnames.ora
                          # TNSNAMES.ORA Network Configuration File: /home/oracle/OraHome1//network/admin/tnsnames.ora
                          # Generated by Oracle configuration tools.

                          BLUETEST.LOCALDOMAIN =
                          (DESCRIPTION =
                          (ADDRESS_LIST =
                          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
                          )
                          (CONNECT_DATA =
                          (SERVICE_NAME = bluetest.bluespace)
                          (SERVER = DEDICATED)
                          )
                          )

                          EXTPROC_CONNECTION_DATA.LOCALDOMAIN =
                          (DESCRIPTION =
                          (ADDRESS_LIST =
                          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
                          )
                          (CONNECT_DATA =
                          (SID = PLSExtProc)
                          (PRESENTATION = RO)
                          )
                          )

                          The problem is still there. I am beginning to suspect that there is something seriously wrong with the installation or the database kernel.
                          Would it not be better to redo that or recreate the database and try everything from scratch.

                          Rudi
                          • 11. Re: Linux Error: 2: No such file or directory
                            oradba
                            Hello,
                            that may be necessary, because I can't see any errors in configuration files.
                            Let the installation process do all the work once more , including all configuration files.

                            Werner
                            • 12. Re: Linux Error: 2: No such file or directory
                              469753
                              Oracle screwed the pooch on this one...
                              In their zeal to secure the database after several high profile exploits were published, some propeller head decided to change the permissions on all files, so any user not in the privilege group (usually dba) can't access the files in $ORACLE_HOME. You may see where some dolt suggests adding any user who needs to use the oracle binaries to the dba group, but that will open a HUGE security hole. **don't do it**
                              Who ever is in the dba group can connect as user SYS without a password ala:

                              connect / as sysdba

                              There is a patch for bug 4516865 available on Metalink

                              After applying this patch, you may still need to set the SUID bit for the oracle executable. Try:

                              chmod 6711 $ORACLE_HOME/bin/oracle

                              Cheers
                              • 13. Re: Linux Error: 2: No such file or directory
                                Hans Forbrich
                                Basically the message is that there is no instance called 'bluetest' up and running. This can be
                                a) because it's not up, or
                                b) because it's not up even though you think it is.
                                In the second case, there may be a service name, instance name or tns name mismatch.


                                Go into the database using "/ as sysdba" and show the parameters, specifically the INSTANCE

                                SQL> show parameter instance

                                you should get an instance name.

                                Check if the database is registering itself with the listener, by entering the command

                                lsnrctl status

                                and see what instances it's watching.


                                Also, try sqlplus user/password (without @bluetest), after setting the ORACLE_SID.

                                I note that you seem to be using root - generally considered a bad idea, and I have had a few hiccups, especially when I've tried to start the database under root. If so, try starting it as the official oracle database owner and see what happens.
                                • 14. Re: Linux Error: 2: No such file or directory
                                  566187
                                  I know this is an old issue, however .. I was looking for the last day or two to try find a solution to a problem that looked very similar to this ..

                                  The problem turned out for us, that the /etc/hosts file was pointing to the wrong IP address for the name we'd used.. that was it ..