May 4, 2021

How to create a database link in oracle database.

 Hi Everyone,

Database Link:

A database link is a schema object in one database that enables you to access objects on another oracle database.
the target database can be an oracle database or any ODBC compliant database such as MySQL and MS SQL(heterogonous service).

  we can create 2 types of database link:

1. Private 
2. Public

1.Private database link: 

 private database links are only visible to the owner of the link.

2.Public database link:

Public database links are the link that is visible to all the users in the database.

Let's Create a database link:

the command used to create a database link is the below:

CREATE DATABASE LINK dblink_Name
    CONNECT TO username IDENTIFIED BY password
    USING '(DESCRIPTION=
                (ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521))
                (CONNECT_DATA=(SERVICE_NAME=servicename))
            )';

another way to create is to add the target entry in tnsnames.ora file so the command is as below


CREATE DATABASE LINK dblink_Name
    CONNECT TO username IDENTIFIED BY password
    USING 'tnsnames';


If you want to create a public link just add the PUBLIC after create as below:

CREATE PUBLIC DATABASE LINK dblink_Name
    CONNECT TO username IDENTIFIED BY password
    USING '(DESCRIPTION=
                (ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521))
                (CONNECT_DATA=(SERVICE_NAME=servicename))
            )';


How to access the table or views on the remote database  let's see:

Select * from remotetable@dblinkname;

In this article, you learn how to create a database link.


Thank you for reading and feedback appreciated.



















January 6, 2021

How to Provision Autonomous Transaction Processing(ATP) database in OCI

 In this article, I am going to demonstrate the provision of an Autonomous Transaction Processing(ATP) database in OCI.

Before going to the provision let me give you a brief about the Autonomous Database.

Autonomous Database:

Autonomous Database provides an easy-to-use database that eliminates the administration of database as it can recover from any failure without downtime, can deliver fast query performance, we can also scale up and scale down the CPU and Storage instantly without downtime, can gather the statistics and optimize the database workload.

In OCI we have 2 types of Autonomous Database
  • Autonomous data warehouse (ADW)
  • Autonomous Transaction Processing (ATP)

Let's Start The Practical:


Login to the OCI Console and click on the top left side as shown in the below SS.



Now click on the Create Autonomous Database


Now Provide the details as shown above in the screenshot
  • Select Compartment 
  • Display Name
  • Database Name
  • Transaction Processing
  • Shared Infrastructure 


As per the above SS, you need to provide the following:
  • Select DB version, I have selected 19c
  • OCPU
  • Storage
  • Admin password required to login to the database.



From the Network access, you can select anyone from the above 
I recommend you to select the Virtual Cloud Network as it is more secure and allows access from the provided network or IP. 

If you select Virtual Cloud Network you need to provide the VCN, Subnet, and Network Security Group(NSG).

From licensed type select according to you like Bring Your Own License(BYOL) or License Included


You can also provide the tag from the advanced options
After all this information you provided select "Create Autonomous Database"



 

The above SS shows the ATP is Available and ready to access.
Thank you for reading the article and appreciate your feedback.