Itpub电子杂志(第三期)

1,051 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,051
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Itpub电子杂志(第三期)

  1. 1. ITPUB µç×ÓÔÓÖ¾ ·âÃæ HOME: http://www.itpub.net MAIL: epub@itpub.net
  2. 2. ITPUB µç×ÓÔÓÖ¾ ÄÚÈݵ¼¶Á ±¾ÆÚÎÄÕÂÄÚÈݵ¼¶Á ¡¤ ý¾Ý¿â¹ÜÀí Ê Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ Ê²Ã´ÑùµÄ ²ÅÊÇÒ»¸öºÃµÄ DBA DBA£¿Ò»¸öºÃµÄ ¾¿¾¹Ó¦¸Ã×öʲô£¬²»Ó¦¸Ã×öʲô£¿ DBA ÕâƪÎÄÕ±ȽϺõĻشðÁËÕâ¸öÎÊÌâ¡£ Using 3 Linux Boxes to Setup OPS Oracle8.1.7 ²úÆ·ÔÚ Aix4.3.3 Éϵݲװ ibm ʵ¼ù³öÕæÖª¡£±¾ÆÚÍƳöÁ½ÆªÊµÕ½ÐÔµÄÎÄÕ£ºto Setup OPS ½éÉÜÁË Using 3 Linux Boxes ÓÃÈý̨ Ö÷»úÄ£ÄâÒ»¸ö linux OPS »·¾³µÄ·½·¨£» Oracle8.1.7 ²úÆ·ÔÚ Aix4.3.3 ÉÏ IBM µÄ°²×° ÔòÏêϸ½éÉÜÁËCLUSTER »·¾³Ï°²×°µÄÏêϸ²½Öè¼°×¢ÒâÊÂÏî ¡£ ¡¤Êý¾Ý¿â¿ª·¢ ORACLE µÄ¸ôÀ뼶±ð ˵ÆðÊý¾Ý¿âÖеÄÊÂÎñ (TRANSACTION) £¬´ó¼Ò¶¼²»Ä°Éú¡£µ«ÊǶÔÓÚÊý¾Ý¿âµÄ¸ôÀ뼶 (isolation level)£¬¿ÖÅÂÀí½â͸³¹µÄÈË»¹²»ÊǺܶࡣϣÍû±¾ÎÄÄÜ°ïÖúÄã¸üºÃµÄÀí½â À뼶±ðÒÔ¼°¸÷ÖÖ¸ôÀ뼶±ðµÄÏàÓ¦µÄЧ¹û¡£ oracle8i º¯Êý½éÉÜ (Ò») ¾-³£ÓÐÈËÎÊ£º 8.1.6/8.1.7 ±ÈÆð 8.1.5 ÓÐÄÄЩ¸Ä½ø£¿ÎÒ¸öÈËÈÏΪ³ýÁËÐÞÕýÁËһЩ bug Ö®Í⣬ ×¶¯ÈËÐĵÄÔöÇ¿¹¦ÄܾÍÊÇÐÂÔöµÄͳ¼Æ·ÖÎöº¯ÊýÁË¡£´Ó±¾ÆÚ¿ª ʼ£¬ jlandzpa ½«Ïò´ó¼Ò·ÖÏíËû ¶ÔÕâЩº¯ÊýµÄʹÓÃÐĵᣠoracle ÈÏÖ¤ ¡¤ Åàѵ£º Lesson 1-10 023 1Z0-023 (Architecture and Administration) ÊÇ OCP ¿¼ÊÔµÄÖصã /Äѵ㣬ҲÊÇÒ»¸öºÏ¸ñµÄ DBA ±ØÐëÊìÁ·ÕÆÎÕµÄÄÚÈÝ¡£±¾ÆÚÔÝʱ¸éÖÃһϠµÄÖص㡣 001£¬Îª´ó¼Ò½éÉÜ 023 ¡¤ÆóÒµÐÅÏ¢»¯ BAAN ϵͳµÄ²úÆ·ÅäÖà ¹«Ë¾µÄ¾ºÕùÁ¦Ô½À´Ô½ÌåÏÖÔÚËûÄܲ»ÄÜÔÚ×î¶ÌµÄʱ¼äÄÚÉú²ú³ö·ûºÏ¿Í»§Òª ˾µÄ²úÆ·ÐòÁÐÖÐÒ²½«³öÏÖÔ½À´Ô½¶àµÄ¡°±ê×¼²úÆ·¡±µÄ±äÖÖ -----¼´Õë¶Ô²»Í¬¿Í »§×öÊʵ±µÄÐ޸ġ£ ±¾ÎÄΪ´ó¼Ò½éÉÜÁËBAAN ϵͳµÄ²úÆ·ÅäÖà ( PCF: Product Configuration£©Ä£¿é¡£ Oracle Applications 11i ¼¼ÊõÖ§³Ö¾-ÑéÔÓ̸ (2) ±¾ÆÚ¼ÌÐøÓÉ Kevon_zengÏò´ó¼Ò½éÉÜÔÚʹÓà Oracle Applications 11iʱµÄһЩ¾-Ñé¡£ HOME: http://www.itpub.net MAIL: epub@itpub.net
  3. 3. ITPUB µç×ÓÔÓÖ¾ ORACLE8.1.7 ²úÆ·ÔÚ AIX4.3.3 Éϵݲװ IBM Oracle8.1.7 ²úÆ·ÔÚ Aix4.3.3 Éϵݲװ ibm ×÷Õߣ £ º¨ *¼û¸½×¢£© 1. ϵͳ¸Å¿ö Ó²¼þÇé¿ö£º IBM H85 Ö÷»úÁ½Ì¨£¬¸÷ÓÐ 1 ¸öCPU£¬ÄÚ´æ¸÷Ϊ 2G£¬±¾µØ¸÷ÓÐ µÄÓ²ÅÌ 18.2G 2 ¿é£¬ ×ܹ²´æ´¢Á¿×óÓÒ£¬7133 SSA ´ÅÅÌÕóÁйñ¹²ÓÐ 9 ¿é£ 36G IBM 36G Ó²ÅÌ ¬×ܹ²´æ´¢Á¿ 320G ×óÓÒ¡£ Èí¼þÇé¿ö£º ²Ù×÷ϵͳ£º IBM-AIX 4.3.3 64-bit ʹÓà HACMP CASCADE 4.4.0.0 Ë«»ú»·¾³ IBM ´òIBM ÓйØACMP ºÍ H AIX µÄ²¹¶¡ Êý¾Ý¿âϵͳ£º 8.1.7 FOR IBM-AIX ENTERPRISE EDITION 64-bit ORACLE ±¾µØÓ²ÅÌ×÷³ÉÒ»¸ö vg £º rootvg£¬ÈÝÁ¿Îª 36G£¬ÓÃÀ´°²×° Oracle Êý¾Ý¿âϵͳ¡£ AIX ºÍ ´ÅÅ̳ÂÁйñÅäÖÃÖУ¬ÓÐ 2 ¿éÓ²Å̲»×ö RAID£¬×÷³ÉÒ»¸ö datavg2£¬ÈÝÁ¿Îª ÈκΠvg:£º 70G ×óÓÒ£¬ÓÃÓÚ´æ·Å±¸ÓÃÊý¾Ý¿âµÄÊý¾Ý¡£ÓàÏ 7 ¿éÓ²ÅÌ×ö RAID5£¬×÷³ÉÒ»¸ödatavg1£¬ vg£º ÈÝÁ¿Îª 180G ×óÓÒ£¬ÓÃÓÚ´æ·ÅÕýʽÊý¾Ý¿âÊý¾Ý¡£ Á½Ì¨Ö÷»úµÄ Çø ¬ rootvg Éϸ÷½¨Ò»¸öÎļþϵͳ£¬ swap 2G£Ú Ô 4G£¬Ãû×ÖΪ ´óСΪ lvoracle, Æämount µãΪ/oracle,ÓÃÀ´·Å oracle RDBMS £¬ÕýʽÊý¾Ý¿â layb µÄÊý¾ÝÕ¼ÓÃµÄ vg Ϊ datavg1£¬²¢½¨Á¢Èý¸ö lv£¬·Ö±ðΪ datavg1_lv01£¬datavg1_lv02 ºÍ datavg1_lv03£¬·Ö±ð ¶ÔÓ¦Îļþϵͳ60G£¬u02£¨ u01£¨ © £ 10G£¬u03£¨ ©£ 40G£©£¬Îļþϵͳ²»Ö§³Ö´óÓÚ 2GB µÄÎÄ ¼þ£¬Æämount µã·Ö±ðΪ /a01£¬ /u01£¬ /backup1£¬ÆäÖÐ ´æ·Å RACLE µÄÊý¾ÝÎļþ£¬ /u01 O ¿ØÖÆÎļþºÍÈÕÖ¾Îļþ£¬Archived log files£¬ /a01 ´æ·Å /backup1 ´æ·ÅÀ䱸·ÝÊý ¾Ý¡£Êý¾Ý ¿â±í¿Õ¼ä³õʼ´óС¹æ»®ÈçÏ£º SYSTEM ±í¿Õ¼äÊý¾ÝÎļþ 500M TOOLS ±í¿Õ¼äÊý¾ÝÎļþ 64M USERS ±í¿Õ¼äÊý¾ÝÎļþ 256M RBS ±í¿Õ¼äÊý¾ÝÎļþ 256M INDX ±í¿Õ¼äÊý¾ÝÎļþ 256M TEMP ±í¿Õ¼äÊý¾ÝÎļþ 128M ¿ØÖÆÎļþ ¹²Èý¸ö ÈÕÖ¾Îļþ Ò»¸ö¹²Èý¸ö 50M HOME: http://www.itpub.net MAIL: epub@itpub.net
  4. 4. ITPUB µç×ÓÔÓÖ¾ ORACLE8.1.7 ²úÆ·ÔÚ AIX4.3.3 Éϵݲװ IBM TRACE ÎļþµÄ´æ·ÅλÖÃĬÈÏ·ÅÔÚ±¾µØÅÌÉÏ¡£ ±¸ÓÃϵͳÊý¾Ý¿â µÄÊý¾ÝÕ¼ÓÃµÄ laybbak vg Ϊdatavg2£¬²¢½¨Á¢Á½¸ölv£¬·Ö±ðΪ datavg2_lv01£¬ datavg1_lv02£¬·Ö±ð¶ÔÓ¦Îļþϵͳ © u02£¨30G£¬backup2£¨ £ 30G£ ©£¬Îļþ ϵͳ²»Ö§³Ö´óÓÚ 2GB µÄÎļþ£¬Æä µã·Ö±ðΪ /backup2£¬ÆäÖÐ ´æ·Å mount /u02£¬ /u02 ORACLE µÄÊý¾ÝÎļþ£¬¿ØÖÆÎļþºÍÈÕÖ¾Îļþ£¬ /backup2 ´æ·ÅÀ䱸·ÝÊý¾Ý¡£Êý¾Ý¿â±í¿Õ ¼ä³õʼ´óС¹æ»®ÈçÏ£º SYSTEM ±í¿Õ¼äÊý¾ÝÎļþ 500M TOOLS ±í¿Õ¼äÊý¾ÝÎļþ 64M USERS ±í¿Õ¼äÊý¾ÝÎļþ 256M RBS ±í¿Õ¼äÊý¾ÝÎļþ 256M INDX ±í¿Õ¼äÊý¾ÝÎļþ 256M TEMP ±í¿Õ¼äÊý¾ÝÎļþ 128M ¿ØÖÆÎļþ ¹²Èý¸ö ÈÕÖ¾Îļþ Ò»¸ö¹²Èý 50M ¸ö TRACE ÎļþµÄ´æ·ÅλÖÃĬÈÏ·ÅÔÚ±¾µØÅÌÉÏ¡£ 2. ÉèÖü°°²×°²½Ö裺 1£©´´½¨×é ¬ dba£ ¼°ÆäËùÊôÓû§ dba ΪÆäÖ÷×é¡ Óû§µÄ¹¤×÷Ŀ¼Π¡ oracle£¬ £ /oracle¡¬ª ° ±£ uid=1001 gid=1001£»Ö÷±¸»ú±£³ÖÒ»Ö¡£ÒÔϲÙ×÷ÔÚÖ÷»úÉÏ¡£ 2£©±à¼-racle Óû§µÄ o .profile£¬¶¨ÒåÏÂÁРʹÓõĻ·¾³±äÁ¿£º oracle ORACLE_BASE=/oracle/app/oracle ORACLE_HOME=$ORACLE_BASE/product/8.1.7 ORACLE_SID=layb£¨ »ú£© B »ú£© A /£¨ ORACLE_TERM=vt100 ORACLE_NLS33=$ORACLE_HOME/ocommon/nls/admin/data NLS_LANG=american_america.zhs16gbk LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib LIBPATH=$ORACLE_HOME/lib PATH=$PATH:$ORACLE_HOME/bin:/usr/local/bin DISPLAY=172.16.25.1:0.0 JAVA_HOME=/usr/jdk_base HOME: http://www.itpub.net MAIL: epub@itpub.net
  5. 5. ITPUB µç×ÓÔÓÖ¾ ORACLE8.1.7 ²úÆ·ÔÚ AIX4.3.3 Éϵݲװ IBM export ORACLE_BASE ORACLE_HOME ORACLE_SID ORACLE_TERM export ORACLE_NLS33 NLS_LANG LD_LIBRARY_PATH LIPPATH export PATH DISPLAY JAVA_HOME umask 022 3£©¼ì²é HACMP ÊÇ·ñÒѳɹ¦Æô¶¯£» IBM 4) °²×° racle Êý¾Ý¿âϵͳ£¬·ÅÈëµÚÒ»ÕŹâÅ̲¢ÇÒ O MOUNT CDROM mount -rv cdrfs /dev/cd0/cdrom 5£©ÒÔ Éí·Ý½øÈë Ŀ¼ root /cdrom ÔËÐÐÃüÁî sh rootpre.sh xhost + ʹÓÃÃüÁ oracle¡±½øÈë su ¨C oracle Óû§Éí·Ý£¬½øÈëĿ¼£¬ÔÚÖ÷»úÉÏÔËÐÐ /cdrom oracle °²×°³ÌÐò runInstaller¡ ±£¬°²×°¡° 8i Enterprise Edtion 8.1.7.0.0¡°£¬Ñ¡Ôñ Oracle ¡°Custom¡± £¬Ñ¡Ôñ°²×°×é¼þ¡£×¢Ò⣺¼ÓÉÏ OUI£¬È¥µô OCI£¬SQLJ£¬ LEGATO¡£µ±ËùÓÐ×é ¼þ°²×°Íê±Ï£¬ÐèÒªÒÔÖ´ÐÐ root Éí·Ý /oracle/app/oracle/product/8.1.7/root.sh£¬¿ÉÒÔÔÚÒ» ¸öÐéÄâÖÕ¶ËÖÐÒÔ root Éí·ÝÖ´ÐиòÙ×÷£¬ÏȲ»ÅäÖà Net8 Configuration Assistant¡£ 6£©¼ì²é¸÷°²×° log Îļþ£¬È·ÈÏ°²×°³É¹¦¡£ 7£©ÒÔracle Éí·ÝÖ´ÐÐ o dbassist ¿ªÊ¼½¨Á¢Êý¾Ý¿âlayb£¬Ñ¡Ôñ¡° a database¡¬ create ± £ Ñ¡Ô¡ñ° Custom¡Ñ¡Ô¡ LTP¡£ÊäÈë²¢·¢Óû§ÊýÄ¡ ñ°edicated Server Mode¡¬ ± ñ° O ±¬ 300¡£Ñ¡Ô¡ ±¬ ¿° D ± £ È¥µôËùÓÐÊý¾Ý¿âÌØÐÔÑ¡ÏÔÚ¡° Name:¡±ÊäÈë Global Database layb£¬ÔÚ¡°SID:¡±ÊäÈë layb£¬ÔÚ¡° Compatible Parameter:¡°Ñ¡Ôñ 8.1.0£¬ÔÚ×Ö·û¼¯ÖÐÑ¡Ôñ zhs16gbk£¬ÊäÈë¿ØÖÆ ÎļþµÄλÖá£É趨¸÷¸ö±í¿Õ¼äµÄ²ÎÊý£¬ÊäÈëÈý¸öÈÕÖ¾ÎļþµÄλÖúʹóС SGA Çø µÄ²ÎÊý: shared_pool_size=256000000 db_block_buffer=50000 log_buffer=1638400 process=512 db_block_size=4096 Ñ¡Ôñ±£´æ½¨¿â½Å±¾£¬Ãû×ÖΪ createlayb.sh¡£ 8) ÔÚ$ORACLE_HOME/assistants/dbca Ä ¿  ¼ Ï Â ² createlayb.sh, laybrun.sh, úÉú laybrun1.sh, laybrun2.sh ºÍlaybalterTablespace.sh ½Å±¾Îļþ¡£ 9£©·Ö±ðÖ´Ðнű¾½¨¿â laybprun.sh,laybrun1.sh,laybrun2.sh,laybalterTablespace.sh ½¨Á¢Êý¾Ý¿â layb¡£ 10£©Ê¹Óà ~9£©µÄ·½·¨½¨Á¢Êý¾Ý¿â 7£© laybbak¡£ HOME: http://www.itpub.net MAIL: epub@itpub.net
  6. 6. ITPUB µç×ÓÔÓÖ¾ ORACLE8.1.7 ²úÆ·ÔÚ AIX4.3.3 Éϵݲװ IBM 11£©ÔËÐÐ netca ÃüÁîÅäÖà listener.ora & tnsnames.ora¡£ net8 12£©ÔÚÁ½¸ö½ÚµãµÄ Ŀ¼Ï½¨Á¢ Îļþ£¬±£Ö¤ ¸÷½ÓµãµÄ¡° /oracle .rhosts cluster user equivalence¡¬ rcp£¬ ±£ rlogin ʱ²»Ðè¿ÚÁî¡£ 13£©Ê¹Óà µÄÉí·ÝÐÞ¸Ä root /etc Ŀ¼ÏµÄÎļþ services£¬ÔÚ×îºóÌí¼ÓÈçÏÂÄÚÈÝ£º listener_main 1521/tcp #Net8 listener for layb listener_bak 1522/tcp #Net8 listener for bak ½«Ð޸ĹýµÄÎļþ ¿½±´µ½±¸»úÉÏ¡£ services 14£© ÓÉÓÚ×÷Ë«»ú½á¹¹£±ØÐëÒÔ oracle Éí·ÝʹÓà ÃüÁî×ö ¬ RCP ORACLE Óû§ $HOME/ Ŀ¼µÄÈ«¿½±´£¬Í¬Ê±£¬Ó¦×¢ÒâÔÚµÚ¶þ½ÚµãÖУ¬Ö´ÐÐ /etc Ŀ¼Ï /cdrom/rootpre.sh ½Å±¾£¬ ora*Îļþ£¨¹²Á½¸ö£©µÄ¸´ÖÆ¡£ 15£©±à¼- listener.ora ºÍtnsnames.ora¡£ LISTENER.ORA ÎļþÈçÏ£º # LISTENER.ORA Network Configuration File: /oracle/app/oracle/product/8.1.7/network/admin/listener.ora # Generated by Oracle configuration tools. LISTENER_MAIN = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = layb1_service)(PORT = 1521)) ) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) ) ) SID_LIST_LISTENER_MAIN = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /oracle/app/oracle/product/8.1.7) (PROGRAM = extproc) ) (SID_DESC = (SID_NAME = layb) (ORACLE_HOME = /oracle/app/oracle/product/8.1.7) ) ) HOME: http://www.itpub.net MAIL: epub@itpub.net
  7. 7. ITPUB µç×ÓÔÓÖ¾ ORACLE8.1.7 ²úÆ·ÔÚ AIX4.3.3 Éϵݲװ IBM LISTENER_BAK = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = layb2_service)(PORT = 1522)) ) ) ) SID_LIST_LISTENER_BAK = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /oracle/app/oracle/product/8.1.7) (PROGRAM = extproc) ) (SID_DESC = (SID_NAME = laybbak) (ORACLE_HOME = /oracle/app/oracle/product/8.1.7) ) ) TNSNAMES.ORA ÎļþÈçÏ£º #TNSNAMES.ORA Configuration File:/oracle/app/oracle/product/8.1.7/network/admin/tnsnames.ora # Generated by Oracle configuration tools. layb = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = layb1_service)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = layb) ) ) laybbak = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = layb2_service)(PORT = 1522)) HOME: http://www.itpub.net MAIL: epub@itpub.net
  8. 8. ITPUB µç×ÓÔÓÖ¾ ORACLE8.1.7 ²úÆ·ÔÚ AIX4.3.3 Éϵݲװ IBM ) (CONNECT_DATA = (SERVICE_NAME = laybbak) ) ) 16) ORACLE Êý¾Ý¿âµÄÆô¶¯ºÍ¹Ø±ÕÓÉ IBM AIX HACMP CASCADE µÄÆô¶¯ºÍ¹Ø±Õ½Å ±¾¸ºÔð¡£ ÆäÖÐastartmain ºÍ h hastopmain£¨ Ŀ¼Ï£©¸ºÔðÊý¾Ý¿â /etc layb µÄÆô¶¯ºÍ¹Ø±Õ¡££ ¡ ËùÒÔÊÖ¹¤½¨Á¢Êý¾Ý¿âÆô¶¯½Å±¾ startdbmain ºÍÊý¾Ý¿â¹Ø±Õ½Å±¾ shutdowndbmain£¨ÔÚ /etc Ï£© ,²¢¿½±´µ½±¸»úÉϵÄÏàӦĿ¼Ï¡£ ¸½¸÷½Å±¾ÄÚÈÝ£º hastartmain ½Å±¾ÄÚÈÝ£º su - oracle -c startdbmain £¨root Óû§ÒÔ oracle Óû§µÄÉí·ÝÖ´Ðнű¾ startdbmain£© hastopmain ½Å±¾ÄÚÈÝ£º su - oracle -c shutdowndbmain (root Óû§ÒÔoracle Óû§µÄÉí·ÝÖ´Ðнű¾ shutdowndbmain£© startdbmain ½Å±¾ÄÚÈÝ£º export ORACLE_SID=layb /oracle/app/oracle/product/8.1.7/bin/svrmgrl<<EOF connect internal startup exit EOF lsnrctl start listener_main shutdowndbmain ½Å±¾ÄÚÈÝ export ORACLE_SID=layb lsnrctl stop listener_main /oracle/app/oracle/product/8.1.7/bin/svrmgrl<<EOF connect internal shutdown normal EOF hastartbak ºÍ ÆäÖÐ hastopbak£¨ Ŀ¼Ï£©¸ºÔðÊý¾Ý¿â /etc laybbak µÄÆô¶¯ºÍ¹Ø±Õ¡£ £ ¡ ËùÒÔÊÖ¹¤½¨Á¢Êý¾Ý¿âÆô¶¯½Å±¾ startdbbak ºÍÊý¾Ý¿â¹Ø±Õ½Å±¾ shutdowndbbak ¨ÔÚ Ï£© £ /etc , HOME: http://www.itpub.net MAIL: epub@itpub.net
  9. 9. ITPUB µç×ÓÔÓÖ¾ ORACLE8.1.7 ²úÆ·ÔÚ AIX4.3.3 Éϵݲװ IBM ²¢¿½±´µ½±¸»úÉϵÄÏàӦĿ¼Ï¡£ ¸½ ¸÷½Å±¾ÄÚÈÝ£º hastartbak ½Å±¾ÄÚÈÝ£º su - oracle -c startdbbak £¨root Óû§ÒÔ oracle Óû§µÄÉí·ÝÖ´Ðнű¾ startdbbak£© hastopbak ½Å±¾ÄÚÈÝ£º su - oracle -c shutdowndbbak £¨root Óû§ÒÔ oracle Óû§µÄÉí·ÝÖ´Ðнű¾ shutdowndbbak£© startdbbak ½Å±¾ÄÚÈÝ£º export ORACLE_SID=laybbak /oracle/app/oracle/product/8.1.7/bin/svrmgrl<<EOF connect internal startup exit EOF lsnrctl start listener_bak shutdowndbbak ½Å±¾ÄÚÈÝ export ORACLE_SID=laybbak lsnrctl stop listener_bak /oracle/app/oracle/product/8.1.7/bin/svrmgrl<<EOF connect internal shutdown normal EOF ×¢£º IBM HA ²Ù ×÷£º clstart smit clstop ·Ö±ðΪÆô¶¯¡¢¹Ø±Õ smit IBM HA Varyonvg datavg varyoffvg datavg ·Ö±ðΪÆô¶¯¡¢¹Ø±Õ´ÅÅ̹ñµÄ vg 3. Êý¾Ý¿âË«»úÑéÖ¤·½Ê½£º layb ¼°Æä¼àÌý³ÌÐòÔËÐÐÔÚ ¬ Õý³£Çé¿öÏÂÖ÷Êý¾Ý¿â A »úÉÏ£±¸ÓÃÊý¾Ý¿â ¼°Æä¼à laybbak Ìý³ÌÐòÔËÐÐÔÚ B »úÉÏ¡£ 1£©Èç¹û »úµ±»ú£¬Ö÷Êý¾Ý¿â A layb ¼°Æä¼àÌý³ÌÐò»á×Ô¶¯Çл»µ½ B »ú£¬»úÔËÐÐÖ÷ B Êý¾Ý¿â ¼°Æä¼àÌý³ÌÐòºÍ±¸ÓÃÊý¾Ý¿â layb laybbak ¼°Æä¼àÌý³ÌÐò¡£ HOME: http://www.itpub.net MAIL: epub@itpub.net
  10. 10. ITPUB µç×ÓÔÓÖ¾ ORACLE8.1.7 ²úÆ·ÔÚ AIX4.3.3 Éϵݲװ IBM 2£©Èç¹û »ú»Ö¸´ÔËÐУ¬Ö÷Êý¾Ý¿â A layb ¼° Æä¼àÌý³ÌÐò»á×Ô¶¯±» A »ú½Ó¹Ü¡£ 3£©Èç¹û »úµ±»ú£¬±¸ÓÃÊý¾Ý¿â B laybbak ¼°Æä¼àÌý³ÌÐò»á×Ô¶¯Çл»µ½ A »ú£¬»úÔË A ÐÐÖ÷Êý¾Ý¿â¼°Æä¼àÌý³ÌÐòºÍ±¸ÓÃÊý¾Ý¿â layb laybbak ¼°Æä¼àÌý³ÌÐò¡£ 4£©Èç¹û »ú»Ö¸´ÔËÐУ¬±¸ÓÃÊý¾Ý¿â B laybbak ¼°Æä¼àÌý³ÌÐò»á×Ô¶¯±» B »ú½Ó¹Ü¡£ *** *** *** *** *** ×¢£º±¾ÎÄ×÷ÕßÇëÓë epub@itpub.net ÁªÏµ , ÒÔ±ãÈ·ÈÏÊðÃû . HOME: http://www.itpub.net MAIL: epub@itpub.net
  11. 11. ITPUB µç×ÓÔÓÖ¾ USING 3 LINUX BOXES TO SETUP OPS Using 3 Linux Boxes to Setup OPS ×÷Õß : Parrotao 1. Ðò ÔÚ Oracle µÄÎĵµÖÐ »·¾³ÐèÒªÒ»¸ö¹²Ïí´ÅÅÌÕûÁУ¬¿ÉÊǾ޴óµÄÓ²¼þͶ×Ê OPS ÎÒÃÇÕâЩ Oralce µÄѧϰÕßÊÇÄÑÒÔ³ÐÊܵġ£±¾È˾-¹ýÊÔÑ飬½«Ò»Ì¨ Linux Ö÷»úÄ£Äâ³É¹² Ïí´ÅÅÌÕûÁУ¬´Ó¶ø½¨Á¢ÁËÒ»¸ö OPS µÄʵÑé»·¾³¡£±¾ÎÄÖ÷Ҫ˵Ã÷ÁËÈçºÎÓà 3 ̨Linux Ö÷ »ú¹¹Ôì³ö Oracle OPS µÄʵÑé»·¾³¡£ 2. »ù±¾Ó²¼þÅäÖà Linux Ö÷»úÈý̨ ×îµÍÅäÖà ¡¤ Intel x86 ÈüÑï ¡¤ 128M RAM ÒÔÉÏ ¡¤ 10G£¨ÆäÖÐһ̨ÍƼö 20G£© ÍƼöÅäÖà ¡¤ Intel x86 PIII 800mHz ÒÔÉÏ ¡¤ 256M RAM ÒÔÉÏ ¡¤ 20G ÒÔÉÏ£¨ÆäÖÐһ̨ÍƼö 40G£© 3. Ó²¼þ¼Ü¹¹ -------------- -------------- -------------- | | | | | | | Linux01 | | Linux02 | | ShareDisk| | | | | | | | Com1|=====|Com1 | | | | | | | | | | NBD Client | | NBD Client | | NBD Server | --- ----------- -------------- -------------- | | | | | | | | | | | | ------------------------------------------------------ | HUB | ------------------------------------------------------ HOME: http://www.itpub.net MAIL: epub@itpub.net
  12. 12. ITPUB µç×ÓÔÓÖ¾ USING 3 LINUX BOXES TO SETUP OPS 4. »ù±¾Èí¼þ RedHat 6.2 ·¢²¼°æ NBD2.4.26(NetWork Block Device) refer http://www.linux-ha.org Oracle 8.1.7 for Linux OPS option refer http://www.oracle.com 5. Âß¼-¼Ü¹¹ Logic Concept -------------- -------------- | | | | | Linux01 | | Linux02 | | | Heartbeat | | | Heartbeat |-----------| Heartbeat | | | Line | | | NBD Client | | NBD Client | -------------- -------------- | | | | | | | -------------- | | | | | |------| ShareDisk |-----| | | | | | | | NBD Server | -------------- 6. °²×°Ö¸ÄÏ a. OS °²×° Linux01/Linux02 ¸Ã»úÆ÷ÓÃÓÚ°²×° OPS µÄϵͳ¡£°²×°ÊÇÑ¡Ôñ Custom °²×°²¢Ñ¡Ôñ ºÍ Cluster Kernel Developer ×é¼þ¡£ ShareDisk ¸Ã»úÆ÷ÓÃÓÚÄ£Äâ¹²Ïí´ÅÅÌÕûÁУ¬°²×°Ê±²»Òª½«ËùÓÐÓ²ÅÌÈ«²¿»®·Ö£¬Áô ´ÅÅÌ ¿Õ¼ä£¬×÷Ϊ Linux01/Linux02 µÄ¹²Ïí´ÅÅÌ£¬ÓÃÓÚ´æ·Å OPS µÄÊý¾ÝÎļþ£¨ RAW ·½Ê½£© HOME: http://www.itpub.net MAIL: epub@itpub.net
  13. 13. ITPUB µç×ÓÔÓÖ¾ USING 3 LINUX BOXES TO SETUP OPS Sample Only£© ÄãÈç¹ûÓÐÁ½¸ö´ÅÅÌ£¬Ò²¿É°´ÕÕÏÂÁз½·¨·ÖÇø£¨ Partition List Command (m for help): p Disk /dev/hda: 16 heads, 63 sectors, 12483 cylinders Units = cylinders of 1008 * 512 bytes Device Boot Start End Blocks Id System /dev/hda1 1 17 8536+ 83 Linux /dev/hda2 18 12483 6282864 5 Extended /dev/hda5 18 830 409720+ 83 Linux /dev/hda6 831 932 51376+ 83 Linux /dev/hda7 933 1136 102784+ 83 Linux /dev/hda8 1137 1340 102784+ 83 Linux /dev/hda9 1341 1442 51376+ 83 Linux /dev/hda10 1443 1544 51376+ 83 Linux /dev/hda11 1545 1646 51376+ 83 Linux /dev/hda12 1647 1667 10552+ 83 Linux /dev/hda13 1668 1688 10552+ 83 Linux /dev/hda14 1689 1729 20632+ 83 Linux /dev/hda15 1730 1770 20632+ 83 Linux /dev/hda16 1771 1811 20632+ 83 Linux /dev/hda17 1812 1852 20632+ 83 Linux Èç¹ûÔڸð²×°¹ý³ÌÖÐÈçÓÐÈκÎÎÊÌâ¿É²ÎÔÄ Linux HOWTO¡£ b. ÍøÂç¿éÉ豸µÄ°²×°£¨ NBD £© Download NBD software From http://www.linux-ha.org °´ÕÕBD µÄ°²×°Êֲᰲװ¡£ N tar xfvz nbd-current.tar.gz cd nbd-2.4.26 make make install ¸Ã°²×°±ØÐëÔÚÈý̨»úÆ÷ÉÏÖ´ÐÐ c.OPS µÄ°²×° ? Oracle °²×°´ó¼Ò¶¼»á°É£¬ÌáÐÑһϲ»ÒªÍüÁËÑ¡Ôñ OPS Ñ¡ÏîŶ 7. ²âÊÔÄãµÄ°²×° a. ²âÊÔ OS ×îÖ÷Òª¿´¿´ Sharedisk ÉÏÓÃÓÚ¹²ÏíµÄ·ÖÇøÊÇ·ñÔÚ±¾»úÄܶÁд¡£ mkfs /dev/hda5 HOME: http://www.itpub.net MAIL: epub@itpub.net
  14. 14. ITPUB µç×ÓÔÓÖ¾ USING 3 LINUX BOXES TO SETUP OPS b. ²â NBD ÊÔ 1.ÔÚ Sharedisk ÉÏÆô¶¯ NBD-Server ³ÌÐò nbd-server 3100 /dev/hda5 2.ÔÚ Linux01/Linux02 ÉÏÆô¶¯ NBD-client ³ÌÐò insmod nbd.o nbd-client sharedisk 3100 -n 2 /dev/nda 3.ÔÚ Linux01/Linux02 ÉÏ ,È¡µÃ¹²ÏíÎļþϵͳ mkfs /dev/nda mount /dev/nda /mnt/nda cp /ect/lilo.conf /mnt/nda 4.ÈçÓÐÎÊÌâÇë²ÎÔÄ http://www.linux-ha.org ÉϵÄ×ÊÁÏ¡£ 8. ÉèÖà NBD ÔÚÒ»ÇпªÊ¼Ç°ÇëÏÈÉèÖà NBD ¿ÉÓà NBD ²¢È·ÈÏ a. ÔÚsharedisk ÉÏÆô¶¯ËùÓÐServer ½ø³Ì NBD For Linux01 nbd-server 2000 /dev/hda1 nbd-server 4010 /dev/hda5 nbd-server 4020 /dev/hda6 nbd-server 4030 /dev/hda7 nbd-server 4040 /dev/hda8 nbd-server 4050 /dev/hda9 nbd-server 4060 /dev/hda10 nbd-server 4070 /dev/hda11 nbd-server 4080 /dev/hda12 nbd-server 4090 /dev/hda13 nbd-server 4100 /dev/hda14 nbd-server 4110 /dev/hda15 nbd-server 4120 /dev/hda16 nbd-server 4130 /dev/hda17 For Linux02 nbd-server 3000 /dev/hda1 nbd-server 5010 /dev/hda5 nbd-server 5020 /dev/hda6 nbd-server 5030 /dev/hda7 nbd-server 5040 /dev/hda8 nbd-server 5050 /dev/hda9 nbd-server 5060 /dev/hda10 nbd-server 5070 /dev/hda11 nbd-server 5080 /dev/hda12 HOME: http://www.itpub.net MAIL: epub@itpub.net
  15. 15. ITPUB µç×ÓÔÓÖ¾ USING 3 LINUX BOXES TO SETUP OPS nbd-server 5090 /dev/hda13 nbd-server 5100 /dev/hda14 nbd-server 5110 /dev/hda15 nbd-server 5120 /dev/hda16 nbd-server 5130 /dev/hda17 b. ÔÚLinux01 ÉÏÆô¶¯ËùÓÐClient ½ø³Ì NBD nbd-client sharedisk 4000 -n 2 /dev/nda nbd-client sharedisk 4010 -n 2 /dev/ndb nbd-client sharedisk 4020 -n 2 /dev/ndc nbd-client sharedisk 4030 -n 2 /dev/ndd nbd-client sharedisk 4040 -n 2 /dev/nde nbd-client sharedisk 4050 -n 2 /dev/ndf nbd-client sharedisk 4060 -n 2 /dev/ndg nbd-client sharedisk 4070 -n 2 /dev/ndh nbd-client sharedisk 4080 -n 2 /dev/ndi nbd-client sharedisk 4090 -n 2 /dev/ndj nbd-client sharedisk 4100 -n 2 /dev/ndk nbd-client sharedisk 4110 -n 2 /dev/ndl nbd-client sharedisk 4120 -n 2 /dev/ndm nbd-client sharedisk 2000 -n 2 /dev/ndn c. ÔÚLinux01 ÉÏÆô¶¯ËùÓÐClient ½ø³Ì NBD nbd-client sharedisk 5000 -n 2 /dev/nda nbd-client sharedisk 5010 -n 2 /dev/ndb nbd-client sharedisk 5020 -n 2 /dev/ndc nbd-client sharedisk 5030 -n 2 /dev/ndd nbd-client sharedisk 5040 -n 2 /dev/nde nbd-client sharedisk 5050 -n 2 /dev/ndf nbd-client sharedisk 5060 -n 2 /dev/ndg nbd-client sharedisk 5070 -n 2 /dev/ndh nbd-client sharedisk 5080 -n 2 /dev/ndi nbd-client sharedisk 5090 -n 2 /dev/ndj nbd-client sharedisk 5100 -n 2 /dev/ndk nbd-client sharedisk 5110 -n 2 /dev/ndl nbd-client sharedisk 5120 -n 2 /dev/ndm nbd-client sharedisk 3000 -n 2 /dev/ndn d. È·ÈÏ ¿ÉÓà NBD mkfs /dev/nda ..... ..... mkfs /dev/ndn HOME: http://www.itpub.net MAIL: epub@itpub.net
  16. 16. ITPUB µç×ÓÔÓÖ¾ USING 3 LINUX BOXES TO SETUP OPS 9. ÉèÖà ORACLE_SID Linux01 ORACLE_SID=orcl1 Linux02 ORACLE_SID=orcl2 10. Àí½â Oracle µÄCluster Manager Oracle Ìṩluster Manager ÒÔ±ã PS ¸üºÃµÄ¹¤×÷ C O | ------------------------ | | ------------------------ | ----- |LMON Oracle Instance | |LMON Oracle Instance | | | -- +--------------------- | | -- +--------------------- | | | | | | -- +--------------------- | | -- +------------------ --- | | | Oracle Cluster Manager | | Oracle Cluster Manager | | | -- +--------------------- | | -- +--------------------- | |Oracle | | | | | ----------------- | | | --- -------------- | |provided | | Node Manager | | | Node Manager | | | | -------- +-------- | | | -------- +-------- | | | | | | | | | | | | | -- +------------ +-------- | | -- +------------ +-------- | | | WatchDog Daemon | | WatchDog Daemon | ----- | -- +--------------------- | | -- +--------------------- | | | | | | | | | #========================# #========================# ----- # Linux Watchdog # # Linux Watchdog # |Linux OS # /dev/watchdog # # /dev/watchdog # |provided #========================# #========================# ----- Oracle ÌṩÁËÒ»¸ö½Ð WatchDog Daemon µÄ³ÌÐò£¬Í¨¹ý OS µÄÌṩµÄ WatchDog(Èí ) É豸½øÐÐͬ²½ºÍͨÐÅ¡£ HOME: http://www.itpub.net MAIL: epub@itpub.net
  17. 17. ITPUB µç×ÓÔÓÖ¾ USING 3 LINUX BOXES TO SETUP OPS 11. Æô¶¯ Oracle Cluster Manager a. Æô¶¯ OSµÄÌṩµÄ WatchDog( í É豸 È) insmod softdog b. ÉèÖÃÔËÐÐ Ëù±ØÐëµÄ»·¾³±äÁ¿ Oralce ÈçORACLE_HOME ORACLE_SID c. ÉèÖà Oracle Cluster Manager OCM ÓÐÁ½¸ö¿ØÖÆÎļþ $ORACLE_HOME /oracm/admin/nmcfg.ora $ORACLE_HOME /oracm/admin/ocmargs.ora Èç²»´æÔÚ£¬Çë´´½¨¡£ # Sample configuration file $ORACLE_HOME/oracm/admin/ocmargs.ora -----cut here------ watchdogd -gdba -e $ORACLE_HOME/oracm/log/wddRAC1.log oranm $ORACLE_HOME/oracm/log/nmRAC1.log oracm $ORACLE_HOME/oracm/log/cmRAC1.log -----cut here------ $ORACLE_HOME/oracm/admin/nmcfg.ora -----cut here------ CmHostName=Linux01 CmDiskFile=/dev/raw/raw1 DefinedNodes=Linux01 Linux02 CmServiceName=ocms ClusterName=oracleops WatchdogMarginWait=40000 PollInterval=1000 MissCount= 5 -----cut here------ d. Æô¶¯ OCM cd $ORACLE_HOME cd oracm/bin ./ocmstart.sh e. ¼ì²é ÊÇ·ñÆô¶¯ OCM µÈÉϼ¸Ê®ÃëÖÓÓÃÈçÏÂÃüÁî¼ì²é OCM ÊÇ·ñÆô¶¯ ps -ef | grep ora HOME: http://www.itpub.net MAIL: epub@itpub.net
  18. 18. ITPUB µç×ÓÔÓÖ¾ USING 3 LINUX BOXES TO SETUP OPS UID PID PPID CMD ... root 830 1 watchdogd -g dba -e /u01/ora/pro <-- WD root 831 1 oranm /m /e:/u01/ora/product/8.1 <-- NM root 832 1 oracm /e:/u01/ora/product/8.1.7. <-- CM root 844 831 oranm /m /e:/u01/ora/product/8.1 root 845 844 oranm /m /e:/u01/ora/product/8.1 root 851 844 oranm /m /e:/u01/ora/product/8.1 <-- child root 852 832 oracm /e:/u01/ora/product/8.1.7. threads root 853 852 oracm /e:/u01/ora/product/8.1.7. root 854 844 oranm /m /e:/u01/ora/product/8.1 root 855 844 oranm /m /e:/u01/ora/product/8.1 root 856 844 oranm /m /e:/u01/ora/product/8.1 ... f . ÔÚLinux02 ÉÏÖظ´ÒÔÉϲÙ×÷£¬²¢È·ÈÏ OCMÊÇ·ñÆô¶¯ g. ÈçÓÐÎÊÌâÇë²ÎÔÄLog 12. ÉèÖà Oracle ÂãÎļþ 1. ÔÚLinux01/Linux02 ÉÏ´´½¨ÂãÎļþ NOD mknod /dev/system c 162 10 mknod /dev/temp c 162 11 mknod /dev/users c 162 12 mknod /dev/rbs c 162 13 mknod /dev/indx c 162 14 mknod /dev/tools c 162 15 mknod /dev/drsys c 162 16 mknod /dev/control1 c 162 17 mknod /dev/control2 c 162 18 mknod /dev/redo1_1 c 162 19 mknod /dev/redo1_2 c 162 20 mknod /dev/redo2_1 c 162 21 mknod /dev/redo2_2 c 162 22 2. ÔÚLinux01/Linux02 ÉÏÉèÖÃÂãÎļþÊôÐÔ chown oracle /dev/system HOME: http://www.itpub.net MAIL: epub@itpub.net
  19. 19. ITPUB µç×ÓÔÓÖ¾ USING 3 LINUX BOXES TO SETUP OPS chown oracle /dev/temp chown oracle /dev/users chown oracle /dev/rbs chown oracle /dev/indx chown oracle /dev/tools chown oracle /dev/drsys chown oracle /dev/control1 chown oracle /dev/control2 chown oracle /dev/redo1_1 chown oracle /dev/redo1_2 chown oracle /dev/redo2_1 chown oracle /dev/redo2_2 3. ÔÚLinux01/Linux02 ÉϽ«ÂãÎļþ Link µ½¹²Ïí´ÅÅÌ ×¢Òâÿ´ÎÆô¶¯Ê±¶¼±ØÐë½øÐÐÕâÏî²Ù×÷ raw /dev/system /dev/nda raw /dev/temp /dev/ndb raw /dev/users /dev/ndc raw /dev/rbs /dev/ndd raw /dev/indx /dev/nde raw /dev/tools /dev/ndf raw /dev/drsys /dev/ndg raw /dev/control1 /dev/ndh raw /dev/control2 /dev/ndi raw /dev/redo1_1 /dev/ndj raw /dev/redo1_2 /dev/ndk raw /dev/redo2_1 /dev/ndl raw /dev/redo2_2 /dev/ndm 13. ´´½¨Êý¾Ý¿â ÔÚLinux01 »òLinux02 ÉϾù¿É×ö¡£ a. ÉèÖà DBCA_RAW_CONFIG Îļþ DBCA_RAW_CONFIG Îļþ¼ÇÔØÁËÊý¾Ý´´½¨Ê±Êý¾ÝÎļþºÍ±í¿Õ¼äµÄ¶ÔÓ¦¹Ø ϵ Create dbca_raw.map file ----cut here----- system1 /dev/system users1 /dev/users temp1 /dev/temp rbs1 /dev/rbs HOME: http://www.itpub.net MAIL: epub@itpub.net
  20. 20. ITPUB µç×ÓÔÓÖ¾ USING 3 LINUX BOXES TO SETUP OPS indx1 /dev/indx tools1 /dev/tools drsys1 /dev/drsys control1 /dev/control1 control2 /dev/control2 redo1_1 /dev/redo1_1 redo1_2 /dev/redo1_2 redo2_1 /dev/redo2_1 redo2_2 /dev/redo2_2 ----cut here----- ÉèÖÃBCA_RAW_CONFIG ÎļþµÄ»·¾³±äÁ¿ D bourne shell (sh) and korn shell (ksh) example: $ DBCA_RAW_CONFIG=/home/oracle/dbca_raw.map ; export DBCA_RAW_CONFIG c shell (csh) example: % setenv DBCA_RAW_CONFIG /home/oracle/dbca_raw.map b. ´´½¨Êý¾Ý¿â ÓÃdbassist ´´½¨Êý¾Ý¿â 1. Start Xwindows 2. cd $ORACLE_HOME /bin/ 3. ./dbassist 4. Select OPS option,then next 5. Èç¹ûÄãµÄÉèÖÃÒ»ÇÐÕýÈ· £¬Äã»áÔÚÒ»¸öÁбí¿òÖÐÓÐLinux02 Linux01 ºÍ 6. ÓÃĬÈÏÑ¡Ïî´´½¨Êý¾Ý¿â 14. Æô¶¯Êý¾Ý¿â <Linux01> | <Linux02> sqlplus / as sysdba | sqlplus / as sysdba startup | startup ... | ... HOME: http://www.itpub.net MAIL: epub@itpub.net
  21. 21. ITPUB µç×ÓÔÓÖ¾ USING 3 LINUX BOXES TO SETUP OPS 15. ½øÒ»²½µÄ¹¤×÷ Linux ÉÏ¿ÉÒÔÓà À´»® LVM ·Ö·ÖÇø£¬ÓиüºÃµÄÀ©Õ¹ÐÔ¡£µ«ÔÚRH6.2 Ï°²×°±È½ÏÀ§ÄÑ Óà Heartbeat Èí¼þ£¬¿ÉÒÔ½« Linux01/Linux02 ×ö³É S µÄ O Cluster£¬ µ«¶ÔÓÚ ×÷Óò»´ó£¬¹Ë²»ÔÚ´ËÌÖÂÛ¡£ OPS 16. ²Î¿¼×ÊÁÏ http://www.linux-ha.org http://metalink.oracle.com Intel_Oracle_9iRAC_workshoptechnicalsession.pdf From www.intel.com 17. ¼¼Êõ±³¾° ÒÔÉÏÎĵµµÄÿһ²½ÎÒ¶¼ÊµÏÖ¹ý£¬Î¨Ò»²»Í¬µÄÊÇÎÒÓÃÁË VMWARE. ÈçÓÐÎÊÌâ¿ÉÒÔÔÚÉϸøÎÒÁôÑÔ ITPUB . »òmail to angelwg@public2.sta.net.cn ================================== ×÷ÕßÁªÏµ·½Ê½£º E TaoPuyin G System Engineer Oracle DBA HOME: http://www.itpub.net MAIL: epub@itpub.net
  22. 22. ITPUB µç×ÓÔÓÖ¾ Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ Ê ý ¾ Ý ¿ â ¹ Ü À í ³ É Ê ì ¶ È Ä £ Ð Í Ver 1.1 ×÷Õß Thomas B. Cox : ·-Òë ´ÞÏþ²¨ : (local0) 2002/2/17 HOME: http://www.itpub.net MAIL: epub@itpub.net
  23. 23. ITPUB µç×ÓÔÓÖ¾ Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ Ä¿Â¼ ¡¤Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ ¡¤Êý¾Ý¹ÜÀíÔ±¡¢Êý¾Ý¿â¹ÜÀíÔ±ºÍÊý¾ÝÉè¼ÆÕßµÄÇø±ð ¡¤ÈÎÎñÐÔÖʵÄÇø±ð ¡¤Êý¾Ý¿âÉúÃüÖÜÆÚ ¡¤Êý¾Ý¿âÉè¼ÆÕߺÍÊý¾Ý¿â¹ÜÀíÔ± ¡¤Êý¾Ý¿âÉúÃüÖÜÆÚÖеÄÈÎÎñ ¡¤Êý¾Ý¿âÉúÃüÖÜÆÚºÍ DBA µÄÈÎÎñ ¡¤ DBA ÈÎÎñÁ÷³Ì£¨¶ÔÓÚ³ÉÊìÊý¾Ý¿â£© ¡¤ SLA Ð-ÒéÑù±¾ HOME: http://www.itpub.net MAIL: epub@itpub.net
  24. 24. ITPUB µç×ÓÔÓÖ¾ Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ Ò»¡¢ Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ DBA MM£ºDatabase Administration Maturity Model ±¾ÎĵµÌÖÂÛÁËÊý¾Ý¿â¹ÜÀí£¬¹´»-³öORACLE Êý¾Ý¿â¹ÜÀíÔ±ÔÚ¿ª·¢½×¶ÎºÍά»¤²úÆ· ½×¶ÎÓ¦¸ÃÖ´ÐеÄÈÎÎñ¡£ DBA MM ·ÖΪ ¸ö¼¶±ð 5 ¼¶±ð ½¹µã ¹Ø¼ü´¦ÀíÓò ³õ²½£¨ INITIAL£© ¹Ø×¢£ºÃ»ÓÐ ¡ ³É¹¦ÊÇż¶û·¢ÉúµÄºÍ²»¿ÉÖظ´µÄ ¤ ¹¤¾ß£º¸öÈË·¢»Ó£¨ HEROISM£© ¡¤¹¤×÷±íÏÖΪ£º½ô¼±Ó¦¶Ô¡¢¾È»ð¡¢ ¸öÈË·¢»Ó ¿ É Ö ¹Ø×¢£º¿ÉÖظ´µÄ´ Ø ¸ DBA ¹ý³Ì ¡¤ÏîÄ¿¼Æ»®£¨ DBA ÏîÄ¿¡¢ ¿ª DBA £¨REPEATABLE£© ¹¤¾ß£º ÈÕ³£¼ì²éÁбí DBA ·¢Ö§³Ö£© ¡¤ÏîÄ¿¸ú×Ù¡¢DBA ÏîÄ¿£© ¿±Â©£¨ ¡¤×ÓÏîÄ¿¹ÜÀí£¨ DBA ÏîÄ¿Íâ°ü»ò ×ÓÏîÄ¿£© ¡¤ÅäÖùÜÀí£¨Êý¾Ý¿âÈí¼þ¡¢ DBA ¹¤¾ß¡¢±ä¸ü¹ÜÀí£© ¶¨Ò壨 DEFINED£© ¹Ø×¢£º½« ´¦Àí¹¤×÷¶¨Òå DBA ¡¤ÐèÇó¹ÜÀí£¨·þÎñ¼¶±ð£© »¯¡¢Îĵµ»¯ ¡¤ÖÊÁ¿±£Ö¤£¨ DBA ÈÎÎñ£© ¹¤¾ß£º Åàѵ DBA ¡¤×î¼ÑµÄʵ¼ù±»Ã÷È·»¯²¢¿É´«²¥ £¨Åàѵ£© ¡¤¹¤×÷±»Ã÷È·¶¨Ò壬ÈÎÎñÖ´ÐÐÇé¿ö ¿ÉÒÔ±»È·ÇеĶÈÁ¿ ¹ÜÀí£¨ MANAGED£© ¹Ø×¢£º¹ý³Ì¿ØÖÆ£¬¼´ ¡¤ËùÓб仯¶¼ÄܿɿصļǼÏÂÀ´£¬ DBA ´¦ ÀíÁ÷³ÌÊÇÎȶ¨µÄºÍ¿É ²¢Ôڱ仯µÄ֮ǰºÍÖ®ºó½øÐжÈÁ¿£¬ ¶ÈÁ¿µÄ£¬ËùÓеı仯¼° ÒÔÈ·Èϱ仯ÊÇ·ñÓÐЧ¡£ ÆäÆðÒò¶¼±»¼Ç¼ºÍ±ê ×¢¡£ ¹¤¾ß£º SLA ÓÅ»¯£¨ OPTIMIZING£© Á¬ÐøµÄ¹ý³ÌÓÅ»¯£º ¡¤¹ÜÀíʵ¼ùÖеõ½Ìá¸ß£¬¼¼Çɵõ½ Ê×ÏÈÒª¿ÉÖظ´²ÅÄÜÌá¸ßÌáÁ¶ Ê×ÏÈÒª¿É¶¨Òå²ÅÄܶÈÁ¿¡¤±ä»¯µÄÒòËصõ½ÏµÍ³µÄ¿ØÖÆ£¬½Ì Ê×ÏÈÒª¿É¶ÈÁ¿²ÅÄܹÜÀíѵѧϰÖеõ½¸ü´óµÄÌá¸ß ¶þ¡¢ Êý¾Ý¹ÜÀíÔ±¡¢Êý¾Ý¿â¹ÜÀíÔ±ºÍÊý¾ÝÉè¼ÆÕßµÄÇø±ð ¸ù¾ÝÊý¾Ý¿âʹÓùý³ÌÖÐÈÎÎñµÄ²»Í¬£¬»®·ÖΪ 3 ¸öÈÎÎñ¼¯ºÏ£º £¨ 1£© Êý¾Ý¹ÜÀíÈÎÎñ £¨ 2£© Êý¾ÝÉè¼ÆÈÎÎñ £¨ 3£© Êý¾Ý¿â¹ÜÀíÈÎÎñ ¿ÉÄÜ»áÒ»ÈËͬʱµ£µ±¶à¸ö½ÇÉ«£¬µ«ÊÇ 3 Àà½ÇÉ«µÄÈÎÎñÊDz»Í¬µÄ£¬±íÏÖÔÚ£ºÒ»·½ÃæÈÎÎñµÄ HOME: http://www.itpub.net MAIL: epub@itpub.net
  25. 25. ITPUB µç×ÓÔÓÖ¾ Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ ÊDz»Ò»ÑùµÄ£¬ÁíÍâÒ»·½Ã棬²»Í¬µÄÈÎÎñ³öÏÖÔÚÊý¾Ý¿âÉúÃüÖÜÆڵIJ»Í¬½×¶Î¡£ Èý¡¢ ÈÎÎñÐÔÖʵÄÇø±ð 1¡¢Êý¾ÝÉè¼Æ Êý¾ÝÉè¼Æ¹Ø×¢Êý¾ÝµÄÂß¼-¡¢ÎïÀíÄ£Ð͵Ľ¨Á¢£¬ÕâЩģÐÍÖ®ºó»á×÷Ϊ¶ÔÏó´ Ϊ½â¾öÌض¨µÄÉÌÒµÎÊÌ⣬ÔÚÓ¦ÓÃËùÉæ¼°µÄ·¶Î§ÖУ¬½¨Á¢ÕâЩģÐÍ£¬Ë³ÐòÊ Ó¦Ó÷¶Î§ÉÌÒµÐèÇó ? ? Êý¾ÝÂß¼-Ä£ÐÍ ? Êý¾ÝÎïÀíÄ£ÐÍ Êý¾ÝÉè¼Æ¸ºÔðÒÔϾßÌå·½Ã棺 ¡¤½¨Á¢µÄÄ£ÐÍÄܹ»³ä·ÖÂú×ãÉÌÒµÎÊÌâµÄÐèÒª¡£ ¡¤È·±£Ä£ÐÍÔÚ¹¹½¨ÔÚÓ¦ÓÃÁìÓòÖ®ÄÚ£¨Í¨³£Ä£Ðͺ-¸ÇµÄ·¶Î§Â À´Ó¦ÓÃϵͳÓëÆäËûϵͳ½Ó¿Ú£¬µ«ÊÇÄ£ÐͲ»Äܹý´óµÄÍÑÀëʵ¼ ¡¤½¨Á¢Ò»¸öÓû§¿ÉÒÔ½ÓÊܵÄÎïÀíÄ£ÐÍ£¨Ó°ÏìÐÔÄÜÌá¸ßµÄÖ÷Ò Êý¾ÝÉè ¼ÆÕßÓ¦¸Ã¾¡¿ÉÄܵÄÌá¸ßÐÔÄÜ£¬¶ø²»ÊÇÆÆ»µËü£© 2¡¢Êý¾Ý¹ÜÀí Êý¾Ý¹ÜÀí¸ºÔðÖƶ¨·ÃÎʲßÂÔ£ºË-ÓµÓÐʲôÊý¾Ý¡¢Ë-ÄÜ´´½¨¡¢¸Ä±ä¡¢É¾³ýʲ ÀíÕß±ØÐë¸ú×Ù¿ØÖÆÊý¾ÝÔªËصÄËùÓÐȨ£¬ÕâÏ×÷ÓëÊý¾ÝµÄÉè¼ÆÎ޹أ¬Ò²º £¨ DBA£©Î޹ء£¾ßÌå¶øÑÔ£º ¡¤Ë-ÓµÓÐÊý¾Ý ¡¤Ë-ÓµÓÐÊý¾ÝµÄ¶¨Òå ¡¤ÔÚÊý¾ÝµÄÉú´æÖÜÆÚÖУ¬Èç¹ûÐèÒª±ä¸üËùÓÐȨ£¬Ê²Ã´Ê±ºò¡¢ÈçºÎ¸Ä±ä£¨ ¶¨µ¥Ò»Ö±µ½¶¨µ¥Ìá½»£¬·¢»õÈËÔ±½Ó×ÅÓµÓÐËüÒ»Ö±µ½»õÎï·¢³ö£¬È»ºóÓÉ²Æ µ½Êܵ½»õ¿î£© 3¡¢Êý¾Ý¿â¹ÜÀí Êý¾Ý¿â¹ÜÀíÔ±¸ºÔðά»¤Êý¾Ý¿âµÄÎïÀíÔË ÐУ¨È罫Êý¾Ý´æ·ÅÔÚij¸ö´ÅÅÌÉÏ£¬ DBA ¸ºÔ𣺠©£ ¡¤Î¬»¤Êý¾Ý¿â£¬Ê¹ËüÔËÐÐÔÚÊý¾Ý¿â¿ª·¢ÕßÒªÇóµÄ״̬Ï¡£ ¡¤½øÐе÷ÓÅ¡¢·Öµ£¸ºÔØ¡¢´ò PATCH¡¢Éý¼¶¡¢±¸·Ý¡¢»Ö¸´µÈ ¡¤³ýÁËÂß¼-·ÃÎÊ£¨Ó¦Óü¶£©ÒÔÍâµÄÊý¾Ý¿âËùÓз½Ãæ¡£ Ìرð×¢Ò⣬ DBA µÄÖ°ÔðÖÐûÓÐд SQL Ó¦Óã¬Ð´ Ó¦ÓÃÊÇ¿ª·¢ÕߵŤ×÷£¬Èç¹û SQL DBA ³Ðµ£ ÕâÏîÈÎÎñ£¬Ëû¾Í³ÉΪ¿ª·¢ÈËÔ±£¬²»ÊÇ DBA¡£ ËÄ¡¢ Êý¾Ý¿âÉúÃüÖÜÆÚ Ò»¸öеÄÊý¾Ý¿âµ®Éú£¬Í¨³£ÊÇΪÁËÂú×ãеÄÓ¦Ó㨻òÐèÒªÔÚÀϵÄÊý¾Ý¿â ¸Ä±ä£ ©£¬ÎªºÏÀíµÄ¹¹½¨Êý¾Ý¿â£¬±ØÐëÓÐÈË·ÖÎöÓ¦Óã¬Éè¼ÆºÏÊʵıí½á¹¹£¨ E- RÄ£ÐÍ£¬ ¶øºóÓ°ÉäΪÊý¾Ý±í£¬Ò²¿ÉÒÔÖ±½ÓÉè¼ÆÊý¾Ý±í£© ¡£Éè¼Æ±íÓ¦ÏÈÓÚÆäËûµÄ½×¶Î Éè¼Æ±íÖ÷ÒªÓÉÊý¾ÝÉè¼ÆÕßÍê³É£¬³ýÁËÉè¼Æ±íÖ®Í⣬Êý¾ÝÉè¼ÆÈËÔ±»¹¸ºÔð ÉúÔÚÓ¦ÓÃÐèÇó±ä»¯Ê±£¬¾ö¶¨ÐèÒª½øÐÐÄÄЩ±ä¸ü¡£ Êý¾Ý¿âÉúÃüÖÜÆÚ Éè¼ÆÕß Êý¾Ý¹ÜÀíÕß DBA 1£®¾ö²ß¡¢·ÖÎö ±íÉè¼Æ£¬°²È«Éè¼Æ Êý¾ÝËùÓÐȨ£¬°²È«²ß HOME: http://www.itpub.net MAIL: epub@itpub.net
  26. 26. ITPUB µç×ÓÔÓÖ¾ Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ ÂÔ Êý¾Ý¿âÉúÃüÖÜÆÚ Éè¼ÆÕß Êý¾Ý¹ÜÀíÕß DBA 2£®Éè¼Æ£¬½¨Ôì Ó°Ïì·ÖÎö ±ä¸ü¹ÜÀí °²×°£ Éú³ÉÊý¾ÝÎÄ ¬ ¼þ£¬±í¡¢±í¿Õ¼ä½¨ Á¢£¬±¸·Ý /»Ö¸´¼Æ »®£¬°²È«¹ý³Ì 3£®Ó×Äê ÎïÀíÖØ×é£ ÐÔÄܵ÷ ¬ ÓÅ 4£®³ÉÊì Òì³£Çé¿ö¼à¿Ø £Ð ¬Ô Äܼà²â£¬ÐÔÄܵ÷ ÓÅ£¬Ö´Ðб¸·Ý /»Ö ¸´£ Êý¾ÝÎļþ¹ÜÀí ¬ A£®Ð¡±ä¸ü Ó°Ïì·ÖÎö ±ä¸ü¹ÜÀí ±íÐÞ¸Ä B£®´ó±ä¸ü Ó°Ïì·ÖÎö£¬±íÖØÉè¼Æ ±ä¸ü¹ÜÀí ½¨±í ÿµ±Ó¦ÓõÄÐèÇó·¢Éú±ä»¯Ê±£¬Êý¾Ý¹ÜÀíÔ±¶¼ÐèÒª½øÐбä¸ü¹ÜÀí£¬ÒÔÈ·± ÓÚÏàÓ¦µÄÓû§¡£ ÔÚÏîÄ¿µÄºóÆÚ£¬±íµÄÉè¼ÆÍê³Éºó£¬¿ªÊ¼ÓÉ DBA ½øÐн¨±í£¬°üÀ¨¿Õ¼ä»®·Ö£¬´æ´¢²ÎÊý ÉèÖ㨸ù¾ÝÊý¾ÝÉè¼ÆÈËÔ±µÄÒªÇó£ © £¬·Ö²¼Êý¾ÝÒÔ»ñµÃ¸ºÔØƽºâ¡£Èç¹û×ñ´Ó OFA£¨ OPTIMAL FLEXIBLE ARCHITECTURE£© DBA ±ØÐë°´ÕÕ µÄÒªÇó½øÐÐÊý¾ÝÎļþ OFA »®·Ö¡£ Îå¡¢ Êý¾Ý¿âÉè¼ÆÕߺÍÊý¾Ý¿â¹ÜÀíÔ± Çø·ÖÊý¾ÝÉè¼ÆÕßºÍ DBA£¬¹Ø¼üµÄÒ»µã²»Í¬ÊÇ£º ¡¤Êý¾ÝÉè¼ÆÈËÔ±µÄ¹¤×÷ÔÚÓÚÊý¾Ý¿âµÄÂß¼-¹¹½¨£¨ÊµÌå¡¢¹Øϵ¡¢±íÉè¼Æ£© ¡¤Êý¾Ý¿â¹ÜÀíÔ±µÄ¹¤×÷ÔÚÓÚÎïÀíÎÊÌâµÄ½â¾ö£¨Êý¾ÝÎļþ¡¢´ÅÅ̸ºÔØ·Öµ£ ÕâÖÖ¹ÛµãÓÐÆäÕýÈ·ÐÔ£¬µ«ÊÇÈç¹ûÑϸñ°´ÕÕÕâÖÖ·Ö·¨£¬Ò²´æÔÚDZÔÚµÄÎÊÌ ÈËÔ±ÓÐÊý¾Ý¿âÎïÀí¹¹½¨·½ÃæµÄ֪ʶ£¬ÊÇÒ»Öֺܺõķ½·¨£¬ÕâʹÊý¾ÝµÄÉè¼Æ ºÍά»¤¡£ÔÚÆû³µÖÆÔìÐÐÒµ£¬ÀàËƵÄÐÐΪ³ÆΪ¡°ÎªÖÆÔì¶øÉè¼Æ¡¡ÉèÏëÉè¼ÆÈËÔ± ±£ ËüÃÇÔÚ¹¦ÄÜÉÏÍêÈ«Ò»Ñù£¬µ«ÆäÒ»µÄÖÆÔì ºÜÁ®¼Û£¬Èç¹ûÉè¼ÆÕßûÓÐÉú²ú·½ÃæµÄ֪ʶ£¬Ëû½ ÖªµÀÄĸö·½°¸¸üÁ®¼Û¡¢¸üÈÝÒ×ʵÏÖ¡£ ÁíÍâÇú½âÕâÒ»¹ÛµãµÄ×ö·¨ÊÇ£ºÈà DBA ¸ºÔðÊý¾Ý¿âÉè¼Æ¡£ÓÐЩÈ˵ÄÈ·ÕâÑù×ö£¬ËûÃÇ ³£½øÐÐÉè¼Æ½ö½ö¿¼ÂÇÈçºÎÒ×ÓÚά»¤£¬¶øºöÂÔÁËÓ¦ÓõÄÒªÇó£¬ÕâÑùµÄÉè¼Æͨ ÒÔÏÂÊǸù¾ÝÈÎÎñµÄ²»Í¬£¬ÁгöÊý¾Ý¿âÉúÃüÖÜÆÚµÄÈÎÎñ·Ö²¼£º Ö´ÐÐÕß ÈÎÎñ ƵÂÊ ÉúÃüÖÜÆÚµÄ ÃèÊö ½×¶Î Éè¼ÆÕß ±íÉè¼Æ Ò»´Î 1 £¬B Éè¼Æ·ûºÏÓ¦ÓÃÒªÇóµÄ±í ½á¹¹£¬µ±ÐèÇó¸Ä±äʱ£¬ HOME: http://www.itpub.net MAIL: epub@itpub.net
  27. 27. ITPUB µç×ÓÔÓÖ¾ Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ ×öÏàÓ¦µÄµ÷Õû Ö´ÐÐÕß ÈÎÎñ ƵÂÊ ÉúÃüÖÜÆÚ ÃèÊö Éè¼ÆÕß °²È«Éè¼Æ Ò»´Î 1 È·±£Êý¾Ý ¿âµÄÉè¼ÆÂú×ã Ó¦ÓõݲȫÐÔÒªÇó Ó°Ïì·ÖÎö ¸ù¾ÝÐèÒª A£¬ 2£¬ B µ±Ó¦Óøıäʱ£¬ÉóÊÓÊý ¾Ý¿âÉè¼ÆµÄÄÇЩ·½ÃæÐè ÒªÏàÓ¦µÄµ÷Õû¡£ Êý¾Ý¹ÜÀíÕß Êý¾ÝËùÓÐȨ Ò»´Î 1 È·ÈÏË-ÓµÓÐÄÄЩÊý¾Ý£¬ ²¢¶ÔÖ®½øÐÐά»¤¡£ °²È«²ßÂÔ Ò»´Î 1 ¾ö¶¨Ë-¿ÉÒÔÊÚȨ·ÃÎÊÊý ¾Ý£¬Ë-¿ÉÒÔÔÚʲôʱºò ½«ÄÇЩÊý¾Ý¹²Ïí¸ø±ðÈË ±ä¸ü¹ÜÀí ¸ù¾ÝÐèÒª A£¬ 2£¬ B µ±Ó¦ÓûòÆäÊý¾Ý·¢Éú±ä »¯Ê±£¬È·±£ËùÓÐÊý¾Ý±£ ³ÖÇåÎúµÄËùÓйØϵ£¬Í¨ ÖªÏà¹ØÐèÒª¸Ä±äµÄÓû§ DBA °²×° Ò»´Î 2 °²×°Êý¾Ý¿â ´´½¨Êý¾ÝÎļþ Ò»´Î 2 ΪÌض¨µÄ±í¿Õ¼ä´´½¨Êý ¾ÝÎļþ£¬¼õÉÙ´ÅÅÌ·ÃÎÊ ³ å Í »¸ ù ¾ Ý É è ¼ Æ Ê ¹ Ó Ã £¬ OFA¡£ Öƶ¨±¸·Ý ´ / » Ö ¸ Ò»´Î 2 ½¨Á¢±¸·Ý»Ö¸´·½°¸£¬²¢ ·½°¸ ½øÐвâÊÔ °²È«´ëÊ© Ò»´Î 2 ´´½¨ role,·ÖÅäÊý¾Ý·ÃÎÊ È¨ÏÞ£¬ÏµÍ³È¨ÏÞ£¬´´½¨ Óû§£ ³õʼ»¯Éó¼Æ¹¦ÄÜ¡£ ¬ ±í -±í¿Õ¼äÓ³Éä Ò»´Î 2 ¸ù¾ÝOFA »òÆäËûµÄ×¼ Ôò£¬´´½¨±í -±í¿Õ¼ä¶ÔÓ¦ ¹Øϵ£¬²¢ÏòʹÓÃÎĵµ¼Í ¼ ´´½¨±í Ò»´Î 2£¬ B ÔÚÏàÓ¦µÄ±í¿Õ¼äÉÏ´´½¨ ±í ÎïÀíÖع¹ ¸ù¾ÝÐèÒª 3 ÔÚ±í¿Õ¼äÄÚÖع¹±í£¬´´ ½¨ /¸Ä±äË÷Òý£/¸Ä±ä ¬´´½¨ ´Ø£¬ ÐÔÄܵ÷ÓÅ ¸ù¾ÝÐèÒª 4 3£¬ Æð³õ²éÕÒÎïÀíÅäÖõÄÑÏ ÖØÎÊÌ⣬ÈçË÷ÒýûÓн¨ µÈ¡£µ±Êý¾Ý¿â½¨³Éºó£¬ ͨ¹ýÐÔÄܼà²âÈÎ Îñ£¬¶Ô ÐèÒªµ÷ÕûµÄ²¿·Ö½øÐе÷ ÓÅ¡£ Òì³£¼à²â ÿÌì 2£¬ 4 3£¬ ͨ¹ýOG£¬ L TRACE µÈ ÈÕÖ¾¼ì²éÒì³£Çé¿ö£¬Í¨ ¹ýEMAIL ½ÓÊÜÓû§µÄ HOME: http://www.itpub.net MAIL: epub@itpub.net
  28. 28. ITPUB µç×ÓÔÓÖ¾ Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ ÎÊÌⱨ¸æ¡£ ÐÔÄܼà²â ÿÖÜ 4 ¸ù¾ÝÊÂÇ°¶¨ÒåµÄ SLA µÈ£¬¶ÔÊý¾Ý¿âµÄÐÔÄܽø Ðмì²é¡£ Êý¾ÝÎļþ¹ÜÀí ¸ù¾ÝÐèÒª 4 ¸ù¾ÝÐèÒª·Ö²¼Êý¾ÝÎÄ ¼þ£¬À©Õ¹Êý¾Ý±í¿Õ¼ä Ö´ÐÐÕß ÈÎÎñ ƵÂÊ ÉúÃüÖÜÆÚ ÃèÊö DBA Ö´Ðб¸·Ý /»Ö¸´ ÿÌì 4 Ö´ÐÐÔÚÏß¡¢ÀëÏß¡¢ÈÕÖ¾ µÈ±¸·Ý£¬ÐèҪʱ½øÐÐ»Ö ¸´¡£ ±íÐÞ¸Ä ¸ù¾ÝÐèÒª A µ±Ó¦Ó÷¢ÉúСµÄ¸Ä¶¯Ðè Òª±ä¶¯±íʱ£¬ DBA ±ØÐë ÔÚ±£Ö¤ÒÑÓÐÊý¾Ý¿É¿¿ÐÔ Ç°ÌáϽøÐÐÐ޸ġ£ Áù¡¢Êý¾Ý¿âÉúÃüÖÜÆÚÖеÄÈÎÎñ 1¡¢°²×° 2¡¢´´½¨Êý¾ÝÎļþ 3¡¢Öƶ¨±¸·Ý / »Ö¸´¼Æ»® ±¸·Ý /»Ö¸´ÊDZ£Ö¤Êý¾Ý¿â¿ÉÓÃÐÔµÄÖØÒªÊֶΣ¬Òª¾¡¿ÉÄܵĽ«ÒÔÍâµÄÖжϽµµ ²½Ö裺 ¡¤½¨Á¢Êý¾Ý¿âµÄ±¸·Ý»Ö¸´²ßÂÔ ¡¤Ðγɱ¸·Ý»Ö¸´Îĵµ ¡¤²âÊÔ±¸·Ý»Ö¸´ ¡¤ÓÉÆäËûר¼Ò½øÐÐÉó²é ¡¤Ê¹±¸·Ý /»Ö¸´²ßÂÔ·ûºÏ SLA ¡¤Èç¹û×ÊÔ´²»ÄÜ´ïµ½ SLA µÄÒªÇó£¬Öð²½Éý¼¶¡£ 4 ¡¢°²È«²ßÂÔ ¹ØÓÚÊý¾Ý¿â°²È«ÐÔÓÐÈý¸ö¼¶±ð£º UNIX Óû§Ãû /¿ÚÁîÈÏÖ¤ ORACLE Óû§Ãû /¿ÚÁîÈÏÖ¤ ÓëÓ¦ÓÃÏà¹ØµÄ°²È«ÌØÐÔ ÍøÂçµÄÈÏÖ¤ ÓëÊý¾Ý¿âûÓÐÖ±½ÓµÄ¹ØÁª£¬µ«ÊÇËüÒ²¹¹³ÉÁËÒ»¸ö°²È«¼¶¡£ ²½Ö裺 ¡¤¾ö¶¨Ê¹ÓÃÄĸö¼¶±ðµÄ°²È«¿ØÖÆ ¡¤²¿ÊðÏàÓ¦µÄ°²È«»úÖÆ ¡¤¸ù¾ÝÐèÒª¹ÜÀíÓû§¡¢½ÇÉ« ¡¤¼ì²é°²È«»úÖÆ HOME: http://www.itpub.net MAIL: epub@itpub.net
  29. 29. ITPUB µç×ÓÔÓÖ¾ Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ 5 ¡¢±í ±í¿Õ¼ä¶ÔÓ¦ - 6 ¡¢½¨±í 7 ¡¢ÎïÀíÔªËØÖØ×é °üº¬ÒÔÏ£º ¡¤½«Ò»¸ö±íÓÉÒ»¸ö±í¿Õ¼ä°áÒƵ½ÁíÒ»¸ö ¡¤´´½¨ËùÐèµÄË÷Òý ¡¤´´½¨¼¯´Ø ¡¤¶¨Òåˮƽ·Ö¸î ¡¤Ñ¹Ëõ±íµÄ extents£¬Í¨¹ý backup/exp/drop/imp ¡¤Ñ¹ËõË÷ÒýµÄ extent£¬Í¨¹ý drop/re-create ORACLE ÎïÀí´æ´¢µÄ¼¸¸ö¸ÅÄ ¡¤ Data blocks ×îСµÄ´æ´¢Á£¶È£¬ËùÓеÄORACLE Êý¾ÝÒÔ BLOCK Ϊµ¥Î»´æ´¢ºÍ·ÖÅä¿Õ ¼ä£¨ÓÖ³ÆÂß¼-¿é¡¢ ¿é¡¢Ò³£ ORACLE © ¡£Ò»¸öÊý¾Ý¿é¶ÔÓ¦×ÅÒ»¶¨ BYTES µÄ ´ÅÅ̿ռ䣬µ±Êý¾Ý¿â´´½¨Ê±¼´Ö¸¶¨ÁËÊý¾Ý¿é´óС¡£ Ïà±È½Ï£¬²Ù×÷ϵͳµÄ¿é½ö½öÊÇÒ»¶¨ÊýÁ¿µÄ BYTES ¼¯ºÏ£¬Êý¾ÝµÄÎïÀí´æ´¢ ÒÔ BYTE Ϊµ¥Î»¡£ ¡¤ Extents EXTENT ÊÇÒ»¶¨Á¬ÐøµÄ µÄ¼¯ºÏ£¬ÓÃÓÚ·ÖÅä´æ´¢Ò»¸öÌض¨µÄÐÅÏ¢¡£ BLOCK ¡¤ Segments Âß¼-ÉÏ EXTENT Ö®ÉÏÊÇSEGMENT £¬ SEGMENT ÊÇÒ»¸öEXTENT µÄ¼¯ºÏ£¬ ÓÃÓÚ¸øÒ»¸öÌض¨µÄ½á¹¹·ÖÅä¿Õ¼ä£¬ SEGMENT ÏÞÖÆÔÚÒ» ¸ö±í¿Õ¼äÖС£ 8¡¢ÐÔÄܵ÷ÓÅ ÐÔÄܵ÷ÕûÊÇÒ»¸ö³¤ÆڵĹý³Ì£¬ÕýÈ·µÄµ÷ÓÅ¿ÉÒÔ´øÀ´ºÜ´óµÄºÃ´¦£¬µ«ÊÇ ¿ÉÄÜ»á´øÀ´¸ºÃæµÄÓ°Ï죬ËæÒâµÄµ÷Õû¿ÉÄÜ´øÀ´²»¿ÉÔ¤ÖªµÄºó¹û¡£ ͨ³£µ÷ÓűØÐëÔÚÒ»¶¨µÄÔ¼¶¨·¶Î§ÄÚ½øÐУ¬²¢×ñÑ-Ô¤ÏÈÉèÖõÄ×¼Ôò£¬Õâ ÄÜ¿ÉÒÔ±»¶ÈÁ¿¡¢¿ÉÐÅÀµºÍ¾«È·¡£ ÔÚÈçϵÄÇé¿öϲŽøÐÐÊý¾Ý¿âµ÷ÓÅ£º £¨ 1£©ÓÐÊʵ±µÄ SLA £¨ 2£©ÓпÉÐÅÀµµÄÐÔÄܶÈÁ¿Ö¸±ê £¨ 3£©Êý¾Ý¿âûÓдﵽ SLA µÄÐÔÄÜÒªÇó ÓÐÁ½ÖÖ¿ÉÒÔ½ÓÊܵĵ÷ÓŽá¹û£º £¨ 1£©Êý¾Ý¿âµÄÐÔÄÜ´ïµ½ÁË SLA µÄÒªÇó £¨ 2£©µ÷ÓŵIJ»¿ÉÐлò²»¿ÉÄÜ£¬ SLA µÄ±ê×¼¾-¹ýÐ-ÉÌ ½ÓÊÜÄ¿Ç°µÄÐÔÄÜ 9¡¢Òì³£Çé¿ö¼à²â Òì³£¼à²âÊÇ ×îÖØÒªµÄÀýÐй¤×÷£¬Ëü¿ÉÒÔʹ DBA DBA Ô¤ÏÈ·¢ÏÖÎÊÌâµÄÇ°Õס£ DBA ÖÁÉÙÐèÒª¼à²â£º £¨1£© Óû§·´Ó³µÄÒì³£Çé¿ö£¬³ö´íÐÅÏ¢µÈ£¨ DBA Ó¦¸ÃÏêϸ¼Ç¼ÏÂÀ´£© £¨2£© ÔÚalert¡¢ trace µÈÈÕÖ¾ÖеÄÒì³£¼Ç¼ HOME: http://www.itpub.net MAIL: epub@itpub.net
  30. 30. ITPUB µç×ÓÔÓÖ¾ Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ 10 ¡¢ÐÔÄܼà²â ÕâÏ×÷ʹ ¸ÐÊÜÊý¾Ý¿â·¢ÉúÎÊÌâµÄ¶úÄ¿£¬ÖÁÉÙÐèÒª×ö£º DBA £¨ 1£© ÿ¸ö±í¿Õ¼ä¿ÕÏÐÄÚ´æµÄËéƬÇé¿ö £¨ 2£© ÿ¸ö±í¿Õ¼äµÄ¿ÕÏÐ¿Õ¼ä £¨ 3£© Êý¾Ý¿âµÄÔö³¤ÂÊ £¨ 4£© ²âËã³öÊý¾Ý¿âÄ¿Ç°×ÊԴʲôʱºò»áºÄ¾¡ £¨ 5£© ÿ¸ö±í¡¢Ë÷Òý³¬¹ýÃÅÏÞµÄ extent ÊýÁ¿ £¨ 6£© ¶Ô²éѯ»òÊÂÎñ£¨ insert,update,delete£©µÄÏìӦʱ¼ä £¨ 7£© alert,trace ÈÕÖ¾ÖÐÒì³£µÄ¼Ç¼ 11 ¡¢Êý¾ÝÎļþ¹ÜÀí 12 ¡¢Ö´Ðб¸·Ý / »Ö¸´ 13 ¡¢±íµÄÐÞ¸Ä DBA Æß¡¢ Êý¾Ý¿âÉúÃüÖÜÆÚºÍ µÄÈÎÎñ ʲôʱºò×öʲôÈÎÎñ£¬Ç°ÌáÊÇÊý¾Ý¿âÒѾ-´¦ÓÚ¡°³É 1¡¢ÐÔÄܼà²â ÐÔÄܼà²â±ØÐëÒÀÕÕ SLA ²¢¾-³£ÓÉÓû§½øÐз´À¡£¬¸ù¾Ý¾-Ñ飬µ±ÏµÍ³¸Õ¸Õ½¨³Éʱ ÿÌì¼à²â£¬µ±ÏµÍ³ÒѾ-Îȶ¨£¬Ã¿Öܼà²âÒ»´Î¡£ £¨ 1£©Ã¿¸ö±í¿Õ¼ä¿ÕÏпռäµÄËéƬÇé¿ö Èç¹û³öÏÖ·ä³²×´ËéƬ£¬ÔòʹÓÃÕ³ºÍ¹¤¾ß£¨ ORACLE7 ÒÔ ºó°æ±¾×Ô¶¯½øÐÐ coalescing ¹¤×÷£ ©£»Èç¹û¿Õ¶´µÄËéƬ̫´ó£¬¿ÕÏпռä½ÏС£¬ÔòºöÂÔ¿Õ¶´£¬ÔÚ½¨Á¢ ¼þ£»Èç¹û´Ëʱ´ÅÅÌ¿Õ¼ä¹ýС£¬Ôò½øÐÐ backup/exp/drop/imp À´ÖØÐÂÕûÀí¡£ £¨ 2£©Ã¿¸ö±í¿Õ¼äµÄÊ£Óà¿Õ¼ä £¨ 3£©¼ÆËã±í¿Õ¼ä¿ÕÏÐÂÊ ×¢ÒâEMP ²»ÔÚ¹Ø×¢Ö®ÄÚ£¬È·ÈÏ Ê¹ÓÃÁË T ROLLBACK OPTIMAL ´æ´¢²ÎÊý¡£ £¨ 4£©¹Øעʲôʱºò¿Õ¼ä»áºÄ¾¡ £¨ 5£©¹Ø×¢´óÓÚEXTENT µÄ¶ÔÏó 4 ¸ö ¶¨ÆÚѹËõ EXTENT £¬Èç¹ûij¸ö¶ÔÏóµÄ ×ܱ»Ñ¹Ëõ£¬Ó¦¿¼ÂÇÔö¼ÓÆä EXTENT NEXT EXTENT ´óС£¬Èç ¹ûij¸ö¶ÔÏó´ïµ½ÁË×î´óµÄ EXTENT Êý£¬Ó¦Á¢¼´Ôö¼Ó NEXT ºÍѹËõ¡£ £¨ 6£©¼ì²é²âÊÔ²éѯ¡¢ÐÞ¸ÄÀý³ÌµÄÏìӦʱ¼ä ¹¹½¨Àý³ÌÊǵÄÒ»²¿·Ö£¬Ò»µ© SLA SLA Ð-ÉÌÈ·¶¨ÏÂÀ´£¬¶¨ÆÚÔËÐÐÒÔºâÁ¿Êý¾Ý¿âµÄ ÔËÐÐÇé¿ö£¬Èç¹û³öÏÖÎÊÌâʱÀý³ÌûÓбíÏÖ³öÀ´£¬Ôò¸ü»»Àý³Ì¡£ £¨ 7£©¸ù¾Ý ¼Ç¼ÏìӦʱ¼ä SLA £¨ 8£©Ã¿Ìì¼ì²éÏà¹ØµÄÈÕÖ¾Îļþ HOME: http://www.itpub.net MAIL: epub@itpub.net
  31. 31. ITPUB µç×ÓÔÓÖ¾ Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ £¨ 9£©¼Ç¼Ï·¢ÏÖµÄÎÊÌâ»òÒì³£ÏÖÏó 2¡¢Öƶ¨±¸·Ý / »Ö¸´¼Æ»® £¨ 1£©¸ù¾Ý Öƶ¨±¸·Ý¼Æ»®£¬²¢Éú³ÉÎĵµ SLA £¨ 2£©ÓÉÆäËûר¼Ò½øÐÐÈ·ÈÏ £¨ 3£©Õë¶ÔÖ÷ÒªµÄÊý¾Ý¿â·¢ÉúÎÊÌâµÄÇé¿ö£¬Öƶ¨»Ö¸´ ·½°¸£¬²¢Éú³ÉÎĵµ £¨ 4£©ÔÚ²âÊÔ ORACLE INSTANCE ÉϽøÐлָ´¼Æ»®²âÊÔ £¨ 5£©Èç¹û µÄij¸öÒªÇó´ï²»µ½£¬»òÕ߸Ľø·½°¸»òÐÞ¸Ä SLA SLA 3 ¡¢Ö´Ðб¸·Ý / »Ö¸´ Ïêϸ¼Ç¼ÏÂËùÓеIJÙ×÷²½ÖèºÍʱ¼ä¡£ 4¡¢ Service Level Agreement £¨ SLA Ó¦¸Ã¾ÍÊý¾Ý¿â·þÎñµÄÒÔÏ·½Ãæ»®·Ö³ö¼¶±ð 1£© ¡¤ÁгöÍ£»úʱ¼ä±í £ºhours/day , days/week , days/year ¡¤´¦ÀíµäÐͲéѯ¡¢ÊÂÎñµÄÏìӦʱ¼ä ¡¤ÔÚ±ÀÀ£Çé¿öÏ£¬×µÄ»Ö¸´Ê±¼äºÍ×î´óµÄÊý¾ÝËðʧÇé¿ö £¨ SLA µÄ 2£© ϸ½Ú½«ÔÚ µÄÈÎÎñÖÐÌåÏÖ DBA Èç ¡ ¤¡°Ã¿ÄêµÄ×î´óÍ£»úʱ¼ä¡± ==¡µDBA ¼à²âÊý¾Ý¿âµÄƵÂÊ ¡ ¤¡°×î´óÊý¾ÝËðʧ¡± ÎļþµÄ´óС£¬µÄ¼ä¸ô ==¡µlog CKPT HOME: http://www.itpub.net MAIL: epub@itpub.net
  32. 32. ITPUB µç×ÓÔÓÖ¾ Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ °Ë¡¢ DBA ÈÎÎñÁ÷³Ì£¨¶ÔÓÚ³ÉÊìÊý¾Ý¿â£© ²Ù×÷¼¶±ðÐ-Òé £¨OLA£© No ×ÊÔ´¿ÉÒÔÂú×ãOLA ²Ù×÷¹ÜÀí Yes ¼à²âÊý¾Ý¿â Ö´Ðб¸·Ý /»Ö¸´ÈÎÎñ Ê£Óà¿Õ¼ä Êý¾ÝÔö³¤Çé ¿ö Ôö³¤ÂÊ ËéƬ Êý¾ÝÎļþ¹Ü ÎïÀíÖع¹ Àí ¶ÔÏóµÄ extentÊýÄ¿ Êý¾Ý¿âµ÷ÓÅ ÏìӦʱ¼ä ÈÕÖ¾¡¢Óû§Í¶ ÆäËû²Ù×÷(Èç¼Ó Ëß Èí¼þpatch) ¾Å¡¢ Ð-ÒéÑù±¾ SLA Service Level Agreement ·þÎñ ¼¶±ð¶¨Òå ϵͳÔËÐÐʱ¼ä 24 Сʱ ϵͳ¿ÉÓÃʱ¼ä 24 Сʱ £¬7 Ìì /Ìì /ÖÜ Èȱ¸·ÝƵÂÊ Ã¿Ì죬ÔöÁ¿±¸·Ý archive log À䱸·ÝƵÂÊ Ã¿Äê4 ´Î ÿ´Î±ÀÀ£×î´óÊý¾ÝËðʧ ²»´óÓÚÒ»ÌìµÄÊý¾Ý ´ÓÈí±ÀÀ££¨Èç¶Ïµç£©Æô¶¯Ê±¼ä ·ÖÖÓÄÚ µçÔ´Õý³£ºó15 HOME: http://www.itpub.net MAIL: epub@itpub.net
  33. 33. ITPUB µç×ÓÔÓÖ¾ Êý¾Ý¿â¹ÜÀí³ÉÊì¶ÈÄ£ÐÍ ´ÓÓ²±ÀÀ££¨Èç´ÅÅÌʧЧ£¬µ«ÊDz»¶ªÊ§ Êý¾Ý£©Æô¶¯Ê±¼ä ¸ü»»Ó²¼þ 1 Сʱ£¬Æô¶¯ 15 ·ÖÖÓÄÚÍê³É ´ÓÓ²±ÀÀ££¨Èç´ÅÅÌʧЧ£¬Ëð»µÊý¾Ý£© 1 Сʱ¸ü»»Ó²¼þ£¬ 15 ·ÖÖÓÆô¶¯Êý¾Ý¿â£¬ 3 Сʱ´Ó±¸·Ý Æô¶¯Ê±¼ä »Ö¸´ ÿÄêå´»úʱ¼ä 12 Ìì /Ä꣬һÌì /Ô£¬Ã¿Ôµĵڶþ¸öÖÜÁù BUG ±¨¸æÏìӦʱ¼ä Ð-ÉÌ ÔöÇ¿¹¦ÄÜÏìӦʱ¼ä Ð-ÉÌ ÐÂÓ¦ÓÃÐèÇóÏìӦʱ¼ä Ð-ÉÌ ²éѯÏìӦʱ¼ä Ð-ÉÌ£¨ÐèÒªÖƶ¨Ö¸±ê²âÊÔ³ÌÐò£© ÿÄê×ܼƼƻ®Í£ »úʱ¼ä 12 Сʱ ¼Æ»®Í£»úʱ¼ä ÀͶ¯½Ú¡¢¸Ð¶÷½Ú¡¢Ê¥µ®½Ú¡¢ÐÂÄ꣬ÿ´Î 3 Сʱ ÿÄê»ú¶¯Í£»úʱ¼ä 4 Сʱ /Äê HOME: http://www.itpub.net MAIL: epub@itpub.net
  34. 34. ITPUB µç×ÓÔÓÖ¾ ORACLE8i º¯Êý½éÉÜ£¨ Ò»£© oracle8i º¯Êý½éÉÜ (Ò» ):RANK(),DENSE_RANK() ×÷Õß : jlandzpa RANK(),DENSE_RANK()ÊÇoracle8i µÄÁ½¸öÓÐȤµÄ·ÖÎöº¯Êý , ¿ÉÒÔÓÃÀ´½â¾ö top-N ÎÊÌâ . Á½¸öº¯ÊýµÄÇø±ð¿ÉÒÔ´ÓÏÂÃæÀý×ÓÖп´³ö£º create table emp (Empno varchar2(10), Ename varchar2(10), Job varchar2(10), Mgr varchar2(10), Sal varchar2(10) ); insert into emp values('Empno1','Ename1','Job1','Mgr1','1'); insert into emp values('Empno2','Ename2','Job2','Mgr2','2'); insert into emp values('Empno3','Ename3','Job3','Mgr3','3'); insert into emp values('Empno4','Ename4','Job4','Mgr4','4'); insert into emp values('Empno5','Ename5','Job5','Mgr5','5'); insert into emp values('Empno6','Ename6','Job6','Mgr6','6'); insert into emp values('Empno7','Ename7','Job7','Mgr7','4'); insert into emp values('Empno8','Ename8','Job8','Mgr7','5'); insert into emp values('Empno9','Ename9','Job9','Mgr7','6'); commit; SELECT Empno, Ename, Job, Mgr, Sal, RANK() OVER (ORDER BY SAL Desc NULLS LAST) AS Rank, DENSE_RANK() OVER (ORDER BY SAL Desc NULLS LAST) AS Drank FROM Emp ORDER BY SAL Desc NULLS LAST; EMPNO ENAME JOB MGR SAL RANK DRANK ---------- ---------- ---------- ---------- ---------- ---------- ---------- Empno6 Ename6 Job6 Mgr6 6 1 1 Empno9 Ename9 Job9 Mgr7 6 1 1 Empno5 Ename5 Job5 Mgr5 5 3 2 HOME: http://www.itpub.net MAIL: epub@itpub.net
  35. 35. ITPUB µç×ÓÔÓÖ¾ ORACLE8i º¯Êý½éÉÜ£¨ Ò»£© Empno8 Ename8 Job8 Mgr7 5 3 2 Empno4 Ename4 Job4 Mgr4 4 5 3 Empno7 Ename7 Job7 Mgr7 4 5 3 Empno3 Ename3 Job3 Mgr3 3 7 4 Empno2 Ename2 Job2 Mgr2 2 8 5 Empno1 Enam e1 Job1 Mgr1 1 9 6 ½á¹ûÊDz»ÊǺÜÆæÃÈç¹ûÎÒÃÇ×Ô¼ºÐ´ sql ʵÏÖ£¬ÊÇÐèҪһЩ¼¼Çɵġ£ 1. ÀûÓà RANK()¿ÉÒÔʵÏÖ - N ÎÊÌâ top sql ¿ÉÒÔÏÔʾ ÏÂÃæÕâ¸ö ,×î´óµÄ¼¸¸ö Sal,Ïàͬal µÄ¼Ç¼ҲͬÑùÏÔʾ S . SELECT Empno, Ename, Job, Mgr, Sal FROM (SELECT Empno, Ename, Job, Mgr, Sal, RANK() OVER (ORDER BY SAL Desc NULLS LAST) AS Emp_Rank FROM Emp ORDER BY SAL Desc NULLS LAST) WHERE Emp_Rank = 1; EMPNO ENAME JOB MGR SAL ---------- ---------- ---------- ---------- ---------- Empno6 Ename6 Job6 Mgr6 6 Empno9 Ename9 Job9 Mgr7 6 SELECT Empno, Ename, Job, Mgr, Sal FROM (SELECT Empno, Ename, Job, Mgr, Sal, RANK() OVER (ORDER BY SAL Desc NULLS LAST) AS Emp_Rank FROM Emp ORDER BY SAL Desc NULLS LAST) WHERE Emp_Rank < 4; EMPNO ENAME JOB MGR SAL ---------- ---------- ---------- ---------- ---------- Empno6 Ename6 Job6 Mgr6 6 Empno9 Ename9 Job9 Mgr7 6 Empno5 Ename5 Job5 Mgr5 5 Empno8 Ename8 Job8 Mgr7 5 HOME: http://www.itpub.net MAIL: epub@itpub.net
  36. 36. ITPUB µç×ÓÔÓÖ¾ ORACLE8i º¯Êý½éÉÜ£¨ Ò»£© SELECT Empno, Ename, Job, Mgr, Sal FROM (SELECT Empno, Ename, Job, Mgr, Sal, RANK() OVER (ORDER BY SAL Desc NULLS LAST) AS Emp_Rank FROM Emp ORDER BY SAL Desc NULLS LAST) WHERE Emp_Rank < 3; EMPNO ENAME JOB MGR SAL ---------- ---------- ---------- ---------- ---------- Empno6 Ename6 Job6 Mgr6 6 Empno9 Ename9 Job9 Mgr7 6 2. ÀûÓà RANK()¿ÉÒÔʵÏÖ top(n,m) ÎÊÌâ . SELECT Empno, Ename, Job, Mgr, Sal FROM (SELECT Empno, Ename, Job, Mgr, Sal, RANK() OVER (ORDER BY SAL Desc NULLS LAST) AS Emp_Rank FROM Emp ORDER BY SAL Desc NULLS LAST) WHERE Emp_Rank > 3 and Emp_Rank < 6; EMPNO ENAME JOB MGR SAL ---------- ---------- ---------- ---------- ---------- Empno4 Ename4 Job4 Mgr4 4 Empno7 Ename7 Job7 Mgr7 4 HOME: http://www.itpub.net MAIL: epub@itpub.net
  37. 37. ITPUB µç×ÓÔÓÖ¾ ORACLE µÄ¸ôÀ뼶±ð ORACLE µÄ¸ôÀ뼶±ð isolation level£© ¸ôÀ뼶±ð£¨ ¡¤¸ôÀ뼶±ð¶¨ÒåÁËÊÂÎñÓëÊÂÎñÖ®¼äµÄ¸ôÀë³Ì¶È¡£ ¡¤¸ôÀ뼶±ðÓë²¢·¢ÐÔÊÇ»¥ÎªÃ¬¶ÜµÄ£º¸ôÀë³Ì¶ÈÔ½¸ß£¬Êý¾Ý¿âµÄ²¢·¢ÐÔÔ½²î£ Êý¾Ý¿âµÄ²¢·¢ÐÔÔ½ºÃ¡£ ¡¤ANSI/ISO SQL92 ±ê×¼¶¨ÒåÁËһЩÊý¾Ý¿â²Ù×÷µÄ¸ôÀ뼶±ð£º ¡¤Î´Ìá½»¶Á£¨ read uncommitted£© ¡¤Ìá½»¶Á£¨ read committed£© ¡¤Öظ´¶Á£¨ repeatable read£© ¡¤ÐòÁл¯£¨ serializable£© ¡¤Í¨¹ýһЩÏÖÏ󣬿ÉÒÔ·´Ó³³ö ¸ôÀ뼶±ðµÄЧ¹û¡£ÕâЩÏÖÏóÓУº ¡¤¸üжªÊ§£¨ lost update£ © £ºµ±ÏµÍ³ÔÊÐíÁ½¸öÊÂÎñͬʱ¸üÐÂͬһÊý¾ÝÊÇ£¬·¢Éú¸üÐ ¡¤Ôà¶Á£¨ read£ dirty © £ºµ±Ò»¸öÊÂÎñ¶ÁÈ¡ÁíÒ»¸öÊÂÎñÉÐδÌá½»µÄÐÞ¸Äʱ£¬²úÉúÔà ¡¤·ÇÖظ´¶Á£¨ nonrepeatable read£© £ºÍ¬Ò»²éѯÔÚͬһÊÂÎñÖжà´Î½øÐУ¬ÓÉÓÚÆäËûÌ ÊÂÎñËù×öµÄÐ޸Ļòɾ³ý£¬Ã¿´Î·µ»Ø²»Í¬µÄ½á¹û¼¯£¬´Ëʱ·¢Éú·ÇÖظ´¶Á¡£ (A transaction rereads data it has previously read and finds that another committed transaction has modified or deleted the data. ) ¡¤»ÃÏñ£¨ phantom read£ ©£ºÍ¬Ò»²éѯÔÚͬһÊÂÎñÖжà´Î½øÐУ¬ÓÉÓÚÆäËûÌá½»ÊÂÎñ ²åÈë²Ù×÷£Ã¿´Î·µ»Ø²»Í¬µÄ½á¹û¼¯£´Ëʱ·¢Éú»ÃÏñ¶Á¡£a query ¬ ¬(A transaction reexecutes returning a set of rows that satisfies a search condition and finds that another committed transaction has inserted additional rows that satisfy the condition. ) ¡¤ÏÂÃæÊǸôÀ뼶±ð¼°Æä¶ÔÓ¦µÄ¿ÉÄܳöÏÖ»ò²»¿ÉÄܳöÏÖµÄÏÖÏó Dirty Read NonRepeatable Phantom Read Read Read uncommitted Possible Possible Possible Read committed Not possible Possible Possible Repeatable read Not possible Not possible Possible Serializable Not possible Not possible Not possible ORACLE µÄ¸ôÀ뼶±ð ¡¤RACLE ÌṩÁË O SQL92 ±ê×¼ÖÐµÄ committed ºÍ read serializable£¬Í¬Ê±ÌṩÁË·Ç SQL92 ±ê×¼µÄ read-only¡£ ¡¤ read committed£º ¡¤ÕâÊÇ ORACLE ȱʡµÄÊÂÎñ¸ôÀ뼶±ð¡£ ¡¤ÊÂÎñÖеÄÿһÌõÓï¾ä¶¼×ñ´ÓÓï¾ä¼¶µÄ¶ÁÒ»ÖÂÐÔ¡£ ¡¤±£Ö¤²»»áÔà¶Á£»µ«¿ÉÄܳöÏÖ·ÇÖظ´¶ÁºÍ»ÃÏñ¡£ ¡¤ serializable£º HOME: http://www.itpub.net MAIL: epub@itpub.net
  38. 38. ITPUB µç×ÓÔÓÖ¾ ORACLE µÄ¸ôÀ뼶±ð serializable ¾ÍÊÇʹÊÂÎñ¿´ÆðÀ´ÏóÊÇÒ»¸ö½Ó×ÅÒ»¸öµØ˳ÐòµØÖ´ÐС ¡¤¼òµ¥µØ˵£¬ ¡¤½ö½öÄÜ¿´¼ûÔÚ±¾ÊÂÎñ¿ªÊ¼Ç°ÓÉÆäËüÊÂÎñÌá½»µÄ¸ü¸ÄºÍÔÚ±¾ÊÂÎñÖÐËù ¡¤±£Ö¤²»»á³öÏÖ·ÇÖظ´¶ÁºÍ»ÃÏñ¡£ ¡¤ Serializable¸ôÀ뼶±ðÌṩÁË read-onlyÊÂÎñËùÌṩµÄ¶ÁÒ»ÖÂÐÔ£¨ÊÂÎñ¼¶µÄ¶ÁÒ»Ö ÐÔ£ © £¬Í¬Ê±ÓÖÔÊÐí DML²Ù×÷¡£ ¡¤Èç¹ûÓÐÔÚ serializable ÊÂÎñ¿ªÊ¼Ê±Î´Ìá½»µÄÊÂÎñÔÚ serializable ÊÂÎñ½áÊø֮ǰÐÞ¸Ä ÁË serializable ÊÂÎñ½«ÒªÐ޸ĵÄÐв¢½øÐÐÁËÌá½»£¬Ôò serializable ÊÂÎñ²»»á¶Áµ½ÕâЩ ±ä¸ü£¬Òò´Ë·¢ÉúÎÞ·¨ÐòÁл¯·ÃÎʵĴíÎó¡ £ £¨»»Ò»ÖÖ½âÊÍ·½·¨£ºÖ»ÒªÔÚ serializable Ê Îñ¿ªÊ¼µ½½áÊøÖ®¼äÓÐÆäËûÊÂÎñ¶Ô serializable ÊÂÎñÒªÐ޸ĵĶ«Î÷½øÐÐÁËÐ޸IJ¢Ìá½» ÁËÐ޸ģ¬Ôò·¢ÉúÎÞ·¨ÐòÁл¯·ÃÎʵĴíÎó¡© £ £ ¡¤ a serializable transaction contains data manipulation language (DML) that If attempts to update any resource that may have been updated in a transaction uncommitted at the start of the serializable transaction, £¨²¢ÇÒÐÞ¸ÄÔÚºóÀ´±»Ìá½» ¶øûÓлعö£¬the DML statement fails. ·µ»ØµÄ´íÎóÊÇ then ©£ ORA-08177: Cannot serialize access for this transaction¡£ ¡¤ RACLE ÔÚÊý¾Ý¿éÖмǼ O ×î½ü¶ÔÊý¾ÝÐÐÖ´ÐÐÐ޸IJÙ×÷µÄ N ¸öÊÂÎñµÄÐÅÏ¢£¬Ä¿µÄÊÇ È·¶¨ÊÇ·ñÓÐÔÚ±¾ÊÂÎñ¿ªÊ¼Ê±Î´Ìá½»µÄÊÂÎñÐÞ¸ÄÁ˱¾ÊÂÎñ½«ÒªÐ޸ĵÄÐÐ ¼ûÓ¢ÎÄ£º Oracle permits a serializable transaction to modify a data row only if it can determine that prior changes to the row were made by transactions that had committed when the serializable transaction began. To make this determination efficiently, Oracle uses control information stored in the data block that indicates which rows in the block contain committed and uncommitted changes. In a sense, the block contains a recent history of transactions that affected each row in the block. The amount of history that is retained is controlled by the INITRANS parameter of CREATE TABLE and ALTER TABLE. Under some circumstances, Oracle may have insufficient history information to determine whether a row has been updated by a "too recent" transaction. This can occur when many transactions concurrently modify the same data block, or do so in a very short period. You can avoid this situation by setting higher values of INITRANS for tables that will experience many transactions updating the same blocks. Doing so will enable Oracle to allocate sufficient storage in each block to record the history of recent transactions that accessed the block. ¡¤ The INITRANS Parameter£º Oracle stores control information in each data block to manage access by concurrent transactions. Therefore, if you set the transaction isolation level to serializable, you must use the ALTER TABLE command to set INITRANS to at least 3. This parameter will cause Oracle to allocate sufficient storage in each block to record the history of recent transactions that accessed the block. Higher values should be used for tables that will undergo many transactions updating the same blocks. ¡¤ read-only£º ¡¤×ñ´ÓÊÂÎñ¼¶µÄ¶ÁÒ»ÖÂÐÔ £¬½ö½öÄÜ¿´¼ûÔÚ±¾ÊÂÎñ¿ªÊ¼Ç°ÓÉÆäËüÊÂÎñÌá½»µÄ¸ü¸Ä ¡¤²»ÔÊÐíÔÚ±¾ÊÂÎñÖнøÐÐ DML ²Ù×÷¡£ ¡¤ read only ÊÇ serializable µÄ×Ó¼¯¡£ËüÃǶ¼±ÜÃâÁË·ÇÖظ´¶ÁºÍ»ÃÏñ¡£Çø±ðÊÇÔÚ read only ÖÐÊÇÖ»¶Á£»¶øÔÚ serializable ÖпÉÒÔ½øÐÐ ²Ù×÷¡£ DML HOME: http://www.itpub.net MAIL: epub@itpub.net
  39. 39. ITPUB µç×ÓÔÓÖ¾ ORACLE µÄ¸ôÀ뼶±ð Export with CONSISTENT = Y sets the transaction to read-only. ¡¤ ¡¤read committed ºÍ serializable µÄÇø±ðºÍÁªÏµ£º ¡¤ÊÂÎñ 1 ÏÈÓÚÊÂÎñ 2 ¿ªÊ¼£¬²¢±£³ÖδÌύ״̬¡£ÊÂÎñ 2 ÏëÒªÐÞ¸ÄÕý 1 ÐÞ¸ÄµÄ ±»ÊÂÎñ ÐС 2 µÈ´ý¡ £ ÊÂÎñ £Èç¹ûÊÂÎñ ¬ 1 »Ø¹ö£ ÔòÊÂÎñ 2 ¨²»ÂÛÊÇ committed »¹ÊÇ £ read serializable ·½Ê½£©½øÐÐËüÏëÒª×öµÄÐ޸ġ£Èç¹ûÊÂÎñ2 ÊÇ 1 Ìá½»£¬Ôòµ±ÊÂÎñ committed ·½Ê½ read ʱ£¬½øÐÐËüÏëÒª×öµÄÐ޸ģ»µ±ÊÂÎñ ·½Ê½Ê±£¬Ê§°Ü²¢±¨´í¡° 2 ÊÇserializable Cannot serialize access¡¬ÒòΪÊÂÎñ ± £ 2 ¿´²»¼ûÊÂÎñ 1 Ìá½»µÄÐ޸ģ¬ÇÒÊÂÎñ 2 ÏëÔÚÊÂÎñÒ»ÐÞ ¸ Ä µ Ä » ù ´ ¡ É Ï Ô Ù × ö Ð Þ ¸ Ä û Ó Both read committed and serializable ¡£¾ßÌå¼ ¢ÎÄ£º transactions use row-level locking, and both will wait if they try to change a row updated by an uncommitted concurrent transaction. The second transaction that tries to update a given row waits for the other transaction to commit or roll back and release its lock. If that other transaction rolls back, the waiting transaction (regardless of its isolation mode) can proceed to change the previously locked row, as if the other transaction had not existed. However, if the other (blocking) transaction commits and releases its locks, a read committed transaction proceeds with its intended update. A serializable transaction, however, fails with the error "Cannot serialize access", because the other transaction has committed a change that was made since the serializable transaction began. ¡¤ read committed ºÍ serializable ¿ÉÒÔÔÚORACLE ²¢ÐзþÎñÆ÷ÖÐʹÓᣠ¡¤¹ØÓÚ TRANSACTION READ WRITE£º SET read write ºÍ read committed Ó¦¸ÃÊÇÒ» ÑùµÄ¡ £ÔÚ¶Á·½Ãæ£ ¬ËüÃǶ¼±ÜÃâÁËÔà¶Á£ ¬µ«¶¼ÎÞ·¨ÊµÏÖÖظ´¶Á¡ read write £ ËäȻûÓÐÎĵµË ÔÚд·½ÃæÓë committed Ò»Ö£¬µ«ÏÔÈ»ËüÔÚдµÄʱºò»á¼ÓÅÅËûËøÒÔ±ÜÃâ¸üж read ÔÚ¼ÓËøµÄ¹ý³ÌÖУ¬Èç¹ûÓöµ½´ýËø¶¨×ÊÔ´ÎÞ·¨Ëø¶¨£¬Ó¦¸ÃÊǵȴý¶ø²»ÊÇ·Å read committed Ò»Ö¡£ ¡¤Óï¾ä¼¶µÄ¶ÁÒ»ÖÂÐÔ ¡¤ORACLE ±£Ö¤Óï¾ä¼¶ µÄ¶ÁÒ»ÖÂÐÔ£¬¼´Ò»¸öÓï¾äËù´¦ÀíµÄÊý¾Ý¼¯ÊÇÔÚµ¥Ò»Ê±¼ä Êý¾Ý¼¯£¬Õâ¸öʱ¼äµãÊÇÕâ¸öÓï¾ä¿ªÊ¼µÄʱ¼ä¡£ ¡¤Ò»¸öÓï¾ä¿´²»¼ûÔÚËü¿ªÊ¼Ö´ÐкóÌá½»µÄÐ޸ġ£ ¡¤¶ÔÓÚ Óï¾ä£¬Ëü¿´²»¼ûÓÉ×Ô¼ºËù×öµÄÐ޸ģ¬¼´ DML DML Óï¾ä¿´¼ûµÄÊÇËü±¾Éí¿ªÊ¼Ö´ ÐÐÒÔÇ°´æÔÚµÄÊý¾Ý¡£ ¡¤ÊÂÎñ¼¶µÄ¶ÁÒ»ÖÂÐÔ ¡¤ÊÂÎñ¼¶µÄ¶ÁÒ»ÖÂÐÔ±£Ö¤ÁË¿ÉÖظ´¶Á£¬²¢±£Ö¤²»»á³öÏÖ»ÃÏñ¡£ ¡¤ÉèÖøôÀ뼶±ð ¡¤ÉèÖÃÒ»¸öÊÂÎñµÄ¸ôÀ뼶±ð ¡¤ SET TRANSACTION ISOLATION LEVEL READ COMMITTED; ¡¤ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; ¡¤ SET TRANSACTION READ ONLY; ¡¤ÉèÖÃÔö¸ö»á»°µÄ¸ôÀ뼶±ð ¡¤ ALTER SESSION SET ISOLATION_LEVEL SERIALIZABLE; ¡¤ ALTER SESSION SET ISOLATION_LEVEL READ COMMITTED; ================================== HOME: http://www.itpub.net MAIL: epub@itpub.net
  40. 40. ITPUB µç×ÓÔÓÖ¾ BANN ϵͳµÄ²úÆ·ÅäÖà BAAN ϵͳµÄ²úÆ·ÅäÖà ×÷Õß : ITPUB κÖÎ (W39) Ò»¡¢ºÎν²úÆ·ÅäÖà ¹«Ë¾µÄ¾ºÕùÁ¦Ô½À´Ô½ÌåÏÖÔÚËûÄܲ»ÄÜÔÚ×î¶ÌµÄʱ¼ä ˾µÄ²úÆ·ÐòÁÐÖÐÒ²½«³öÏÖÔ½À´Ô½¶àµÄ¡°±ê×¼²úÆ·¡±µÄ± -----¼´Õë¶Ô²»Í¬¿Í»§×öÊʵ±µÄÐ޸ġ£ BAAN ϵͳµÄ PCF£¨ Product Configuration£©Ä£¿é¾ÍÊÇÕâÀàÆóÒµ×î¼ÑµÄ½â¾ö·½°¸¡£ ²úÆ·ÅäÖÃÊÇÖ¸ÔÚ±ê×¼²úÆ·½á¹¹ÉÏÅäÖóö¶àÖÖ±äÐβúÆ·¡£ 1¡¢Ìص㣺 A¡¢´ó²¿·ÖµÄ×é¼þÏàͬ¡£ B¡¢Õë¶Ô²»Í¬µÄ¿Í»§¿ÉÄÜÓв»Í¬µÄÒªÇó¡£ C¡¢²úÆ·½á¹¹³Êµ¹Èý½ÇÐÍ£¬Ô-ÁÏ /²¿¼þÏà¶Ô ½ÏÉÙ£¬µ«²úÆ·Æ·ÖÖ£¨±äÐÎÆ·ÖÖ£©ºÜ¶à¡£ 2¡¢ÊÊÓ÷¶Î§£º ²úÆ·±äÐÎÆ·Öֽ϶à»òÐèÒªÕë¶Ô²»Í¬¿Í»§½øÐвúÆ·ÅäÖõÄÆóÒµ¡£ 3¡¢ PCF ÓëBAAN ϵͳÖÐÆäËûÄ£¿éµÄ¹Øϵ £¨Í¼Ò»£© HOME: http://www.itpub.net MAIL: epub@itpub.net

×