8 Replies Latest reply on Mar 10, 2015 11:51 AM by Laurent Schneider

    sqsql gives error 0

    Laurent Schneider

      C:> sqlplus scott/tiger@db01

       

      SQL*Plus: Release 12.1.0.2.0 Production on Di Dez 9 11:37:03 2014

       

      Copyright (c) 1982, 2014, Oracle.  All rights reserved.

       

      Last Successful login time: Di Dez 09 2014 11:36:22 +01:00

       

      Connected to:
      Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
      With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

       

      SQL> quit
      Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
      With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

       

      C:> sdsql scott/tiger@db01

       

      sdsql: Release 4.1.0 Beta on Di Dez 09 11:37:17 2014

       

      Copyright (c) 1982, 2014, Oracle.  All rights reserved.

       

      Error starting at line : 0 in command -
      connect scott/tiger@db01
      Error report -
      Connection Failed

      I cannot get this tool working. Any hint?

        • 1. Re: sqsql gives error 0
          Laurent Schneider

          it works with

           

          sdsql -oci scott/tiger@db01

          • 2. Re: sqsql gives error 0
            Turloch O'Tierney-Oracle

            Hi Laurent,

             

            If you want to connect non oci the options include:

            tnsnames.ora alias scott/tiger@db01 where db01 is set on ORACLE_HOME\network\admin\tnsnames.* or TNS_ADMIN\tnsnames.*

            ezconnect host:port/Servicename scott/tiger@localhost:1521/db01

            or $TWO_TASK (non windows) or %LOCAL% (windows) [set LOCAL/TWO_TASK] then scott/tiger

            (We do not currently have HOSTNAME resolution method on thin driver)

            Logged bug:

            Bug 20181262 - HOSTNAME RESOLUTION METHOD FOR THIN NOT AVAILABLE

            Turloch,

            SQLDeveloper team

            • 3. Re: sqsql gives error 0
              Rajeshwaran, Jeyabal

              Again I don't work with TNS entries added. but the same is working in SQL*Plus ( I am Windows 7 64bit connecting to 12.1.0.2 )

               

              D:\app\SQL_Developer_4.1_EA\sdsql\bin>sdsql -oci rajesh/oracle@pdb1

              sdsql: Release 4.1.0 Beta on Tue Dec 09 20:20:33 2014

              Copyright (c) 1982, 2014, Oracle.  All rights reserved.

               

              Error starting at line : 0 in command -
              connect rajesh/oracle@pdb1
              Error report -
              Connection Failed
              D:\app\SQL_Developer_4.1_EA\sdsql\bin>sqlplus rajesh/oracle@pdb1

              SQL*Plus: Release 12.1.0.2.0 Production on Tue Dec 9 20:21:52 2014

              Copyright (c) 1982, 2014, Oracle.  All rights reserved.

              Last Successful login time: Tue Dec 09 2014 17:39:37 +05:30

              Connected to:
              Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
              With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

              rajesh@PDB1>

              • 4. Re: sqsql gives error 0
                Turloch O'Tierney-Oracle

                Hi Laurent and Regeshwaren,

                 

                Please confirm: Is the connection failed because hostname connection is not supported?

                Where does the service name come from if you use EZConnect i.e.host:port/service

                is a default configured or do you use the host name?

                 

                Error starting at line : 0 in command -
                connect scott/tiger@db01
                Error report -
                Connection Failed

                Note

                -optl

                if you use the -optl (OPTional Logging) flag it will echo out the urls it is trying,

                 

                show jdbc

                show jdbc will give the url that the connection is using if you successfully connect.

                 

                -Turloch O'Tierney

                SQLDeveloper Team

                1 person found this helpful
                • 5. Re: sqsql gives error 0
                  laurentschneider-JavaNet

                  Hi

                   

                  Thanks for the hint. It is very usefull to use -optl. It also shows that sqlplus differs from sdsql in tnsadmin resolution

                   

                  When using advanced feature like LDAP or SSL, it does not work properly without the oci.

                   

                  Here is my output with oci

                   

                  SQL> show jdbc
                  -- Database Info --
                  Database Product Name: Oracle
                  Database Product Version: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
                  With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
                  Database Major Version: 12
                  Database Minor Version: 1
                  -- Driver Info --
                  Driver Name: Oracle JDBC driver
                  Driver Version: 12.1.0.2.0
                  Driver Major Version: 12
                  Driver Minor Version: 1
                  Driver URL: jdbc:oracle:oci8:@db01
                  

                   

                  Please bring us some meaningfull error message like ORA-1017 or ORA-12154

                   

                  If the password is expired (ora-28001), prompt for a new password

                   

                  sqlplus scott/tiger
                  
                  SQL*Plus: Release 12.1.0.1.0 Production on Tue Dec 16 16:42:31 2014
                  
                  Copyright (c) 1982, 2013, Oracle.  All rights reserved.
                  
                  ERROR:
                  ORA-28001: the password has expired
                  
                  
                  Changing password for scott
                  New password:
                  


                  Thanks

                  Laurent

                  • 6. Re: sqsql gives error 0
                    Turloch O'Tierney-Oracle

                    Hi Laurent,

                     

                    Password is expired - you are correct is in SQLDeveloper not in sdsql.

                     

                    LDAP - you are correct, LDAP search (OID) is in SQLDeveloper, not explicitly in sdsql default/thin(not oci).

                     

                    If you want to try thin ldap syntax (we do not automate this)  the information is in LDAP.ora:

                      https://docs.oracle.com/cd/B28359_01/network.111/b28317/ldap.htm#NETRF011

                    Thin syntax:

                      http://docs.oracle.com/cd/B28359_01/java.111/b31224/urls.htm#CHDBICFA

                    From the documentation:

                    >An example of database specifier using the Lightweight Directory Access Protocol (LDAP) syntax is as follows:

                    "jdbc:oracle:thin:@ldap://ldap.acme.com:7777/sales,cn=OracleContext,dc=com" 

                    >When using SSL, change this to:

                    "jdbc:oracle:thin:@ldaps://ldap.acme.com:7777/sales,cn=OracleContext,dc=com" 

                    i.e. sdcli scott/tiger@ldap://host:port/entry,context

                    it should pass through the url details to the thin driver:

                    i.e.

                    sdsql -optl scott/iger@ldaps://ldap.acme.com:7777/sales,cn=OracleContext,dc=com

                    ...

                    INFO: Attempting to connect using URL= "jdbc:oracle:thin:@ldaps://ldap.acme.com:

                    7777/sales,cn=OracleContext,dc=com"

                    (You can put it as a tnsnames.ora entry)

                     

                    For completeness:

                    Thick LDAP 'url' syntax  is different - however if you have the right oci version (and the LDAP configured (i.e. sqlplus LDAP works))

                    it should work the same as sqlplus, as you have mentioned above.

                     

                    Turloch

                    -SQLDeveloper Team

                    1 person found this helpful
                    • 7. Re: sqsql gives error 0
                      Laurent Schneider

                      Thanks, I am not using anonymous ldap, I need the authenticated part of it (names.ldap_authenticated_bind=true), and I am not using OID (but AD)

                       

                      oci is just working fine

                      • 8. Re: sqsql gives error 0
                        Laurent Schneider

                        sql still not prompting for password change in EA2

                        sql -oci x/x@db01
                        SQLcl: Release 4.1.0 Beta on Di MΣr 10 12:33:36 2015
                        Copyright (c) 1982, 2015, Oracle.  All rights reserved.
                        USER          = x
                        URL           = jdbc:oracle:oci8:@db01
                        Error Message = ORA-28001: the password has expired