Which SPFILE is Impacted when Issuing an ALTER SYSTEM Command? [ID 138119.1]
Which SPFILE Parameter File is Impacted when Issuing an ALTER SYSTEM Command? [ID 138119.1]
***Checked for relevance on 17-Jul-2012***
PURPOSE You maintain several SPFILE files: $ ls -l spfile* -rw-r----- 1 sme dba 2560 Mar 20 08:20 spfile.ora -rw-r----- 1 sme dba 2560 Mar 20 08:20 spfileRel14.ora Which one is modified when you run the "ALTER SYSTEM" SQL command to permanently change parameter values in the spfile? SCOPE & APPLICATION The DBAs must be cautious when using ALTER SYSTEM command since it permanently modifies an SPFILE parameter file. They need to know which parameter file will be modified. Which SPFILE Parameter File is Impacted when Issuing an ALTER SYSTEM Command? ============================================================================= Determine which SPFILE was used at startup, if any was used: ------------------------------------------------------------ 1. At instance STARTUP, there are 3 possibilities for the instance to retrieve instance parameter values: * read the initSID.ora referring to an spfile referenced by the new parameter SPFILE=spfile.ora (CASE 1) * read spfileSID.ora containing all instance parameters (CASE 2) * read the initSID.ora containing all instance parameters (CASE 3) 2. When you execute an ALTER SYSTEM command to modify the spfile parameter values, the SPFILE impacted is always the spfile used at startup. 3. Which one was used at startup? There are 3 places to retrieve this information: * alert.log file * V$PARAMETER * V$SPPARAMETER view 4. 3 possible cases: ---------------------------------------------------------------------------- Case 1 ---------------------------------------------------------------------------- If, in the alertSID.log file, the name of the spfile used is displayed, then it is clearly explicit that the instance started with the initSID.ora calling an spfile. Starting up ORACLE RDBMS Version: 9.0.0.0.0. System parameters with non-default values: processes = 150 timed_statistics = TRUE shared_pool_size = 67108864 large_pool_size = 1048576 java_pool_size = 20971520 spfile = spfile.ora The V$PARAMETER view displays the full name of the spfile used: SQL> select name,value from v$parameter where name='spfile'; NAME VALUE ---------------- ------------------------------------------------- spfile /export/home1/ora900/dbs/spfile.ora In this example, when you use the "ALTER SYSTEM" SQL command to change a parameter value, the modification is made to the spfile.ora and not to the spfileSID.ora file. Example: $ cp spfile.ora spfileRel14.ora SQL> alter system set sort_area_size=65000 scope=spfile; System altered. $ more spfileRel14.ora ... *.sort_area_size=524288 ... $ more spfile.ora ... *.sort_area_size=65000 ... ---------------------------------------------------------------------------- Case 2 ---------------------------------------------------------------------------- If, in the alert.log file, no SPFILE parameter is mentioned, then an ALTER SYSTEM command would alter the spfileRel14.ora file by default if used at startup. The V$PARAMETER view displays the name of the spfile used. The value can be: * spfile@.ora for spfileSID.ora * spfile.ora for spfile.ora SQL> select name,value from v$parameter where name='spfile'; NAME VALUE ---------------- ------------------------------------------------- spfile ?/dbs/spfile@.ora You can check that the spfileRel14.ora file was used at startup: in V$SPPARAMETER view, some of the parameters have the ISSPECIFIED column value set to TRUE and therefore the VALUE column is not null: SQL> select name, value,isspecified 2 from v$spparameter where name like 'undo%' NAME VALUE ISSPEC ------------------------------ ------------------------------ ------ undo_management MANUAL TRUE undo_tablespace RBS TRUE undo_suppress_errors FALSE undo_retention FALSE SQL> alter system set processes =100 scope=spfile; System altered. $ more spfileRel14.ora ... *.processes=100 ... The previous spfile.ora showed above displays the following information: $ more spfile.ora ... processes=150 ... ---------------------------------------------------------------------------- Case 3 ---------------------------------------------------------------------------- If, in the alert.log file, no SPFILE parameter is mentioned, then an ALTER SYSTEM command would issue an error if no spfile was used at startup. SQL> alter system set open_cursors=500 scope=spfile; alter system set open_cursors=500 scope=spfile * ERROR at line 1: ORA-32001: write to SPFILE requested but no SPFILE specified at startup The V$PARAMETER view displays a NULL value for the name of the spfile: SQL> select name,value from v$parameter where name='spfile'; NAME VALUE ---------------- ------------------------------------------------- spfile You can check that no spfile file was used at startup: in V$SPPARAMETER view there are no parameters for which the ISSPECIFIED value is set to TRUE, nor is the VALUE column not null: Example: In initRel12.ora , no SPFILE parameter used: SQL> startup pfile=initRel12.ora ORACLE instance started. Total System Global Area 143433028 bytes Fixed Size 286020 bytes Variable Size 100663296 bytes Database Buffers 41943040 bytes Redo Buffers 540672 bytes Database mounted. Database opened. SQL> select * from v$spparameter where VALUE is NOT NULL; no rows selected SQL> select * from v$spparameter where ISSPECIFIED ='TRUE'; no rows selected RELATED DOCUMENTS ----------------- Note:137483.1 How to modify the content of an SPFILE parameter file
PURPOSE You maintain several SPFILE files: $ ls -l spfile* -rw-r----- 1 sme dba 2560 Mar 20 08:20 spfile.ora -rw-r----- 1 sme dba 2560 Mar 20 08:20 spfileRel14.ora Which one is modified when you run the "ALTER SYSTEM" SQL command to permanently change parameter values in the spfile? SCOPE & APPLICATION The DBAs must be cautious when using ALTER SYSTEM command since it permanently modifies an SPFILE parameter file. They need to know which parameter file will be modified. Which SPFILE Parameter File is Impacted when Issuing an ALTER SYSTEM Command? ============================================================================= Determine which SPFILE was used at startup, if any was used: ------------------------------------------------------------ 1. At instance STARTUP, there are 3 possibilities for the instance to retrieve instance parameter values: * read the initSID.ora referring to an spfile referenced by the new parameter SPFILE=spfile.ora (CASE 1) * read spfileSID.ora containing all instance parameters (CASE 2) * read the initSID.ora containing all instance parameters (CASE 3) 2. When you execute an ALTER SYSTEM command to modify the spfile parameter values, the SPFILE impacted is always the spfile used at startup. 3. Which one was used at startup? There are 3 places to retrieve this information: * alert.log file * V$PARAMETER * V$SPPARAMETER view 4. 3 possible cases: ---------------------------------------------------------------------------- Case 1 ---------------------------------------------------------------------------- If, in the alertSID.log file, the name of the spfile used is displayed, then it is clearly explicit that the instance started with the initSID.ora calling an spfile. Starting up ORACLE RDBMS Version: 9.0.0.0.0. System parameters with non-default values: processes = 150 timed_statistics = TRUE shared_pool_size = 67108864 large_pool_size = 1048576 java_pool_size = 20971520 spfile = spfile.ora The V$PARAMETER view displays the full name of the spfile used: SQL> select name,value from v$parameter where name='spfile'; NAME VALUE ---------------- ------------------------------------------------- spfile /export/home1/ora900/dbs/spfile.ora In this example, when you use the "ALTER SYSTEM" SQL command to change a parameter value, the modification is made to the spfile.ora and not to the spfileSID.ora file. Example: $ cp spfile.ora spfileRel14.ora SQL> alter system set sort_area_size=65000 scope=spfile; System altered. $ more spfileRel14.ora ... *.sort_area_size=524288 ... $ more spfile.ora ... *.sort_area_size=65000 ... ---------------------------------------------------------------------------- Case 2 ---------------------------------------------------------------------------- If, in the alert.log file, no SPFILE parameter is mentioned, then an ALTER SYSTEM command would alter the spfileRel14.ora file by default if used at startup. The V$PARAMETER view displays the name of the spfile used. The value can be: * spfile@.ora for spfileSID.ora * spfile.ora for spfile.ora SQL> select name,value from v$parameter where name='spfile'; NAME VALUE ---------------- ------------------------------------------------- spfile ?/dbs/spfile@.ora You can check that the spfileRel14.ora file was used at startup: in V$SPPARAMETER view, some of the parameters have the ISSPECIFIED column value set to TRUE and therefore the VALUE column is not null: SQL> select name, value,isspecified 2 from v$spparameter where name like 'undo%' NAME VALUE ISSPEC ------------------------------ ------------------------------ ------ undo_management MANUAL TRUE undo_tablespace RBS TRUE undo_suppress_errors FALSE undo_retention FALSE SQL> alter system set processes =100 scope=spfile; System altered. $ more spfileRel14.ora ... *.processes=100 ... The previous spfile.ora showed above displays the following information: $ more spfile.ora ... processes=150 ... ---------------------------------------------------------------------------- Case 3 ---------------------------------------------------------------------------- If, in the alert.log file, no SPFILE parameter is mentioned, then an ALTER SYSTEM command would issue an error if no spfile was used at startup. SQL> alter system set open_cursors=500 scope=spfile; alter system set open_cursors=500 scope=spfile * ERROR at line 1: ORA-32001: write to SPFILE requested but no SPFILE specified at startup The V$PARAMETER view displays a NULL value for the name of the spfile: SQL> select name,value from v$parameter where name='spfile'; NAME VALUE ---------------- ------------------------------------------------- spfile You can check that no spfile file was used at startup: in V$SPPARAMETER view there are no parameters for which the ISSPECIFIED value is set to TRUE, nor is the VALUE column not null: Example: In initRel12.ora , no SPFILE parameter used: SQL> startup pfile=initRel12.ora ORACLE instance started. Total System Global Area 143433028 bytes Fixed Size 286020 bytes Variable Size 100663296 bytes Database Buffers 41943040 bytes Redo Buffers 540672 bytes Database mounted. Database opened. SQL> select * from v$spparameter where VALUE is NOT NULL; no rows selected SQL> select * from v$spparameter where ISSPECIFIED ='TRUE'; no rows selected RELATED DOCUMENTS ----------------- Note:137483.1 How to modify the content of an SPFILE parameter file
References
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-753300/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ALTER SYSTEM 中 SCOPE=SPFILE/MEMORY/BOTH 的區別:
- When to Use Startup / Shutdown DB and Alter Database Command in 12c_1582453.1Database
- alter system events與alter system event的區別
- Alter system in OracleOracle
- [alter system dump學習1]alter system dump logfile
- alter system archive log current和alter system switch logfileHive
- ALTER SYSTEM SWITCH LOGFILE ALTER SYSTEM ARCHIVELOG CURRENT 區別Hive
- alter system kill sessionSession
- alter database和alter system和alter session的區別DatabaseSession
- ASM Spfile Is Not Used when ASM Instance StartsASM
- alter system disconnect/kill session 'sid,serial#';Session
- ora-00054 , alter system kill session 'id,serial#'Session
- alter system switch logfile和alter system archive log current的區別Hive
- alter system switch logfile 和 alter system archive log current 的區別Hive
- alter system check datafiles 命令
- alter session|system set eventsSession
- [轉]alter system switch logfile和alter system archive log current的區別Hive
- zt:alter system switch logfile與ALTER SYSTEM ARCHIVE LOG CURRENT的區別Hive
- alter system dump datafile headerHeader
- ALTER SYSTEM DISCONNECT SESSION ClauseSession
- alter system archive log current noswitch!!Hive
- 忍不住問下alter system 和alter database的區別Database
- alter system kill session 不成功Session
- 【故障-ORACLE】‘ALTER SYSTEM SET service_names='' SCOPE=MEMORY SID=’解釋Oracle
- alter system set events 相關知識
- alter system set events 知識 [final]
- oracle中Alter system 命令的總結Oracle
- alter system set events相關知識:
- alter system set events相關知識
- alter system archive log current / all / switch logfileHive
- 【Oracle】alter system set events 相關知識Oracle
- ALTER SYSTEM KILL SESSION這麼沒力?(轉)Session
- WGET command is getting 403 forbidden response when remote install gc agent,TroubleshootingwgetORBREMGC
- alter system set event和set events的區別
- 停庫前執行alter system checkpoint 很重要!
- Alter system suspend/resume 導致的bug和特性
- by which, in which, from which 語法區別
- alter system switch logfile hang住的一種可能