Useful for Oracle Support and experienced DBAs. How to Set EVENTS in the SPFILE ? You need to set several events in the parameter file. You can perform
this task successfully in the text based parameter file, and need to do
the same operation for an instance that uses the new Oracle9i binary
server side 1) An example of the text based parameter file syntax is: event="10325 trace name context forever, level 10" Inserting other parameters between these lines will cause the last 2a) One method to set the event in the SPFILE is to use the SQL syntax: SQL> ALTER SYSTEM SET You can also, run the below command: SQL> alter system set event='10325 trace
name context forever, level 10:10015 trace name context forever, level
1' scope=spfile; The instance must be restarted for the events to take effect. 2b) The instance must have been started with an SPFILE. Otherwise this ALTER command will fail as follows:
SQL> ALTER SYSTEM SET ALTER SYSTEM SET 2c) You cannot set the event during the instance life: SQL> ALTER SYSTEM SET If you get an error like this, it is necessary to use SCOPE=SPFILE and restart the database. 2d) The command can be performed with the instance in NOMOUNT state. 3) If you need to alter, add or remove an event, you have to enter the whole new list in the ALTER SYSTEM command and restart. 4) To remove all events, use:
SQL> ALTER SYSTEM RESET EVENT SCOPE=SPFILE SID='*' ; System altered. The asterisk ("*") in this example applies to all cases but Real
Application Cluster. In a Real Application Cluster configuration
environment the instance name is required instead of the asterisk. 5) To have events set up immediately, typically for dumping or tracing, use:
SQL> ALTER SESSION SET EVENTS 'immediate trace name controlf level 2' ; System altered. 6) To configure a system-wide "triggered" event, use something like
SQL> alter system set events '942 trace name ERRORSTACK level 3'; System altered. 7) To turn off non-immediate system or session events interactively, you can use a syntax like the following:
SQL> alter system set events '942 trace name ERRORSTACK off'; System altered. SQL> alter system set events='10325 trace name context off'; System altered. Note the different syntax: Applies to:
Oracle Database - Enterprise Edition - Version 9.0.1.0 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.
Purpose
This note summarizes the syntax used to set trace and debug
events when the server uses the binary server side parameter file
(SPFILE).Scope
Details
parameter file, also known as the SPFILE.
event="10015 trace name context forever, level 1"
event only to be included.
EVENT='10325 trace name context forever, level 10',
'10015 trace name context forever, level 1'
COMMENT='Debug tracing of control and rollback' SCOPE=SPFILE;
System altered.
EVENT='10325 trace name context forever, level 10',
'10015 trace name context forever, level 1'
COMMENT='Debug tracing of control and rollback' SCOPE=SPFILE;
*
ERROR at line 1:
ORA-32001: write to SPFILE requested but no SPFILE specified at startup
EVENT='10325 trace name context forever, level 10',
'10015 trace name context forever, level 1'
COMMENT='Debug tracing of control and rollback' SCOPE=BOTH;
EVENT='10325 trace name context forever,
*
ERROR at line 2:
ORA-02095: specified initialization parameter cannot be modified
You can set events without having to open or mount the database.
- "SESSION" versus "SYSTEM", "EVENTS" versus "EVENT", and no "," before the "level" keyword.
- Additionally, you can specify each event in a separate ALTER SESSION command.References
BUG:2942335 - ALTER SYSTEM RESET EVENT SCOPE=SPFILE SID='*' NOT RESETING EVENTS
NOTE:168042.1 - ORA-2194 Starting up the Database
NOTE:1051056.6 - How to Set Multiple Events in INIT.ORA
NOTE:436036.1 - How To List All The Named Events Set For A Database
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




