5 Verifying Your Private Endpoint

Create a test VM in the private endpoint subnet. Login to the VM and run the commands below to fetch ADW wallet and test Database connection using the wallet.

# Fetch wallet
$ export TOKEN="<OCI IAM OAuth Token>"
$ curl --location "https://<base-url>//api/data-pe/v1/fetch-credentials" \
    --header "Authorization: Bearer ${TOKEN}" \
    --header "Cookie: RGBUEnvironmentID=<CUSTOMER_RDS_ENVIRONMENT_NAME>" >
response.json 

# Store wallet and schema information
$ cat response.json | jq -r .wallet > wallet.json
$ cat response.json | jq -r .schemas > schemas.json
 
 
# Decode wallets
$ mkdir -p wallet
$ cat wallet.json | jq -r .README | base64 -d > wallet/README
$ cat wallet.json | jq -r '."cwallet.sso"' | base64 -d > wallet/cwallet.sso
$ cat wallet.json | jq -r '."ewallet.p12"' | base64 -d > wallet/ewallet.p12
$ cat wallet.json | jq -r '."keystore.jks"' | base64 -d > wallet/keystore.jks
$ cat wallet.json | jq -r '."ojdbc.properties"' | base64 -d > wallet/ojdbc.properties
$ cat wallet.json | jq -r '."sqlnet.ora"' | base64 -d > wallet/sqlnet.ora
$ cat wallet.json | jq -r '."tnsnames.ora"' | base64 -d > wallet/tnsnames.ora
$ cat wallet.json | jq -r '."truststore.jks"' | base64 -d > wallet/truststore.jks
 
 
# Update sqlnet.ora file with right wallet directory
# Example sqlnet.ora file
[opc@test ~]$ cat wallet/sqlnet.ora
WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="/home/opc/wallet")))
SSL_SERVER_DN_MATCH=no
 
 
# Get ADW schema username and password for the schema you want to connect
# Below is an example command to get mfcs_rds_custom user for MFCS schema in ADW
$ cat schemas.json | jq -r .mfcs_rds_custom
 
 
# Get ADW Instance Connection identifier from tnsnames.ora file
# Example DB conn identifier - qp4la9e4h50vgyxa_high
$ cat wallet/tnsnames.ora
 
 
# Try connecting to ADW Instance
$ sqlplus <USER NAME>@<ADW CONN IDENTIFIER>
# Example
[opc@test ~]$ sqlplus mfcs_rds_custom@qp4la9e4h50vgyxa_high
 
SQL*Plus: Release 21.0.0.0.0 - Production on Wed May 8 12:37:10 2024
Version 21.13.0.0.0
 
Copyright (c) 1982, 2022, Oracle. All rights reserved.
 
Enter password:
Last Successful login time: Tue May 07 2024 12:04:17 +00:00
 
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.23.0.1.0
 
SQL> select name from v$database;
 
NAME
---------
EZY1POD