0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Oracle Cloud] 複数の Autonomous Database に Regional Wallet で接続

Last updated at Posted at 2020-09-10

はじめに

Autonomous Database を複数稼働したときに、便利な Regional Wallet を紹介します。

通常の Instance Wallet では、1 Wallet ファイルに、1 Autonomous Database が紐づいています。1個の Autonomous Database に接続するだけのときは、Instance Wallet で十分です。2個以上の Autonomous Database を利用するときは、複数の Wallet ファイルを使わないといけないため、素直に設定が出来ません。

そこで、Regional Wallet を使うことで、同一の OCI アカウント、同一のリージョンの Autonomous Database に対して 1個の Regional Wallet ファイルで接続が出来ます。

異なる リージョンの場合は、別の方法が必要です。こちらを参考にしてみると良いと思います。

Regional Wallet Download

OCI Console の画面から、DB Connection を押します。

1599694081062.png

Regional Wallet を選択して、Download を押します。

1599694123351.png

Password を選択して、Download を押します。

1599694143692.png

Wallet ファイルを配置

ダウンロードしてきた Regional Wallet ファイルを配置します。そもそもの設定方法はこちら をご欄ください。

1599694253728.png

なお、tnsnames.ora には、次の設定が含まれています。SQL*Plus のログインに使用するため、見ておきましょう。

# 1台目
adwsugi_high = (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=adb.ap-tokyo-1.oraclecloud.com))(connect_data=(service_name=sya6vphk3pzlkhq_adwsugi_high.adwc.oraclecloud.com))(security=(ssl_server_cert_dn="CN=adb.ap-tokyo-1.oraclecloud.com,OU=Oracle ADB TOKYO,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))
adwsugi_low = (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=adb.ap-tokyo-1.oraclecloud.com))(connect_data=(service_name=sya6vphk3pzlkhq_adwsugi_low.adwc.oraclecloud.com))(security=(ssl_server_cert_dn="CN=adb.ap-tokyo-1.oraclecloud.com,OU=Oracle ADB TOKYO,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))
adwsugi_medium = (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=adb.ap-tokyo-1.oraclecloud.com))(connect_data=(service_name=sya6vphk3pzlkhq_adwsugi_medium.adwc.oraclecloud.com))(security=(ssl_server_cert_dn="CN=adb.ap-tokyo-1.oraclecloud.com,OU=Oracle ADB TOKYO,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))

# 2台目
db202009100320_high = (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=adb.ap-tokyo-1.oraclecloud.com))(connect_data=(service_name=sya6vphk3pzlkhq_db202009100320_high.adwc.oraclecloud.com))(security=(ssl_server_cert_dn="CN=adb.ap-tokyo-1.oraclecloud.com,OU=Oracle ADB TOKYO,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))
db202009100320_low = (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=adb.ap-tokyo-1.oraclecloud.com))(connect_data=(service_name=sya6vphk3pzlkhq_db202009100320_low.adwc.oraclecloud.com))(security=(ssl_server_cert_dn="CN=adb.ap-tokyo-1.oraclecloud.com,OU=Oracle ADB TOKYO,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))
db202009100320_medium = (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=adb.ap-tokyo-1.oraclecloud.com))(connect_data=(service_name=sya6vphk3pzlkhq_db202009100320_medium.adwc.oraclecloud.com))(security=(ssl_server_cert_dn="CN=adb.ap-tokyo-1.oraclecloud.com,OU=Oracle ADB TOKYO,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))

2つの Autonomous Database に対して接続を行います。まず、1つ目です。

admin@adwsugi_high

実行例です。事前に EXAMPLES テーブルを作成していたので、テーブル一覧が見えています。

Enter user-name: admin@adwsugi_high
Enter password:
Last Successful login time: Wed Sep 09 2020 23:36:12 +00:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.5.0.0.0

SQL>
SQL> select table_name from user_tables;

TABLE_NAME
--------------------------------------------------------------------------------
EXAMPLES
EXP_SD_46-13_35_26

SQL>

次に2つ目への接続です。

admin@db202009100320_high

実行例です。こちらは何もテーブルを作っていないため、表示されていません。

Enter user-name: admin@db202009100320_high
Enter password:
Last Successful login time: Wed Sep 09 2020 23:33:59 +00:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.5.0.0.0

SQL> select table_name from user_tables;

no rows selected

SQL>

参考URL

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?