14 Manageability


001 Oracle Database 10g represents a major milestone in Oracle's drive toward self-managing databases. It automates many routine administrative tasks, and considerably simplifies key DBA functions, such as performance diagnostics, SQL tuning, and space and memory management. It also provides several advisors that guide DBAs in managing key components of the database by giving specific recommendations along with potential benefit. Furthermore, Oracle Database 10g proactively sends alerts when a problem is anticipated, thus facilitating proactive rather than reactive database management.
¡¡
ÔÚ Oracle Öð½¥·¢Õ¹Îª¾ß±¸×ÔÎÒ¹ÜÀíÄÜÁ¦µÄ£¨self-managing£©Êý¾Ý¿âµÄ¹ý³ÌÖУ¬Oracle Êý¾Ý¿â 10g ÊÇÒ»¸öÖØÒªµÄÀï³Ì±®¡£Oracle Êý¾Ý¿â 10g Äܹ»×Ô¶¯Ö´ÐÐÐí¶à³£¹æµÄÊý¾Ý¿â¹ÜÀíÈÎÎñ£¬Í¬Ê±Äܹ»ÏÔÖøµØ¼ò»¯Ä³Ð©¹Ø¼üµÄ DBA ¹¤×÷£¬ÀýÈçÐÔÄÜÕï¶Ï£¨performance diagnostic£©£¬SQL µ÷ÓÅ£¨tuning£©£¬¿Õ¼ä£¨space£©¹ÜÀí¼°ÄÚ´æ¹ÜÀíµÈ¡£Oracle 10g »¹ÌṩÁ˶à¸ö¹ËÎʹ¤¾ß£¨advisor£©£¬ÎªÊý¾Ý¿â²ÎÊýµÄÉèÖÃÌṩ½¨Òé²¢Ô¤²âÐ޸IJÎÊý¶ÔÊý¾Ý¿âµÄÓ°Ï죬Ϊ DBA ¹ÜÀí¹Ø¼üÊý¾Ý¿â×é¼þÌṩÁ˲ο¼ÒÀ¾Ý¡£´ËÍ⣬Oracle Êý¾Ý¿â 10g Äܹ»Ô¤²âϵͳÖпÉÄܳöÏÖµÄÎÊÌâ²¢ÌáǰÏòÓû§·¢³ö¸æ¾¯£¬×öµ½ÁË·À»¼ÓÚδȻµÄÊý¾Ý¿â¹ÜÀí¡£
¡¡
002 This chapter contains the following topics: ±¾Õ°üº¬ÒÔÏÂÖ÷Ì⣺
003

Installing Oracle and Getting Started

14.1 °²×°Êý¾Ý¿â²¢Ê¹ÏµÍ³¿ªÊ¼ÔËת

004 The Oracle Universal Installer (OUI) is a GUI tool for installing Oracle software. It automates all installation tasks, performs comprehensive prerequisite checks (such as operating system version, software patches, and capacity), installs selected software components, and performs all postinstall configuration.
¡¡
Oracle ͨÓð²×°³ÌÐò£¨Oracle Universal Installer£¬OUI£©ÊÇÓÃÓÚ°²×° Oracle Èí¼þµÄͼÐλ¯¹¤¾ß¡£ËýÄÜ×Ô¶¯µØÖ´Ðи÷Ïî°²×°ÈÎÎñ£¬½øÐа²×°ÏȾöÌõ¼þ¼ì²é£¨ÀýÈç²Ù×÷ϵͳ°æ±¾£¬Èí¼þ²¹¶¡£¬´ÅÅÌÈÝÁ¿µÈ£©£¬°²×°Óû§Ñ¡ÔñµÄÈí¼þ×é¼þ£¬²¢Ö´Ðа²×°ºóµÄÅäÖà ¹¤×÷¡£
¡¡
005 The installation process is self-contained to automatically set up the required infrastructure for routine monitoring and administration. The Enterprise Manager Database Management Console is automatically configured to let you to get started with database administrative tasks without any manual configuration. The Enterprise Manager Database Console provides all essential functionality for managing a single database, including alert notification, job scheduling, and software management. In addition, all Oracle server components such as the database, listener, management framework, and so on, are configured for automated startup and shutdown.
¡¡
°²×°¹ý³Ì½«×Ô¶¯µØÅäÖÃ¼à¿Ø¼°¹ÜÀí¹¤×÷ËùÐèµÄ»ù´¡½á¹¹¡£°²×°½áÊøºó£¬ÆóÒµ¹ÜÀíÆ÷Êý¾Ý¿â¹ÜÀí¿ØÖÆÌ¨£¨Enterprise Manager Database Management Console£©ÒѾ­±»×Ô¶¯µØÅäÖÃÁË£¬¹ÜÀíÔ±ÎÞÐèÊÖ¹¤ÅäÖþͿÉÒÔ¿ªÊ¼½øÐÐÊý¾Ý¿â¹ÜÀí¹¤×÷ÁË¡£ÆóÒµ¹ÜÀíÆ÷Êý¾Ý¿â¹ÜÀí¿ØÖÆÌ¨°üº¬Á˹ÜÀíÒ»¸öµ¥ÊµÀýÊý¾Ý¿â£¨single database£©µÄÖ÷Òª¹¦ÄÜ£¬°üÀ¨¸æ¾¯Ìáʾ£¨alert notification£©£¬×÷Òµµ÷¶È£¨job scheduling£©£¬¼°Èí¼þ¹ÜÀí¡£´ËÍ⣬ËùÓÐµÄ Oracle ·þÎñÆ÷×é¼þ£¬ÀýÈçÊý¾Ý¿â£¬¼àÌýÆ÷£¬¹ÜÀí¿ò¼Ü£¨management framework£©µÈ£¬¶¼Òѱ»ÅäÖÃΪÄܹ»×Ô¶¯µØÆô¶¯Óë¹Ø±Õ¡£
¡¡
006

See Also:

"Configuration Management" for more information on Enterprise Manager

Áí¼û£º

¡°ÅäÖùÜÀí¡± ÁË½â¹ØÓÚÆóÒµ¹ÜÀíÆ÷µÄ¸ü¶àÐÅÏ¢
007

Simplified Database Creation

14.1.1 ¼ò»¯µÄÊý¾Ý¿â´´½¨¹¤×÷

008 The Database Creation Assistant (DBCA) is a GUI tool for database creation. It lets you create all possible configurations of the database, be it a standalone database, a Real Application Cluster database, or a standby database. During the database creation process, the DBCA guides you in setting up an automated disk-based backup and registering the database with a LDAP server, if available. A database created using the DBCA is fully setup and ready to use in all respects.
¡¡
Êý¾Ý¿â´´½¨ÖúÊÖ£¨Database Creation Assistant£¬DBCA£©ÊÇÒ»¸öͼÐλ¯µÄÊý¾Ý¿â´´½¨¹¤¾ß¡£Óû§¿ÉÒÔʹÓô˹¤¾ß´´½¨¸÷ÖÖ²»Í¬ÅäÖõÄÊý¾Ý¿â£¬ÀýÈ絥ʵÀýÊý¾Ý¿â£¨standalone database£©£¬RAC Êý¾Ý¿â£¬»ò±¸ÓÃÊý¾Ý¿â£¨standby database£©¡£ÔÚÊý¾Ý¿â´´½¨¹ý³ÌÖУ¬Óû§¿ÉÒÔÔÚ DBCA µÄÖ¸ÒýÏ´´½¨Ò»¸ö»ùÓÚ´ÅÅÌ£¨disk-based£©µÄ×Ô¶¯±¸·Ý»úÖÆ£¬»òÕß½«Êý¾Ý¿â×¢²áµ½ LDAP ·þÎñÆ÷ÖС£Í¨¹ý DBCA ´´½¨µÄÊý¾Ý¿âÒѾ­½øÐÐÁËÈ«ÃæµÄÉèÖ㬿ÉÒÔÂíÉÏͶÈëʹÓá£
¡¡
009

Instant Client

14.1.2 ¼´Ê±¿Í»§¶Ë

010 The Instant Client is the simplest way to deploy a full Oracle Client application built with OCI, OCCI, JDBC-OCI, or ODBC drivers. It provides the necessary Oracle Client libraries in a small set of files. Installation is as easy as copying a few shared libraries to a directory on the client computer. If this directory is accessible through the operating system library path variable (for instance, LD_LIBRARY_PATH or PATH) then the application will operate in the Instant Client mode. Instant Client deployment does not require the ORACLE_HOME environment, nor does it require the large number of code and data files provided in a full Oracle Client install, thereby significantly reducing the client application disk space needs. There is no loss in functionality or performance for an application deployed using Instant Client when compared to the same application running in a full ORACLE_HOME environment.
¡¡
²¿Êð½¨Á¢ÔÚ OCI£¬OCCI£¬JDBC-OCI£¬»ò ODBC Çý¶¯É쵀 Oracle ¿Í»§¶ËÓ¦ÓóÌÐòʱ£¬²ÉÓü´Ê±¿Í»§¶Ë£¨Instant Client£©ÊÇ×î¼òµ¥µÄ·½·¨¡£¼´Ê±¿Í»§¶ËʹÓÃ×îÉÙµÄÎļþ°üº¬ÁËËùÓбØÒªµÄ Oracle ¿Í»§¶Ëº¯Êý¿â¡£¼´Ê±¿Í»§¶ËµÄ°²×°¹ý³Ì¼«Îª¼òµ¥£¬Ö»ÐèÒª½«¿Í»§¶Ëº¯Êý¿âÎļþ¸´ÖƵ½¿Í»§¶Ë¼ÆËã»úµÄij¸öĿ¼¡£Èç¹ûÕâ¸öĿ¼ÒѾ­°üº¬ÔÚ²Ù×÷ϵͳµÄ·¾¶»·¾³±äÁ¿£¨ÀýÈç LD_LIBRARY_PATH »ò PATH£©ÖУ¬ÄÇôӦÓóÌÐò¾ÍÄܹ»ÀûÓü´Ê±¿Í»§¶Ë¿ªÊ¼ÔËÐС£¼´Ê±¿Í»§¶Ë²»ÐèÒª ORACLE_HOME »·¾³±äÁ¿£¬Ò²²»ÐèÒªÍêÈ«°²×°µÄ Oracle ¿Í»§¶ËÖаüº¬µÄ´óÁ¿³ÌÐò¼°Êý¾ÝÎļþ£¬Òò´ËÏÔÖøµØ¼õÉÙÁ˿ͻ§¶ËÓ¦ÓóÌÐòËùÐèµÄ´ÅÅ̿ռ䡣ӦÓóÌÐòÎÞÂÛÀûÓü´Ê±¿Í»§¶Ë²¿Ê𣬻¹ÊÇÀûÓÃÍêÈ«°²×°µÄ Oracle ¿Í»§¶Ë²¿Ê𣬶¼ÓµÓÐÍêÈ«ÏàͬµÄ¹¦Äܼ°ÔËÐÐÐÔÄÜ¡£
¡¡
011

See Also:

Áí¼û£º

012

Automated Upgrades

14.1.3 ×Ô¶¯Éý¼¶

013 With the Database Upgrade Assistant (DBUA), you can upgrade any database configuration, including RAC and standby, just by answering a few simple questions. It automatically checks that adequate resources are available, ensures adherence to the best practices ¨C such as backing up the database before beginning the upgrade process, replacing the obsolete and deprecate initialization parameters, and so on ¨C and, verifies the successful completion of the operation.
¡¡
Óû§¿ÉÒÔʹÓÃÊý¾Ý¿âÉý¼¶ÖúÀí£¨Database Upgrade Assistant£¬DBUA£©À´Éý¼¶¸÷ÖÖÅäÖõÄÊý¾Ý¿â£¬°üÀ¨ RAC Êý¾Ý¿â¼°±¸ÓÃÊý¾Ý¿â£¨standby database£©£¬Éý¼¶¹ý³ÌÖ»ÐèÓû§»Ø´ðһЩ¼òµ¥µÄÎÊÌâ¡£Êý¾Ý¿âÉý¼¶ÖúÀíÄܹ»×Ô¶¯µØ¼ì²éÊÇ·ñ¾ß±¸ËùÐèµÄ×ÊÔ´£¬Äܹ»±£Ö¤Éý¼¶¹ý³Ì¾¡Á¿ÍêÉÆ--ÀýÈçÔÚÉý¼¶Ç°±¸·ÝÊý¾Ý¿â£¬Äܹ» Çå³ý·ÏÆúµÄ³õʼ»¯²ÎÊý£¨initialization parameter£©£¬×îºó»¹Äܹ»¼ìÑéÊý¾Ý¿âÉý¼¶ÊÇ·ñ³É¹¦¡£
¡¡
014 The upgrade process is restartable, allowing it to automatically resume from the point of interruption. You can also get a time estimation of how long the upgrade process is likely to take.
¡¡
Éý¼¶¹ý³Ì¿ÉÒÔ´ÓÖжϵãÖØÐ¿ªÊ¼¡£DBUA ¿ÉÒÔÊÂÏȸæÖªÓû§Éý¼¶¹ý³ÌÔ¤¼ÆËùÐèµÄʱ¼ä¡£
¡¡
015

Basic Initialization Parameters

14.1.4 »ù±¾³õʼ»¯²ÎÊý

