7
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【ADB】Autonomous DatabaseへSQL Plusで接続

Posted at

Walletを使ってSQL PlusでADBに接続する

  • データベース接続からWalletをダウンロード

image.png

  • 鍵を格納して解凍する
unzip Wallet_ADB02apex.zip
Archive:  Wallet_ADB02apex.zip
  inflating: ewallet.pem
  inflating: README
  inflating: cwallet.sso
  inflating: tnsnames.ora
  inflating: truststore.jks
  inflating: ojdbc.properties
  inflating: sqlnet.ora
  inflating: ewallet.p12
  inflating: keystore.jks
  • TNS_ADMIN 環境変数にウォレットの保存先を設定
export TNS_ADMIN=<パス>
  • sqlnet.ora の設定確認

ウォレットの場所が環境変数 $TNS_ADMIN を使うように変更します。

変更前
WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="?/network/admin")))
変更後
WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY=$TNS_ADMIN)))
  • sqlplusの準備

既にインストールされているか確認

sqlplus -V

無ければインストール

sudo dnf install -y oracle-instantclient-basic oracle-instantclient-sqlplus
  • sqlplus への接続

以下の形式で接続します。

sqlplus <ユーザー名>/<パスワード>@<サービス名>

接続できました!

SQL*Plus: Release 21.0.0.0.0 - Production on Wed Aug 20 11:28:53 2025
Version 21.19.0.0.0

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

Last Successful login time: Wed Aug 20 2025 08:27:40 +00:00

Connected to:
Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems
Version 23.9.0.25.08

参考

7
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?