05.11.2015 Views

Apress.Expert.Oracle.Database.Architecture.9i.and.10g.Programming.Techniques.and.Solutions.Sep.2005

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

74<br />

CHAPTER 3 ■ FILES<br />

The ALTER SYSTEM SET comm<strong>and</strong>, by default, will update the currently running instance<br />

<strong>and</strong> make the change to the SPFILE for you, greatly easing administration <strong>and</strong> removing the<br />

problems that arose when parameter settings were made via the ALTER SYSTEM comm<strong>and</strong>, but<br />

you forgot to update or missed an init.ora parameter file.<br />

With that in mind, let’s take a look at each element of the comm<strong>and</strong>:<br />

• The parameter=value assignment supplies the parameter name <strong>and</strong> the new value<br />

for the parameter. For example, pga_aggregate_target = 1024m would set the<br />

PGA_AGGREGATE_TARGET parameter to a value of 1,024MB (1GB).<br />

• comment='text' is an optional comment we may associate with this setting of the<br />

parameter. The comment will appear in the UPDATE_COMMENT field of the V$PARAMETER<br />

view. If we use the options to also save the change to the SPFILE, the comment will be<br />

written into the SPFILE <strong>and</strong> preserved across server restarts as well, so future restarts of<br />

the database will see the comment.<br />

• deferred specifies whether the system change takes place for subsequent sessions only<br />

(not currently established sessions, including the one making the change). By default,<br />

the ALTER SYSTEM comm<strong>and</strong> will take effect immediately, but some parameters cannot<br />

be changed “immediately”—they can be changed only for newly established sessions.<br />

We can use the following query to see what parameters m<strong>and</strong>ate the use of deferred:<br />

ops$tkyte@ORA10G> select name<br />

2 from v$parameter<br />

3 where ISSYS_MODIFIABLE = 'DEFERRED';<br />

NAME<br />

------------------------------<br />

backup_tape_io_slaves<br />

audit_file_dest<br />

object_cache_optimal_size<br />

object_cache_max_size_percent<br />

sort_area_size<br />

sort_area_retained_size<br />

olap_page_pool_size<br />

7 rows selected.<br />

The code shows that SORT_AREA_SIZE is modifiable at the system level, but only in a<br />

deferred manner. The following code shows what happens if we try to modify its value<br />

with <strong>and</strong> without the deferred option:<br />

ops$tkyte@ORA10G> alter system set sort_area_size = 65536;<br />

alter system set sort_area_size = 65536<br />

*<br />

ERROR at line 1:<br />

ORA-02096: specified initialization parameter is not modifiable with this<br />

option

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!