October 25, 2022

How to Provision a Compute Linux Instance in OCI

 Hi All,

This blog post will show you how to launch an OCI Compute Instance.

Once you log in to the OCI Cloud using your tenancy, click on compute on the top left side and then Instance as shown below.


After you click on the instance it will take you to the create instance page see below.


Once you click on the create instance button it will ask you to fill in details like
Instance Name
Choose Compartment
Choose AD (Availability Domain) 
Fault Tolerant
Shape and OS 
Networking 

 



From the above screenshot, you can see that you can add an SSH key or OCI will generate for you, so you can choose anyone.
If you choose the option "Generate SSH key", download it because it is used for logging in to the server.


Once you have done with all the details click on create, it will be in a Provision state.
After a while, the Compute Instance will be up and running as shown below in the Screenshot.






You have successfully created a Compute Instance in OCI.
You can start, stop, reboot, and terminate a Compute Instance from OCI Console.

Thanks for reading.

Regards
Shaik Ahmed Ali

 

October 24, 2022

ORA-02085: database link String connects to string

 Hi Everyone,

after creating the database link, I was trying to fetch record from the remote database server but receive the following error as below 

ORA-02085: database link String connects to String

Solution:

Description

ORA-02085: database link string connects to string

Cause:

a database link connected to a database with a different name. The connection is rejected.

Action:

create a database link with the same name as the database it connects to or set global_names=false.



If the global_names is set to TRUE, then run the below command:


Alter system set global_names=FALSE scope=both;


then recreate the database link.


It worked for me.


Hope the Solution worked for you as well.


Thanks for reading 

Shaik Ahmed Ali


October 16, 2022

About Oracle Autonomous Database on OCI

 In this article, I will explain you about the new database service which is Autonomous database (ADB) in OCI.

Oracle Cloud provide a new set of databases as a service called the Autonomous. it is a part of database which can automate the DBA administration task such as creation, patching, upgrade, performance tuning, backups and daily maintenance task while the database is up and running.

Oracle Autonomous is a cloud database which uses machine learning to automate database management task traditionally perform by DBAs.

With Oracle Autonomous database, oracle makes it easy and quick for you to have a secure, fully managed, database service in oracle cloud.

In Oracle Cloud Infrastructure (OCI), Autonomous Database comes with 3 varieties of DB.

 a) Oracle Autonomous Transaction Processing (For Transaction Processing Workloads)
b) Oracle Autonomous Database Warehouse (For Data Warehouse Workloads)
 c) Oracle Autonomous JSON Database (For NoSQL Database which uses JSON)


Autonomous database is available on Oracle Cloud Infrastructure (OCI) for shared and dedicated deployments as describe below and On-premises as Exadata Cloud@Customer and dedicated region as Cloud@Customer.

Dedicated Infrastructure: 

If Autonomous database is deployed on dedicated Exadata infrastructure it uses its own Exadata rack minimum quarter rack. A completely dedicated compute, storage, network and database service for only a single tenant.

Shared Infrastructure: 

A simple and elastic choice. oracle autonomously operated all aspects of database.
if Autonomous database is deployed on a shared Exadata infrastructure, then oracle charged you as per OCPU and Storage actively used. 

Cloud@Customer:

The Cloud@Customer means an autonomous database on dedicated Exadata infrastructure in customer datacentre.

Features of Oracle Autonomous Database:

The Autonomous Database is revolutionizing database which fully automates the management of database lifecycle and enables you to pay less and ensure data safety when compared to traditional database.

You have auto indexing feature in oracle autonomous database which ensures you to provide a better execution plan to optimizer for executing the SQL by monitoring the application workloads and creating, maintaining the index automatically. Auto indexing is disabled by default in ADB.

To enable the auto indexing feature, use the below command:

EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_MODE','IMPLEMENT').


In Oracle Cloud Infrastructure (OCI) you have an auto scaling feature for ADB as well where you can scale in or scale out the OCPU and shrink the Storage according to your workload as shown in below screen shot.    




The Autonomous database is a self-driving, self-secure, self-tuning, self-repairing, and self-scaling.  


How do you migrate On-Prem Database to Autonomous Database (OCI)? 

Premigration Steps/Tasks:
 
During migration legacy features automatically get replaced, some of them are listed below.


Also, oracle provide us with a tool called Cloud Premigration Advisor Tool (CPAT).
by running the CPAT against the source database it will validate all the objects, parameters and features and generate a report in text or JSON format and make ensure it is ready for ADB. if you find any error or red flag, please resolved it before migration.

Migration Methods for ADB:

First of all, when it comes to autonomous database all migration is logical, it means you are migrating the data not the database so TTS and RMAN are not available for the migration.

There are many ways to migrate on-prem database to oracle cloud (OCI) according to your data size, some of them are:

1) Data pump ( expdp/impdp)
2) Move To Autonomous Database (MV2ADB) Tool.
      The Move to Oracle Autonomous Database (MV2ADB) tool is designed to enable you to quickly upload source file to the cloud and supports Oracle Cloud Infrastructure APIs and command-line interface (oci-cli).
3)SQL Developer
4)SQL Loader
5)Zero Downtime Migration (ZDM).
6) Database Migration Service (OCI).

