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
FOR c1 IN (SELECT OWNER,table_name, constraint_name FROM dba_constraints WHERE constraint_type = 'R' and...
select decode( grouping(nm), 1, 'total', nm ) nm, round(sum(val/1024/1024)) mb
select 'sga' nm, sum(value) val
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);
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...
Command to check CPU info on Linux
cat /proc/cpuinfo|grep processor|wc -l
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...
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....
User below query to get the top wait classes in Oracle database
Select wait_class, sum(time_waited), sum(time_waited)/sum(total_waits)
Group by wait_class
Order by 3 desc;
From the above query, supply each wait class into below query to get the top wait events...
Whenever you want to invoke graphical interface in Linux, You must know how to set DISPLAY variable in order to open the GUI. Linux by default does not allow you to open any GUI (Linux Oracle Installer) until you enable the GUI display.
Enabling DISPLAY Variable
Use below command to enable Linux...
When you try to schedule backups under corntab as Oracle user, you might encounter crontab permission error
[[email protected] ~]$ crontab -l
cron/oracle: Permission denied
Resolving Crontab Permission Error
The error is because of permission issues on /usr/bin/crontab file. Login as root user...