Category Oracle İntroduction

“Oracle Database Security with practice solution” books


Finally I would like to say I made it. First time in Azerbaijan , I published “Oracle Database Security with practice solution” books. I strongly recommend read it this book. I want to share my book free all to my colleagues.

Oracle Database Security with practice solution


Finally I would like to say I made it. First time in Azerbaijan , I published “Oracle Database Security with practice solution” books. I strongly recommend read it this book. I want to share my book free all to my colleagues.

29-10.2020 – Congratulations ! I’ve been promoted to Oracle Gold Badge


29-10.2020 – Congratulations ! I’ve been promoted to  Oracle Gold Badge 

29-10.2020 – Congratulations ! I’ve been promoted to Oracle Gold Badge


29-10.2020 – Congratulations ! I’ve been promoted to  Oracle Gold Badge 

Restoring a lost Datafile on a Standby Database and knowing about V$RECOVER_FILE


How to restore a lost datafile in the Standby [when there is no backup on the Standby server and no backup recently taken or planned on the Primary server] STDBYDB>sqlplus ‘/ as sysdba’ SQL*Plus: Release 19.0.0.0.0 – Production on Fri May 8 22:19:56 2020 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected […]

How to check last modified table in Oracle


As a DBA, application team sometimes might ask you to provide details of last modified table in oracle. The table modification can be insert, update or delete. Below queries get details of last or latest modifed table in oracle database. Run the queries depending upon the database version. Last modified table in oracle 10g and […]

How to check FRA location utilization in Oracle


Flash Recovery Area must be monitored regularly. Sometimes FRA runs our of space and a DBA must be able to gather FRA space utilization. It is very important to monitor space usage in the fast recovery area to ensure that it is large enough to contain backups and other recovery-related files. Below script gives you […]

Crontab error – Permission Denied


When you try to schedule backups under corntab as Oracle user, you might encounter crontab permission error [oracle@plcdbprod ~]$ crontab -l cron/oracle: Permission denied The error is because of permission issues on /usr/bin/crontab file. Login as root user and find the crontab permissions on /usr/bin/crontab [root@plcdbprod ~]# ls -l /usr/bin/crontab -rwxr-xr-x 1 root root 315432 […]

How to set DISPLAY variable in Linux


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. Use below command to enable Linux GUI interface at command prompt as […]

How to analyze wait events in Oracle


User below query to get the top wait classes in Oracle database Select wait_class, sum(time_waited), sum(time_waited)/sum(total_waits) Sum_Waits From v$system_wait_class 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 in database with respect to particular wait class Select a.event, a.total_waits, a.time_waited, […]

Find files older than 7 days and print output on screen


If you want to print files older than 7 days on screen and do not want to save it into a file, use below command find /backup/logs -type f -mtime +7 -print Find files in current directory older than 28 days and remove them Below linux command will and all the files under current location […]

How to delete files older than X days in Linux


Find fles older than X days and save ouput into a file: The below Linux command will help you to and 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 speci􀁓es the modifed time of a file. We […]

Oracle 19c Active Data Guard-DML Redirection


Oracle Database Relase 19c New Features You can perform Sql and Pl/sql operations in Active data Guard standby database Allows DML to be execute against the standby database Set the ADG_REDIRECT_DML initialization parameter to TRUE Primary side [oracle@dev19c admin]$ export ORACLE_SID=anarai [oracle@dev19c admin]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 – Production on Sat Oct […]

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 HP/UX ioscan -C processor | grep processor | […]

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 (‘SYS’,’DBSNMP’,’DUMMY’,’SYSTEM’,’RMAN’);

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);

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);

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 owner=upper(‘&shema_name’)) LOOP EXECUTE IMMEDIATE ‘ALTER TABLE ‘||’ “‘||c1.owner||'”.”‘||c1.table_name||'” DROP CONSTRAINT […]

How to check datapump export progress


Sometimes when you run datapump export, it might take a lot of time. Meanwhile client might ask you for the % of export completed. Use below query to get the details of how much % export is done. SELECT SID, SERIAL#, USERNAME, CONTEXT, SOFAR, TOTALWORK, ROUND(SOFAR/TOTALWORK*100,2) “%_COMPLETE” FROM V$SESSION_LONGOPS WHERE TOTALWORK != 0 AND SOFAR […]

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. You can query below and check the details of job logs select log_id, log_date, owner, job_name from […]