Configuration Example
In the example presented in this section, we use a Sun Fire 4800 server with two boards, each populated with two CPUs and one gigabyte of memory. The initial Oracle domain uses only one board. The maximum amount of physical memory a Sun Fire 4800 server can hold is 12 gigabytes; therefore, we will increase the maximum size of the SGA to 12 gigabytes.
The following code sample shows the default Oracle configuration.
SQL> startup ORACLE instance started. Total System Global Area 303531784 bytes Fixed Size 730888 bytes Variable Size 285212672 bytes Database Buffers 16777216 bytes Redo Buffers 811008 bytes Database mounted. Database opened.
When inspecting the address space of one of the database engine processes, as shown in the following sample, you can see that the SGA is created as an ISM segment.
$ pmap 386 386: ora_pmon_SGA 0000000100000000 53880K r-x-- /unused/oracle/OraHome1/bin/oracle 000000010359C000 1048K rwx-- /unused/oracle/OraHome1/bin/oracle 00000001036A2000 1936K rwx-- [ heap ] 0000000380000000 315392K rwxsR [ ism shmid=0x64 ] FFFFFFFF7C400000 8K rw--R [ anon ] FFFFFFFF7C410000 8K rw--R [ anon ]
As shown in the following sample, the SGA is increased to 12 gigabytes by setting the instance parameter SGA_MAX_SIZE. This static parameter needs to be set upon initial configuration of the instance because it requires you to shut down and restart the database. To do this, you need to configure a sufficiently large amount of swap space. (12 gigabytes plus the swap space reserved by all other processes on the system. Note that this is reported as having a status of "used" by the command swap -s.) If you do not configure a large enough swap space, the Oracle instance will fail to start.
The following list outlines the different steps we will take in the configuration example:
When you initially configure the instance, make sure that the instance parameter SGA_MAX_SIZE is as big as the size you eventually want your instance to be. This parameter has to be backed up by at least an equal amount of virtual memory (physical memory plus swap space).
Add a second system board using dynamic reconfiguration.
Now, grow the instance parameter db_cache_size while the instance is running.
To shrink the size of an SGA component, change the instance parameter on the running instance. If you want to remove the system board, you can do so at this time.
SQL> ALTER SYSTEM SET sga_max_size=12g SCOPE=spfile; System altered. SQL>SHUTDOWN IMMEDIATE SQL>STARTUP ORACLE instance started. Total System Global Area 1.2886E+10 bytes Fixed Size 748984 bytes Variable Size 1.2868E+10 bytes Database Buffers 16777216 bytes Redo Buffers 811008 bytes Database mounted. Database opened. SQL>
As shown in the following sample, the address space now shows a 12 gigabyte DISM segment.
# pmap 368 368: ora_pmon_SGA 0000000100000000 53880K r-x-- /unused/oracle/OraHome1/bin/oracle 000000010359C000 1048K rwx-- /unused/oracle/OraHome1/bin/oracle 00000001036A2000 1520K rwx-- [ heap ] 0000000380000000 12603392K rwxs- [ dism shmid=0x12c ] FFFFFFFF7C400000 8K rw--R [ anon ] FFFFFFFF7C410000 8K rw--R [ anon ] FFFFFFFF7C450000 8K rw--R [ anon ]
After increasing the size of the SGA, you are ready to dynamically add the second system board.
The following sample shows the initial system configuration.
sf4800a[523]# prtconf | head System Configuration: Sun Microsystems sun4u Memory size: 1024 Megabytes System Peripherals (Software Nodes): sf4800a[524]# psrinfo 18 on-line since 10/31/2003 16:54:12 19 on-line since 10/31/2003 16:54:13
As shown in the next sample, the second board is added using the cfgadm command.
sf4800a[525]# cfgadm -c configure N0.SB0 {/N0/SB0/P2} Running CPU POR and Set Clocks {/N0/SB0/P3} Running CPU POR and Set Clocks {/N0/SB0/P2} @(#) lpost 5.15.0 2003/04/14 16:54 {/N0/SB0/P3} @(#) lpost 5.15.0 2003/04/14 16:54 {/N0/SB0/P2} Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved. {/N0/SB0/P3} Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved. {/N0/SB0/P2} Use is subject to license terms. {/N0/SB0/P3} Use is subject to license terms. {/N0/SB0/P2} Subtest: Setting Fireplane Config Registers for aid 0x2 {/N0/SB0/P2} Subtest: Display CPU Version, frequency {/N0/SB0/P3} Subtest: Setting Fireplane Config Registers for aid 0x3 {/N0/SB0/P2} Version register = 003e0014.54000507 {/N0/SB0/P2} Cpu/System ratio = 5, cpu actual frequency = 750 {/N0/SB0/P3} Subtest: Display CPU Version, frequency {/N0/SB0/P3} Version register = 003e0014.54000507 {/N0/SB0/P3} Cpu/System ratio = 5, cpu actual frequency = 750 {/N0/SB0/P2} Running Basic CPU {/N0/SB0/P3} Running Basic CPU {/N0/SB0/P2} @(#) lpost 5.15.0 2003/04/14 16:54 {/N0/SB0/P3} @(#) lpost 5.15.0 2003/04/14 16:54 {/N0/SB0/P2} Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved. {/N0/SB0/P3} Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved. {/N0/SB0/P2} Use is subject to license terms. {/N0/SB0/P3} Use is subject to license terms. {/N0/SB0/P2} Subtest: I-Cache Initialization {/N0/SB0/P2} Subtest: D-Cache Initialization {/N0/SB0/P2} Subtest: W-Cache Initialization {/N0/SB0/P3} Subtest: I-Cache Initialization
After the dynamic configuration operation, the system configuration appears as follows.
sf4800a[528]# prtconf | head System Configuration: Sun Microsystems sun4u Memory size: 2048 Megabytes System Peripherals (Software Nodes): sf4800a[528]# psrinfo 2 on-line since 10/31/2003 17:03:31 3 on-line since 10/31/2003 17:03:36 18 on-line since 10/31/2003 16:54:12 19 on-line since 10/31/2003 16:54:13
As shown in the following sample, you can now change the size of the database buffer cache from 16 megabytes to 1.5 gigabytes without restarting the instance.
SQL> alter system set db_cache_size=1500M; System altered. SQL> show sga Total System Global Area 1.2886E+10 bytes Fixed Size 748984 bytes Variable Size 1.1308E+10 bytes Database Buffers 1577058304 bytes Redo Buffers 811008 bytes
You can also dynamically shrink the size of the SGA components and then remove the system board that was just added. The following command shrinks the size of the database buffer cache back to 16 megabytes.
SQL> alter system set db_cache_size=16M; System altered. SQL> show sga Total System Global Area 1.2886E+10 bytes Fixed Size 748984 bytes Variable Size 1.2868E+10 bytes Database Buffers 16777216 bytes Redo Buffers 811008 bytes
The following set of commands remove the system board and show the systems configuration after this operation.
sf4800a[545]# cfgadm -c unconfigure N0.SB0 sf4800a[547]# prtconf | grep -i mem Memory size: 1024 Megabytes