¡¾×ª¡¿OracleÖÐKill sessionµÄÑо¿
OracleÖÐKill sessionµÄÑо¿
×÷Õߣºeygle |English Version ¡¾×ªÔØʱÇëÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷¡¿
Á´½Ó£ºhttp://www.eygle.com/archives/2004/06/kill_session.html
ÎÒÃÇÖªµÀ,ÔÚOracleÊý¾Ý¿âÖÐ,¿ÉÒÔͨ¹ýkill sessionµÄ·½Ê½À´ÖÕÖ¹Ò»¸ö½ø³Ì,Æä»ù±¾Óï·¨½á¹¹Îª:
alter system kill session 'sid,serial#' ;
±»killµôµÄsession,״̬»á±»±ê¼ÇΪkilled,Oracle»áÔÚ¸ÃÓû§ÏÂÒ»´ÎtouchʱÇå³ý¸Ã½ø³Ì.
ÎÒÃÇ·¢ÏÖµ±Ò»¸ösession±»killµôÒԺ󣬸ÃsessionµÄpaddr±»Ð޸ģ¬Èç¹ûÓжà¸ösession±»kill£¬ÄÇô¶à¸ösession
µÄpaddr¶¼±»¸ü¸ÄΪÏàͬµÄ½ø³ÌµØÖ·:
SQL> select saddr,sid,serial#,paddr,username,status from v$session where username is not null;
SADDR SID SERIAL# PADDR USERNAME STATUS
-------- ---------- ---------- -------- ------------------------------ --------
542E0E6C 11 314 542B70E8 EYGLE INACTIVE
542E5044 18 662 542B6D38 SYS ACTIVE
SQL> alter system kill session '11,314';
System altered.
SQL> select saddr,sid,serial#,paddr,username,status from v$session where username is not null;
SADDR SID SERIAL# PADDR USERNAME STATUS
-------- ---------- ---------- -------- ------------------------------ --------
542E0E6C 11 314 542D6BD4 EYGLE KILLED
542E5044 18 662 542B6D38 SYS ACTIVE
SQL> select saddr,sid,serial#,paddr,username,status from v$session where username is not null;
SADDR SID SERIAL# PADDR USERNAME STATUS
-------- ---------- ---------- -------- ------------------------------ --------
542E0E6C 11 314 542D6BD4 EYGLE KILLED
542E2AA4 14 397 542B7498 EQSP INACTIVE
542E5044 18 662 542B6D38 SYS ACTIVE
SQL> alter system kill session '14,397';
System altered.
SQL> select saddr
Ïà¹ØÎĵµ£º
δʵÑé
ORACLEÊý¾Ý¿â×Ô´øµÄDBMS_JOB¹¦ÄÜ¿ÉÒÔʵÏÖ¶¨Ê±Ö´ÐÐPL/SQLµÄ´æ´¢¹ý³Ì£¬µ«ÊÇÈç¹ûSQLÓï¾äºÜ¸´ÔÓ£¬
SQLÓï¾äºÜ¶à£¬ÒÔ¼°¾³£Òª¸Ä±äSQLÓï¾äµÄд·¨£¬ÓÃдPL/SQL´æ´¢¹ý³ÌµÄ·½·¨ÔÙ¶¨Ê±Ö´Ðлá±È½Ï·±Ëö¡£ºÎ
¿ö»¹ÓÐһЩUNIXϵͳ¹ÜÀíÔ±²»»áдPL/SQL´æ´¢¹ý³Ì£¬ËùÒÔÎÒ½éÉ ......
¿ªÊ¼ÔÚmyeclipse6.5ÖÐDB BROWERн¨ÁËÒ»¸öÊý¾Ý¿âÁ¬½Ó£¬Èçͼ£º
Ò»Á¬½Ó£¬±¨³öÁËÁ½¸ö´íÎó£º
1. ORA-00604 error occurred at recursive SQL level string.
2.ORA-12705: invalid or unknown NLS parameter value.
²é×ÊÁϺó½â¾ö£¨ÆÚ¼äÎÒ»¹¸Ä¹ýtestÓû§µÄÁ¬½ÓȨÏÞ£©£º
½«MyEclipseÖÐeclipseĿ¼ÏµÄeclipse.iniÎļþ£¬° ......
ÈçºÎ±¸·ÝOracleÊý¾Ý¿â£º
MD F:\DB_BAK\%date:~0,10%
EXP userid=bszlhr/bszlhr@ORCL_14 file=F:\DB_BAK\%date:~0,10%\bszlhr%date:~0,10%.dmp log=f:\DB_BAK\%date:~0,10%\log_bszlhr_%date:~0,10%.log
buffer=64000 owner=bszlhr
-----´´½¨ÐÅÓÃÐÅÏ¢µÄ±í----------
create table GCCredit(
itemID numb ......
Õª×ÔÐìÓñ½ðµÄ<<sqlÐÔÄܵĵ÷Õû-×ܽá>>
ÈçºÎʹÓÃhints:
HintsÖ»Ó¦ÓÃÔÚËüÃÇËùÔÚsqlÓï¾ä¿é(statement block£¬ÓÉselect¡¢update¡¢delete¹Ø¼ü×Ö±êʶ)ÉÏ£¬¶ÔÆäËüSQLÓï¾ä»òÓï¾äµÄÆäËü²¿·ÖûÓÐÓ°Ïì¡£È磺¶ÔÓÚʹÓÃunion²Ù×÷µÄ2¸ösqlÓï¾ä£¬Èç¹ûÖ»ÔÚÒ»¸ösqlÓï¾äÉÏÓÐhints£¬Ôò¸Ãhints²»»áÓ°ÏìÁíÒ»¸ösqlÓï¾ä¡£
ÎÒÃÇ¿ÉÒÔÊ ......