[Oracle]如何在Oracle中设置Event

简介:
为了调查Oracle 的故障,可以通过设置event ,来了解详细的状况。方法如下:

■ 如果使用 SPFILE,

=============
To enable it:

1. Check the current event setting status:

SQL> show parameter event;

2. Add an event and set it up:

If there is no existing event, it is set as follows:
SQL> alter system set event = '235 errorstack (3) systemstate (10)' scope = spfile;

If there is an existing event, add it and set it as follows:
For example, if there is already an event of "902 errorstack (3) systemstate (10)" as a result of the above "1"
SQL> alter system set event = '902 errorstack (3) systemstate (10): 235 errorstack (3) systemstate (10)' scope = spfile;

3. Just to be sure, I will get a backup of SPFILE:

Example of execution:
SQL> create pfile = '/ home / oracle / pfile.ora' from spfile;

4. Restart the database.


=============
To disable it:

1. Delete event 235:

If there is no existing event, it is set as follows:
SQL> alter system set event = '' scope = spfile;

If there is an existing event, restore the original value:
For example, if there is already an event "902 errorstack (3) systemstate (10)" before this event setting,
SQL> alter system set event = '902 errorstack (3) systemstate (10)' scope = spfile;

2. Restart the database.



■ 如果使用 PFILE,

=============
To enable it:

1. Check the line related to "*. Event" with the cat command in the contents of PFILE.

2. Add and configure event 235:

If there is no existing event, please modify it as follows:
*. Event = '235 errorstack (3) systemstate (10)'

The existing event will be appended and set as follows:
For example, if the event of *. Event = '902 errorstack (3) systemstate (10)' already exists as a result of the above "1"
In some cases,
*. Event = '902 errorstack (3) systemstate (10): 235 errorstack (3) systemstate (10)'

3. Restart the database.

=============
To disable it:

1. Correct the line related to "*. Event" to the contents of PFILE.

If there is no existing event, it is set as follows:

*. Event = ''

If there is an existing event, restore the original value:
For example, 
if there is already an event of *. Event = '902 errorstack (3) systemstate (10)' before this event setting,
leave it as following:

*. Event = '902 errorstack (3) systemstate (10)'

2. Restart the database.

至于数据库是使用了PFILE, 还是使用了SPFILE,可以通过查看如下的SQL文来看:

select * from v$spparameter where value is not null;

如果返回0行,则表明是使用了 spfile 启动的。









本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/p/7619960.html,如需转载请自行联系原作者

目录
相关文章
|
7月前
|
Oracle 关系型数据库 Linux
Oracle设置监听之Navicat的锅
Oracle设置监听之Navicat的锅
114 0
|
Oracle 网络协议 关系型数据库
Oracle会话超时设置1:在sqlnet.ora和listener.ora中设置
这篇文章是Oracle会话超时设置的第一个文章,简述和Oracle 数据库 net services有关的会话超时管理。
1441 0
|
SQL 运维 Oracle
Oracle 超时设置2:设置实例级参数
Oracle超时设置系列的第二篇文章,设置实例级参数
605 0
|
1月前
|
监控 Oracle 关系型数据库
Linux平台Oracle开机自启动设置
【11月更文挑战第8天】在 Linux 平台设置 Oracle 开机自启动有多种方法,本文以 CentOS 为例,介绍了两种常见方法:使用 `rc.local` 文件(较简单但不推荐用于生产环境)和使用 `systemd` 服务(推荐)。具体步骤包括编写启动脚本、赋予执行权限、配置 `rc.local` 或创建 `systemd` 服务单元文件,并设置开机自启动。通过 `systemd` 方式可以更好地与系统启动过程集成,更规范和可靠。
120 2
|
1月前
|
Oracle Ubuntu 关系型数据库
Linux平台Oracle开机自启动设置
【11月更文挑战第7天】本文介绍了 Linux 系统中服务管理机制,并详细说明了如何在使用 systemd 和 System V 的系统上设置 Oracle 数据库的开机自启动。包括创建服务单元文件、编辑启动脚本、设置开机自启动和启动服务的具体步骤。最后建议重启系统验证设置是否成功。
|
5月前
|
SQL Oracle 关系型数据库
关系型数据库Oracle设置 RMAN 环境:
【7月更文挑战第25天】
81 2
|
5月前
|
Oracle 关系型数据库 Unix
关系型数据库Oracle设置环境变量:
【7月更文挑战第22天】
646 4
|
7月前
|
Oracle 关系型数据库
oracle wait event
oracle wait event
40 1
|
Oracle 关系型数据库 Linux
Oracle设置连接数进程数会话数
Oracle设置连接数进程数会话数
265 0
|
Oracle 关系型数据库 数据库
Oracle——给数据库的某个字段设置随机数
Oracle——给数据库的某个字段设置随机数