016 The Oracle Database provides a number of initialization parameters to optimize its operation in diverse environments. Only a few of these parameters need to be explicitly set, because the default values are adequate in the majority of cases.
¡¡
Oracle Êý¾Ý¿âʹÓÃÁË´óÁ¿µÄ³õʼ»¯²ÎÊý£¨initialization paramete£©£¬ÒÔ±ãÓû§¸ù¾Ý²»Í¬µÄϵͳÐèÇó¶ÔÊý¾Ý¿â½øÐе÷ÓÅ¡£µ«Ö»ÓÐÉÙÁ¿²ÎÊýÐèÒªÏÔʾµØÉèÖã¬ÒòΪËýÃǵÄĬÈÏÖµÄܹ»Âú×ã´ó¶àÊýÇé¿öµÄÒªÇó¡£
¡¡
017 There are approximately 30 basic parameters. The remainder of the parameters are preserved to allow expert DBAs to adapt the behavior of the Oracle Database to meet unique requirements without overwhelming those who have no such requirements.
¡¡
Oracle Êý¾Ý¿âÓÐ 30 ¸ö×óÓÒ»ù±¾³õʼ»¯²ÎÊý¡£¶ø»ù±¾³õʼ»¯²ÎÊýÖ®ÍâµÄ²ÎÊý¹©¾­Ñé·á¸»µÄ DBA ʹÓã¬Ê¹Êý¾Ý¿â¾­¹ýµ÷ÕûºóÄܹ»Âú×ã¶ÀÌØµÄÐèÇó¡£Ã»ÓÐÌØÊâÐèÇóʱ²»±Ø¸Ä±äÕâЩ²ÎÊý¡£
¡¡
018

See Also:

Oracle Database Administrator's Guide

Áí¼û£º

Oracle Database Administrator's Guide
019

Data Loading, Transfer, and Archiving

14.1.5 Êý¾Ý¼ÓÔØ£¬´«Ê䣬¼°¹éµµ

020 Data Pump enables very high-speed data and metadata loading and unloading to and from the Oracle Database. It automatically manages and schedules multiple, parallel streams of load or unload for maximum throughput.
¡¡
Êý¾Ý±Ã£¨Data Pump£©¹¤¾ßÄܹ»ÔÚ Oracle Êý¾Ý¿â¼ä¸ßËٵص¼³ö»ò¼ÓÔØÊý¾Ý¼°ÔªÊý¾Ý¡£Êý¾Ý±Ã¹¤¾ßµ÷¶È²¢¹ÜÀí¶à¸ö²¢Ðеؽø³Ì½øÐе¼³ö¼°¼ÓÔØ£¬´Ó¶ø»ñµÃ×î´óµÄÊý¾ÝÍÌÍÂÁ¿¡£
¡¡
021 The transportable tablespace feature lets you quickly move a tablespace across Oracle databases. This can be much faster than performing either an export/import or unload/load of the same data, because transporting a tablespace only requires the copying of datafiles and integrating the tablespace structural information. You can also use transportable tablespaces to move index data, thereby avoiding the index rebuilds you would have to perform when importing or loading table data.
¡¡
Óû§¿ÉÒÔÀûÓÿÉÒÆ¶¯±í¿Õ¼ä£¨transportable tablespace£©¹¦ÄÜÔÚÊý¾Ý¿â¼ä¿ìËÙµØÒƶ¯±í¿Õ¼ä¡£Õâ±ÈÖ´Ðе¼Èëµ¼³öÒª¿ìµÃ¶à£¬ÒòΪÔÚÊý¾Ý¿â¼äÒÆ¶¯±í¿Õ¼äÖ»Ðè¸´ÖÆÊý¾ÝÎļþ£¬ÔÙµ¼Èë±í¿Õ¼ä½á¹¹ÐÅÏ¢¼´¿É¡£Óû§Ê¹ÓÿÉÒÆ¶¯±í¿Õ¼äʱ»¹Äܹ»Òƶ¯Ë÷ÒýÊý¾Ý£¬ ¶øµ¼Èëµ¼³öÊý¾Ýºó»¹ÐèÒª½øÐÐË÷ÒýÖØ½¨¹¤×÷¡£
¡¡
022 Data Pump functionality together with cross-platform transportable tablespace feature provides powerful, easy to use, and high performance tools for moving data in and out of the database.
¡¡
Êý¾Ý±Ã¹¤¾ß¼°¿çƽ̨µÄ¿ÉÒÆ¶¯±í¿Õ¼ä¹¦ÄÜΪÓû§ÌṩÁËÇ¿´ó£¬Ò×Óã¬ÇÒ¸ßЧµÄÊý¾ÝÇ¨ÒÆÍ¾¾¶¡£
¡¡
023

See Also:

Áí¼û£º

024

Intelligent Infrastructure

14.2 ÖÇÄܵĻù´¡½á¹¹

025 Oracle Database has a sophisticated self-management infrastructure that allows the database to learn about itself and use this information to adapt to workload variations or to automatically remedy any potential problem. The self-management infrastructure includes the following: Oracle Êý¾Ý¿âÓµÓÐÒ»Ì×ÓÃÓÚ×ÔÎÒ¹ÜÀí£¨self-management£©µÄÍêÉÆµÄ»ù´¡½á¹¹£¬Êý¾Ý¿âÄܹ»ÀûÓÃÕâÌ×»ù´¡½á¹¹Á˽â×ÔÉíµÄÔËÐÐÐÅÏ¢£¬²¢ÀûÓÃÕâЩÐÅÏ¢¶Ô×ÔÉí½øÐе÷ÕûÒÔÊÊÓ¦¹¤×÷¸ºÔصı仯£¬»ò×Ô¶¯µØÐÞÕýϵͳÖеÄDZÔÚÎÊÌâ¡£ÓÃÓÚ×ÔÎÒ¹ÜÀíµÄ»ù´¡½á¹¹°üÀ¨ÒÔÏÂÄÚÈÝ£º
026

Automatic Workload Repository

14.2.1 ×Ô¶¯¸ºÔØ×ÊÁÏ¿â

027 Automatic Workload Repository (AWR) is a built-in repository in every Oracle Database. At regular intervals, the Oracle Database makes a snapshot of all its vital statistics and workload information and stores them in AWR. By default, the snapshots are made every 60 minutes, but you can change this frequency. The snapshots are stored in the AWR for a certain period of time (seven days by default) after which they are automatically purged.
¡¡
×Ô¶¯¸ºÔØ×ÊÁϿ⣨Automatic Workload Repository£¬AWR£©ÊÇ Oracle Êý¾Ý¿âÖÐÄÚÖõÄÒ»¸ö×ÊÁϿ⡣Oracle »á°´Õչ̶¨µÄÖÜÆÚ¶ÔÆäÔËÐÐÐÅÏ¢¼°¸ºÔØÐÅÏ¢½øÐпìÕÕ£¨snapshot£©£¬²¢´æ´¢ÔÚ AWR ÖС£¿ìÕÕµÄĬÈϵÄÖÜÆÚΪ 60 ·ÖÖÓ£¬Óû§Ò²¿ÉÒÔµ÷ÕûÕâ¸öƵÂÊ¡£¿ìÕÕ½«ÔÚ AWR Öд洢һ¶Îʱ¼ä£¨Ä¬ÈÏΪ 7 Ì죩£¬¹ýÆÚµÄ¿ìÕջᱻ×Ô¶¯Çå³ý¡£
¡¡
028 The captured data allows both system level and user level analysis to be performed, again reducing the requirement to repeat the workload in order to diagnose problems.
¡¡
AWR ÖеÄÊý¾Ý¼È¿ÉÒÔ¹©ÏµÍ³Ê¹Óã¬Ò²¿ÉÒÔ¹©Óû§Ê¹Óã¬Õâ±ÜÃâÁËΪÕï¶ÏϵͳÎÊÌâ¶øÖØ¸´µØÊÕ¼¯¸ºÔØÐÅÏ¢¡£
¡¡
029 Optimizations have been performed to ensure that the capture of data is performed efficiently to minimize overhead. One example of these optimizations is in the SQL statement capture. It maintains deltas of the data for SQL statements between snapshots. These let the Oracle Database capture only statements that have significantly impacted the load of the system since the previous snapshot in an efficient manner, rather than having to capture all statements that had performed above a threshold level of work since they first appeared in the system.
¡¡
Oracle ÒѾ­¶Ô²¶»ñÐÅÏ¢µÄ¹¤×÷½øÐÐÁËÓÅ»¯£¬´Ó¶ø±£Ö¤Æä¸ßЧִÐв¢Ê¹ÏµÍ³¿ªÏú×îС»¯¡£ÒÔ SQL Óï¾ä²¶»ñµÄÓÅ»¯ÎªÀý£¬Oracle Äܹ»¼Ç¼ SQL Óï¾ä²»Í¬¿ìÕÕ¼äµÄÔöÁ¿ÐÅÏ¢£¨delta£©¡£Òò´Ë£¬Oracle ²»»á²¶»ñϵͳÖг¬¹ý¸ºÔØãÐÖµµ«Ö»ÊǵÚÒ»´Î³öÏÖµÄ SQL Óï¾ä£¬¶øÖ»Ðè²¶»ñÓëÉÏÒ»´Î¿ìÕÕÏà±ÈÏÔÖøÓ°Ïìϵͳ¸ºÔصÄÓï¾ä¡£¶Ô±ÈÕâÁ½ÖÖ²¶»ñ»úÖÆ£¬ºóÕß½ÏǰÕßЧÂʸü¸ß¡£
¡¡
030 AWR forms the foundation for all self-management functionality of Oracle Database. It is the source of information that gives the Oracle Database an historical perspective on how it is being used and enables it to make decisions that are accurate and specifically tailored for each environment.
¡¡
AWR ÊÇ Oracle Êý¾Ý¿âËùÓÐ×ÔÎÒ¹ÜÀí£¨self-management£©¹¦ÄܵĻù´¡¡£Oracle ÀûÓà AWR ×÷ΪÐÅÏ¢Ô´µÃÒÔ´ÓÀúÊ·µÄ½Ç¶È¹Û²ìÊý¾Ý¿âÊÇÈçºÎ±»Ê¹Óõ쬴ӶøÊ¹Êý¾Ý¿âµÄ×Ô¶¯µ÷Õû¸ü¾«È·ÇÒ¸ü·ûºÏϵͳµÄʵ¼ÊÒªÇó¡£
¡¡
031

Automatic Maintenance Tasks

14.2.2 ×Ô¶¯Î¬»¤ÈÎÎñ

032 By analyzing the information stored in AWR, the database can identify the need to perform routine maintenance tasks, such as optimizer statistics refresh. The automated maintenance tasks infrastructure enables the Oracle Database to automatically perform such operations. It uses the Scheduler to run such tasks in a pre-defined "maintenance window".
¡¡
ͨ¹ý·ÖÎö AWR ÖеÄÊý¾Ý£¬Oracle Äܹ»¾ö¶¨ÊÇ·ñÐèÒªÖ´Ðг£¹æµÄά»¤ÈÎÎñ£¨maintenance task£©£¬ÀýÈçË¢ÐÂÓÅ»¯Æ÷£¨optimizer£©µÄͳ¼ÆÐÅÏ¢¡£Oracle ʹÓÃ×Ô¶¯Î¬»¤ÈÎÎñ»ù´¡½á¹¹£¨automated maintenance tasks infrastructure£©À´×Ô¶¯µØÖ´ÐдËÀàά»¤²Ù×÷¡£Oracle ʹÓõ÷¶ÈÆ÷£¨scheduler£©ÔÚÔ¤¶¨ÒåµÄά»¤´°¿Ú£¨maintenance window£©ÄÚÔËÐÐά»¤ÈÎÎñ¡£
¡¡
033 By default, the maintenance window starts at 10 PM every night and lasts until 6 AM next morning and throughout the weekend. All attributes of the maintenance window are customizable, including start and end time, frequency, days of the week, and so on. Also, the impact of automated maintenance tasks on normal database operations can be limited by associating a Database Resource Manager resource plan to the maintenance window.
¡¡
Oracle ÖÐĬÈϵÄά»¤´°¿ÚΪÿÍí 22 µãÖÁµÚ¶þÌìÔ糿 6 µã¼°Õû¸öÖÜÄ©¡£Î¬»¤´°¿ÚµÄÊôÐÔÊÇÄܹ»×Ô¶¨ÒåµÄ£¬Õâ°üÀ¨´°¿ÚµÄ¿ªÊ¼¼°½áÊøÊ±¼ä£¬ÆµÂÊ£¬Ò»ÖÜÄÚµÄÄļ¸ÌìµÈµÈ¡£´ËÍ⣬Óû§»¹¿ÉÒÔ½«Êý¾Ý¿â×ÊÔ´¹ÜÀíÆ÷£¨Database Resource Manager£©ÖеÄ×ÊÔ´¼Æ»®Ó¦Óõ½Î¬»¤´°¿Ú£¬´Ó¶ø±ÜÃâ×Ô¶¯»¤ÈÎÎñ¶ÔÊý¾Ý¿â³£¹æ²Ù×÷Ôì³ÉÓ°Ïì¡£
¡¡
034 Optimizer statistics are automatically refreshed using the automatic maintenance task infrastructure.
¡¡
ÓÅ»¯Æ÷µÄͳ¼ÆÐÅÏ¢ÊÇʹÓÃ×Ô¶¯Î¬»¤ÈÎÎñ»ù´¡½á¹¹À´½øÐÐˢеġ£
¡¡
035

See Also:

Áí¼û£º

036

Server-Generated Alerts

14.2.3 ·þÎñÆ÷¸æ¾¯

