温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

ORACLE 配置event参数

发布时间:2020-06-09 23:40:05 来源:网络 阅读:689 作者:7343696 栏目:关系型数据库

下面测试来至于11G

1,数据库的版本

www.htz.pw > select * from v$version;

 

BANNER

--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

PL/SQL Release 11.2.0.4.0 - Production

CORE    11.2.0.4.0      Production

TNS for Linux: Version 11.2.0.4.0 - Production

NLSRTL Version 11.2.0.4.0 - Production

2,在spfile中修改event参数

www.htz.pw > alter system set event='10235 trace name context forever,level 512', '10015 trace name context forever, level 1' scope=spfile;

 

System altered.

 

www.htz.pw > startup force;

 

 

www.htz.pw > @dump_event.sql

"***************************************************************************"

"session - Dump session group's event settings                              "

"process - Dump process group's event settings                              "

"system  - Dump system group's event settings(Ie the instance wide events)  "

"***************************************************************************"

Statement processed.

Enter value for input: system

10015 trace name context forever, level 1

10235 trace name context forever,level 512

 

清空event的值

ALTER SYSTEM RESET EVENT SCOPE=SPFILE SID='*';

 

其实我们还可以使用下面的方法

这里需要注意的是:level 512后面接的:没有','

 

www.htz.pw > alter system set event='10235 trace name context forever,level 512:10015 trace name context forever,level 1' scope=spfile;

 

System altered.

 

"***************************************************************************"

"session - Dump session group's event settings                              "

"process - Dump process group's event settings                              "

"system  - Dump system group's event settings(Ie the instance wide events)  "

"***************************************************************************"

Statement processed.

Enter value for input: system

10235 trace name context forever,level 512

10015 trace name context forever,level 1

3,在init中修改event参数

方法1

www.htz.pw > !grep "event" /tmp/123.txt

*.event='10235 trace name context forever,level 512:10015 trace name context forever,level 1'

方法2

www.htz.pw > !grep "event" /tmp/123.txt

*.event='10235 trace name context forever,level 512'

*.event='10015 trace name context forever,level 1'

方法3

www.htz.pw >  !grep -A1 "event" /tmp/123.txt

*.event='10235 trace name context forever,level 512:\

10015 trace name context forever,level 1' 

4,清空event的方法

如果使用init参数文件,直接删除event参数,如果使用spfile文件

www.htz.pw > @dump_event.sql

"***************************************************************************"

"session - Dump session group's event settings                              "

"process - Dump process group's event settings                              "

"system  - Dump system group's event settings(Ie the instance wide events)  "

"***************************************************************************"

Statement processed.

Enter value for input: system

10235 trace name context forever,level 512

10015 trace name context forever,level 1

www.htz.pw > alter system set event='' scope=spfile ;

其实这里我们还可以使用reset event scope=spfile sid='*'来操作

System altered.

 

www.htz.pw > startup force;

ORACLE instance started.

 

Total System Global Area  379965440 bytes

Fixed Size                  2253464 bytes

Variable Size             171969896 bytes

Database Buffers          201326592 bytes

Redo Buffers                4415488 bytes

Database mounted.

Database opened.

www.htz.pw > @dump_event.sql

"***************************************************************************"

"session - Dump session group's event settings                              "

"process - Dump process group's event settings                              "

"system  - Dump system group's event settings(Ie the instance wide events)  "

"***************************************************************************"

Statement processed.

Enter value for input: system

Statement processed.

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI