Inserting 1 Billion Rows in an Oracle Autonomous Database

 Oracle’s Autonomous Database recently scored highest in all four Use Cases in the 2020 Gartner “Critical Capabilities for Cloud Database Management Systems for Operational Use Cases” report. Oracle’s fully cloud native Autonomous Database comes in three flavours — Autonomous Transaction Processing (ATP), Autonomous Datawarehouse (ADW) & Autonomous JSON Database (AJD). With ATP being the database of choice for transactional OLTP like systems.


https://medium.com/oracledevs/inserting-1-billion-rows-in-an-oracle-autonomous-database-f9519902c9db

In this blog post we will stress test the Transaction Processing Autonomous instance using a PL/SQL loop of inserting 1 billion rows and selecting records from all_objects system table. Our test will be inserting about half a terabyte of transactional data to the lowest possible shape for Autonomous database. Even with such low specs the instance was hardly under any stress and blazed through the workload. So lets get started…

Setup

  1. First create an Autonomous Transaction Processing Database from the OCI console.

With the Always Free tier you are eligible to create one free Transaction processing and one free Data warehouse instance with 20G of storage.

2. Download the ATP Instance’s Wallet from “DB Connection” Tab

3. Download and Install SQLCL on your client machine or cloud instance from where you will run this test

4. Copy the Wallet file and connect to your Autonomous Database

5. Create the Test Table in the ATP instance.

I’m using the default ADMIN schema for my test but it is advisable to create a new schema and run it from there.

6. Run the PL/SQL block to Insert 1 Billion rows

Make sure to enter 1000000000 when prompted twice

Wait for the execution of the job to finish. It can take sometime depending on your instance size. In my case it took about 40mins to complete. So if your session might close, it will be better to save the PL/SQL block as a .sql file; hardcode l_rows and rownum and then run it in nohup mode.

Results

With just 1 ocpu and 1TB of storage it blazed through the workload. Overall it took 36mins to finish the select and insert for 1 billion rows.

This was just a quick and simple test to check the capabilities of the smallest possible ATP shape. Below is the SQL Monitoring report from the Autonomous DB Performance Hub.

SQL Monitoring Report

Just look at these numbers :

Rows Processed : 1,000M (1B)

Time to Complete : 36mins

IO Requests : 444K

IO Bytes : 458GB

Conclusion

The Oracle Autonomous Database has been named a Leader in 2020 for Gartner Magic Quadrant for Cloud Database Management Systems for a reason. Even with a quick test we can see the amount of performance which can be drawn from it. It is a visionary piece of technology which will change the landscape of Databases in the coming years for both Enterprises and SMEs.

Comments

Popular posts from this blog

Easy Text-to-Speech with Python

Flutter for Single-Page Scrollable Websites with Navigator 2.0

Better File Storage in Oracle Cloud