Oracleのパスワードに"/"を入れたらsqlplusでログインできなくなった
概要
Oracleのパスワードに"/"を入れたらsqlplusでログインできなくなったので解決した話です。 パスワードは「test/test」と仮定しています。
詳細
どうやら、"/"があるとコマンドラインのオプションと思うようで以下のようなエラーになりました。 エスケープなど頑張ってみたのですがダメでした🤨
$ sqlplus testuser@db001 SQL*Plus: Release xx.x.x.x.x Production on xxxxxxxx Copyright (c) 1982, 2016, Oracle. All rights reserved. パスワードを入力してください: 【"test/test"を入力】 SP2-0306: オプションが無効です。 使用方法: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM|SYSRAC}] [edition=value]] 条件 <logon> ::= <username>[/<password>][@<connect_identifier>] <proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>] ユーザー名を入力してください:
解決策
sqlplus /nologでsqlplusに入り、connコマンドでログインする。
$ sqlplus /nolog SQL*Plus: Release xx.x.x.x.x Production on xxxxxxxx Copyright (c) 1982, 2016, Oracle. All rights reserved. SQL> conn testuser/"test/test"@db001 接続されました。 SQL>
ログインできたらpasswordコマンドでパスワードを変えると良いと思います。僕は速攻で変更しました:relaxed:
最後に
解決できるまで、"/"をパスワードいれた自分の未熟さを恨みました😅