0 Replies Latest reply: Jun 26, 2013 3:31 AM by mbreply RSS

    SQLPLUS TNS Problem

    mbreply

      Hi

       

      I have a fresh installation of Oracle 11g XE on Fedora 18 64bit.

      I installaed everything with rpm package downloaded directly from oracle websites:

      oracle-xe-11.2.0-1.0.x86_64.rpm

      oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm

      oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm

      I completed the installation, the server started, etc ...

       

      Later I have installed SQLDeveloper and configured tnsnames.ora with other database in my intranet and I can connect using the tnsconnection successfully.

       

      Then I tried to connect to the same database with sqlplus but don't work. I tried to google up the problem but I haven't found any solution

      $ sqlplus GOOFY/GOOFY@DISNEYDB
      
      SQL*Plus: Release 11.2.0.2.0 Production on Wed Jun 26 10:04:00 2013
      
      Copyright (c) 1982, 2011, Oracle.  All rights reserved.
      
      ERROR:
      ORA-12546: TNS:permission denied
      
      
      Enter user-name:
      

      I tried other syntaxes as well

      $ sqlplus GOOFY/GOOFY@DISNEYDB
      
      $ sqlplus GOOFY/GOOFY@//db1.disney.prv:1531/DISNEYDB
      
      $ sqlplus 'GOOFY/GOOFY@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db1.disney.prv)(PORT=1531))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=DISNEYDB)))'
      

      For every test I get the same error: ORA-12546: TNS:permission denied

       

      Test mad with tnsping confirm the correct syntax of tnsnames.ora

      $ tnsping DISNEYDB 
      
      TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 26-JUN-2013 10:15:55
      
      Copyright (c) 1997, 2011, Oracle. All rights reserved.
      
      Used parameter files:
      
      
      Used TNSNAMES adapter to resolve the alias
      Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = db1.disney.prv)(PORT = 1531)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = DISNEYDB)))
      OK (50 msec)
      

       

      I tried to strace both process and I got this:

      tnsping:

      $ strace tnsping DISNEYDB 2>&1 | grep tnsnames
      access("/home/myself/.tnsnames.ora", F_OK) = -1 ENOENT (No such file or directory)
      access("/etc/tnsnames.ora", F_OK) = -1 ENOENT (No such file or directory)
      access("/u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora", F_OK) = 0
      stat("/u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora", {st_mode=S_IFREG|0755, st_size=15124, ...}) = 0
      open("/u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora", O_RDONLY) = 3
      read(3, "# tnsnames.ora Network Configura"..., 4096) = 4096
      

      sqlplus:

      $ strace sqlplus GOOFY/GOOFY@DISNEYDB 2>&1 | grep tnsnames
      "/home/myself/.tnsnames.ora", F_OK) = -1 EACCES (Permission denied)
      "/etc/tnsnames.ora", F_OK) = -1 ENOENT (No such file or directory)
      "/u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora", F_OK) = 0
      "/u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora", process_vm_readv: Operation not permitted
      "/u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora", O_RDONLY) = 8
      "# tnsnames.ora Network Configura"..., 4096) = 4096
      "/u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora", process_vm_readv: Operation not permitted
      ^C
      

       

      Last but not least if I try to connect to the XE istance on localhost sqlplus work fine

      $ sqlplus SYS/myxepwd@XE AS SYSDBA
      
      SQL*Plus: Release 11.2.0.2.0 Production on Wed Jun 26 10:26:07 2013
      
      Copyright (c) 1982, 2011, Oracle. All rights reserved.
      
      
      Connected to:
      Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
      
      SQL>
      

       

      I'm out of option and I don't know where to look anymore.

      Can you help me get sqlplus work?

      Thanks