Unified Audit Trail In Oracle 12c

This post is about Unified Audit Trail In Oracle 12c . Few starting lines give the overview of ” Unified Audit Trail ” .   With Oracle 12c, unified auditing has been introduced. It consolidates all audit trails into a single audit trail table. It will capture audit records from below sources. SYS audit records ( which was […]

Read More

FINDING SCHEMA SIZE FOR A ORACLE DATABASE

 

Read More

How to check hidden parameter in Oracle

Check hidden parameter in Oracle

Read More

Importing just 1 view via impdp

Hi, Struggling the right syntax in Unix environment for importing a lost view, here is the proper way: impdp user/password@database directory=dir_dump dumpfile=dump.dmp logfile=imp_MY_VIEW.log INCLUDE=VIEW:\”= \’MY_VIEW\’\” job_name=imp_MY_VIEW

Read More

Tablespace growth in Oracle

— Find Tablespace growth size in number of days. set feed off set pages 1000 lines 180 column “tablespace_name” heading “Tablespace | Name” format a20 select to_char (sp.begin_interval_time,’dd-mm-yyyy’) days, ts.tsname, max(round((tsu.tablespace_size* dt.block_size )/(1024*1024),2) ) cur_size_mb, max(round((tsu.tablespace_usedsize* dt.block_size )/(1024*1024),2)) usedsize_mb from dba_hist_tbspc_space_usage tsu, dba_hist_tablespace_stat ts, dba_hist_snapshot sp, dba_tablespaces dt where tsu.tablespace_id= ts.ts# and tsu.snap_id = sp.snap_id and […]

Read More

RMAN BACKUP Scripts

~~~~~~~~~~~~~~~~~~~~~~~~ # RMAN backup history ~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # This script will report on all backups – full, incremental and archivelog backups – ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # This script will report all on full and incremental backups, not archivelog backups – ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RMAN Incremental Report Generation Query ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Read More

Extracts DDL statements for specified objects

exec dbms_metadata.set_transform_param( dbms_metadata.session_transform,’SQLTERMINATOR’, TRUE); select dbms_metadata.get_ddl( object_type, object_name, owner ) from all_objects where object_type NOT LIKE ‘%PARTITION’ AND object_type NOT LIKE ‘%BODY’ AND upper(object_name) LIKE upper(CASE WHEN INSTR(‘&1′,’.’) > 0 THEN SUBSTR(‘&1’,INSTR(‘&1′,’.’)+1) ELSE ‘&1’ END ) AND owner LIKE CASE WHEN INSTR(‘&1′,’.’) > 0 THEN UPPER(SUBSTR(‘&1’,1,INSTR(‘&1′,’.’)-1)) ELSE user END /

Read More

Displays information on all long operations

COLUMN sid FORMAT 999 COLUMN serial# FORMAT 9999999 COLUMN machine FORMAT A30 COLUMN progress_pct FORMAT 99999999.00 COLUMN elapsed FORMAT A10 COLUMN remaining FORMAT A10 SELECT s.sid, s.serial#, s.machine, ROUND(sl.elapsed_seconds/60) || ‘:’ || MOD(sl.elapsed_seconds,60) elapsed, ROUND(sl.time_remaining/60) || ‘:’ || MOD(sl.time_remaining,60) remaining, ROUND(sl.sofar/sl.totalwork*100, 2) progress_pct FROM v$session s, v$session_longops sl WHERE s.sid = sl.sid AND s.serial# = […]

Read More

Lists all locked objects for whole RAC

COLUMN owner FORMAT A20 COLUMN username FORMAT A20 COLUMN object_owner FORMAT A20 COLUMN object_name FORMAT A30 COLUMN locked_mode FORMAT A15 SELECT b.inst_id, b.session_id AS sid, NVL(b.oracle_username, ‘(oracle)’) AS username, a.owner AS object_owner, a.object_name, Decode(b.locked_mode, 0, ‘None’, 1, ‘Null (NULL)’, 2, ‘Row-S (SS)’, 3, ‘Row-X (SX)’, 4, ‘Share (S)’, 5, ‘S/Row-X (SSX)’, 6, ‘Exclusive (X)’, b.locked_mode) […]

Read More

FIND THE ARCHIVE LAG BETWEEN PRIMARY AND STANDBY

select LOG_ARCHIVED-LOG_APPLIED “LOG_GAP” from (SELECT MAX(SEQUENCE#) LOG_ARCHIVED FROM V$ARCHIVED_LOG WHERE DEST_ID=1 AND ARCHIVED=’YES’), (SELECT MAX(SEQUENCE#) LOG_APPLIED FROM V$ARCHIVED_LOG WHERE DEST_ID=2 AND APPLIED=’YES’);

Read More