ITPub博客

首页 > Linux操作系统 > Linux操作系统 > How to set EVENTS in the SPFILE (from metalink)

How to set EVENTS in the SPFILE (from metalink)

原创 Linux操作系统 作者:yanyp 时间:2009-04-15 11:51:34 0 删除 编辑
文档 ID:注释:160178.1类型:BULLETIN
 上次修订日期:02-MAY-2006状态:PUBLISHED

Purpose
=======

This event, 'note');" target="_self">note summarizes the syntax used to set trace and debug events
when the server uses the binary server side parameter file (SPFILE).

Scope & Application
===================

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
parameter file, also known as the SPFILE.

1) An example of the text based parameter file syntax is:

event='10325 trace name context forever, level 10'
event='10015 trace name context forever, level 1'

Inserting other parameters between these lines will cause only the last
event only to be included.

2a) One method to set the event in the SPFILE is to use the SQL syntax:

SQL> ALTER SYSTEM SET
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.

The instance must be restarted for the events to take effect.

2b) The instance must have been started with an SPFILE:

SQL> ALTER SYSTEM SET
EVENT='10325 trace name context forever, level 10',
'10015 trace name context forever, level 1'
COMMENT='Debug tracing of control and rollback' SCOPE=SPFILE;

ALTER SYSTEM SET
*
ERROR at line 1:
ORA-32001: write to SPFILE requested but no SPFILE specified at startup

2c) You cannot set the event during the instance life:

SQL> ALTER SYSTEM SET
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

2d) The command can be performed with the instance in NOMOUNT state.
You can set events without having to mount nor open the database.

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.


Note the different syntax:

- "SESSION" versus "SYSTEM", "EVENTS" versus "EVENT", and no "," before the
"level" keyword.
- Additionally, you can specify each event in a seperate ALTER SESSION command.


Related Documents
=================

Note 1051056.6How to set multiple events in Init.Ora
Note 168042.1ORA-2194 Starting up the Database


References
==========

Bug 2942335ALTER SYSTEM RESET EVENT SCOPE=SPFILE SID='*' NOT RESETING EVENTS

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/230160/viewspace-589226/,如需转载,请注明出处,否则将追究法律责任。

上一篇: ttrtyrt
请登录后发表评论 登录
全部评论

注册时间:2009-04-12

  • 博文量
    139
  • 访问量
    171864