今天我要做一个SKID translation(不要问我什么是SKID translation).
我用BW9518账号干活。处于习惯,我会监控等待事件
SQL> select inst_id,sid,serial#,event,p1,p2,p3,program from gv$session where username='BW9518';
INST_ID SID SERIAL# EVENT P1 P2 P3 PROGRAM
---------- ---------- ---------- ------------------------------ ---------- ---------- ---------- ------------------------------------------------
2 4576 19086 SQL*Net message from client 1413697536 1 0 plsqldev.exe
2 4776 30492 PX Deq: Execution Msg 268632063 1 0 oracle@bdhp4464 (PZ93)
1 4617 34773 enq: TS - contention 1414725636 3 3 sqlplus.exe
1 4645 24446 PX Deq: reap credit 0 0 0 oracle@bdhp4463 (PZ93)
3 4654 25663 PX Deq: reap credit 0 0 0 oracle@bdhp4624 (PZ93)
3 4748 10251 SQL*Net message from client 1413697536 1 0 plsqldev.exe
4 4884 15389 PX Deq: reap credit 0 0 0 oracle@bdhp4627 (PZ93)
7 rows selected
更新----------------------------------------------------------------
今天早上终于拿到一个牛逼 账户
SQL> select inst_id,sid,serial#,event ,p1,p2,p3,program ,status from gv$session where username='BW9518';
INST_ID SID SERIAL# EVENT P1 P2 P3 PROGRAM STATUS
---------- ---------- ---------- ---------------------------------------------------------------- ---------- ---------- ---------- ------------------------------------------------ --------
1 4584 60888 SQL*Net message from client 1413697536 1 0 plsqldev.exe INACTIVE
1 4662 57133 PX Deq: Execution Msg 268566527 1 0 oracle@bdhp4463 (PZ99) ACTIVE
1 4687 42262 SQL*Net message from client 1413697536 1 0 plsqldev.exe INACTIVE
1 4863 29426 enq: TS - contention 1414725636 3 4 sqlplus.exe ACTIVE
4 4805 35973 PX Deq: reap credit 0 0 0 oracle@bdhp4627 (PZ99) ACTIVE
3 4624 49517 PX Deq: reap credit 0 0 0 oracle@bdhp4624 (PZ99) ACTIVE
2 4596 10273 PX Deq: reap credit 0 0 0 oracle@bdhp4464 (PZ99) ACTIVE
7 rows selected
SQL> alter session set events 'immediate trace name DROP_SEGMENTS level 4';
Session altered
SQL> select inst_id,sid,serial#,event ,p1,p2,p3,program ,status from gv$session where username='BW9518';
INST_ID SID SERIAL# EVENT P1 P2 P3 PROGRAM STATUS
---------- ---------- ---------- ---------------------------------------------------------------- ---------- ---------- ---------- ------------------------------------------------ --------
1 4863 29426 direct path read temp 20023 2771404 1 sqlplus.exe ACTIVE
The DROP_SEGMENTS event
~~~~~~~~~~~~~~~~~~~~~~~
Available from 8.0 onwards.
DESCRIPTION
Finds all the temporary segments in a tablespace which are not
currently locked and drops them.
For the purpose of this event a "temp" segment is defined as a
segment (seg$ entry) with TYPE#=3. Sort space in a TEMPORARY
tablespace does not qualify under this definition as such
space is managed independently of SEG$ entries.
PARAMETERS
level - tablespace number+1. If the value is 2147483647 then
temp segments in ALL tablespaces are dropped, otherwise, only
segments in a tablespace whose number is equal to the LEVEL
specification are dropped.
NOTES
This routine does what SMON does in the background, i.e. drops
temporary segments. It is provided as a manual intervention tool which
the user may invoke if SMON misses the post and does not get to
clean the temp segments for another 2 hours. We do not know whether
missed post is a real possibility or more theoretical situation, so
we provide this event as an insurance against SMON misbehaviour.
Under normal operation there is no need to use this event.
It may be a good idea to
alter tablespace <tablespace> coalesce;
after dropping lots of extents to tidy things up.
*SQL Session (if you can connect to the database):
alter session set events 'immediate trace name DROP_SEGMENTS level TS#+1';
The TS# can be obtained from v$tablespace view:
select ts# from v$tablespace where name = '<Tablespace name>';
Or from SYS.TS$:
select ts# from sys.ts$ where name = '<Tablespace name>' and online$ != 3;
If ts# is 5, an example of dropping the temporary segments in that tablespace
would be:
alter session set events 'immediate trace name DROP_SEGMENTS level 6';