Use Bastion Service to Connect To Autonomous DB within a private subnet PLSQL DEVELOPER
- Personal Chao yu
- May 19, 2022
- 1 min read
Validate VCN security list ingression rule.
1. find your DB subnet
2. check security list settings
3. if not existing, add 1522

Create A Bastion in the same VCN or existing bastion in the same VCN where your Autonomous DB reside
1. create session

PORT : 1522
Add SSH KEY : on the machine where you would connect to the database, run(if you don't ssh key generated ever)
ssh-keygen
this should work on both win 10 onward and mac.
To validate if you have existing SSH keys
cd ~/.ssh
on MAC
cd C:\Users\<your_user>\.ssh
On Windows
If you see

You do NOT need to generate a new key. In this folder, we need the file *.pub. Open *.pub file and copy all and paste it into OCI.
Click Create session.
COPY SSH command start your connection

Click on three dots on the right => View SSH Command


Here change <privateKey> into the location where your private key located, this is the file next to *.pub, and change <localPort> to 1522. When copy this command, remember to add
-v
at the end. This will output logs on the console. Otherwise, you would not see any thing, which confused me a lot on the first try.

Keep the CLI running, here we are half way done
next we need to download db wallet and configure sqlnet and tns file locally.
Download DB wallet


Save the zip file and unzip it locally.
Place the file in oracle instantclient folder

1. Copy all tns settings from Wallet_APEXPROCDBS/tnsnames.ora to tnsnames.ora
2. Open sqlnet.ora in Admin folder, change the DIRECTORY and point it to your wallet folder

3. open tnsnames.ora in admin folder, and change host to localhost.

4.open PLSQL Developer and add new connection

Comments