Database Migration service is a fully managed, easy to use database migrations into oracle cloud.


Thank you all for reading my blog on Autonomous Database (ADB). 

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.








December 26, 2020

Step by step to configure the Oracle dataguard in 19c

 Hi in this blog I will demonstrate step by step procedure to set up the Dataguard in 19c using an Active data guard without backup.

Let's start the preparation:

My Environment:


On Primary Side:

first, let's Check the Archive log enable or not 

It enables and now checks the force logging is enabled or not:

Now I have also enabled the force logging  as shown in the above screen

Adding the standby redo log files(SRL)


Now, setup the data guard parameter on the primary side:


Adding the tns entry and listener file 


My tnsnames.ora looks like as above and tnsping result below


Creating the Password file and pfile for standby in the primary



Let's copy the password file,tnsnames. ora and pfile to the standby database.


On the Standby Side

After copying the files to the standby let's edit the pfile and create the required directory for the instance to start.




As per the above SS, we have created the directory structure now move the other two file which is tnsnames. ora and password file to there location


Now let's start the standby database in nomount using the pfile we edited.


Connect to RMAN and start duplicating the database using the below command:

duplicate target database for standby from active database nofilenamecheck;





Yes we have finished the duplication and now start the Managed recovery process(MRP) to start the redo apply, let's check it


and now enable the parameter  "log_archive_dest_state_2" in the primary and move the logfiles.
yes, it's applying now perform the archive log switch and check if it's applying or not .




It's applying the redo logs and the data guard is sync using SQL Apply.
Thank you for reading and feedback appreciated.











December 16, 2020

Upgrade Oracle 12c to 19c using autoupgrade utility

Upgrading a database is always a big task for every DBA in this world but this time Oracle introduces a new feature in 19c for an upgrade which is called "Autoupgrade Utility". 

More details on the autoupgrade utility you can find HERE.

Supported version for upgrade:

As a source database, you should have a minimum of 11.2.0.4 
and as a target, you can upgrade to 19.3.0,18.5.0,12.2.0.1 with Jan 2019 RU

In this article, I will demonstrate how to upgrade the database from 12.1.0.2 to 19.3.0 using the autoupgrade utility.

Steps for Upgrade:

  • Install 19c database binaries. 
  • Download the latest autoupgrade.jar file from Oracle supports MOS Document 2485457.1.
  • Create a Config file for the upgrade process.
  • Analyze the database using a config file created.
  • Deploy the actual upgrade process.

Let us start the Practical:

  • Install Oracle 19c database Binaries: 
               Just for time-saving, I have already installed the oracle 19c binaries, which you can find HERE.
  • Download the latest autoupgrade.jar file and replace it with the default one as below

After replacing let's confirm the version as below SS.


For an upgrade, the java version should be 1.8 which is available in "ORACLE_HOME/jdk/bin" so just check the version of java.



  • Create the Config file for the DB upgrade as below.

Before creating a config file let's create a directory which holds all the logs file of the upgrade process.

Sample of the config file in which we need to fill the information of the source and target database for an upgrade.

Now let's edit the config file according to our needs as below, as I have only 1 database to be upgraded so updated only 1, if you have 2 databases that need to upgrade you can edit "database number 2" in the config file.  


From the above SS, I have edited the config file.

  • Time for database analysis let's do it using the below command:
$ORACLE_HOME/jdk/bin/java -jar $ORACLE_HOME/rdbms/admin/autoupgrade.jar -config conifgfilename -mode analyze 


From the above SS, we have done the ANALYZE of the source database now check the logs 
you can find the logs at the location shown in the below SS.


Now open the Html file using firefox as below and read the file 



From the above Html, it shows 1 error which is about the archive log disable 



Enable the archive log mode as below SS, also gather statistics.



  • Time for the actual upgrade (DEPLOY mode)
Now we are ready for the actual upgrade of the database let's do it

$ORACLE_HOME/jdk/bin/java -jar $ORACLE_HOME/rdbms/admin/autoupgrade.jar -config conifgfilename -mode DEPLOY

set the environment to 19c oracle home and run the upgrade in deploy mode
Before running the upgrade make sure the PDB is on read-write mode otherwise, the upgrade will fail as below


let's run the upgrade after the environment set:



My upgrade got failed at the PRECHECKS let's see the log file what is the root cause of the failure.


from the above log file, I found the MIN_RECOVERY_AREA_SIZE error so I increase the db_recovery_file_dest_size which solve my issue 



 
we have some commands to monitor the status of upgrade using 

1) lsj
2) status



After upgrade, it's compiling the CDB$ROOT


Now it is started the PDB$SEED and pluggable database upgrade 



After the upgrade, it starts POSTCHECKS as shown in the above SS.




The database has been successfully upgraded using the autoupgrade utility and took 4.5 hours 

Now we will check is the time version upgrades and drop the restored point 


From the above time zone has been upgrade 



we have checked the status of the database and drop the GRP successfully.

If you want to change the compatible parameter please change it from 12c to 19c as below



Thank you for reading and feedback appreciated.
Hope this article helps you in upgrading the database using autoupgrade utility

Regards

Shaik Ahmed Ali