有oracle问题的,请进......

王释之 2001-03-14 12:38:00
...全文
108 5 打赏 收藏 举报
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
王释之 2001-03-15
to flyinthesky:
下面是一个显示lock的script:
select s.sid, s.serial#,
decode(s.process, null,
decode(substr(p.username,1,1), '?', upper(s.osuser), p.username),
decode( p.username, 'ORACUSR ', upper(s.osuser), s.process)
) process,
nvl(s.username, 'SYS ('||substr(p.username,1,4)||')') username,
decode(s.terminal, null, rtrim(p.terminal, chr(0)),
upper(s.terminal)) terminal,
decode(l.type,
-- Long locks
'TM', 'DML/DATA ENQ', 'TX', 'TRANSAC ENQ',
'UL', 'PLS USR LOCK',
-- Short locks
'BL', 'BUF HASH TBL', 'CF', 'CONTROL FILE',
'CI', 'CROSS INST F', 'DF', 'DATA FILE ',
'CU', 'CURSOR BIND ',
'DL', 'DIRECT LOAD ', 'DM', 'MOUNT/STRTUP',
'DR', 'RECO LOCK ', 'DX', 'DISTRIB TRAN',
'FS', 'FILE SET ', 'IN', 'INSTANCE NUM',
'FI', 'SGA OPN FILE',
'IR', 'INSTCE RECVR', 'IS', 'GET STATE ',
'IV', 'LIBCACHE INV', 'KK', 'LOG SW KICK ',
'LS', 'LOG SWITCH ',
'MM', 'MOUNT DEF ', 'MR', 'MEDIA RECVRY',
'PF', 'PWFILE ENQ ', 'PR', 'PROCESS STRT',
'RT', 'REDO THREAD ', 'SC', 'SCN ENQ ',
'RW', 'ROW WAIT ',
'SM', 'SMON LOCK ', 'SN', 'SEQNO INSTCE',
'SQ', 'SEQNO ENQ ', 'ST', 'SPACE TRANSC',
'SV', 'SEQNO VALUE ', 'TA', 'GENERIC ENQ ',
'TD', 'DLL ENQ ', 'TE', 'EXTEND SEG ',
'TS', 'TEMP SEGMENT', 'TT', 'TEMP TABLE ',
'UN', 'USER NAME ', 'WL', 'WRITE REDO ',
'TYPE='||l.type) type,
decode(l.lmode, 0, 'NONE', 1, 'NULL', 2, 'RS', 3, 'RX',
4, 'S', 5, 'RSX', 6, 'X',
to_char(l.lmode) ) lmode,
decode(l.request, 0, 'NONE', 1, 'NULL', 2, 'RS', 3, 'RX',
4, 'S', 5, 'RSX', 6, 'X',
to_char(l.request) ) lrequest,
decode(l.type, 'MR', decode(u.name, null,
'DICTIONARY OBJECT', u.name||'.'||o.name),
'TD', u.name||'.'||o.name,
'TM', u.name||'.'||o.name,
'RW', 'FILE#='||substr(l.id1,1,3)||
' BLOCK#='||substr(l.id1,4,5)||' ROW='||l.id2,
'TX', 'RS+SLOT#'||l.id1||' WRP#'||l.id2,
'WL', 'REDO LOG FILE#='||l.id1,
'RT', 'THREAD='||l.id1,
'TS', decode(l.id2, 0, 'ENQUEUE',
'NEW BLOCK ALLOCATION'),
'ID1='||l.id1||' ID2='||l.id2) object
from sys.v_$lock l, sys.v_$session s, sys.obj$ o, sys.user$ u,
sys.v_$process p
where s.paddr = p.addr(+)
and l.sid = s.sid
and l.id1 = o.obj#(+)
and o.owner# = u.user#(+)
and l.type <> 'MR'

解除锁可以用dbms_lock,也可以直接使用dba命令:
alter system kill session 'sid,serial#';
  • 打赏
  • 举报
回复
王释之 2001-03-15
to gogoli:我不是一个高手,只是尽自己的一份力!

to superall:
因为我不懂delphi,我只能跟你说一下oracle中的处理方法:
在oracle中有一个操作包DBMS_LOB,下面列出了DBMS_LOB包中的过程函数:
APPEND procedure Appends the contents of the source LOB to the destination LOB.
CLOSE procedure Closes a previously opened internal or external LOB.
COMPARE function Compares two entire LOBs or parts of two LOBs.
COPY procedure Copies all, or part, of the source LOB to the destination LOB.
CREATETEMPORARY procedure Creates a temporary BLOB or CLOB and its corresponding index in the user's default temporary tablespace.
ERASE procedure Erases all or part of a LOB.
FILECLOSE procedure Closes the file.
FILECLOSEALL procedure Closes all previously opened files.
FILEEXISTS function Checks if the file exists on the server.
FILEGETNAME procedure Gets the directory alias and file name.
FILEISOPEN function Checks if the file was opened using the input BFILE locators.
FILEOPEN procedure Opens a file.
FREETEMPORARY procedure Frees the temporary BLOB or CLOB in the user's default temporary tablespace.
GETCHUNKSIZE function Returns the amount of space used in the LOB chunk to store the LOB value.
GETLENGTH function Gets the length of the LOB value.
INSTR function Returns the matching position of the nth occurrence of the pattern in the LOB.
ISOPEN function Checks to see if the LOB was already opened using the input locator.
ISTEMPORARY function Checks if the locator is pointing to a temporary LOB.
LOADFROMFILE procedure Loads BFILE data into an internal LOB.
OPEN procedure Opens a LOB (internal, external, or temporary) in the indicated mode.
READ procedure Reads data from the LOB starting at the specified offset。
BSTR function Returns part of the LOB value starting at the specified offset.
TRIM procedure Trims the LOB value to the specified shorter length.
WRITE procedure Writes data to the LOB from a specified offset.
WRITEAPPEND procedure Writes a buffer to the end of a LOB.
  • 打赏
  • 举报
回复
flyinthesky 2001-03-15
如果杀掉oracle死锁的进程?!
请查看:
http://www.csdn.net/expert/topicview1.asp?id=83603

谢谢了!
  • 打赏
  • 举报
回复
superall 2001-03-15
如何在Delphi里,存取Oracle数据库的Blob字段?本人以前在网上也找到一些方法,但都不可行。希望哪位高手能给一个验证了的方法,谢谢!
  • 打赏
  • 举报
回复
gogoli 2001-03-14
你是oracle高手么
  • 打赏
  • 举报
回复
相关推荐
发帖
MS-SQL Server
加入

3.3w+

社区成员

MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
申请成为版主
帖子事件
创建了帖子
2001-03-14 12:38
社区公告
暂无公告