【Oracle Cloud】ORA-28001: the password has expiredの際の対処方法【Oracle Autonomous Database】
Oracle Cloudで稼働させているOracleDBがパスワードの有効期限切れで落ちるようになっていたので、対処方法をメモ。
sqlplusのインストール
yum
でsqlplus
をインストールします。
バージョンは使用しているDBと同じものを選択してください。
[opc@xxxxx ~]$ yum search sqlplus /usr/lib/python2.7/site-packages/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release. from cryptography import x509 読み込んだプラグイン:langpacks, ulninfo ===================================================================================== N/S matched: sqlplus ====================================================================================== oracle-instantclient12.2-sqlplus.x86_64 : SQL*Plus for Instant Client. oracle-instantclient18.3-sqlplus.x86_64 : SQL*Plus for Instant Client. oracle-instantclient18.5-sqlplus.x86_64 : SQL*Plus for Instant Client. oracle-instantclient19.10-sqlplus.x86_64 : Oracle Instant Client SQL*Plus package oracle-instantclient19.11-sqlplus.x86_64 : Oracle Instant Client SQL*Plus package oracle-instantclient19.12-sqlplus.x86_64 : Oracle Instant Client SQL*Plus package oracle-instantclient19.13-sqlplus.x86_64 : Oracle Instant Client SQL*Plus package oracle-instantclient19.14-sqlplus.x86_64 : Oracle Instant Client SQL*Plus package oracle-instantclient19.15-sqlplus.x86_64 : Oracle Instant Client SQL*Plus package oracle-instantclient19.3-sqlplus.x86_64 : Oracle Instant Client SQL*Plus package oracle-instantclient19.5-sqlplus.x86_64 : Oracle Instant Client SQL*Plus package oracle-instantclient19.6-sqlplus.x86_64 : Oracle Instant Client SQL*Plus package oracle-instantclient19.8-sqlplus.x86_64 : Oracle Instant Client SQL*Plus package oracle-instantclient19.9-sqlplus.x86_64 : Oracle Instant Client SQL*Plus package Name and summary matches only, use "search all" for everything. [opc@xxxxx ~]$ yum install oracle-instantclient19.X-sqlplus.x86_64
sqlplusからパスワードを更新
以下のコマンドでパスワードを更新します。 更新後のパスワードで問題なく接続できることが確認できたら、作業は完了です。
[opc@xxxxx ~]$ sqlplus ADMIN/{パスワード}@xxxxxxxx0_high SQL> alter user {ユーザー名} identified by "{新しいパスワード}"; User altered. SQL> ALTER USER {ユーザー名} ACCOUNT UNLOCK; User altered. # 開発の現場では、あまりやらない方が良いかも SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; Profile altered. SQL> exit;