It seems an odd thing that so many facilities on the cloud environment take advantage of the concept of stored database credentials when it comes to authenticating/authorising access to those facilities, but a database link on your on-premise database typically will still require the username and password hard-coded as part of the DDL in the CREATE DATABASE link command. That creates a nuisance when you are wanting to deploy scripts securely.

But you’ll be pleased to know you can now also use a stored credential for your database links, eg

SQL> exec dbms_credential.create_credential('SCOTT_CRED', 'SCOTT', 'tiger') PL/SQL procedure successfully completed. SQL> create database link mydblink connect with SCOTT_CRED using 'pdb21a'; Database link created. SQL> select * from dual@mydblink; D - X SQL>

Full disclosure: The capability actually arrived in 21c, but since 99% of you are on 19c it is likely the first time you can start to take advantage of it is once you upgrade to 26ai.

Similarly, there is probably a huge stack of other 21c features that you’ve never explored, that its probably time to go back and take a look at as you plan your upgrades to 26ai.

Enjoy!

3 responses to “26ai Quick Tip for Database Links”

  1. Hemant K Chitale Avatar
    Hemant K Chitale


    That’s a good change !

  2. Connor, I could not find any reference for credentials in dbms_metadata…. is there a way to pull them ?

    1. I dont know – I will ask around, but that would seem like a security risk to be honest

Leave a Reply to ChrisCancel reply

Trending

Discover more from Learning is not a spectator sport

Subscribe now to keep reading and get access to the full archive.

Continue reading