Rules and Limitations
Note some of below rules and limitations of creating DB link from ADB:
- The target databases (non-ADB) should be configured to use TCP/IP with SSL (TCPS) authentication
- The allowed DB port range is 1521-1525 to ensure the security. You can define the port while creating the DB link
- ADB DB link support databases that are only accessible through a public IP or public hostname
- One directory restricted to one wallet file. Create multiple directories to keep multiple wallet files of multiple databases
- Supported target database versions are 184.108.40.206, 220.127.116.11, 18.104.22.168, 18c and 19c.
Creating DB link from Autonomous Database
Now let's walk through DB link creation procedure from an Autonomous database. As mentioned, you should use DBMS_CLOUD_ADMIN.CREATE_ DATABASE_LINK procedure on ADB. Below steps describe the required procedure:
- Copy your target database wallet file (cwallet.sso) which contains target database certification to an object store
- Using DBMS_CLOUD.CREATE_CREDENTIAL procedure, create access credentials to the object store where the target wallet file is stored.
- Upload the target database wallet file from Object store to database directory using the DBMS_CLOUD.GET_OBJECT procedure. Refer example below:
-- DATA_PUMP_DIR is the predefined/default directory. It can be another DB directory. /
- Create credentials on ADB, refer below example:
Details are stored in the database in encrypted format.
You can use the query below to list the stored credentials:
credential_name, username, comments all_credentials;
- You can use below command to drop credentials from the database:
- Now we are ready to create database link from Autonomous database. Use the example below to create:
If you are not an admin privileged user, get the permission to run DBMS_CLOUD_ADMIN.CREATE_DATABASE_LINK procedure.
Now, you can use the DB link from ADB to the target database.
To drop DB link from ADB, you can use the example below:
Creating DB link to ADB
We have learned so far how to create a DB link from ADB to target database. This section will zip through DB link creation to ADB.
As I have mentioned my previous blog entry that ADB only accepts secured client connections. To which, you will have to download client connect credentials. You can refer my previous blog post for the procedure.
Before creating database link, ensure the following is met:
- Download the client connect credentials
- Unzip the downloaded file to a secure location your computer
- Turn of GLOBAL_NAMES parameter using 'ALTER SYSTEM SET GLOBAL_NAMES=FALSE';
- Using below example, create a db LINK ADB:
LINK DBL_TO_ADB SYEDJ welcome1 ;
At this point in time the DB link is ready.
In nutshell, this blog post explained the do's and don'ts of creating DB link from/to ADB.