Oracle_Flashback_Important_Queries

Instance Information : set linesize 300 select name||’ – ‘||instance_name||’@’||host_name||’ – ‘||DB_UNIQUE_NAME||’ – ‘||version||’ – ‘||open_mode||’ – ‘||to_char(startup_time,’DD-MON-YYYY HH24:MI:SS’) || ‘ – ‘|| database_role from v$database, v$instance; FRA Usage : set linesize 300 col file_type for a40 select * from V$FLASH_RECOVERY_AREA_USAGE; Check Restore Point :… Read More

Executing job in Background for one sql

cat g_stats_1_test.sh sqlplus / as sysdba <<EOF set head off conn / as sysdba set serveroutput on set timing on set echo on spool dict_stats_test.log exec DBMS_STATS.gather_table_stats (ownname => ‘SCOTT’,tabname => ‘EMP’,method_opt=>’FOR COLUMNS SIZE AUTO STATUS’); spool off set timing off set serveroutput off exit;… Read More

Simple Script to Delete Archive logs

$ cat /u01/app/oracle/admin/SEPQA01/scripts/archiveclean.sh #CURRDATETIME=date ‘+%Y%m%d-%H%M%S’ ORACLE_SID=ORCL1;export ORACLE_SID ORACLE_HOME=/u01/app/oracle/product/12102;export ORACLE_HOME LOGDIR=/var/opt/monitoring/oracle/logs LOGFILE=/var/opt/monitoring/oracle/logs/archiveclean.log $ORACLE_HOME/bin/rman <<EOF | tee -a /var/opt/monitoring/oracle/logs/archiveclean.log connect target delete archivelog until time ‘sysdate-1’ ; exit EOF ORACLE_SID=ORCL2;export ORACLE_SID $ORACLE_HOME/bin/rman <<EOF | tee -a /var/opt/monitoring/oracle/logs/archiveclean.log connect target delete archivelog until time ‘sysdate-1’ ; exit EOF… Read More

RMAN Full Backup

/u01/app/oracle/DBA/rmanbackup.sh #!/bin/ksh CURRDATETIME=date ‘+%Y%m%d-%H%M%S’a ORACLE_SID=ORCL1;export ORACLE_SID ORACLE_HOME=/u01/app/oracle/product/12.1.0.2;export ORACLE_HOME LOGDIR=/var/opt/oracle/logs LOGFILE=${LOGDIR}/${ORACLE_SID}_rman_${CURRDATETIME}.log RMANBACKUPDIR=/backup/ORCL1/jul16 $ORACLE_HOME/bin/sqlplus dbsnmp/password <<EOF | tee -a $LOGFILE SET LINESIZE 200 COL FILE_NAME FOR A70 SET FEEDBACK OFF SET PAGESIZE 100 COL MEMBER FOR A60 SELECT FILE_NAME,BYTES/1024/1024 MBYTES FROM DBA_DATA_FILES; SELECT FILE_NAME,BYTES/1024/1024 MBYTES FROM DBA_TEMP_FILES;… Read More

Load Test Monitoring