037 For problems that cannot be resolved automatically and require administrators to be notified, such as running out of space, the Oracle Database provides server-generated alerts. The Oracle Database can monitor itself and send out alerts to notify you of any problem in an efficient and timely manner.
¡¡
¶ÔÓÚ²»ÄÜ×Ô¶¯½â¾ö¶ø±ØÐë֪ͨ¹ÜÀíÔ±µÄÎÊÌ⣨ÀýÈç´æ´¢¿Õ¼ä²»×㣩£¬Oracle Êý¾Ý¿â½«Éú³É·þÎñÆ÷¸æ¾¯£¨server-generated alert£©¡£Oracle Êý¾Ý¿âÄܹ»½øÐÐ×ÔÎÒ¼à¿Ø£¬ÔÚ³öÏÖÎÊÌâʱ¼°Ê±ÏòÓû§·¢³ö¸æ¾¯¡£
¡¡
038 Monitoring activities take place as the database performs its regular operation. This ensures that the database is aware of problems the moment they arise. The alerts produced by the Oracle Database not only notify the problem, they also provide recommendations on how the reported problem can be resolved. This ensures quick problem resolution and helps prevent potential failures.
¡¡
ÔÚÊý¾Ý¿â½øÐг£¹æ²Ù×÷µÄʱ£¬¼à¿Ø»î¶¯Ò²ÔÚͬʱ½øÐС£Òò´Ë·¢ÉúÎÊÌâºó Oracle Äܹ»ÂíÉÏ»ñÖª¡£ÓÉ Oracle Êý¾Ý¿â²úÉúµÄ·þÎñÆ÷¸æ¾¯²»½öÄܽ«ÎÊÌâ֪ͨ¸øÓû§£¬»¹ÄÜÌṩÈçºÎ½â¾öÎÊÌâµÄ½¨Òé¡£ÕâÓÐÖúÓÚѸËÙ½â¾öÎÊÌ⣬²¢ÄÜÔ¤·ÀDZÔÚµÄϵͳ¹ÊÕÏ¡£
¡¡
039

Advisor Framework

14.2.4 ¹ËÎʹ¤¾ß¿ò¼Ü

040 The Oracle Database includes a number of advisors for different sub-systems in the database to automatically determine how the operation of the corresponding subcomponents could be further optimized. The SQL Tuning Advisor and the SQL Access Advisor, for example, provide recommendations for running SQL statements faster. Memory advisors help size the various memory components without resorting to trial-and-error techniques. The Segment Advisor handles space-related issues, such as recommending wasted-space reclamation and analyzing growth trends, while the Undo Advisor guides you in sizing the undo tablespace correctly. The various advisors are discussed more throughout this chapter.
¡¡
Oracle Êý¾Ý¿âÖаüº¬Á˶à¸öÕë¶Ô²»Í¬Êý¾Ý¿â×ÓϵͳµÄ¹ËÎʹ¤¾ß£¨advisor£©£¬ÓÃÓÚ¾ö¶¨ÈçºÎ½øÒ»²½ÓÅ»¯¸÷¸ö×Óϵͳ¡£¾ÙÀýÀ´Ëµ£¬SQL µ÷ÓŹËÎʹ¤¾ß£¨SQL Tuning Advisor£©¼° SQL Êý¾Ý´æÈ¡¹ËÎʹ¤¾ß£¨SQL Access Advisor£©Äܹ»Îª¸ü¿ìµØÖ´ÐÐ SQL Óï¾äÌṩ½¨Òé¡£Óû§¿ÉÒÔ¸ù¾ÝÄÚ´æ¹ËÎʹ¤¾ß£¨Memory advisor£©µÄ½¨Òéµ÷Õû¸÷¸öÄÚ´æ×é¼þµÄÈÝÁ¿£¬¶ø²»±Ø·´¸´³¢ÊÔµ÷ÕûÖµÊÇ·ñÕýÈ·£¨trial-and-error technique£©¡£Êý¾Ý¶Î¹ËÎʹ¤¾ß£¨Segment Advisor£©ÓÃÓÚ½â¾öºÍ¿Õ¼äÏà¹ØµÄÎÊÌ⣬ÀýÈç½øÐÐ¿Õ¼ä»ØÊÕ£¨wasted-space reclamation£©¼°·ÖÎö¿Õ¼äÔö³¤Ç÷ÊÆ¡£»¹Ô­¹ÜÀí¹ËÎʹ¤¾ß£¨Undo Advisor£©Äܹ»Ö¸µ¼Óû§ÕýÈ·µØÉèÖû¹Ô­±í¿Õ¼äµÄÈÝÁ¿¡£±¾Õ»¹½«ÏêϸÂÛÊö¸÷ÖÖ¹ËÎʹ¤¾ß¡£
¡¡
041 To ensure the consistency and uniformity in the way advisors function and allow them to interact with each other seamlessly, the Oracle Database includes an advisor framework. The advisor framework provides a consistent manner in which advisors are invoked and results are reported. Although these advisors are primarily used by the database to optimize its own performance, they can be invoked by administrators to get more insight into the functioning of a particular subcomponent.
¡¡
ΪÁËʹ¸÷¸ö¹ËÎʹ¤¾ßÄܹ»ÒÔÒ»ÖÂÇÒͳһµÄ·½Ê½¹¤×÷£¬²¢Ê¹²»Í¬¹ËÎʹ¤¾ß¼äÄܹ»ÎÞ·ìµØ½»»¥£¬Oracle Êý¾Ý¿âÖж¨ÒåÁ˹ËÎʹ¤¾ß¿ò¼Ü£¨advisor framework£©¡£ÔÚ¹ËÎʹ¤¾ß¿ò¼ÜÏ£¬²»Í¬¹ËÎʹ¤¾ßµÄµ÷Ó÷½Ê½¼°½á¹û·µ»Ø·½Ê½¾ßÓÐÒ»ÖÂÐÔ¡£Êý¾Ý¿âÖеĹËÎʹ¤¾ßÖ÷Òª¹©Êý¾Ý¿âÓÅ»¯ÆäÐÔÄÜʱʹÓ㬵«¹ÜÀíÔ±Ò²Äܹ»µ÷ÓùËÎʹ¤¾ß£¬´Ó¶øÉîÈëÁ˽â¸÷¸ö×ÓϵͳµÄÔËÐÐÇé¿ö¡£
¡¡
042

See Also:

Oracle Database 2 Day DBA for more information on using advisors

Áí¼û£º

Oracle Database 2 Day DBA Á˽â¸ü¶à¹ØÓÚʹÓùËÎʹ¤¾ßµÄÐÅÏ¢
043

Performance Diagnostic and Troubleshooting

14.3 ÐÔÄÜÕï¶Ï¼°¹ÊÕÏ´¦Àí

044 Building upon the data captured in AWR, the Automatic Database Diagnostic Monitor (ADDM) lets the Oracle Database diagnose its own performance and determine how identified problems could be resolved. ADDM runs automatically after each AWR statistics capture, making the performance diagnostic data readily available.
¡¡
Oracle Êý¾Ý¿âÖеÄ×Ô¶¯Êý¾Ý¿âÕï¶Ï¼àÊÓÆ÷£¨Automatic Database Diagnostic Monitor£¬ADDM£©£¬Äܹ»ÀûÓà AWR Öв¶»ñµÄÊý¾Ý¶ÔÊý¾Ý¿âÐÔÄܽøÐзÖÎö£¬²¢¾ö¶¨ÈçºÎ½â¾ö·¢ÏÖµÄÎÊÌâ¡£AWR ÿ´Î²¶»ñͳ¼ÆÐÅÏ¢ºó ADDM ½«×Ô¶¯ÔËÐУ¬Ñ¸ËÙÉú³ÉÐÔÄÜÕï¶ÏÐÅÏ¢¡£
¡¡
045 ADDM examines data captured in AWR and performs analysis to determine the major issues on the system on a proactive basis. In many cases, it recommends solutions and quantifies expected benefits. ADDM takes a holistic approach to the performance of the system, using time as a common currency between components. ADDM identifies those areas of the system that are consuming the most time. ADDM drills down to identify the root cause of problems, rather than just the symptoms, and reports the impact that the problem is having on the system overall. If a recommendation is made, it reports the benefits that can be expected in terms of time. The use of time throughout allows the impact of several problems or recommendations to be compared.
¡¡
ADDM Äܹ»·ÖÎö AWR Öв¶»ñµÄÐÅÏ¢£¬²¢È·¶¨ÏµÍ³ÖдæÔÚµÄDZÔÚÎÊÌâ¡£¶ÔÓÚ´ó¶àÊýÎÊÌ⣬ADDM Äܹ»Ìá³ö½¨ÒéµÄ½â¾ö·½°¸²¢¸ø³öÁ¿»¯µÄÔ¤ÆÚЧ¹û¡£ADDM ×ÜÊÇ´ÓÕûÌåÉÏÀ´ÆÀ¹ÀϵͳµÄÐÔÄÜ£¬ËýʹÓÃʱ¼ä×÷ΪÆÀ¹Àϵͳ¸÷¸ö×é¼þµÄͨÓñê×¼¡£ADDM Äܹ»È·¶¨ÏµÍ³ÖÐÄĸö×é¼þÏûºÄµÄʱ¼ä×î¶à¡£È·¶¨ÁËÎÊÌâµÄ±íÏóºó£¬ADDM »¹ÄÜÉîÈëÑо¿ÒÔÈ·¶¨ÎÊÌâµÄ¸ùÔ´£¬²¢ÏÔʾ´ËÎÊÌâ¶ÔϵͳÕûÌåµÄÓ°Ïì¡£Èç¹û ADDM Äܹ»Ìá³öµ÷ÓÅÒâ¼û£¬Ëý»¹»áÒÔʱ¼äΪµ¥Î»¼ÆËãµ÷ÕûºóµÄÔ¤ÆÚЧ¹û¡£Í³Ò»ÒÔʱ¼äΪµ¥Î»Ê¹ ADDM Äܹ»¶Ô²»Í¬µÄÐÔÄÜÎÊÌâ¼°½â¾ö·½°¸½øÐбȽϡ£
¡¡
046 ADDM focuses on activities that the database is spending most time on and then drills down through a sophisticated problem classification tree. Some common problems detected by ADDM include the following:
  • CPU bottlenecks
  • Poor connection management
  • Excessive parsing
  • Lock contention
  • I/O capacity
  • Undersizing of Oracle memory structures; for example, PGA, buffer cache, log buffer
  • High load SQL statements
  • High PL/SQL and Java time
  • High checkpoint load and cause; for example, small log files, aggressive MTTR setting
  • RAC-specific issues
ADDM ¼¯ÖзÖÎöÊý¾Ý¿âÖÐÏûºÄʱ¼ä×î¶àµÄ²Ù×÷£¬²¢ÒÀÕÕÒ»¸öÍêÉÆµÄÎÊÌâ·ÖÀàÊ÷£¨problem classification tree£©½øÐÐÉîÈë·ÖÎö¡£ADDM Äܹ»¼ì²â³öµÄͨÓÃÎÊÌâ°üÀ¨£º
  • CPU Æ¿¾±
  • Á¬½Ó¹ÜÀí£¨connection management£©ÎÊÌâ
  • ¹ýÁ¿µÄ½âÎö²Ù×÷£¨excessive parsing£©
  • Ëø¾ºÕù£¨lock contention£©
  • I/O ÐÔÄÜÎÊÌâ
  • Oracle ÄÚ´æ½á¹¹¹ýС£»ÀýÈç PGA£¬Êý¾Ý¿â»º´æ£¬ÖØ×öÈÕÖ¾»º´æµÈ
  • Ö´ÐÐ SQL Óï¾äÔì³ÉµÄ¸ºÔعý¸ß
  • Ö´ÐÐ PL/SQL ¼° Java ³ÌÐòʱ¼ä¹ý³¤
  • ¼ì²éµã£¨checkpoint£©¸ºÔعý¸ß¼°Ô­Òò£»ÀýÈçÖØ×öÈÕÖ¾Îļþ£¨log file£©¹ýС£¬»ò MTTR ÉèÖò»Êʵ±
  • Óë RAC Ïà¹ØµÄÎÊÌâ
047 Besides reporting potential performance issues, ADDM also documents non-problem areas of the system. The subcomponents, such as I/O and memory, that are not significantly impacting system performance are pruned from the classification tree at an early stage and are listed so that you can quickly see that there is little to be gained by performing actions in those areas.
¡¡
³ýÁ˱¨¸æÇ±ÔÚµÄÐÔÄÜÎÊÌ⣬ADDM »¹ÄܼǼϵͳÖÐûÓÐÎÊÌâµÄ×Óϵͳ¡£Ã»ÓÐÏÔÖøÓ°ÏìϵͳÐÔÄܵÄ×ÓϵͳÔÚÕï¶Ï³õÆÚ¾Í±»´ÓÎÊÌâ·ÖÀàÊ÷ÖÐÒÆ³ö£¬²¢±»ÁÐÔÚÕï¶Ï½á¹ûÖС£Óû§Äܹ»Çå³þµØÁ˽â¶ÔϵͳÖÐÄÄЩ×é¼þ½øÐе÷ÓŵÄЧ¹û²»»áÌ«Ã÷ÏÔ¡£
¡¡
048 You no longer need to first collect huge volumes of diagnostic data and spend hours analyzing them in order to find out answers to performance issues. You can simply follow the recommendation made by ADDM with just a few mouse clicks.
¡¡
ʹÓÃÁË ADDM ºó£¬Óû§²»±ØÊÖ¹¤ÊÕ¼¯´óÁ¿Õï¶ÏÊý¾Ý£¬²¢»¨·Ñ´óÁ¿Ê±¼ä¶ÔÊý¾Ý½øÐзÖÎö£¬ÔÙÉè·¨ÕÒµ½½â¾öϵͳÐÔÄÜÎÊÌâµÄ°ì·¨¡£Óû§Ö»ÐèÇáµãÊó±ê£¬²Î¿¼ ADDM µÄ½¨Òé¼´¿É¡£
¡¡
049

Application and SQL Tuning

14.4 Ó¦Óõ÷Óż° SQL µ÷ÓÅ

