FIND RECENTLY WHO and WHAT UPDATED in DATABASE
SELECT s.sid,s.CLIENT_INFO,s.schemaname,s.MACHINE,s.PROGRAM,s.TYPE,s.logon_time,s.osuser,sq.sorts,sq.DISK_READS,sq.BUFFER_GETS,sq.ROWS_PROCESSED,sq.SQLTYPE ,sq.SQL_TEXT FROM v$session s , v$sql sq where s.logon_time BETWEEN to_date('28-MAY-14') and to_date('29-MAY-14');
SELECT a.USERNAME, b.sql_text, a.STATUS FROM V$SESSION a INNER JOIN V$SQLAREA b ON a.SQL_ID = b.SQL_ID;
***********************************************************
******* FIND LAST UPDATED QUERIES WITH USERNAME ***********
***********************************************************
SELECT S.USERNAME || '(' || s.sid || ')-' || s.osuser UNAME,
s.program || '-' || s.terminal || '(' || s.machine || ')' PROG,
s.sid || '/' || s.serial# sid,
s.status "Status",
p.spid,
sql_text sqltext
FROM v$sqltext_with_newlines t, V$SESSION s, v$process p
WHERE t.address = s.sql_address
AND p.addr = s.paddr(+)
AND t.hash_value = s.sql_hash_value
ORDER BY s.sid, t.piece;
##################################################
SELECT CREATED, TIMESTAMP, last_ddl_time
FROM all_objects
WHERE OWNER = 'CMICH'
AND OBJECT_TYPE = 'TABLE'
AND OBJECT_NAME = 'QP_QP_SETTLEMENT_BATCH';
SELECT s.sid,s.CLIENT_INFO,s.schemaname,s.MACHINE,s.PROGRAM,s.TYPE,s.logon_time,s.osuser,sq.sorts,sq.DISK_READS,sq.BUFFER_GETS,sq.ROWS_PROCESSED,sq.SQLTYPE ,sq.SQL_TEXT FROM v$session s , v$sql sq where s.logon_time BETWEEN to_date('28-MAY-14') and to_date('29-MAY-14');
SELECT a.USERNAME, b.sql_text, a.STATUS FROM V$SESSION a INNER JOIN V$SQLAREA b ON a.SQL_ID = b.SQL_ID;
***********************************************************
******* FIND LAST UPDATED QUERIES WITH USERNAME ***********
***********************************************************
SELECT S.USERNAME || '(' || s.sid || ')-' || s.osuser UNAME,
s.program || '-' || s.terminal || '(' || s.machine || ')' PROG,
s.sid || '/' || s.serial# sid,
s.status "Status",
p.spid,
sql_text sqltext
FROM v$sqltext_with_newlines t, V$SESSION s, v$process p
WHERE t.address = s.sql_address
AND p.addr = s.paddr(+)
AND t.hash_value = s.sql_hash_value
ORDER BY s.sid, t.piece;
##################################################
SELECT CREATED, TIMESTAMP, last_ddl_time
FROM all_objects
WHERE OWNER = 'CMICH'
AND OBJECT_TYPE = 'TABLE'
AND OBJECT_NAME = 'QP_QP_SETTLEMENT_BATCH';
No comments:
Post a Comment