top of page
DBAGenesis_png.png

DBA Scripts

Script to create JUSTLEE schema in Oracle

Here is the 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 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 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...

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...

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...

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....

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...

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...

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...

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....

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...

bottom of page