易截截图软件、单文件、免安装、纯绿色、仅160KB

oracle 锁问题的解决

可以用Spotlight软件对数据库的运行状态进行监控。
当出现session锁时,我们要及时进行处理.
1. 查看哪些session锁:
SQL语句:select 'alter system kill session '''||sid||','||serial#||''';' from v$session where sid in (select sid from v$lock where block = 1);
SQL> select 'alter system kill session '''||sid||','||serial#||''';' from v$session where sid in (select sid from v$lock where block = 1);
'ALTERSYSTEMKILLSESSION'''||SID||','||SERIAL#||''';'
--------------------------------------------------------------------------------
alter system kill session '132,731';
alter system kill session '275,15205';
alter system kill session '308,206';
alter system kill session '407,3510';
2. 查看session锁.
sql语句:select s.sid, q.sql_text from v$sqltext q, v$session s
where q.address = s.sql_address
and s.sid = &sid
order by piece;
SQL> select s.sid,q.sql_text from v$sqltext q, v$session s where q.address = s.sql_address and s.sid in (select sid from v$lock where block = 1) order by piece;
        SID SQL_TEXT
---------- ----------------------------------------------------------------
       77 UPDATE PROFILE_USER SET ID=1,COMPANY_ID=2,CUSTOMER_ID=3,NAMED  
       77 _INSURED_ID=4,LOGIN=5,ROLE_ID=6,PASSWORD=7,EMAIL=8,TIME_ZON
       77 E=9 WHERE PROFILE_USER.ID=:34
3 rows selected.
3. kill锁的进程.
SQL语句:alter system kill session '77,22198';
SQL> alter system kill session '391,48398';
System altered.
4. 查看谁锁了谁。
select s1.username || [email='@']'@'[/email] || s1.machine
  || ' ( SID=' || s1.sid || ' )  is blocking '
  || s2.username || [email='@']'@'[/email] || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status
  from v$lock l1, v$session s1, v$lock l2, v$session s2
  where s1.sid=l1.sid and s2.sid=l2.sid
&nb


相关文档:

oracle 表空间操作

oracle表空间操作详解
  1
  2
  3作者:   来源:    更新日期:2006-01-04 
  5
  6 
  7建立表空间
  8
  9CREATE TABLESPACE data01
 10DATAFILE '/ora ......

Oracle redo undo commit rollback剖析

刚才在逛一个网友的博客的时候发现了一篇关于REDO、UNDO、COMMIT、ROLLBAKC的文章。虽然内容可能不是特别全面,可是还是总结的挺好的,转过来方便将来学习。
==================================================================================
redo--> undo-->datafile
insert一条记录时,表跟undo的信息都会 ......

Oracle编程高手箴言:位图索引(Bitmap Index)的故事

您如果熟悉Oracle数据库,我想您对Thomas Kyte的大名一定不会陌生。Tomas主持的asktom.oracle.com网站享誉Oracle界数十年,绝非幸致。最近在图书馆借到这位Oracle绝顶高手编著的《Expert Oracle Database Architecture-9i and 10g programming Techniques and Solutions》,翻阅之下,果然盛名无虚,虽然说不上字字珠玑,但 ......

One good feature flashback of oracle 10g

1. use database as archive log mode and set archive dest location
alter system set LOG_ARCHIVE_DEST_1 = 'LOCATION=/u04/arch/orcl' scope=spfile;
2. configuration retention days/size/distination
ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=43200; --30 days
ALTER SYSTEM SET db_recovery_file_dest_ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号