050 The Oracle Database completely automates the SQL tuning process. ADDM identifies SQL statements consuming unusually high system resources and therefore causing performance problems. In addition, the top SQL statements in terms of CPU and shared memory consumption are automatically captured in AWR. Thus, the identification of high load SQL statements happens automatically in the Oracle Database and requires no intervention.
¡¡
Oracle Êý¾Ý¿âÖÐµÄ SQL Óï¾äµ÷ÓŹý³ÌÊÇÍêÈ«×Ô¶¯»¯µÄ¡£ADDM Äܹ»Ê¶±ð³öÏûºÄϵͳ×ÊÔ´Òì³£¸ß²¢µ¼ÖÂϵͳÐÔÄÜÎÊÌâµÄ SQL Óï¾ä¡£´ËÍâ AWR Ò²ÄÜ×Ô¶¯µØ²¶»ñϵͳÖÐÏûºÄ CPU »ò¹²ÏíÄÚ´æ½Ï¸ßµÄÓï¾ä¡£Òò´ËÔÚ Oracle Êý¾Ý¿âÖУ¬¶ÔÔì³É¸ß¸ºÔØµÄ SQL Óï¾äµÄʶ±ðÊÇÍêÈ«×Ô¶¯µÄ£¬ÎÞÐëÓû§¸ÉÔ¤¡£
¡¡
051 After identifying the top resource-consuming SQL statements, the Oracle Database can automatically analyze them and recommend solutions using the Automatic Tuning Optimizer. Automatic SQL Tuning is exposed with an advisor, called the SQL Tuning Advisor. The SQL Tuning Advisor takes one or more SQL statements as input and produces well-tuned plans along with tuning advice. You do not need to do anything other than invoke the SQL Tuning Advisor.
¡¡
µ±Ê¶±ð³öÏûºÄ×ÊÔ´½Ï¸ßµÄ SQL ºó£¬Oracle Êý¾Ý¿âÄÜ×Ô¶¯µØÊ¹ÓÃ×Ô¶¯µ÷ÓÅÓÅ»¯Æ÷£¨Automatic Tuning Optimizer£©¶ÔÆä½øÐзÖÎö²¢¸ø³ö½¨ÒéµÄÖ´Ðмƻ®¡£¶øÓû§¿ÉÒÔͨ¹ý SQL µ÷ÓŹËÎʹ¤¾ß£¨SQL Tuning Advisor£©À´Ê¹Óà Oracle µÄ×Ô¶¯ SQL µ÷ÓÅ£¨Automatic SQL Tuning£©¹¦ÄÜ¡£SQL µ÷ÓŹËÎʹ¤¾ß½ÓÊÕÒ»¸ö»ò¶à¸ö SQL Óï¾ä×÷ΪÊäÈ룬Êä³ö¾­¹ýµ÷ÓÅµÄ SQL Ö´Ðмƻ®¼°µ÷ÓŽ¨Òé¡£Óû§ÐèÒª×öµÄ¹¤×÷Ö»Êǵ÷Óà SQL µ÷ÓŹËÎʹ¤¾ß¡£
¡¡
052 The solution comes right from the optimizer and not from external tools using pre-defined heuristics. This provides several advantages: a) the tuning is done by the system component that is ultimately responsible for the execution plans and SQL performance, b) the tuning process is fully cost-based, and it naturally accounts for any changes and enhancements done to the query optimizer, c) the tuning process considers the past execution statistics of a SQL statement and customizes the optimizer settings for that statement, and d) it collects auxiliary information in conjunction with the regular statistics based on what is considered useful by the query optimizer.
¡¡
ÔÚ Oracle ÖÐ SQL Óï¾äµÄÖ´Ðмƻ®ÊÇÓɲéѯÓÅ»¯Æ÷£¨query optimizer£©¸ø³öµÄ£¬¶ø·ÇÆäËüʹÓÃÔ¤¶¨ÒåµÄ̽Ë÷·½Ê½£¨pre-defined heuristics£©À´ÓÅ»¯ SQL µÄÍⲿ¹¤¾ß¡£ÕâÖÖģʽÒÔϼ¸¸öÓÅÊÆ£ºa£©µ÷ÓŹ¤×÷ÊÇÓÉ×îÖÕ¸ºÔðÉú³ÉÖ´Ðмƻ®£¨execution plan£©¼°±£Ö¤ SQL Ö´ÐÐÐÔÄܵÄϵͳ×é¼þÍê³ÉµÄ£¬b£©µ÷ÓŹý³ÌÊÇÍêÈ«»ùÓڳɱ¾µÄ£¨cost-based£©£¬ÇÒÐÞ¸ÄÁ˲éѯÓÅ»¯Æ÷µÄÈκβÎÊýºó¶¼»áÖ±½ÓÓ°Ïìµ÷ÓŽá¹û£¬c£©µ÷ÓŹý³ÌÄܹ» ²Î¿¼ SQL Óï¾äÒÔÍùÖ´ÐÐËù²úÉúµÄͳ¼ÆÐÅÏ¢£¬²¢¸ù¾Ýÿ¸ö SQL Óï¾äµÄÌØÐÔÉèÖòéѯÓÅ»¯Æ÷£¬d£©µ÷ÓŹý³ÌÄܹ»¸ù¾Ý²éѯÓÅ»¯Æ÷µÄÐèÒªÊÕ¼¯ÏµÍ³ÖÐÆäËûÓÐÒâÒåµÄͳ¼ÆÐÅÏ¢¡£
¡¡
053 The recommendation of the Automatic Tuning Optimizer can fall into one of the following categories
  • Statistics Analysis: The Automatic Tuning Optimizer checks each query object for missing or stale statistics and makes recommendations to gather relevant statistics. It also collects auxiliary information to supply missing statistics or correct stale statistics in case recommendations are not implemented. Because the Oracle Database automatically gathers optimizer statistics, this should not be the problem unless the automatic statistics gathering functionality has been disabled.
  • SQL Profiling: The Automatic Tuning Optimizer verifies its own estimates and collects auxiliary information to remove estimation errors. It also collects auxiliary information in the form of customized optimizer settings (for example, first rows or all rows) based on past execution history of the SQL statement. It builds a SQL profile using the auxiliary information and makes a recommendation to create it. It then enables the query optimizer (under normal mode) to generate a well-tuned plan. The most powerful aspect of SQL profiles is that they enable tuning of queries without requiring any syntactical changes and thereby proving a unique database ¨Cresident solution to tune the SQL statements embedded in packaged applications.
  • Access Path Analysis: The Automatic Tuning Optimizer considers whether a new index can be used to significantly improve access to each table in the query and when appropriate makes recommendations to create such indexes.
  • SQL Structure Analysis: The Automatic Tuning Optimizer tries to identify SQL statements that lend themselves to bad plans and makes relevant suggestions to restructure them. The suggested restructuring can be syntactic as well as semantic changes to the SQL code.
×Ô¶¯µ÷ÓÅÓÅ»¯Æ÷Ìá³öµÄµ÷ÓŽ¨Òé¿ÉÒÔ±»·ÖΪÒÔϼ¸Àࣺ
  • ͳ¼ÆÐÅÏ¢·ÖÎö£º×Ô¶¯µ÷ÓÅÓÅ»¯Æ÷½«¼ì²é²éѯÖÐʹÓõÄÿ¸ö¶ÔÏó£¬Èç·¢ÏÖûÓÐͳ¼ÆÐÅÏ¢»òÐÅÏ¢¹ýÓڳ¾ɣ¬ÓÅ»¯Æ÷½«½¨ÒéÖØÐÂÊÕ¼¯Ïà¹ØµÄͳ¼ÆÐÅÏ¢¡£Èç¹ûÓÅ»¯Æ÷µÄ½¨ÒéûÓб»Ö´ÐУ¬Ëý»¹ÄÜ×Ô¶¯µØÊÕ¼¯ÐÅÏ¢ÒÔ²¹³äȱʧµÄͳ¼ÆÐÅÏ¢»òÐÞÕý³Â¾ÉµÄͳ¼ÆÐÅÏ¢¡£ÓÉÓÚ Oracle Êý¾Ý¿âÄܹ»×Ô¶¯µØÊÕ¼¯ÓÅ»¯Æ÷ËùÐèµÄͳ¼ÆÐÅÏ¢£¬Í¨³£´ËÀàÎÊÌâ²»»á³öÏÖ£¬³ý·Ç×Ô¶¯ÊÕ¼¯Í³¼ÆÐÅÏ¢µÄ¹¦Äܱ»Óû§½ûÖ¹¡£
  • SQL µµ°¸£¨SQL Profiling£©£º×Ô¶¯µ÷ÓÅÓÅ»¯Æ÷Äܹ»ÑéÖ¤Æäµ÷ÓŽá¹û£¬²¢ÊÕ¼¯¶îÍâÐÅÏ¢ÐÞÕýµ÷ÓŽá¹ûÖеĴíÎó¡£×Ô¶¯µ÷ÓÅÓÅ»¯Æ÷»¹ÄÜÒÀ¾Ý SQL Óï¾äÖ´ÐеÄÀúÊ·Çé¿ö£¬ÊÕ¼¯ÒÀ¾ÝΪһ¸ö SQL ¶ø¶¨ÖƵÄÓÅ»¯Æ÷ÉèÖÃÐÅÏ¢£¨customized optimizer setting£©£¨ÀýÈ磬Ê×ÐУ¨first rows£©Ä£Ê½»òËùÓÐÐУ¨all rows£©Ä£Ê½£©¡£×Ô¶¯µ÷ÓÅÓÅ»¯Æ÷ÀûÓÃÆäÊÕ¼¯µÄ¶îÍâÐÅϢΪ SQL Óï¾ä½¨Á¢ SQL µµ°¸¡£´Ëʱ²éѯÓÅ»¯Æ÷£¨ÈçÔËÐÐÔÚÆÕͨģʽÏ£©¾Í¿ÉÒÔʹÓà SQL µµ°¸À´Éú³ÉÖ´Ðмƻ®ÁË¡£Óû§Ê¹Óà SQL µµ°¸¹¦Äܺó£¬ÎÞÐèÐÞ¸Ä SQL Óï¾äÒ²ÄܶԲéѯ½øÐе÷ÓÅ£¬ÕâÏ൱ÓÚ½« SQL Óï¾äµÄµ÷ÓÅ·½°¸¹Ì»¯ÔÚÊý¾Ý¿âÖУ¬´Ë¹¦ÄÜÓÐÖúÓÚ¶ÔÔ¤ÖÆµÄÓ¦ÓóÌÐò£¨packaged application£©ÖÐµÄ SQL Óï¾ä½øÐе÷ÓÅ¡£
  • Êý¾Ý´æÈ¡Â·¾¶£¨Access Path£©·ÖÎö£º×Ô¶¯µ÷ÓÅÓÅ»¯Æ÷Äܹ»Ô¤²âеÄË÷ÒýÊÇ·ñÄÜÏÔÖøÌá¸ß²éѯÖÐij¸ö±íµÄ´æÈ¡Ð§ÂÊ£¬ÈçÓпÉÄܽ«½¨ÒéÓû§´´½¨Ë÷Òý¡£
  • SQL ½á¹¹·ÖÎö£º×Ô¶¯µ÷ÓÅÓÅ»¯Æ÷Äܹ»Ê¶±ðÖ´Ðмƻ®½Ï²îµÄ SQL Óï¾ä£¬²¢Ìá³öÖØ¹¹ SQL Óï¾äµÄ½¨Òé¡£×Ô¶¯µ÷ÓÅÓÅ»¯Æ÷µÄ½¨Òé¼È¿ÉÄÜÕë¶ÔÓï·¨£¨syntactic£©£¬Ò²¿ÉÄÜÕë¶ÔÓïÒ壨semantic£©¡£
