0

I am using sqldeveloper to query database and export results to csv file. I need this file on daily basis so thought of creating bat file which can be scheduled on windows task scheduler. I was researching it and found I can use SQLcl to run my script to export the query data. But somehow I can't connect it and it gives me and error 'ORA-01017: invalid username/password;logon denied. Here is my connection properties from sql developer

enter image description here

Here is my command line:

sql testuser1/mypass@tstwd2.myhost.internal:1521/tst.internal

I have java development kit installed

enter image description here

Do I need anything for java? Or do I need any special rights to run sql command line?

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
mak101
  • 147
  • 1
  • 11
  • The error says your password is wrong – thatjeffsmith Jul 02 '20 at 18:57
  • Yes I know, but I am using correct password. Same password works with sqldeveloper – mak101 Jul 02 '20 at 21:10
  • Then it must be a different database – thatjeffsmith Jul 02 '20 at 23:06
  • How do I confirm if its different database of same database? Sorry I am new for command line operations :( – mak101 Jul 06 '20 at 15:14
  • there are only a few things that can explain your issue - your username is wrong, your password is wrong, you're not talking to the database you think you are...or your password is case sensitive and you're not typing it correctly, or it needs quoted – thatjeffsmith Jul 06 '20 at 15:25
  • I retype everything and confirmed few times what I am typing is correct, now I am getting this error: log4j: WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies)...Error Message - Listner refused the connection with the following error: ORA-12514, TNS:listener does not currently know of service requested in connect descriptor – mak101 Jul 06 '20 at 15:34
  • the service you're asking to connect to doesn't exist according to the listener you're trying to work with – thatjeffsmith Jul 06 '20 at 16:11
  • That is confusing, I am using same service name as in attached picture and as I said it connects fine with sqldeveloper, I am sure I am missing something here but can't figure out :( – mak101 Jul 06 '20 at 16:43

1 Answers1

0

Found the problem, my userid is in double quotes so I have to use escape sequence **\**, its working like a charm.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
mak101
  • 147
  • 1
  • 11