Apress.Expert.Oracle.Database.Architecture.9i.and.10g.Programming.Techniques.and.Solutions.Sep.2005
CHAPTER 3 ■ FILES 67 Without a parameter file, you cannot start an Oracle database. This makes the parameter file fairly important, and as of Oracle9i Release 2 (versions 9.2 and above), the backup and recovery tool Recovery Manager (RMAN) recognizes this file’s importance and will allow you to include the server parameter file (but not the legacy init.ora parameter file type) in your backup set. However, since it is simply a plain text file, which you can create with any text editor, it is not a file you have to necessarily guard with your life. You can re-create it, as long as you know what was in it (e.g., you can retrieve that information from the database’s alert log, if you have access to that). We will now examine each type of parameter file (init.ora and SPFILE) in turn, but before we do that, let’s see what a database parameter file looks like. What Are Parameters? In simple terms, a database parameter may be thought of as a “key” and “value” pair. You saw an important parameter, DB_NAME, in the preceding chapter. The DB_NAME parameter was stored simply as db_name = ora10g. The “key” here is DB_NAME and the “value” is ora10g—that is our key/value pair. In order to see the current value of an instance parameter, you can query the V$ view V$PARAMETER. Alternatively, in SQL*Plus you can use the SHOW PARAMETER command, for example: sys@ORA10G> select value 2 from v$parameter 3 where name = 'pga_aggregate_target'; VALUE ------------------------------------------------------------------------------- 1073741824 sys@ORA10G> show parameter pga_agg NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ pga_aggregate_target big integer 1G Both outputs show basically the same information, although you can get more information from V$PARAMETER (there are many more columns to choose from than displayed in this example). But SHOW PARAMETER wins for me in ease of use and the fact that it “wildcards” automatically. Notice that I typed in only pga_agg; SHOW PARAMETER adds % to the front and back. ■Note All V$ views and all dictionary views are fully documented in the Oracle Database Reference manual. Please regard that manual as the definitive source of what is available in a given view. If you counted the number of documented parameters that you may set in each of the database versions 9.0.1, 9.2.0, and 10.1.0, you would probably find 251, 258, and 255 different parameters, respectively (I’m sure there could be additional parameters available on an
68 CHAPTER 3 ■ FILES operating system–by–operating system basis). In other words, the number of parameters (and their names) varies by release. Most parameters, like DB_BLOCK_SIZE, are very long lived (they won’t go away from release to release), but over time many other parameters become obsolete as implementations change. For example, in Oracle 9.0.1 there was a DISTRIBUTED_TRANSACTIONS parameter that could be set to some positive integer and that controlled the number of concurrent distributed transactions the database could perform. It was available in prior releases, but it is not found in any release subsequent to 9.0.1 and, in fact, attempting to use it with subsequent releases will raise an error: ops$tkyte@ORA10G> alter system set distributed_transactions = 10; alter system set distributed_transactions = 10 * ERROR at line 1: ORA-25138: DISTRIBUTED_TRANSACTIONS initialization parameter has been made obsolete If you would like to review these parameters and get a feeling for what is available and what each parameter does, you should refer to the Oracle Database Reference manual. The first chapter of this manual examines each and every documented parameter in detail. I would like to point out that in general, the default value assigned to these parameters (or the derived value for parameters that obtain their default settings from other parameters) is sufficient for most systems. In general, the values of parameters, such as the CONTROL_FILES parameter (which specifies the location of the control files on your system), DB_BLOCK_SIZE, and various memory-related parameters, need to be set uniquely for each database Notice I used the term “documented” in the preceding paragraph. There are undocumented parameters as well. You can identify these by the fact that their names begin with an underscore (_). There is a great deal of speculation about these parameters. Since they are undocumented, some people believe they must be “magical,” and many people assume that they are well known and used by Oracle “insiders.” In fact, I find the opposite to be true. They are not well known and they are hardly ever used. Most of these undocumented parameters are rather boring, actually, as they represent deprecated functionality and backwardcompatibility flags. Others help in the recovery of data, not of the database itself; for example, some of them enable the database to start up in certain extreme circumstances, but only long enough to get data out. You have to rebuild after that. Unless you are so directed by Oracle Support, there is no reason to have an undocumented parameter in your configuration. Many have side effects that could be devastating. In my development database, I use only one undocumented setting, if any: _TRACE_FILES_PUBLIC = TRUE This parameter makes trace files readable by all, not just the DBA group. On my development database, I want my developers to use SQL_TRACE, TIMED_STATISTICS, and the TKPROF utility frequently (well, I demand it actually); hence they need to be able to read the trace files. With the advent of external tables in Oracle 9.0.1 and above, we’ll see that we need not use even this parameter to permit access to trace files. In my production database, I don’t use any undocumented settings. In fact, the seemingly “safe” undocumented parameter just mentioned can have undesirable side effects in a live system. Think about the sensitive information that you might find in a trace file, such as SQL
- Page 62 and 63: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 64 and 65: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 66 and 67: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 68 and 69: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 70 and 71: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 72 and 73: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 74 and 75: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 76 and 77: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 78 and 79: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 80 and 81: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 82 and 83: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 84 and 85: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 86 and 87: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 88 and 89: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 90 and 91: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 92: CHAPTER 1 ■ DEVELOPING SUCCESSFUL
- Page 95 and 96: 50 CHAPTER 2 ■ ARCHITECTURE OVERV
- Page 97 and 98: 52 CHAPTER 2 ■ ARCHITECTURE OVERV
- Page 99 and 100: 54 CHAPTER 2 ■ ARCHITECTURE OVERV
- Page 101 and 102: 56 CHAPTER 2 ■ ARCHITECTURE OVERV
- Page 103 and 104: 58 CHAPTER 2 ■ ARCHITECTURE OVERV
- Page 105 and 106: 60 CHAPTER 2 ■ ARCHITECTURE OVERV
- Page 107 and 108: 62 CHAPTER 2 ■ ARCHITECTURE OVERV
- Page 110 and 111: CHAPTER 3 ■ ■ ■ Files In this
- Page 114 and 115: CHAPTER 3 ■ FILES 69 and even dat
- Page 116 and 117: CHAPTER 3 ■ FILES 71 all operatio
- Page 118 and 119: CHAPTER 3 ■ FILES 73 *.cluster_da
- Page 120 and 121: CHAPTER 3 ■ FILES 75 ops$tkyte@OR
- Page 122 and 123: CHAPTER 3 ■ FILES 77 • To maint
- Page 124 and 125: CHAPTER 3 ■ FILES 79 • Resource
- Page 126 and 127: CHAPTER 3 ■ FILES 81 3 l_dummy nu
- Page 128 and 129: CHAPTER 3 ■ FILES 83 Trace Files
- Page 130 and 131: CHAPTER 3 ■ FILES 85 _qerixAlloca
- Page 132 and 133: CHAPTER 3 ■ FILES 87 6 ( 7 TYPE O
- Page 134 and 135: CHAPTER 3 ■ FILES 89 A Brief Revi
- Page 136 and 137: CHAPTER 3 ■ FILES 91 Redundant Ar
- Page 138 and 139: CHAPTER 3 ■ FILES 93 (data from m
- Page 140 and 141: CHAPTER 3 ■ FILES 95 dictionary t
- Page 142 and 143: CHAPTER 3 ■ FILES 97 ■Note df i
- Page 144 and 145: CHAPTER 3 ■ FILES 99 “accidenta
- Page 146 and 147: CHAPTER 3 ■ FILES 101 So, at the
- Page 148 and 149: CHAPTER 3 ■ FILES 103 Password Fi
- Page 150 and 151: CHAPTER 3 ■ FILES 105 USER is "SY
- Page 152 and 153: CHAPTER 3 ■ FILES 107 Flashback L
- Page 154 and 155: CHAPTER 3 ■ FILES 109 of the requ
- Page 156 and 157: CHAPTER 3 ■ FILES 111 IMPDP, howe
- Page 158 and 159: CHAPTER 3 ■ FILES 113 tkyte@ORA10
- Page 160 and 161: CHAPTER 4 ■ ■ ■ Memory Struct
68<br />
CHAPTER 3 ■ FILES<br />
operating system–by–operating system basis). In other words, the number of parameters (<strong>and</strong><br />
their names) varies by release. Most parameters, like DB_BLOCK_SIZE, are very long lived (they<br />
won’t go away from release to release), but over time many other parameters become obsolete<br />
as implementations change.<br />
For example, in <strong>Oracle</strong> 9.0.1 there was a DISTRIBUTED_TRANSACTIONS parameter that could<br />
be set to some positive integer <strong>and</strong> that controlled the number of concurrent distributed<br />
transactions the database could perform. It was available in prior releases, but it is not found<br />
in any release subsequent to 9.0.1 <strong>and</strong>, in fact, attempting to use it with subsequent releases<br />
will raise an error:<br />
ops$tkyte@ORA10G> alter system set distributed_transactions = 10;<br />
alter system set distributed_transactions = 10<br />
*<br />
ERROR at line 1:<br />
ORA-25138: DISTRIBUTED_TRANSACTIONS initialization parameter has been made<br />
obsolete<br />
If you would like to review these parameters <strong>and</strong> get a feeling for what is available <strong>and</strong><br />
what each parameter does, you should refer to the <strong>Oracle</strong> <strong>Database</strong> Reference manual. The first<br />
chapter of this manual examines each <strong>and</strong> every documented parameter in detail. I would like<br />
to point out that in general, the default value assigned to these parameters (or the derived<br />
value for parameters that obtain their default settings from other parameters) is sufficient for<br />
most systems. In general, the values of parameters, such as the CONTROL_FILES parameter<br />
(which specifies the location of the control files on your system), DB_BLOCK_SIZE, <strong>and</strong> various<br />
memory-related parameters, need to be set uniquely for each database<br />
Notice I used the term “documented” in the preceding paragraph. There are undocumented<br />
parameters as well. You can identify these by the fact that their names begin with an<br />
underscore (_). There is a great deal of speculation about these parameters. Since they are<br />
undocumented, some people believe they must be “magical,” <strong>and</strong> many people assume that<br />
they are well known <strong>and</strong> used by <strong>Oracle</strong> “insiders.” In fact, I find the opposite to be true.<br />
They are not well known <strong>and</strong> they are hardly ever used. Most of these undocumented parameters<br />
are rather boring, actually, as they represent deprecated functionality <strong>and</strong> backwardcompatibility<br />
flags. Others help in the recovery of data, not of the database itself; for example,<br />
some of them enable the database to start up in certain extreme circumstances, but only long<br />
enough to get data out. You have to rebuild after that.<br />
Unless you are so directed by <strong>Oracle</strong> Support, there is no reason to have an undocumented<br />
parameter in your configuration. Many have side effects that could be devastating.<br />
In my development database, I use only one undocumented setting, if any:<br />
_TRACE_FILES_PUBLIC = TRUE<br />
This parameter makes trace files readable by all, not just the DBA group. On my development<br />
database, I want my developers to use SQL_TRACE, TIMED_STATISTICS, <strong>and</strong> the TKPROF<br />
utility frequently (well, I dem<strong>and</strong> it actually); hence they need to be able to read the trace files.<br />
With the advent of external tables in <strong>Oracle</strong> 9.0.1 <strong>and</strong> above, we’ll see that we need not use<br />
even this parameter to permit access to trace files.<br />
In my production database, I don’t use any undocumented settings. In fact, the seemingly<br />
“safe” undocumented parameter just mentioned can have undesirable side effects in a live<br />
system. Think about the sensitive information that you might find in a trace file, such as SQL