Oracle×Ö·û¼¯ÐÞ¸ÄÎÊÌâ
¾³£ÓÐͬÊÂ×ÉѯoracleÊý¾Ý¿â×Ö·û¼¯Ïà¹ØµÄÎÊÌ⣬ÈçÔÚ²»Í¬Êý¾Ý¿â×öÊý¾ÝÇ¨ÒÆ¡¢Í¬ÆäËüϵͳ½»»»Êý¾ÝµÈ£¬³£³£ÒòΪ×Ö·û¼¯²»Í¬¶øµ¼ÖÂÇ¨ÒÆÊ§°Ü»òÊý¾Ý¿âÄÚÊý¾Ý±ä³ÉÂÒÂë¡£ÏÖÔÚÎÒ½«oracle×Ö·û¼¯Ïà¹ØµÄһЩ֪ʶ×ö¸ö¼òµ¥×ܽᣬϣÍû¶Ô´ó¼Ò½ñºóµÄ¹¤×÷ÓÐËù°ïÖú¡£
¡¡¡¡Ò»¡¢Ê²Ã´ÊÇoracle×Ö·û¼¯
¡¡¡¡Oracle×Ö·û¼¯ÊÇÒ»¸ö×Ö½ÚÊý¾ÝµÄ½âÊ͵ķûºÅ¼¯ºÏ,ÓдóС֮·Ö,ÓÐÏ໥µÄ°üÈݹØÏµ¡£ORACLE Ö§³Ö¹ú¼ÒÓïÑÔµÄÌåϵ½á¹¹ÔÊÐíÄãʹÓñ¾µØ»¯ÓïÑÔÀ´´æ´¢£¬´¦Àí£¬¼ìË÷Êý¾Ý¡£ËüʹÊý¾Ý¿â¹¤¾ß£¬´íÎóÏûÏ¢£¬ÅÅÐò´ÎÐò£¬ÈÕÆÚ£¬Ê±¼ä£¬»õ±Ò£¬Êý×Ö£¬ºÍÈÕÀú×Ô¶¯ÊÊÓ¦±¾µØ»¯ÓïÑÔºÍÆ½Ì¨¡£
¡¡¡¡Ó°ÏìoracleÊý¾Ý¿â×Ö·û¼¯×îÖØÒªµÄ²ÎÊýÊÇNLS_LANG²ÎÊý¡£ËüµÄ¸ñʽÈçÏÂ:
¡¡¡¡NLS_LANG = language_territory.charset
¡¡¡¡ËüÓÐÈý¸ö×é³É²¿·Ö(ÓïÑÔ¡¢µØÓòºÍ×Ö·û¼¯)£¬Ã¿¸ö³É·Ö¿ØÖÆÁËNLS×Ó¼¯µÄÌØÐÔ¡£ÆäÖÐ:
¡¡¡¡Language Ö¸¶¨·þÎñÆ÷ÏûÏ¢µÄÓïÑÔ£¬territory Ö¸¶¨·þÎñÆ÷µÄÈÕÆÚºÍÊý×Ö¸ñʽ£¬charset Ö¸¶¨×Ö·û¼¯¡£Èç:AMERICAN _ AMERICA. ZHS16GBK
¡¡¡¡´ÓNLS_LANGµÄ×é³ÉÎÒÃÇ¿ÉÒÔ¿´³ö£¬ÕæÕýÓ°ÏìÊý¾Ý¿â×Ö·û¼¯µÄÆäʵÊǵÚÈý²¿·Ö¡£ËùÒÔÁ½¸öÊý¾Ý¿âÖ®¼äµÄ×Ö·û¼¯Ö»ÒªµÚÈý²¿·ÖÒ»Ñù¾Í¿ÉÒÔÏ໥µ¼Èëµ¼³öÊý¾Ý£¬Ç°ÃæÓ°ÏìµÄÖ»ÊÇÌáʾÐÅÏ¢ÊÇÖÐÎÄ»¹ÊÇÓ¢ÎÄ¡£
¡¡¡¡¶þ¡¢ÈçºÎ²éѯOracleµÄ×Ö·û¼¯
¡¡¡¡ºÜ¶àÈ˶¼Åöµ½¹ýÒòΪ×Ö·û¼¯²»Í¬¶øÊ¹Êý¾Ýµ¼Èëʧ°ÜµÄÇé¿ö¡£ÕâÉæ¼°Èý·½ÃæµÄ×Ö·û¼¯£¬Ò»ÊÇoracel server¶ËµÄ×Ö·û¼¯£¬¶þÊÇoracle client¶ËµÄ×Ö·û¼¯;ÈýÊÇdmpÎļþµÄ×Ö·û¼¯¡£ÔÚ×öÊý¾Ýµ¼ÈëµÄʱºò£¬ÐèÒªÕâÈý¸ö×Ö·û¼¯¶¼Ò»Ö²ÅÄÜÕýÈ·µ¼Èë¡£
¡¡¡¡1¡¢²éѯoracle server¶ËµÄ×Ö·û¼¯
¡¡¡¡ÓкܶàÖÖ·½·¨¿ÉÒÔ²é³öoracle server¶ËµÄ×Ö·û¼¯£¬±È½ÏÖ±¹ÛµÄ²éѯ·½·¨ÊÇÒÔÏÂÕâÖÖ:SQL>select userenv(‘language’) from dual;
¡¡¡¡½á¹ûÀàËÆÈçÏÂ:AMERICAN _ AMERICA. ZHS16GBK
¡¡¡¡2¡¢ÈçºÎ²éѯdmpÎļþµÄ×Ö·û¼¯
¡¡¡¡ÓÃoracleµÄexp¹¤¾ßµ¼³öµÄdmpÎļþÒ²°üº¬ÁË×Ö·û¼¯ÐÅÏ¢£¬dmpÎļþµÄµÚ2ºÍµÚ3¸ö×ֽڼǼÁËdmpÎļþµÄ×Ö·û¼¯¡£Èç¹ûdmpÎļþ²»´ó£¬±ÈÈçÖ»Óм¸M»ò¼¸Ê®M£¬¿ÉÒÔÓÃUltraEdit´ò¿ª(16½øÖÆ·½Ê½)£¬¿´µÚ2µÚ3¸ö×Ö½ÚµÄÄÚÈÝ£¬Èç0354£¬È»ºóÓÃÒÔÏÂSQL²é³öËü¶ÔÓ¦µÄ×Ö·û¼¯:
¡¡¡¡SQL> select nls_charset_name(to_number('0354','xxxx')) from dual;
¡¡¡¡ZHS16GBK
¡¡¡¡Èç¹ûdmpÎļþºÜ´ó£¬±ÈÈçÓÐ2GÒÔÉÏ(ÕâÒ²ÊÇ×î³£¼ûµÄÇé¿ö)£¬ÓÃÎı¾±à¼Æ÷´ò¿ªºÜÂý»òÕßÍêÈ«´ò²»¿ª£¬¿ÉÒÔÓÃÒÔÏÂÃüÁî(ÔÚunixÖ÷»úÉÏ):
¡¡¡¡cat exp.dmp |od -x|head -1|awk '{print
Ïà¹ØÎĵµ£º
Èý¡¢Ç¶Ì×±íµÄʹÓ÷½·¨
1¡¢½«Ç¶Ì×±í¶¨ÒåΪPL/SQLµÄ³ÌÐò¹¹Ôì¿é
TYPE type_name IS TABLE OF element_type[NOT NULL];
ÈçÏÂÀýËùʾ£º
DECLARE
-- Define a nested table of variable length strings.
TYPE card_table IS TABLE OF VARCHAR2(5 CHAR);
-- Declare and initialize a n ......
(1) v$sql
¡¡¡¡Ò»ÌõÓï¾ä¿ÉÒÔÓ³Éä¶à¸öcursor,ÒòΪ¶ÔÏóËùÖ¸µÄcursor¿ÉÒÔÓв»Í¬Óû§(ÈçÀý1)¡£Èç¹ûÓжà¸öcursor(×ÓÓαê)´æÔÚ£¬ÔÚV$SQLAREAΪËùÓÐcursorÌṩ¼¯ºÏÐÅÏ¢¡£
Àý1£º
ÕâÀï½éÉÜÒÔÏÂchild cursor
user A: select * from tbl
user B: select * from tbl
´ó¼ÒÈÏΪÕâÁ½ÌõÓï¾äÊDz»ÊÇÒ»ÑùµÄ°¡£¬¿ÉÄÜ»áÓкܶàÈË»á˵ÊÇÒ»Ñù ......
Oracle×Ô8iÆð¾ÍÈ«ÃæÖ§³Öjava£¬µ«¸÷¸ö°æ±¾µÄoracleÖÐĬÈÏjdk°æ±¾¾ù²»Ïàͬ£¬oracle8iÖÐΪ jdk1.2,oracle9iÖÐΪjdk1.3,oracle10gÖÐΪjdk1.4~~ÖÁ±ÊÕßÐÐΪ֮¼Ê£¬µ±Ç°µÄ×îа汾Ϊjdk1.5 update 11.
Òò±ÊÕßjava¿ª·¢³öÉí£¬ÔÚ×öoracle¿ª·¢Öо³£»áÓÃjavaÀ´À©Õ¹ oracle¹¦ÄÜ£¬µ«ÊÇÓÉÓÚoracle×Ô´øjdk°æ±¾¹ýµÍ£¬¿ÉÄÜ»áÔì³ÉһЩ ......
±¾ÊÓͼ³ÖÐø¸ú×ÙËùÓÐshared poolÖеĹ²Ïícursor£¬ÔÚshared poolÖеÄÿһÌõSQLÓï¾ä¶¼¶ÔÓ¦Ò»ÁС£±¾ÊÓͼÔÚ·ÖÎöSQLÓï¾ä×ÊԴʹÓ÷½Ãæ·Ç³£ÖØÒª¡£
V$SQLAREAÖеÄÐÅÏ¢ÁÐ
HASH_VALUE£ºSQLÓï¾äµÄHashÖµ¡£
ADDRESS£ºSQLÓï¾äÔÚSGAÖеĵØÖ·¡£
ÕâÁ½Áб»ÓÃÓÚ¼ø±ðSQLÓï¾ä£¬ÓÐʱ£¬Á½Ìõ²»Í¬µÄÓï¾ä¿ÉÄÜhashÖµÏàͬ¡£Õâʱºò£¬±ØÐëÁ¬Í¬ADDRESSÒ ......
DML:Data Manipulation Language Êý¾Ý²Ù×÷ÓïÑÔ
°üÀ¨£ºCRUD
1. insertÓï¾ä
(1) ´ÓÆäËü±íÖи´ÖÆÊý¾Ý,ʵÏÖ·½·¨:ÔÚinsert Óï¾äÖмÓÈë²éѯÓï¾ä
insert into sales_reps(id,name,salary,commission_pct) select employee_id,last_name,salary,commission_pct
from employees where job_id like '%rep';
(2) up ......