|
在锁竞争中查受害者:
- select s.BLOCKING_SESSION
- from v_$session s
- where s.BLOCKING_SESSION is not null;
复制代码 定位锁着别人的会话:
- select sid,serial# from v$session
- where sid in ( select s.BLOCKING_SESSION
- from v_$session s
- where s.BLOCKING_SESSION is not null );
复制代码 观察锁:
开发时,要使行级独占锁 nowait:
- SQL> select a from t05209_a for update nowait ;
复制代码- select * from dba_rollback_segs;
- select * from v$transaction;
- select * from v_$session s
- where s.TADDR in ( select addr from v$transaction);
复制代码
- select * from dba_rollback_segs;
- select * from v$transaction;
- select * from v_$session s
- where s.TADDR in ( select addr from v$transaction);
-
- select t.tablespace_name , t.retention from dba_tablespaces t;
-
- alter tablespace undotbs1 retention guarantee;
-
- alter tablespace undotbs1 retention noguarantee;
复制代码
要做快照太旧,准备环境:
- create undo tablespace undotbs2 datafile size 256K autoextend off;
- alter system set undo_tablespace=undotbs2;
- alter tablespace temp add tempfile '/home/oracle/temp02.dbf' size 5G ;
复制代码
结果:
|
|