Making Oracle simple for you!

Simplifying Oracle learning by sharing knowledge with professionals across the globe

How to check biggest table in Oracle

As a DBA, you must keep an eye on the largest tables in the database. There are many things that get impacted with the largest objects like DB performance, growth, index rebuild etc. The below query gives you the top 10 largest tables in oracle database. Query to check top 10 largest tables in...

READ MORE

How to check database backups via sqlplus

Checking Database backups are one of the main focus areas of a DBA. Time to time, DBA needs to check database backup status and see if its completed, failed, running etc. Also, DBA must be able to get the backup start time, end time and even the backup size for reference purpose. The below query...

READ MORE

How to display date and time in query output

By default, when you query a date column, oracle will only display dates and not time. Below query enables Oracle to display both date and time for a particular session alter session set nls_date_format='dd-Mon-yyyy hh:mi:sspm'; Note – this is only session level query.

READ MORE

How to check scheduler jobs in Oracle

Below command will help you check Scheduler jobs which are configured inside database SELECT JOB_NAME, STATE FROM DBA_SCHEDULER_JOBS where job_name='RMAN_BACKUP'; Query to check currently running scheduler jobs SELECT * FROM ALL_SCHEDULER_RUNNING_JOBS; All the DBA Scheduler jobs create logs....

READ MORE

How to check datapump export progress

SELECT SID, SERIAL#, USERNAME, CONTEXT, SOFAR, TOTALWORK, ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE" FROM V$SESSION_LONGOPS WHERE TOTALWORK != 0 AND SOFAR <> TOTALWORK;

READ MORE

How to drop all schema objects in Oracle

The below script will drop all the objects owned by a schema. This will not delete the user but only deletes the objects SET SERVEROUTPUT ON SIZE 1000000 set verify off BEGIN FOR c1 IN (SELECT OWNER,table_name, constraint_name FROM dba_constraints WHERE constraint_type = 'R' and...

READ MORE

How to find memory used by Oracle

select decode( grouping(nm), 1, 'total', nm ) nm, round(sum(val/1024/1024)) mb from ( select 'sga' nm, sum(value) val from v$sga union all select 'pga', sum(a.value) from v$sesstat a, v$statname b where b.name = 'session pga memory' and a.statistic# = b.statistic# ) group by rollup(nm);

READ MORE

How to check last user login Oracle

While performing database audits, you might need to check who logged in last into the database. The query will help you find out last user who logged in to database select username, timestamp, action_name from dba_audit_session where action_name='LOGON' and rownum<10 and username not in...

READ MORE

How to check CPU cores in Linux

Command to check CPU info on Linux cat /proc/cpuinfo|grep processor|wc -l OR nproc --all OR getconf _NPROCESSORS_ONLN Command to check CPU info on Solaris psrinfo -v|grep "Status of processor"|wc -l Command to check CPU info on AIX lsdev -C|grep Process|wc -l Command to check CPU info on...

READ MORE

How to delete files older than X days in Linux

Find files older than X days and save ouput into a file The below Linux command will help you to find files older than 35 days in a specific directory path and save the ouput in backupfiles.log Here the directory we are searching is /backup/logs and -mtime specifies the modified time of a file....

READ MORE