0

On a Ubunut machine, I use this command to connect to an Oracle 11g database with the 11g instant client:

sqlplus username/password@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = the.address.com)(PORT = theport)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = service.address.com)))

Which works fine… On Mac OS X Mountain Lion I could only get the instant client 10g (32bit version) running, which gives me this error when I try to connect using the same line:

-bash: syntax error near unexpected token `('

Did the syntax changed from 10g to 11g?

tamasgal
  • 24,826
  • 18
  • 96
  • 135

1 Answers1

2

You need to put quotes around the connect string, parenthesis can be interpreted by your shell otherwise.

Something like:

sqlplus user/pass@"(DESCRIPTION...)"
Mat
  • 202,337
  • 40
  • 393
  • 406
  • Oh man thanks ; ) Still confusing, I use BASH on both machines and it works on Ubuntu without parenthesis. – tamasgal Oct 21 '12 at 10:38
  • You've probably got one space "luckily misplaced" somewhere. You should not count on this working anywhere without quotes. – Mat Oct 21 '12 at 10:39
  • I thought it too, but the line works fine without quotes on Ubuntu – I copy&pasted it. However, I'll use quotes in future ; ) – tamasgal Oct 21 '12 at 10:54