054 Both access path and SQL structure analysis can be useful in tuning the performance of an application under development or a homegrown production application where the administrators and developers have access to application code.
¡¡
Èç¹ûÓ¦ÓóÌÐòÕýÔÚ¿ª·¢£¬»òÕßÓ¦ÓóÌÐòÊÇ×ÔÖÆµÄ£¬¹ÜÀíÔ±»ò¿ª·¢ÕßÄܹ»Ð޸ijÌÐò´úÂ룬ÄÇô¿ÉÒÔ²ÉÓÃÊý¾Ý´æÈ¡Â·¾¶·ÖÎö»ò SQL ½á¹¹·ÖÎö¶Ô SQL Óï¾ä½øÐе÷ÓÅ¡£
¡¡
055 The SQL Access Advisor can automatically analyze the schema design for a given workload and recommend indexes, function-based indexes, and materialized views to create, retain, or drop as appropriate for the workload. For single statement scenarios, the advisor only recommends adjustments that affect the current statement. For complete business workloads, the advisor makes recommendations after considering the impact on the entire workload.
¡¡
SQL Êý¾Ý´æÈ¡¹ËÎʹ¤¾ß£¨SQL Access Advisor£©Äܹ»·ÖÎö·½°¸¶ÔÏóÔÚijÖÖ¹¤×÷¸ºÔØÏµÄÊý¾Ý·ÃÎÊÇé¿ö£¬²¢ÔÚÐèҪʱÏòÓû§½¨Òé´´½¨£¬±£Áô£¬»òÒÆ³ýË÷Òý£¬º¯ÊýË÷Òý£¬ÎﻯÊÓͼµÈ¶ÔÏó£¬ÒÔÂú×㠴˹¤×÷¸ºÔصÄÐèÇó¡£Èç¹ûÓû§¶ÔÒ»¸öµ¥¶ÀÓï¾ä½øÐе÷ÓÅ£¬¹ËÎʹ¤¾ßÔÚÌá³öµ÷ÓŽ¨Òéʱֻ¿¼ÂǶԵ±Ç°Óï¾äµÄÓ°Ïì¡£Èç¹ûÓû§ÐèÒª¶ÔÕû¸öϵͳµÄ¸ºÔؽøÐе÷ÓÅ£¬¹ËÎʹ¤¾ßÔÚÌá³öµ÷ÓŽ¨Òéʱ½«¿¼ÂǶÔÕû¸öϵͳµÄÓ°Ïì¡£
¡¡
056 While generating recommendations, the SQL Access Advisor considers the impact of adding new indexes and materialized views on data manipulation activities, such as insert, update, and delete, in addition to the performance improvement they are likely to provide for queries. After the SQL Access Advisor has filtered the workload, but while it is still identifying all possible solutions, you can asynchronously interrupt the process to get the best solution up to that point in time.
¡¡
SQL Êý¾Ý´æÈ¡¹ËÎʹ¤¾ßÔÚÉú³Éµ÷ÓŽ¨Òéʱ£¬³ýÁË¿¼Âǵ÷ÓŶԲéѯÐÔÄܵÄÌá¸ßÖ®Í⣬»¹»á¿¼ÂÇÌí¼ÓÁËÐÂÊý¾Ý¿â¶ÔÏó£¨ÀýÈçË÷Òý»òÎﻯÊÓͼ£©ºó¶Ô²åÈ룬¸üм°É¾³ýµÈÊý¾Ý²Ù×÷»î¶¯µÄÓ°Ïì¡£Èç¹û SQL Êý¾Ý´æÈ¡¹ËÎʹ¤¾ßÒѾ­ÌôÑ¡³öÁËÊý¸öÖ´Ðмƻ®£¬µ«ÈÔÔÚѰÕÒÆäËû¿ÉÐеķ½°¸£¬Óû§¿ÉÒÔÒì²½µØÖÕÖ¹Õâ¸ö¹ý³Ì£¬²¢Ê¹Óõ±Ç°·¢ÏÖµÄ×îºÃµÄ·½°¸¡£
¡¡
057 The SQL Access Advisor provides an easy to use interface and requires very little system knowledge. It can be run without affecting production systems, because the data can be gathered from the production system and taken to another computer where the SQL Access Advisor can be run.
¡¡
SQL Êý¾Ý´æÈ¡¹ËÎʹ¤¾ßÓµÓÐÒ×ÓõÄÓû§½Ó¿Ú£¬ÎÞÐèÓû§ÕÆÎÕ´óÁ¿µÄϵͳ֪ʶ¡£SQL Êý¾Ý´æÈ¡¹ËÎʹ¤¾ß²»»á¶ÔÉú²úϵͳ²úÉúºÜ´óµÄÓ°Ï죬ÒòΪÓû§¿ÉÒÔ½«ÔÚÉú²úϵͳÖÐÊÕ¼¯µÄÊý¾ÝÇ¨ÒÆµ½ÆäËû°²×°ÁËSQL Êý¾Ý´æÈ¡¹ËÎʹ¤¾ßµÄ¼ÆËã»úÉϽøÐзÖÎö¡£
¡¡
058

See Also:

Oracle Database Performance Tuning Guide for more information on the SQL Tuning Advisor and the SQL Access Advisor

Áí¼û£º

Oracle Database Performance Tuning Guide ÁË½â¹ØÓÚ SQL µ÷ÓŹËÎʹ¤¾ß¼° SQL Êý¾Ý´æÈ¡¹ËÎʹ¤¾ßµÄÏêϸÐÅÏ¢
059

Memory Management

14.5 ÄÚ´æ¹ÜÀí

060 The System Global Area (SGA) is a shared memory region that contains data and control information for one Oracle instance. Automatic Shared Memory Management automates the management of SGA used by an Oracle Database instance. Simply specify the total amount of SGA memory available to an instance with the parameter SGA_TARGET. The Oracle Database then automatically distributes the available memory among various components as required.
¡¡
ϵͳȫ¾ÖÇø£¨System Global Area£¬SGA£©ÊÇÒ»¸ö¹²ÏíµÄÄÚ´æÇøÓò£¬ÆäÖаüº¬Á˹© Oracle ʵÀýʹÓõÄÊý¾Ý¼°¿ØÖÆÐÅÏ¢¡£×Ô¶¯¹²ÏíÄÚ´æ¹ÜÀí£¨Automatic Shared Memory Management£©ÄÜʹ Oracle Êý¾Ý¿âʵÀý SGA µÄ¹ÜÀí×Ô¶¯»¯¡£Óû§Ö»Ðèͨ¹ý SGA_TARGET ²ÎÊýΪһ¸öʵÀýÉ趨¿É¹©Æä SGA ʹÓõÄ×ÜÄÚ´æÈÝÁ¿¡£Oracle Êý¾Ý¿âÄܸù¾Ý¸÷¸öÄÚ´æ×é¼þµÄÐèÇó×Ô¶¯µØ·ÖÅä¿ÉÓÃÄÚ´æ¡£
¡¡
061 Oracle provides dynamic memory management that allows for resizing of the Oracle shared memory components dynamically. It also provides for transparent management of working memory for SQL execution by self-tuning the initialization runtime parameters controlling allocation of private memory. This helps users on systems with a low number of users to reduce the time and effort required to tune memory parameters for their applications, such as data warehouse and reporting applications. On systems with a higher number of users, this also allows them to avoid memory tuning for individual workloads.
¡¡
Oracle ¾ß±¸¶¯Ì¬ÄÚ´æ¹ÜÀí¹¦ÄÜ£¬Òò´Ë¸÷¸ö¹²ÏíÄÚ´æ×é¼þ£¨shared memory component£©µÄÈÝÁ¿Äܹ»¶¯Ì¬µØµ÷½Ú¡£Oracle »¹ÄÜ×Ô¶¯µ÷ÕûÓÃÓÚ¿ØÖÆË½ÓÐÄڴ棨private memory£©·ÖÅäµÄÔËÐÐʱ³õʼ»¯²ÎÊý£¨initialization runtime parameter£©£¬Òò´ËÄܹ»£¨¶ÔÓû§£©Í¸Ã÷µØ¹ÜÀí SQL Óï¾äÖ´ÐÐʱËùÐèµÄ¹¤×÷ÄÚ´æÇø£¨working memory£©¡£¶ÔÓÚÊý¾Ý²Ö¿â»ò±¨±íÓ¦ÓõÈÓû§½ÏÉÙµÄϵͳ£¬ÉÏÊö¹¦ÄÜ¿ÉÒÔ´óÁ¿¼õÉÙÓû§ÊÖ¹¤µ÷ÕûÓ¦ÓóÌÐòÄÚ´æ²ÎÊýµÄ¹¤×÷¡£¶ÔÓÚÓû§Êý½Ï¶àµÄϵͳ£¬ÉÏÊö¹¦ÄÜͬÑù¿ÉÒÔ¼õÉÙΪÿ¸öÓû§Á¬½Óµ÷ÕûÄÚ´æµÄ¹¤×÷¡£
¡¡
062 Oracle provides the following advisors to help size the memory allocation for optimal database performance.
¡¡
Oracle ÌṩÁËÒÔϹËÎʹ¤¾ßÀ´Ð­Öúµ÷ÕûÄÚ´æ·ÖÅ䣬ÒÔÓÅ»¯Êý¾Ý¿âÐÔÄÜ¡£
¡¡
063 The Shared Pool Advisor determines the optimal shared pool size by tracking its use by the library cache. The amount of memory available for the library cache can drastically affect the parse rate of an Oracle instance. The shared pool advisor statistics provide information about library cache memory, letting you predict how changes in the size of the shared pool can affect aging out of objects in the shared pool.
¡¡
¹²Ïí³Ø¹ËÎʹ¤¾ß£¨Shared Pool Advisor£©Í¨¹ý¸ú×ٿ⻺´æ£¨library cache£©Ê¹Óù²Ïí³ØµÄÇé¿öÀ´¾ö¶¨×îÓŵĹ²Ïí³ØÈÝÁ¿¡£¿â»º´æ¿ÉÓõÄÄÚ´æÈÝÁ¿¾ö¶¨ÁË Oracle ʵÀýµÄ½âÎö£¨parse£©Ð§ÂÊ¡£¹²Ïí³Ø¹ËÎʹ¤¾ßÊÕ¼¯Á˹ØÓڿ⻺´æµÄͳ¼ÆÐÅÏ¢£¬¹©Óû§Ô¤²â¹²Ïí³ØµÄÈÝÁ¿¸Ä±ä¶Ô¹²Ïí³ØÄÚ¶ÔÏó±£´æÊ±¼äµÄÓ°Ïì¡£
¡¡
064 The Buffer Cache Advisor determines the optimal size of the buffer cache. When configuring a new instance, it is difficult to know the correct size for the buffer cache. Typically, you make a first estimate for the cache size, then run a representative workload on the instance and examines the relevant statistics to see whether the cache is under or over configured. A number of statistics can be used to examine buffer cache activity. These include the V$DB_CACHE_ADVICE view and the buffer cache hit ratio.
¡¡
Êý¾Ý¿â»º´æ¹ËÎʹ¤¾ß£¨Buffer Cache Advisor£©µÄ×÷ÓÃÊǾö¶¨Êý¾Ý¿â»º´æµÄ×îÓÅÈÝÁ¿¡£µ±Óû§ÅäÖÃÒ»¸öеÄʵÀýʱ£¬Ò»°ãÄÑÒÔÈ·¶¨Êý¾Ý¿â»º´æµÄ×î¼ÑÈÝÁ¿¡£Í¨³££¬Óû§ÐèÒªÊ×ÏÈÉèÖÃÒ»¸öÔ¤¹ÀµÄÈÝÁ¿£¬È»ºóͨ¹ý¹Û²ìʵÀýÔÚÔ¤ÆÚ¸ºÔØÏµÄͳ¼ÆÐÅÏ¢À´¾ö¶¨Ö®Ç°Ô¤¹ÀµÄÈÝÁ¿ÊÇ·ñÊʵ±¡£Óû§¹Û²ìÊý¾Ý¿â»º´æ»î¶¯µÄͳ¼ÆÖ¸±êÓжà¸ö¡£ÀýÈç V$DB_CACHE_ADVICE ÊÓͼ¼°Êý¾Ý¿â»º´æÃüÖÐÂÊ£¨buffer cache hit ratio£©¡£
¡¡
065 The Java Pool Advisor provides information about library cache memory used for Java and predicts how changes in the size of the Java pool can affect the parse rate.
¡¡
Java ³Ø¹ËÎʹ¤¾ß£¨Java Pool Advisor£©Äܹ»¼Ç¼ Java ³ÌÐòʹÓÿ⻺´æµÄÇé¿ö£¬²¢Ô¤²â¸Ä±ä Java ³ØÈÝÁ¿¶Ô½âÎöЧÂʵÄÓ°Ïì¡£
¡¡
066 The Streams Pool Advisor determines the optimal size of the Streams pool. The view V$STREAMS_POOL_ADVICE gives estimates of the amount of bytes spilled and unspilled for the different values of the STREAMS_POOL_SIZE parameter. You can use this to tune the STREAMS_POOL_SIZE parameter for Streams and for logical standby. Automatic Workload Repository reports on the V$STREAMS_POOL_ADVICE view and CPU usage help you tune Streams performance.
¡¡
Êý¾ÝÁ÷³Ø£¨Streams Pool Advisor£©¹ËÎʹ¤¾ßÄܹ»¾ö¶¨Êý¾ÝÁ÷³ØµÄ×î¼ÑÈÝÁ¿¡£Óû§¿ÉÒÔͨ¹ý¶Ô V$STREAMS_POOL_ADVICE ÊÓͼ½øÐвéѯ£¬Á˽â Oracle Ô¤²âµÄÔÚ¸÷ÖÖ STREAMS_POOL_SIZE ²ÎÊýÖµÏÂÊý¾ÝÁ÷³ØµÄʹÓÃÇé¿ö¡£Óû§ÒÀ¾ÝÊÓͼÖеÄÐÅϢΪÊý¾ÝÁ÷¼°Âß¼­±¸ÓÃÊý¾Ý¿â£¨logical standby£©É趨 STREAMS_POOL_SIZE ²ÎÊý¡£×Ô¶¯¸ºÔØ×ÊÁϿ⣨Automatic Workload Repository£©Äܹ»Ìṩ»ùÓÚÊý¾ÝÁ÷ CPU ʹÓÃÇé¿öºÍ V$STREAMS_POOL_ADVICE ÊÓͼµÄ±¨±í£¬Ð­ÖúÓû§µ÷ÕûÊý¾ÝÁ÷ÐÔÄÜ¡£
¡¡
067 The Program Global Area (PGA) Advisor tunes PGA memory allocated to individual server processes. Under automatic PGA memory management mode, Oracle honors the PGA_AGGREGATE_TARGET limit by controlling dynamically the amount of PGA memory allotted to SQL database areas. At the same time, Oracle maximizes the performance of all the memory-intensive SQL operators by maximizing the number of database areas that are using an optimal amount of PGA memory (cache memory). The rest of the database areas are executed in one-pass mode, unless the PGA memory limit set by PGA_AGGREGATE_TARGET is so low that multipass execution is required to reduce even more the consumption of PGA memory and honor the PGA target limit.
¡¡
³ÌÐòÈ«¾ÖÇø¹ËÎʹ¤¾ß£¨Program Global Area Advisor£©Äܹ»¶Ôÿ¸ö·þÎñ½ø³Ì£¨server process£©µÄÄÚ´æ·ÖÅä½øÐе÷Õû¡£ÔÚ×Ô¶¯ PGA ÄÚ´æ¹ÜÀíģʽÏ£¬Oracle Äܹ»¶¯Ì¬µØ¿ØÖÆÎª¸÷¸ö SQL ¹¤×÷Çø£¨database area£©Ëù·ÖÅäµÄ PGA ÄÚ´æÈÝÁ¿£¬Ê¹Æä×Ü PGA ÈÝÁ¿Âú×ã PGA_AGGREGATE_TARGET ²ÎÊýµÄÏÞÖÆ¡£¶ÔÓÚÐèÒª´óÁ¿ÄÚ´æµÄ SQL ²Ù×÷£¬Oracle ÓÅÏȱ£Ö¤Æä¹¤×÷ÇøÄܹ»´Ó PGA ÖзÖÅä×ã¹»µÄÄڴ棬´Ó¶ø±£Ö¤ÕâÀà²Ù×÷µÄÐÔÄÜ¡£Oracle »¹½«±£Ö¤ÆäÓàµÄ¹¤×÷Çø¾¡Á¿¹¤×÷ÔÚÒ»´Î½»»»£¨one-pass£©Ä£Ê½Ï¡£Èç¹û PGA_AGGREGATE_TARGET ²ÎÊýÉèÖõĹýµÍ£¬Oracle ½«Ê¹Ä³Ð©¹¤×÷Çø²ÉÈ¡¶à´Î½»»»£¨multipass£©µÄ·½Ê½Ö´ÐУ¬´Ó¶ø¼õÉÙ PGA µÄÏûºÄ£¬È·±£ PGA ÈÝÁ¿Âú×ãÏÞÖÆ¡£
¡¡
068 When configuring a new instance, it is difficult to know an appropriate setting for PGA_AGGREGATE_TARGET. You can determine this setting in three stages:
  1. Make a first estimate for PGA_AGGREGATE_TARGET.
  2. Run a representative workload on the instance and monitor performance using PGA statistics collected by Oracle to see whether the maximum PGA size is under configured or over configured.
  3. Tune PGA_AGGREGATE_TARGET using Oracle's PGA advice statistics.
