Oracle 10g Æô¶¯Óë¹Ø±Õ
ÔÚÖ´ÐÐÆô¶¯¹Ø±ÕÃüÁî֮ǰÐèÒªÕýÈ·ÉèÖÃÏÂÁл·¾³±äÁ¿£º
ORACLE_BASE
ORACLE_HOME °²×°¹ý³ÌÖÐÏÔʾµÄoracle home Ŀ¼
ORACLE_SID
PATH=$PAHT£º$ORACLE_HOME/bin
ÒÔ oracle Õ˺ŵǽ Linux£¬»òÕß´Ó root ÏÂÊäÈë su - oracle ±ä³É oracle ÕʺÅÖ´ÐÐÆô¶¯¹Ø±ÕÃüÁî
1. Æô¶¯ºÍ¹Ø±Õ¼àÌý
Æô¶¯¼àÌý£ºlsnrctl start
¹Ø±Õ¼àÌý£ºlsnrctl stop
2. Æô¶¯ºÍÍ£Ö¹Êý¾Ý¿â
Æô¶¯Êý¾Ý¿â£ºÔÚÖÕ¶ËÊäÈë sqlplus '/ as sysdba' ½øÈë sqlplus£¬ÔÚ sqlplus ÊäÈë startup
Í£Ö¹Êý¾Ý¿â£ºÔÚ sqlplus ÊäÈë shutdown »òÕß shutdown immediate
3. Æô¶¯ºÍÍ£Ö¹ dbconsole ·þÎñ
Æô¶¯Ç°Ðè×¢ÒâOracleµÄidÊÇ·ñÕýÈ·
windowsÏÂÃüÁîΪset ORACLE_SID=TEST
AIXÏÂÃüÁîΪexport ORACLE_SID=TEST
Æô¶¯ dbconsole ·þÎñ£º emctl start dbconsole
Í£Ö¹ dbconsole ·þÎñ£º emctl stop dbconsole
4. Æô¶¯ºÍÍ£Ö¹ iSQL*Plus isqlplusctl start | stop
5. ÁгöOracle½ø³Ì
ps -fu oracle
Ïà¹ØÎĵµ£º
ÒÔdbaµÇ½
1.²é¿´Äĸö±í±»Ëø:
select b.owner,b.object_name,l.session_id,l.locked_mode
from v$locked_object l, dba_objects b
where b.object_id=l.object_id;
2.²é¿´±»Ëø±íµÄsid ºÍserial# :
select t2.username,t2.sid,t2.serial#,t2.logon_time
from v$locked_object t1 ......
Ä¿Ç°£¬ÕýÔò±í´ïʽÒѾÔںܶàÈí¼þÖеõ½¹ã·ºµÄÓ¦Ó㬰üÀ¨*nix£¨Linux, UnixµÈ£©£¬HPµÈ²Ù×÷ϵͳ£¬PHP£¬C#£¬JavaµÈ¿ª·¢»·¾³¡£
Oracle 10gÕýÔò±í´ïʽÌá¸ßÁËSQLÁé»îÐÔ¡£ÓÐЧµÄ½â¾öÁËÊý¾ÝÓÐЧÐÔ£¬ Öظ´´ÊµÄ±æÈÏ, Î޹صĿհ׼ì²â£¬»òÕß·Ö½â¶à¸öÕýÔò×é³É
µÄ×Ö·û´®µÈÎÊÌâ¡£
Oracle 10gÖ§³ÖÕýÔò±í´ïʽµÄËĸöк¯Êý·Ö±ðÊÇ£ºREGEXP_L ......
¾¡Á¿ÉÙÓÃIN²Ù×÷·û£¬»ù±¾ÉÏËùÓеÄIN²Ù×÷·û¶¼¿ÉÒÔÓÃEXISTS´úÌæ¡£
²»ÓÃNOT IN²Ù×÷·û£¬¿ÉÒÔÓÃNOT EXISTS»òÕßÍâÁ¬½Ó+Ìæ´ú¡£
OracleÔÚÖ´ÐÐIN×Ó²éѯʱ£¬Ê×ÏÈÖ´ÐÐ×Ó²éѯ£¬½«²éѯ½á¹û·ÅÈëÁÙʱ±íÔÙÖ´ÐÐÖ÷²éѯ¡£¶øEXISTÔòÊÇÊ×Ïȼì²éÖ÷²éѯ£¬È»ºóÔËÐÐ×Ó²éѯֱµ½ÕÒµ½µÚÒ»¸öÆ¥ÅäÏî¡£NOT EXISTS±ÈNOT INЧÂÊÉԸߡ£µ«¾ßÌåÔÚÑ¡ÔñIN»òEXIST² ......
ÓÐʱºò£¬ÐèÒªÔÚÁ½¸öOracleÊý¾Ý¿âÖ®¼äÊÖ¹¤Í¬²½Êý¾Ýʱ£¬DBLinkÊÇ×î·½±ã¿ì½ÝµÄÊÖ¶ÎÖ®Ò»£¬´´½¨DBLinkµÄ·½Ê½Ò»°ãÊÇÕâÑù£º
create public database link <DBLinkÃû³Æ> connect to <±»Á¬½Ó¿âµÄÓû§Ãû> identified by <±»Á¬½Ó¿âµÄÃÜÂë> using '< ......
²éѯ·¢ÉúËÀËøµÄselectÓï¾ä
select sql_text from v$sql where hash_value in
(select sql_hash_value from v$session where sid in
(select session_id from v$locked_object))
---------------------------------------------------------
¹ØÓÚÊý¾Ý¿âËÀËøµÄ¼ì²é·½·¨
Ò»¡¢   ......