Linux – Special Character in password

linuxoraclesqlplus

I'm Trying to connect to a remote DB using Sqlplus, but the password contains a special character (!).
The SID is working fine, but Sqlplus is complaining about it when I use the ! in the password

/usr/lib/oracle/18.3/client64/bin/sqlplus -s bloth/hods!@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=remoteServer)(Port=1521))(CONNECT_DATA=(SID=SUDFR)))

ORA-12505: TNS:listener does not currently know of SID given in connect

on the other hand, when I remove the special character I get

ORA-01017: invalid username/password; logon denied

any idea how to fix that?

Best Answer

Works with single quotes.

[oracle@o71 ~]$ sqlplus u1/u1!@(description=(address=(protocol=tcp)(port=1521)(host=o71.balazs.vm))(connect_data=(service_name=min18_o71)))
-bash: !@: event not found
[oracle@o71 ~]$ sqlplus 'u1/u1!@(description=(address=(protocol=tcp)(port=1521)(host=o71.balazs.vm))(connect_data=(service_name=min18_o71)))'

SQL*Plus: Release 18.0.0.0.0 - Production on Sat Mar 2 09:07:54 2019
Version 18.5.0.0.0

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

Last Successful login time: Sat Mar 02 2019 09:07:15 +01:00

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0

SQL>