µ±Óû§ÅäÖÃÐÂʵÀýʱ£¬ºÜÄÑÈ·¶¨Ç¡µ±µÄ PGA_AGGREGATE_TARGET ²ÎÊýÖµ¡£Óû§¿ÉÒÔͨ¹ýÒÔϲ½Öèʹ´Ë²ÎÊý¸üΪºÏÀí£º
  1. Ê×ÏȹÀ¼ÆÒ»¸ö PGA_AGGREGATE_TARGET ²ÎÊýÖµ¡£
  2. ʹʵÀýÔËÐÐÔÚÔ¤ÆÚµÄ¸ºÔØÏ£¬Í¨¹ý Oracle ÊÕ¼¯µÄ PGA ͳ¼ÆÐÅÏ¢À´¼à¿ØÏµÍ³ÐÔÄÜ£¬´Ó¶ø¾ö¶¨µ±Ç°²ÎÊýÖµÊÇ·ñÊʵ±¡£
  3. ¸ù¾Ý PGA ¹ËÎʹ¤¾ßµÄͳ¼ÆÊý¾ÝÀ´µ÷Õû PGA_AGGREGATE_TARGET ²ÎÊýµÄÖµ¡£
069 When the Automatic Shared Memory Management is enabled, the most commonly configured components are sized automatically. These include the following:
  • Shared pool (for SQL and PL/SQL execution)
  • Java pool for (Java execution state)
  • Large pool (for large allocations such as RMAN backup buffers)
  • Buffer cache
  • Streams pool
µ±Óû§ÆôÓÃÁË×Ô¶¯¹²ÏíÄÚ´æ¹ÜÀíºó£¬ÐèÒªÓû§¾­³£µ÷ÕûÈÝÁ¿µÄÄÚ´æ×é¼þ½«±» Oracle ×Ô¶¯µØµ÷Õû¡£ÕâÑùµÄÄÚ´æ×é¼þ°üÀ¨£º
  • ¹²Ïí³Ø£¨¹© SQL ¼° PL/SQL Ö´ÐÐÊÊÓã©
  • Java ³Ø£¨¹© Java ³ÌÐòÖ´ÐÐÊÊÓã©
  • ´óÐͳأ¨ÓÃÓÚ´óÁ¿µÄÄÚ´æ·ÖÅ䣬ÀýÈç RMAN µÄ±¸·Ý»º³åÇø£©
  • Êý¾Ý¿â»º´æ
  • Êý¾ÝÁ÷³Ø
070 There is no need to set the of size any of these components explicitly, and by default the parameters for these components appear to have values of zero. Whenever a component needs memory, it can request that it be transferred from another component with the internal auto-tuning mechanism. This happens transparently without user-intervention.
¡¡
Óû§ÎÞÐèÏÔʽµØÎªÕâЩÄÚ´æ×é¼þÉ趨ÈÝÁ¿£¬Ä¬ÈÏÇé¿öÏÂÕâЩ×é¼þµÄÈÝÁ¿²ÎÊý¾ùÏÔʾΪ 0¡£µ±Ä³¸öÄÚ´æ×é¼þÐèÒªÀ©Õ¹ÈÝÁ¿Ê±£¬Ëý½«Ïòϵͳ·¢³öÇëÇó£¬Oracle Ôòͨ¹ýÄÚ²¿µÄ×Ô¶¯µ÷½Ú»úÖÆ½«ÆäËû×é¼þµÄÄÚ´æ×ªÒƸøËý¡£ÉÏÊö¹ý³Ì¶ÔÓû§ÊÇ͸Ã÷µÄ¡£
¡¡
071 The performance of each component is monitored by the Oracle instance. The instance uses internal views and statistics to determine how to optimally distribute memory among the automatically-sized components. Thus, as the workload changes, memory is redistributed to ensure optimal performance with the new workload. This algorithm tries to find the optimal distribution by taking into consideration long term and short terms trends.
¡¡
Oracle ×é¼þ¸ºÔð¼à¿Ø¸÷¸öÄÚ´æ×é¼þµÄÐÔÄÜ¡£ÊµÀý¸ù¾ÝÄÚ²¿ÊÓͼµÄÐÅÏ¢¼°ÆäËûͳ¼ÆÐÅÏ¢À´¾ö¶¨ÈçºÎÔÚ¸÷¸ö×Ô¶¯¹ÜÀíµÄ×é¼þ¼ä·ÖÅäÄÚ´æÒÔ´ïµ½×îÓÅ¡£ÕâÑù£¬µ±¹¤×÷¸ºÔظıäʱÄÚ´æ¾ÍÄܹ»±»ÖØÐ·ÖÅ䣬´Ó¶øÈ·±£ÏµÍ³ÔÚиºÔØÏÂÒ²ÄÜ»ñµÃ×îÓÅÐÔÄÜ¡£ÄÚ´æ·ÖÅäµ÷ÕûËã·¨»áͬʱ¿¼ÂÇϵͳÔËÐÐµÄ¶ÌÆÚÓ볤ÆÚÇ÷ÊÆ¡£
¡¡
072 You can exercise some control over the size of the auto-tuned components by specifying minimum values for each component. This can be useful in cases where you know that an application needs a minimum amount of memory in certain components to function properly.
¡¡
¶ÔÓÚ×Ô¶¯¹ÜÀíµÄÄÚ´æ×é¼þ£¬Óû§¿ÉÒÔΪÆäÖ¸¶¨×îСÈÝÁ¿¡£µ±Óû§Á˽âÆäÓ¦ÓÃËùÐèµÄ¸÷¸öÄÚ´æ×é¼þµÄÈÝÁ¿Ê±£¬¾Í¿ÉÒÔʹÓô˹¦ÄÜ¡£
¡¡
073 The sizes of the automatically-tuned components are remembered across shutdowns if a server parameter file (SPFILE) is used. This means that the system picks up where it left off from the last shutdown.
¡¡
Èç¹ûÊý¾Ý¿âʹÓÃÁË·þÎñÆ÷²ÎÊýÎļþ£¨server parameter file£¬SPFILE£©£¬ÄÇô×Ô¶¯µ÷ÕûÄÚ´æ×é¼þµÄ²ÎÊýÔÚʵÀý¹Ø±ÕºóÒÀÈ»Äܱ»±£Áô¡£ÏµÍ³ÏÂ´ÎÆô¶¯Ê±¿ÉÒÔʹÓÃÉϴιرÕʱ±£ÁôµÄ²ÎÊý¡£
¡¡
074 The most significant benefit of using automatic SGA memory management is that the sizes of the different SGA components are flexible and adapt to the needs of a workload without requiring user intervention. Besides maximizing the use of available memory, Automatic Shared Memory Management can enhance workload performance. With manual configuration, it is possible that the compiled SQL statements will frequently age out of the shared pool because of its inadequate size. This manifests into frequent hard parses and reduced performance. However, when automatic management is enabled, the internal tuning algorithm monitors the performance of the workload and grows the shared pool if it determines that doing so will reduce the number of parses required. This provides enhanced performance, without requiring any additional resources or manual tuning effort.
¡¡
ʹÓÃ×Ô¶¯ SGA ÄÚ´æ¹ÜÀíµÄ×î´óºÃ´¦ÊÇ£¬¸÷¸ö SGA ×é¼þµÄÈÝÁ¿ÊÇÁé»î¿É±äµÄ£¬Äܹ»ÊÊÓ¦²»Í¬µÄ¹¤×÷¸ºÔضøÎÞÐèÓû§¸ÉÔ¤¡£³ýÁËÊÇ¿ÉÓÃÄÚ´æ×î´ó»¯Ö®Í⣬×Ô¶¯¹²ÏíÄÚ´æ¹ÜÀí»¹ÓÐÖúÓÚÌá¸ßϵͳÐÔÄÜ¡£²ÉÓÃÊÖ¹¤ÄÚ´æ¹ÜÀíʱ£¬ÒѱàÒëµÄ SQL Óï¾ä¿ÉÄÜ»áÒòΪ¹²Ïí³ØÈÝÁ¿²»×ã¶ø±»Çå³ý³ö¹²Ïí³Ø¡£Õ⽫µ¼ÖÂÆµ·±µÄÓ²½âÎö£¨hard parse£©½ø¶øÓ°ÏìϵͳÐÔÄÜ¡£¶øÆôÓÃÁË×Ô¶¯ÄÚ´æ¹ÜÀíºó£¬ÄÚ²¿µ÷½ÚËã·¨½«¼à¿ØÏµÍ³ÐÔÄÜ£¬ÈçÈÏΪÔö´ó¹²Ïí³ØÓÐÖúÓÚ¼õÉÙÓ²½âÎöµÄ»°¾Í»á¶ÔÄÚ´æ×é¼þ×ö³öÏàÓ¦µ÷Õû¡£´Ë¹¦ÄÜÌá¸ßÁËϵͳÐÔÄÜ£¬ÇÒÎÞÐèÏòϵͳÌí¼Ó×ÊÔ´£¬Ò²ÎÞÐèÈκÎÊÖ¹¤ µ÷Õû²Ù×÷¡£
¡¡
075

See Also:

Áí¼û£º

076

Space Management

14.6 ¿Õ¼ä¹ÜÀí

077 The Oracle Database automatically manages its space consumption, sends alerts on potential space problems, and recommends possible solutions. Oracle features that help you to easily manage space include the following: Oracle Êý¾Ý¿âÄܹ»×Ô¶¯µØ¶ÔÆä¿Õ¼äʹÓýøÐйÜÀí£¬Äܹ»·¢ÏÖDZÔڵĿռäÎÊÌ⣬¼°Ê±Ïò¹ÜÀíÔ±·¢³ö¸æ¾¯²¢¸ø³ö¿ÉÐеĽâ¾ö·½°¸¡£Oracle ÌṩµÄЭÖúÓû§¶Ô¿Õ¼ä½øÐйÜÀíµÄ¹¦ÄÜÓУº
078

Automatic Undo Management

14.6.1 ×Ô¶¯»¹Ô­¹ÜÀí

079 Earlier releases of Oracle used rollback segments to store undo. Space management for these rollback segments was complex. Automatic undo management eliminates the complexities of managing rollback segments and lets you exert control over how long undo is retained before being overwritten. Oracle strongly recommends that you use undo tablespace to manage undo rather than rollback segments.
¡¡
֮ǰ°æ±¾µÄ Oracle ʹÓûعö¶Î£¨rollback segment£©À´´æ´¢»¹Ô­ÐÅÏ¢£¨undo£©¡£»Ø¹ö¶ÎµÄ¿Õ¼ä¹ÜÀíÊ®·Ö¸´ÔÓ¡£¶ø²ÉÓÃ×Ô¶¯»¹Ô­¹ÜÀí£¨automatic undo management£©½«´ó´ó½µµÍ¹ÜÀí»Ø¹ö¶ÎµÄ¸´ÔÓÐÔ£¬¹ÜÀíÔ±Ö»ÐèרעÓÚ¿ØÖÆ»¹Ô­ÐÅÏ¢¾­¹ý¶à³¤Ê±¼ä²ÅÄܱ»¸²¸Ç¼´¿É¡£Oracle Ç¿ÁÒ½¨ÒéÓû§Ê¹Óû¹Ô­±í¿Õ¼ä£¨undo tablespace£©À´¹ÜÀí»¹Ô­ÐÅÏ¢£¬¶ø²»Òª¼ÌÐøÊ¹Óûعö¶Î¡£
¡¡
080 The Undo Advisor improves manageability of transaction management, especially for automatic undo management. The Undo Advisor presents the best retention possible for the given undo tablespace. It also advises a size for the undo tablespace when you want to set undo retention to a particular value.
¡¡
»¹Ô­¹ÜÀí¹ËÎʹ¤¾ß£¨Undo Advisor£©Äܹ»Ìá¸ßÊÂÎïµÄ¿É¹ÜÀíÐÔ£¬ÓÈÆäÊÇϵͳ²ÉÓÃÁË×Ô¶¯»¹Ô­¹ÜÀíʱ¡£»¹Ô­¹ÜÀí¹ËÎʹ¤¾ßÄܹ»¸ù¾Ý¿ÉÓõĻ¹Ô­±í¿Õ¼äÈÝÁ¿È·¶¨×î¼ÑµÄ»¹Ô­ÐÅÏ¢±£´æÖÜÆÚ£¨undo retention£©¡£»¹Ô­¹ÜÀí¹ËÎʹ¤¾ßÒ²Äܸù¾ÝÓû§ËùÐèµÄ»¹Ô­ÐÅÏ¢±£´æÖÜÆÚ½¨Òé×î¼ÑµÄ»¹Ô­±í¿Õ¼äÈÝÁ¿¡£
¡¡
081 The Undo Advisor is based on system activity statistics, including the longest running query and undo generation rate. Advisor information includes the following:
  • Current undo retention
  • Current undo tablespace size
  • Longest query duration
  • Best undo retention possible
  • Undo tablespace size necessary for current undo retention
