We discussed setting the STATISTICS_LEVEL parameter to TYPICAL or ALL to enable ASMM. For a more detailed understanding of various statistics levels, query the V$STATISTICS_LEVEL view. You can use ALTER SESSION or ALTER SYSTEM to change the values if you decide to switch back and forth using ASMM. Use the following query to get your database session settings: SQL> select STATISTICS_NAME, SESSION_STATUS, ACTIVATION_LEVEL from V$STATISTICS_LEVEL; STATISTICS_NAME SESSION_ ACTIVAT ---------------------------------------- -------- ------- Buffer Cache Advice ENABLED TYPICAL MTTR Advice ENABLED TYPICAL Timed Statistics ENABLED TYPICAL Timed OS Statistics DISABLED ALL Segment Level Statistics ENABLED TYPICAL PGA Advice ENABLED TYPICAL Plan Execution Statistics DISABLED ALL Shared Pool Advice ENABLED TYPICAL Modification Monitoring ENABLED TYPICAL Longops Statistics ENABLED TYPICAL Bind Data Capture ENABLED TYPICAL Ultrafast Latch Statistics ENABLED TYPICAL Threshold-based Alerts ENABLED TYPICAL Global Cache Statistics ENABLED TYPICAL Cache Stats Monitor ENABLED TYPICAL Active Session History ENABLED TYPICAL Undo Advisor, Alerts and Fast Ramp up ENABLED TYPICAL 17 rows selected. Converting a Manual MemoryManaged Database to ASMM
If you want to enable automatic shared-memory management in a manual memorymanaged database, do the following:
Tuning SGA_TARGET and SGA_MAX_SIZEOracle Database 10g controls the virtual memory used by the SGA. It can start instances with minimal memory and allow the instance to use more memory up to SGA_MAX_SIZE by increasing the memory allocated for SGA components. If the value for SGA_MAX_SIZE in the initSID.ora file or SPFILE is less than the sum of the memory allocated for all memory components, then the database ignores the value for SGA_MAX_SIZE at instance startup. SGA_MAX_SIZE cannot be dynamically resized. It is the maximum size of the SGA for the entire instance lifetime. When you set SGA_TARGET in an instance, the value of SGA_MAX_SIZE is automatically set to the new value for SGA_TARGET. But you cannot raise SGA_TARGET to a value higher than SGA_MAX_SIZE. So use the steps in the preceding section, "Converting a Manual MemoryManaged Database to ASMM," to find appropriate values for SGA_TARGET. The SGA_TARGET value should always be lower than SGA_MAX. You will get ORA-00823 if you try to raise SGA_TARGET above SGA_MAX as given in Listing 5.1. Listing 5.1. Tuning SGA_TARGETSQL> show parameter sga ; NAME TYPE VALUE ------------------------------------ ----------- ----------------------------- lock_sga boolean FALSE pre_page_sga boolean FALSE sga_max_size big integer 4G sga_target big integer 0 SQL> alter system set sga_target=500M; System altered. SQL> show parameter sga ; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ lock_sga boolean FALSE pre_page_sga boolean FALSE sga_max_size big integer 4G sga_target big integer 4G SQL> alter system set sga_target=5000M; alter system set sga_target=5000M * ERROR at line 1: ORA-02097: parameter cannot be modified because specified value is invalid ORA-00823: Specified value of sga_target greater than sga_max_size Similarly, if you try to shrink SGA_TARGET to a value below the sum of individual components, you will get an ORA-00827 error. For resizing SGA to a lower value, reduce the size of individual components and try the shrink operation.
|