Wednesday, November 13, 2013

How To Check User Login Information In The Past

Use DBA_HIST_ACTIVE_SESS_HISTORY:

To get client machine name:
SELECT distinct machine  FROM DBA_HIST_ACTIVE_SESS_HISTORY

To get timeframe
SELECT *   FROM DBA_HIST_ACTIVE_SESS_HISTORY where sql_exec_start  > sysdate -7  order by sql_exec_start desc

To get User name

SELECT  user_id  FROM DBA_HIST_ACTIVE_SESS_HISTORY where sql_exec_start  > sysdate -7  order by sql_exec_start desc

user user_id to get name from dba_users

Tuesday, November 12, 2013

Output v$flash_recovery_area_usage is incorrect

sometimes we clean recovery area manually , delete archive logs, old files ourselves
the output v$flash_recovery_area_usage can be  incorrect.

Use rman to sync the data dictionary

RMAN>CROSSCHECK BACKUP;
RMAN>CROSSCHECK ARCHIVELOG ALL;   (crosscheck won't delete, just mark them)

RMAN>Delete expired backup;     (will delete items which crosscheck fail )
RMAN>Delete expired archivelog all;
RMAN>Delete force obsolete;


RMAN> list backup    (it won't list data copies )
RMAN> list datafilecopy all;
RMAN> crosscheck datafilecopy all;
RMAN> delete datafilecopy all;
RMAN>delete datafilecopy tag=test_copy;

RMAN>Delete archivelog all completed before  'SYSDATE-7';
 
Then
use exec dbms_backup_restore.refreshagedfiles ; 
to refresh

Thursday, October 24, 2013

Email SMTP Host DNS MX Record

Sometimes the mail gateway is configured as MX record
 ie test-mail-router.example.com
You can't get any IP from nslookup from  test-mail-router.example.com
However you can use dig and find hostnames behind MX record
dig  test-mail-router.example.com  mx

How it works ,refer wiki http://en.wikipedia.org/wiki/MX_record

Wednesday, October 09, 2013

How To Find Who is Bulk Loading on Oracle WebCenter Content

You always need to face performance issues. Sometimes they are from user side. When they pick a big folder and throw into WebContent, it generates lots of traffic and load on WCC archiver/indexer

How do we know the volume and username of bulk loading
Below sql is to tell last 1 hour information. You can change timeframe to know different period

select extract(day from (h.realactiondate)) dy, extract(hour from (h.realactiondate)) hr, h.duser, count(h.did)
  from cms_dochist h, docmeta d
  where h.did = d.did
  and h.daction = 'Checkin'
  and d.xconsumptionserver = 'TEST'
  and h.realactiondate sysdate -1/24 and sysdate
  group by extract(day from (h.realactiondate)), extract(hour from (h.realactiondate)), h.duser
   having count(h.did) > 100
  order by 1,2, 4 desc