»¹Ô­¹ÜÀí¹ËÎʹ¤¾ßÊÇÒÀ¾ÝϵͳÔËÐеÄͳ¼ÆÐÅÏ¢¹¤×÷µÄ£¬ÕâЩÐÅÏ¢°üÀ¨ÏµÍ³ÖÐÖ´ÐÐʱ¼ä×µÄ²éѯ£¬»¹Ô­ÐÅÏ¢Éú³ÉÂʵȡ£»¹Ô­¹ÜÀí¹ËÎʹ¤¾ßÄܹ»ÌṩµÄÐÅÏ¢°üÀ¨£º
  • µ±Ç°µÄ»¹Ô­ÐÅÏ¢±£´æÖÜÆÚ
  • µ±Ç°µÄ»¹Ô­±í¿Õ¼äÈÝÁ¿
  • ϵͳÖÐ×µÄ²éѯִÐÐʱ¼ä
  • µ±Ç°»¹Ô­±í¿Õ¼äÈÝÁ¿ËùÄÜÌṩµÄ×î´ó»¹Ô­ÐÅÏ¢±£´æÖÜÆÚ
  • ¸ø¶¨µÄ»¹Ô­ÐÅÏ¢±£´æÖÜÆÚËùÐèµÄ»¹Ô­±í¿Õ¼äÈÝÁ¿
082

See Also:

Áí¼û£º

083

Oracle-Managed Files

14.6.2 ×Ô¶¯Îļþ¹ÜÀí

084 With Oracle-managed files, you do not need to directly manage the files comprising an Oracle database. Oracle uses standard file system interfaces to create and delete files as needed. This automates the routine task of creation and deletion of database files.
¡¡
²ÉÓÃÁË×Ô¶¯Îļþ¹ÜÀí£¨Oracle-managed file£©ºó£¬Óû§ÎÞÐèÖ±½Ó¹ÜÀí×é³É Oracle Êý¾Ý¿âµÄ¸÷¸öÎļþ¡£Oracle Äܹ»Ê¹Óñê×¼µÄÎļþϵͳ½Ó¿Ú×Ô¶¯µØ´´½¨»òɾ³ýÎļþ¡£ÕâʹÊý¾Ý¿âÎļþ´´½¨É¾³ýÖ®ÀàµÄ³£¹æ¹ÜÀí¹¤×÷Äܹ»×Ô¶¯µØÖ´ÐС£
¡¡
085

Free Space Management

14.6.3 ¿ÉÓÿռä¹ÜÀí

086 Oracle allows for managing free space within a table with bitmaps, as well as traditional dictionary based space management. The bitmapped implementation eliminates much space-related tuning of tables, while providing improved performance during peak loads. Additionally, Oracle provides automatic extension of data files, so the files can grow automatically based on the amount of data in the files. Database administrators do not need to manually track and reorganize the space usage in all the database files.
¡¡
Oracle ¼È¿ÉÒÔʹÓÃλͼ£¨bitmap£©À´¹ÜÀí±íµÄ¿ÉÓÿռ䣨free space£©£¬Ò²¿ÉÒÔʹÓô«Í³µÄÊý¾Ý×ֵ䷽ʽ½øÐйÜÀí¡£²ÉÓÃλͼ·½Ê½¶Ô±íµÄ¿ÉÓÃ¿Õ¼ä½øÐйÜÀíÄܹ»Ïû³ý´óÁ¿µÄ¿Õ¼äµ÷Õû¹¤×÷£¬Í¬Ê±»¹ÄÜÌá¸ß±íÔڸ߸ºÔØÏµĹ¤×÷ÐÔÄÜ¡£Oracle »¹Äܹ»×Ô¶¯µØÀ©Õ¹Êý¾ÝÎļþ£¨data file£©£¬¼´Êý¾ÝÎļþµÄÈÝÁ¿Äܹ»¸ù¾ÝÆäÖÐËù´æ´¢µÄÊý¾ÝÁ¿¶ø×Ô¶¯µØÔö³¤¡£Òò´ËÊý¾Ý¿â¹ÜÀíÔ±ÎÞÐèÊÖ¹¤µØ¼à¿ØËùÓÐÊý¾ÝÎļþµÄ¿Õ¼äʹÓÃÇé¿ö¡£
¡¡
087

Proactive Space Management

14.6.4 Ö÷¶¯¿Õ¼ä¹ÜÀí

088 Oracle Database introduces a non-intrusive and timely check for space utilization monitoring. It automatically monitors space utilization during normal space allocation and de-allocation operations and alerts you if the free space availability falls below the pre-defined thresholds. Space monitoring functionality is set up out of box, causes no performance impact, and is uniformly available across all tablespace types. Also, the same functionality is available both through Enterprise Manager as well as SQL. Because the monitoring is performed at the same time as space is allocated and freed up in the database, this guarantees immediate availability of space usage information whenever you need it.
¡¡
Oracle Êý¾Ý¿âÄܹ»¶¨ÆÚµØ½øÐмì²é£¬´Ó¶øÊµÏÖ¶Ô¿Õ¼äʹÓÃÇé¿öµÄ¼à¿Ø£¬ÕâÖÖ¼ì²é²»»áÖжÏÕý³£µÄÊý¾Ý¿â²Ù×÷¡£Oracle ÔÚ¿Õ¼ä·ÖÅä¼°»ØÊÕ²Ù×÷ÆÚ¼ä¶ÔϵͳµÄ¿Õ¼äʹÓÃÇé¿ö½øÐÐ¼à¿Ø£¬Èç¹û·¢ÏÖ¿ÉÓÿռäµÍÓÚÔ¤ÉèµÄãÐÖµ½«ÏòÓû§·¢³ö¸æ¾¯¡£¿Õ¼ä¼à¿ØÊÇ Oracle µÄÄÚÖù¦ÄÜ£¬Òò´Ë²»»á¶ÔϵͳÐÔÄܲúÉúÓ°Ï죬ÇÒ¸÷ÖÖÀàÐ͵ıí¿Õ¼ä¾ù¿ÉʹÓá£Óû§Í¨¹ýÆóÒµ¹ÜÀíÆ÷£¨Enterprise Manager£©»ò SQL Óï¾ä¾ù¿ÉʹÓÃϵͳµÄ¿Õ¼ä¼à¿Ø¹¦ÄÜ¡£ÓÉÓÚ¼à¿ØÊÇÓëÊý¾Ý¿â¿Õ¼ä·ÖÅä¼°ÊÍ·Åͬʱ½øÐеģ¬Óû§¿ÉÒÔËæÊ±µÃµ½¼°Ê±×¼È·µÄ¿Õ¼äʹÓÃÇé¿ö¡£
¡¡
089 Notification is performed using server-generated alerts. The alerts are triggered when certain space-related events occur in the database. For example, when the space usage threshold of a tablespace is crossed or when a resumable session encounters an out of space situation, then an alert is raised. An alert is sent instantaneously to take corrective measures. You may choose to get paged with the alert information and add space to the tablespace to allow the suspended operation to continue from where it left off.
¡¡
¹ØÓÚ¿Õ¼äʹÓõÄÐÅÏ¢ÊÇͨ¹ý·þÎñÆ÷¸æ¾¯£¨server-generated alert£©Í¨Öª¸øÓû§µÄ¡£µ±Êý¾Ý¿âÖз¢ÉúµÄijЩÓë¿Õ¼äʹÓÃÏà¹ØµÄʼþʱ£¬¸æ¾¯½«±»´¥·¢¡£ÀýÈ磬µ±Ä³¸ö±í¿Õ¼äµÄÒÑÓÿռ䳬¹ýÁËãÐÖµ£¬»òÒ»¸ö¿É»Ö¸´»á»°£¨resumable session£©Óöµ½¿Õ¼ä²»×ãµÄ×´¿ö£¬¶¼»á²úÉú¸æ¾¯¡£¸æ¾¯ÐÅÏ¢Äܹ»±»¼°Ê±µØ´«µÝ¸øÓû§£¬ÒÔ±ãÓû§²ÉÈ¡Êʵ±µÄ´ëÊ©¡£ÀýÈ磬Óû§¿ÉÒÔͨ¹ý´«ºô£¨page£©½ÓÊܸ澯ÐÅÏ¢£¬ÔÙΪ±í¿Õ¼äÔö¼Ó´æ´¢¿Õ¼ä£¬Ê¹¹ÒÆðµÄ²Ù×÷µÃÒÔ¼ÌÐøÖ´ÐС£
¡¡
090 The database comes with a default set of alert thresholds. You can override the default for a given tablespace or set a new default for the entire database through Enterprise Manager.
¡¡
Êý¾Ý¿âÄÚÓÐÒ»×éĬÈϵĸ澯ãÐÖµ¡£Óû§ÔÚÆóÒµ¹ÜÀíÆ÷ÖпÉÒÔΪij¸ö±í¿Õ¼äµ¥¶ÀÉè¶¨ÌØÊâµÄãÐÖµ£¬Ò²¿ÉÒÔΪÕû¸öÊý¾Ý¿âÉ趨еÄĬÈÏÖµ¡£
¡¡
091

Intelligent Capacity Planning

14.6.5 ÖÇÄÜ´æ´¢¿Õ¼ä¹æ»®

092 Space may get overallocated because of the difficulty to predict the space requirement of an object or the inability to predict the growth trend of an object. On tables that are heavily updated, the resulting segment may have a lot of internal fragmentation and maybe even row chaining. These issues can result in a wide variety of problems from poor performance to space wastage. The Oracle Database offers several features to address these challenges.
¡¡
Èç¹ûÊý¾Ý¿â¶ÔÏóËùÐèµÄ´æ´¢¿Õ¼äÄÑÒÔÔ¤²â£¬»òÕß¶ÔÏóÈÝÁ¿µÄÔö³¤Ç÷ÊÆÄÑÒÔÔ¤²â£¬ÎªÄ³¸öÊý¾Ý¿â¶ÔÏó·ÖÅäµÄ¿Õ¼äºÜ¿ÉÄÜ»á¹ý´ó¡£¶øÆµ·±µØ½øÐиüвÙ×÷µÄ±í£¬ÆäÊý¾Ý¶Î£¨segment£© ÖпÉÄÜ´æÔÚ´óÁ¿Ë鯬£¨internal fragmentation£©»òÐÐÇ¨ÒÆ£¨row chaining£©¡£ÕâЩÇé¿ö¿ÉÄܵ¼Ö¸÷ÖÖÎÊÌ⣬ÀýÈç´æ´¢ÐÔÄÜϽµ»ò¿Õ¼äÀË·Ñ¡£Oracle Êý¾Ý¿âÌṩÁ˶àÖÖ½â¾ö´ËÀàÎÊÌâµÄ·½·¨¡£
¡¡
093 The Oracle Database can predict the size of a given table based on its structure and estimated number of rows. This is a powerful "what if" tool that allows estimation of the size of an object before it is created or rebuilt. If tablespaces have different extent management policies, then the tool will help decide the tablespace that will cause least internal fragmentation.
¡¡
Oracle Äܹ»ÒÀ¾Ý±í½á¹¹¼°Ô¤¼ÆÐÐÊýÔ¤²â±íµÄÈÝÁ¿¡£Óû§¿ÉÒÔÔÚ´´½¨»òÖØ½¨¶ÔÏó֮ǰʹÓÃÕâ¸öÇ¿´óµÄ¡°what if¡±¹¤¾ßÔ¤²â¶ÔÏóµÄÈÝÁ¿¡£Èç¹û±í¿Õ¼ä¿ÉÒÔʹÓò»Í¬µÄÊý¾ÝÀ©Õ¹£¨extent£©¹ÜÀí²ßÂÔ£¬Õâ¸ö¹¤¾ß»¹ÄܰïÖúÓû§¾ö¶¨²ÉÓÃÄÄÖÖ²ßÂÔÄܹ»Ê¹Êý¾Ý¶ÎÄÚµÄË鯬×îÉÙ¡£
¡¡
094 The growth trend report takes you to the next step of capacity planning ¨C planning for growth. Most database systems grow over time. Planning for growth is an important aspect of provisioning resources. To aid this process, the Oracle Database tracks historical space utilization in the AWR and uses this information to predict the future resource requirements.
¡¡
Óû§¿ÉÒÔʹÓÿռäÔö³¤Ç÷ÊÆ±¨¸æ£¨growth trend report£©½øÒ»²½µØ¶Ô¿Õ¼ä½øÐй滮¡ª¡ª¿Õ¼äÔö³¤¹æ»®£¨planning for growth£©¡£¾ø´ó¶àÊýÊý¾Ý¿âϵͳµÄÈÝÁ¿¶¼»áËæÊ±¼ä¶øÔö³¤¡£¿Õ¼äÔö³¤¹æ»®ÊÇ×ÊÔ´¹©¸ø£¨provisioning resource£©µÄÒ»¸öÖØÒª·½Ãæ¡£Oracle Êý¾Ý¿âÔÚ AWR ÖмǼ¿Õ¼äʹÓõÄÀúÊ·ÐÅÏ¢£¬²¢ÒÔ´ËΪÒÀ¾ÝÔ¤²âδÀ´µÄ×ÊÔ´ÐèÇ󣬴ӶøÊµÏÖ¶Ô¿Õ¼äÔö³¤µÄ¹æ»®¡£
¡¡
095

Space Reclamation

