top of page

DBA Scripts

Script to create JUSTLEE schema in Oracle

Here is the script to create JUSTLEE schema in Oracle

Script to create JUSTLEE schema in Oracle

Find Invalid Objects Inside Oracle

Changing things in database can cause some objects to become INVALID. Query to check invalid objects in oracle SELECT OWNER, OBJECT_TYPE,...

Find Invalid Objects Inside Oracle

Find SQL Id of the Statement You Just Ran

While connected to the database, you might want to know the sql id of the query you just ran (in your own session, not some other...

Find SQL Id of the Statement You Just Ran

Find Current Session SID in Oracle

Sometimes when you are connected to Oracle database, you might need to find your own session SID and serial number. Below are the two...

Find Current Session SID in Oracle

Grant Select on all tables in a schema

I encountered this situation where I wanted to grant SELECT on all the tables owned by one user to another user. There are two simple...

Grant Select on all tables in a schema

Find Session Id Running Specific Query

At times DBAs need to find or search for session details that are running a specific query inside database. Example, you might want to...

Find Session Id Running Specific Query

Script to create HR schema

I was working on a database connected via SQL developer and could not find HR schema. I wanted to create the HR schema using SQL queries....

Script to create HR schema

Check table size in oracle

Once you run the query, it will ask your table name. Enter the table name in the format of owner.tablename. Eg – scott.emp select...

Check table size in oracle

Find scheduler jobs in oracle

The below command will help you check Scheduler jobs that are configured inside database SELECT JOB_NAME, STATE FROM DBA_SCHEDULER_JOBS...

Find scheduler jobs in oracle

Last modified table

As a DBA, application team sometimes might ask you to provide details of last modified table in oracle. The table modification can be...

Last modified table

Check FRA location utilization

Fast Recovery Area must be monitored regularly. Sometimes FRA runs our of space and a DBA must be able to gather FRA space utilization....

Check FRA location utilization

Display time in a Date column

By default, when you query a date column, oracle will only display dates and not time. Below query enables Oracle to display both date...

Display time in a Date column
bottom of page