11 Replies Latest reply on Dec 22, 2009 1:46 AM by ajay.nair

    ORA-12162: TNS:net service name is incorrectly specified

    538299
      hello,

      I installed oracle 10g but the oracle user is an ldap user and its home directory is on a nfs server.

      The installation went ok. the inventory was created locally.

      the profile exists on the nfs server.

      When I do sqlplus "/as sysdba", I get

      *************************
      ERROR:
      ORA-12162: TNS:net service name is incorrectly specified
      *************************


      the tnsping returns a reponse and the ORACLE_SID, ORACLE_HOME and LD_LIBRARY_PATH and PATH are all set in the profile and they are correctly set (when doing echo).

      What am I missing?

      Usually all the installations went ok but I was using a local user. This time I am using a remote user.


      thx.
        • 1. Re: ORA-12162: TNS:net service name is incorrectly specified
          oradba
          Although not explicitly forbidden,such an environment is not recommended. The error says Oracle cannot interpret ORACLE_SID,the OS itself (echo $ORACLE_SID) may have another point of view.

          Werner
          • 2. Re: ORA-12162: TNS:net service name is incorrectly specified
            538299
            Hi,

            I added export before each environment variable.

            the error changed:

            sqlplus "/as sysdba"

            ERROR:
            ORA-01031: insufficient privileges

            any idea?
            thanks
            • 3. Re: ORA-12162: TNS:net service name is incorrectly specified
              622858
              Hi,

              This may help..

              "Please run $ORACLE_HOME/install/changePerm.sh. This is if you want to invoke sqlplus from other than oracle unix account"
              • 4. Re: ORA-12162: TNS:net service name is incorrectly specified
                Hans Forbrich
                sqlplus "/as sysdba"
                The need to quote ended with 10g. Just to confirm that is not causing a problem, what happens when you do
                sqlplus / as sysdba
                1) no quote
                2) space before 'as'

                And ... which OS and which OS user are you using to log in? It looks like a *nix variant.  If so, typically only a member of the OSDBA group can use that  syntax.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                • 5. Re: ORA-12162: TNS:net service name is incorrectly specified
                  646563
                  Hello

                  I am also getting the same problem.
                  When i try to connect through sqlplus and enter the use name and password i get the same error. I did some of the steps but in vain.
                  i have installed Oracle on Enterprize Linux.
                  Please help.
                  Arif
                  • 6. Re: ORA-12162: TNS:net service name is incorrectly specified
                    491243
                    Hi!
                    We have the same problem. We have some DB running on Solaris and some running on Linux.
                    The '/ as sysdba' connection works on all Solaris Servers, but on none of the Linux Systems.
                    We found out that if you change the oracle user to use dba as the primary group instead of oinstall it works - but this does not seem to be the right solution.
                    Has anybody another suggestion?
                    KR Richard
                    • 7. Re: ORA-12162: TNS:net service name is incorrectly specified
                      656723
                      same issue happened on my box too.

                      i'm using solaris 5.10, ORACLE_HOME, ORACLE_OWNER, ORACLE_SID are set.

                      it is working ok when cd $ORACLE_HOME in OS.

                      but fail with same error when launching sql plus
                      • 8. Re: ORA-12162: TNS:net service name is incorrectly specified
                        485418
                        Same thing here.

                        Just finished installing 11g. Trying to start SQL*Plus but SQL*Plus returned "ORA-12162: TNS:net service name is incorrectly specified".

                        Solution: I was logged in as root when trying to launch SQL*Plus. Exited back to user oracle and got into SQL*Plus OK.

                        Hope this helps,

                        Gregory
                        • 9. Re: ORA-12162: TNS:net service name is incorrectly specified
                          Michael McLaughlin
                          That's interesting. I ran into the same thing when I was working with an Oracle Database 11g in a VM on my Mac. The problem was odd because tnsping worked but SQL failed. It turned out that I'd forgot to change the server's hosts file IP address but the DNS entry was valid. More here on my blog:

                          http://blog.mclaughlinsoftware.com/how-to-configure-mac-os-x-as-an-oracle-client/
                          • 10. Re: ORA-12162: TNS:net service name is incorrectly specified
                            669184
                            I had the same problem. I exited my shell and started a fresh one, and it worked.

                            Had the environment settings for ORACLE_HOME, PATH, ORACLE_SID in the .cshrc. I thought I had them set correctly in the shell but maybe not.

                            Anyways, if you get this it error it could be your environment variables.
                            • 11. Re: ORA-12162: TNS:net service name is incorrectly specified
                              ajay.nair
                              I manually started my listener by going to $ORACLE_HOME/bin $ lsnrctl and then LSNRCTL>start and then started my DB

                              Step1.
                              If you have multiple listeners, then go to .$ORACLE_HOME/network/admin/tnsnames.ora, if your listener name are LNSRXXX and LSNRYYY, and the DB uses LSNRYYY then,
                              LSNRCTL>start LSNRYYY
                              LSNRCTL> set current_listener LSNRYYY

                              If you have only the default listener then LSNRCTL>start would suffice

                              Step 2.
                              Next step set env variables , $ORACLE_HOME and $ORACLE_SID and finally start the db by

                              ORACLE_HOME/bin$./sqlplus /nolog
                              SQL>conn / as sysdba

                              Edited by: ajay.nair on Dec 21, 2009 5:15 PM

                              Edited by: user9931657 on Dec 21, 2009 5:46 PM