14.6.6 ¿Õ¼ä»ØÊÕ

096 The Oracle Database provides in-place reorganization of data for optimal space utilization by shrinking it. Shrinking of a segment makes unused space available to other segments in the tablespace and may improve the performance of queries and DML operations.
¡¡
Oracle Êý¾Ý¿âÄܹ»¶ÔÊý¾Ý¶Î£¨segment£©½øÐÐÊÕËõ£¨shrinking£©´Ó¶øÓÅ»¯¿Õ¼äÀûÓÃÂÊ£¬ÇÒÖ´ÐÐÊÕËõ²Ù×÷ʱÎÞÐè¶îÍâ¿Õ¼ä£¨in-place£©À´ÖØ×éÊý¾Ý¡£ÊÕËõ²Ù×÷¿ÉÒÔÊÍ·ÅÊý¾Ý¶ÎÖеÄδÓÿռäÒÔ¹©ÆäËûÊý¾Ý¶ÎʹÓã¬ÇÒÄÜÌá¸ß²éѯ¼° DML ²Ù×÷µÄÐÔÄÜ¡£
¡¡
097 The segment shrink functionality both compacts the space used in a segment and then deallocates it from the segment. The deallocated space is returned to the tablespace and is available to other objects in the tablespace. Sparsely populated tables may cause a performance problem for full table scans. By performing shrink, data in the table is compacted and the high water mark of the segment is pushed down. This makes full table scans read less blocks run faster.
¡¡
Ö´ÐÐÊý¾Ý¶ÎÊÕËõ£¨segment shrink£©Ê±£¬Ê×ÏÈÐèÒª¼¯ÖУ¨compact£©Êý¾Ý¶ÎÄÚµÄÊý¾Ý£¬Ö®ºóÔÙÊͷŶÎÄÚµÄδÓÿռ䡣´ÓÊý¾Ý¶ÎÖÐÊͷŵĿռ佫±»·µ»¹¸ø±í¿Õ¼ä£¬¹©±í¿Õ¼äÄ򵀮äËû¶ÔÏóʹÓá£Èç¹û±íÄÚµÄÊý¾Ý´æ´¢ µÄ½ÏΪ·ÖÉ¢£¬½«»áÓ°ÏìÈ«±íɨÃ裨full table scan£©µÄÐÔÄÜ¡£Ö´ÐÐÁËÊÕËõ²Ù×÷ºó£¬±íÄÚµÄÊý¾Ý½«±»¼¯ÖУ¬ÇÒÊý¾Ý¶ÎµÄ¸ßˮλÏߣ¨high water mark£©½«±»½µµÍ¡£Õ⽫ʹȫ±íɨÃèÐèÒª·ÃÎʵÄÊý¾Ý¿é£¨block£©¸üÉÙ£¬É¨Ãè¸üѸËÙ¡£
¡¡
098 Segment shrink is an online operation ¨C the table being shrunk is open to queries and DML while the segment is being shrunk. Additionally, segment shrink is performed in place. This is an advantage over online table redefinition for compaction and reclaiming space. You can schedule segment shrink for one or all the objects in the database as nightly jobs without requiring any additional space to be provided to the database.
¡¡
Êý¾Ý¶ÎÊÕËõÊôÓÚÁª»ú²Ù×÷£¬µ±±íµÄÊý¾Ý¶Î±»ÊÕËõʱ£¬´Ë±íÒÀÈ»¿ÉÒÔ½øÐвéѯ»ò DML ²Ù×÷¡£´ËÍ⣬Êý¾Ý¶ÎÊÕËõÎÞÐè¶îÍâµÄ´æ´¢¿Õ¼ä¡£±¾µØÊÕËõ£¨in-place£©Óëͨ¹ýÁª»úÖØ¶¨Ò壨online table redefinition£©µÄ·½Ê½ÊÕËõÏà±È¸üÓÐÓÅÊÆ¡£Óû§¿ÉÒÔÔÚÒ¹¼ä¶¨ÆÚµ÷¶È×÷ÒµÀ´Ö´ÐÐÊý¾Ý¿â¶ÔÏóµÄÊÕËõ²Ù×÷£¬¶øÎÞÐèΪÊý¾Ý¿âÌṩ¶îÍâµÄ´æ´¢¿Õ¼ä¡£
¡¡
099 Segment shrink works on heaps, IOTs, IOT overflow segments, LOBs, LOB segments, materialized views, and indexes with row movement enabled in tablespaces with automatic segment space management. When segment shrink is performed on tables with indexes on them, the indexes are automatically maintained when rows are moved around for compaction. User-defined triggers are not fired, however, because compaction is a purely physical operation and does not impact the application.
¡¡
ÔÚ²ÉÓÃÁË×Ô¶¯¶Î¿Õ¼ä¹ÜÀí£¨automatic segment space management£©µÄ±í¿Õ¼äÖУ¬Êý¾Ý¶ÎÊÕËõ¿ÉÒÔ×÷ÓÃÓÚ¶Ñ±í£¨heap-organized table£©£¬Ë÷Òý±í£¨index-organized table£¬IOT£©£¬Ë÷Òý±íµÄÐÐÒç³ö¶Î£¨Row Overflow Area£©£¬LOB ¶ÔÏó£¬LOB ¶Î£¬ÎﻯÊÓͼ£¬¼°ÔÊÐíÐÐÒÆ¶¯£¨row movement enabled£©µÄË÷Òý¡£Èç¹û¶Ô´øÓÐË÷ÒýµÄ±í½øÐÐÊý¾Ý¶ÎÊÕËõ²Ù×÷£¬µ±Êý¾ÝÐз¢ÉúÒÆ¶¯Ê± Oracle Äܹ»×Ô¶¯µØÎ¬»¤Ë÷Òý¡£µ«Óû§×Ô¶¨ÒåµÄ´¥·¢Æ÷²»»á±»´¥·¢£¬ÒòΪÊý¾Ý¶ÎÊÕËõÊôÓÚÎïÀí²Ù×÷£¬¶ÔÓ¦ÓóÌÐòûÓÐÓ°Ïì¡£
¡¡
100

Note:

Segment shrink can be performed only on tables with row movement enabled. Applications that explicitly track rowids of objects cannot be shrunk, because the application tracks the physical location of rows in the objects.

Ìáʾ£º

Ö»ÓÐÔÊÐíÐÐÒÆ¶¯µÄ±í²ÅÄܹ»½øÐÐÊý¾Ý¶ÎÊÕËõ²Ù×÷¡£Èç¹ûÓ¦ÓóÌÐòÖÐÏÔʾµØÊ¹ÓÃÁ˶ÔÏóµÄ ROWID£¬ÄÇôÕâ¸ö¶ÔÏó¾Í²»ÄܽøÐÐÊÕËõ£¬ÒòΪӦÓóÌÐòÐèҪͨ¹ýÎïÀíλÖÃÀ´¶¨Î»¶ÔÏóÄÚµÄÊý¾ÝÐС£
101 To easily identify candidate segments for shrinking, the Oracle Database automatically runs the Segment Advisor to evaluate the entire database. The Segment Advisor performs growth trend analysis on individual objects to determine if there will be any additional space left in the object in seven days. It then uses the reclaim space target to select candidate objects to shrink.
¡¡
Oracle Êý¾Ý¿âÄܹ»×Ô¶¯µØÔËÐÐÊý¾Ý¶Î¹ËÎʹ¤¾ß£¨Segment Advisor£©¶ÔÊý¾Ý¿â½øÐÐÆÀ¹À£¬È·¶¨ÄÄЩÊý¾Ý¶ÎÓ¦¸Ã½øÐÐÊÕËõ²Ù×÷¡£Êý¾Ý¶Î¹ËÎʹ¤¾ßÄܹ»Õë¶Ôÿ¸öÊý¾Ý¿â¶ÔÏó½øÐÐÈÝÁ¿Ôö³¤Ç÷ÊÆ·ÖÎö£¬Ô¤²âÊý¾Ý¿â¶ÔÏóÔÚÆßÌìÖ®ºóÊÇ·ñÒÀÈ»´æÔÚ¿ÉÓÿռ䡣֮ºó¾Í¿ÉÒÔ¶ÔÂú×ãÌõ¼þµÄ¶ÔÏó½øÐÐÊý¾Ý¶ÎÊÕËõÒÔ»ØÊտռ䡣
¡¡
102

Note:

The Segment Advisor does not evaluate undo and temporary tablespaces.

Ìáʾ£º

Êý¾Ý¶Î¹ËÎʹ¤¾ß²»»áÆÀ¹À»¹Ô­±í¿Õ¼ä¼°ÁÙʱ±í¿Õ¼ä¡£
103 In addition to using the pre-computed statistics in the workload repository, the Segment Advisor performs sampling of the objects under consideration to refine the statistics for the objects. Although this operation is more resource intensive, it can be used to perform a more accurate analysis.
¡¡
Êý¾Ý¶Î¹ËÎʹ¤¾ß³ýÁË¿ÉÒÔʹÓà AWR ÖÐÒÑÓеÄͳ¼ÆÐÅÏ¢£¬Ò²¿ÉÒÔÖ±½Ó¶Ô¶ÔÏó½øÐвÉÑùʹͳ¼ÆÐÅÏ¢¸üΪ׼ȷ¡£ÕâÖÖ²Ù×÷½«ÏûºÄ´óÁ¿ÏµÍ³×ÊÔ´£¬µ«ÄÜÌṩ¸üΪ¾«È·µÄ·ÖÎö½á¹û¡£
¡¡
104 Although segment shrink reduces row chaining, and the Oracle Database recommends online redefinition to remove chained rows, the Segment Advisor actually detects certain chained rows that are above a threshold. For example, if a row size increases during an update such that it not longer fits into the block, then the Segment Advisor recommends that the segment be reorganized to improve I/O performance.
¡¡
Êý¾Ý¶ÎÊÕËõÓÐÖúÓÚ¼õÉÙÐÐÁ´½Ó£¨row chaining£©£¬µ« Oracle ½¨Òé²ÉÓöÔÏóÁª»úÖØ¶¨Ò壨online redefinition£©À´Ïû³ýÐÐÁ´½Ó¡£Êý¾Ý¶Î¹ËÎʹ¤¾ßÄܹ»¼ì²â³öijЩ³¬¹ýãÐÖµµÄÐÐÁ´½ÓÇé¿ö¡£ÀýÈ磬Èç¹ûÒ»¸ö¸üвÙ×÷µ¼ÖÂijÐеÄÈÝÁ¿³¬¹ýÁËÒ»¸öÊý¾Ý¿éµÄ×î´óÈÝÁ¿£¬Êý¾Ý¶Î¹ËÎʹ¤¾ß½«½¨Òé¶ÔÊý¾Ý¶Î½øÐÐÖØ×éÒÔÌá¸ß I/O ÐÔÄÜ¡£
¡¡
105

Note:

The Segment Advisor does not detect chained rows created by inserts.

Ìáʾ£º

Êý¾Ý¶Î¹ËÎʹ¤¾ßÎÞ·¨¼ì²â²åÈë²Ù×÷µ¼ÖµÄÐÐÁ´½Ó¡£
106

See Also:

Áí¼û£º

107

Storage Management

14.7 ´æ´¢¹ÜÀí

108 Automatic Storage Management provides a vertical integration of the file system and volume manager specifically built for the Oracle database files. ASM distributes I/O load across all available resource to optimize performance while removing the need for manual I/O tuning (spreading out the database files avoids hotspots). ASM helps you manage a dynamic database environment by letting you grow the database size without having to shutdown the database to adjust the storage allocation.
¡¡
×Ô¶¯´æ´¢¹ÜÀí£¨Automatic Storage Management£©½«µ×²ãµÄÎļþϵͳ£¨file system£©¼°ÆäÉϵľí¹ÜÀíÆ÷£¨volume manager£©¼¯³É£¬ÓÃÓÚ¹ÜÀí Oracle µÄÊý¾Ý¿âÎļþ¡£ASM Äܹ»½« I/O ¸ºÔØ·Ö²¼µ½ËùÓпÉÓõĴ洢×ÊÔ´ÉÏ£¬´Ó¶øÌá¸ßÁËϵͳÐÔÄÜÇÒÎÞÐè´óÁ¿µÄÊÖ¹¤ I/O µ÷Õû£¨¼´×Ô¶¯µØ½«Êý¾Ý¿âÎļþ·ÖÉ¢´Ó¶ø±ÜÃâ³öÏÖÈȵ㣨hotspot£©£©¡£ASM ʹÓû§Äܹ»Ôö¼ÓÊý¾Ý¿âÈÝÁ¿¶øÎÞÐè¹Ø±ÕÊý¾Ý¿â£¬´Ó¶øÊ¹Êý¾Ý¿â´æ´¢·ÖÅ䶯̬»¯¡£
¡¡
109 Automatic Storage Management lets you define a pool of storage (called a disk group) and then the Oracle kernel manages the file naming and placement of the database files on that pool of storage. You can change the storage allocation (adding or removing disks) with SQL statements (CREATE DISKGROUP, ALTER DISKGROUP, and DROP DISKGROUP). You can also manage the disk groups with Enterprise Manager and the Database Configuration Assistant (DBCA).
¡¡
Óû§¿ÉÒÔͨ¹ý×Ô¶¯´æ´¢¹ÜÀí¶¨ÒåÒ»¸ö´æ´¢³Ø£¨³ÆÎª´ÅÅÌ×飨disk group£©£©£¬Oracle Äܹ»×Ô¶¯µØ»ùÓÚ´æ´¢³Ø¹ÜÀíÎļþÃüÃû¼°Îļþ´æ´¢Î»Öá£Óû§¿ÉÒÔʹÓà SQL Óï¾ä£¨CREATE DISKGROUP£¬ALTER DISKGROUP£¬¼° DROP DISKGROUP£©¸Ä±ä´æ´