如何关闭Oracle11g数据库的审计功能?

如何关闭Oracle11g数据库的审计功能?,第1张

在oracle11g中,数据库的审计功能是默认开启的(这和oracle10g的不一样,10g默认是关闭的),\x0d\x0aoracle11gR2的官方文档上写的是错的,当上说default是none,而且是审计到DB级别的,这样就会\x0d\x0a往aud$表里记录统计信息。\x0d\x0a \x0d\x0a1.如果审计不是必须的,可以关掉审计功能;\x0d\x0a\x0d\x0aSQL>show parameter audit_trail\x0d\x0a\x0d\x0aNAME TYPEVALUE\x0d\x0a------------------------------------ ----------- ------------------------------\x0d\x0aaudit_trail string DB\x0d\x0a\x0d\x0aSQL>alter system set audit_trail=none scope=spfile\x0d\x0aSQL>shut immediate\x0d\x0aSQL>startup\x0d\x0a2.删除已有的审计信息\x0d\x0a可以直接truncate表aud$,\x0d\x0atruncate table SYS.AUD$\x0d\x0a\x0d\x0a3.或者将aud$表移到另外一个表空间下,以减少system表空间的压力和被撑爆的风险。\x0d\x0a \x0d\x0a附:11g中有关audit_trail参数的设置说明:\x0d\x0aAUDIT_TRAIL\x0d\x0aProperty Description\x0d\x0aParameter type String\x0d\x0aSyntaxAUDIT_TRAIL = { none | os | db [, extended] | xml [, extended] }\x0d\x0aDefault valuenone\x0d\x0aModifiable No\x0d\x0aBasic No\x0d\x0aAUDIT_TRAIL enables or disables database auditing.\x0d\x0aValues:\x0d\x0anone\x0d\x0aDisables standard auditing. This value is the default if the AUDIT_TRAIL parameter was not set \x0d\x0ain the initialization parameter file or if you created the database using a method other than \x0d\x0aDatabase Configuration Assistant. If you created the database using Database Configuration \x0d\x0aAssistant, then the default is db.\x0d\x0aos\x0d\x0aDirects all audit records to an operating system file. Oracle recommends that you use the os \x0d\x0asetting, particularly if you are using an ultra-secure database configuration.\x0d\x0adb\x0d\x0aDirects audit records to the database audit trail (the SYS.AUD$ table), except for records \x0d\x0athat are always written to the operating system audit trail. Use this setting for a general \x0d\x0adatabase for manageability.\x0d\x0aIf the database was started in read-only mode with AUDIT_TRAIL set to db, then Oracle Database \x0d\x0ainternally sets AUDIT_TRAIL to os. Check the alert log for details.\x0d\x0adb, extended\x0d\x0aPerforms all actions of AUDIT_TRAIL=db, and also populates the SQL bind and SQL text CLOB-type \x0d\x0acolumns of the SYS.AUD$ table, when available. These two columns are populated only when this \x0d\x0aparameter is specified.\x0d\x0aIf the database was started in read-only mode with AUDIT_TRAIL set to db, extended, then Oracle \x0d\x0aDatabase internally sets AUDIT_TRAIL to os. Check the alert log for details.\x0d\x0axml\x0d\x0aWrites to the operating system audit record file in XML format. Records all elements of the \x0d\x0aAuditRecord node except Sql_Text and Sql_Bind to the operating system XML audit file.\x0d\x0axml, extended\x0d\x0aPerforms all actions of AUDIT_TRAIL=xml, and populates the SQL bind and SQL text CLOB-type columns\x0d\x0a of the SYS.AUD$ table, wherever possible. These columns are populated only when this parameter \x0d\x0ais specified.\x0d\x0aYou can use the SQL AUDIT statement to set auditing options regardless of the setting of this \x0d\x0aparameter.

在服务中关闭:

OracleOracle_homeTNSListener对应于数据库的监听程序

OracleServiceSID 对应于数据库的例程

OracleDBConsoleSID 对应于Oracle Enterprise Manager(OEM)

其中,Oracle_home表示Oracle主目录,如Oracle11g_home1;SID表示Oracle系统标识符,如OracleServiceMAG01的MAG01。

比较好的启动顺序是:OracleOracle_homeTNSListener,OracleServiceSID,OracleDBConsoleSID。

关闭时次序相反。

下面给出了自己写的已经排好顺序的启动和停止服务的两个批处理文件:

//启动Oracle

Start Oracle.bat

@echo off

echo 确定要启动Oracle 11g服务吗?

pause

net start OracleOraDb11g_home1TNSListener

net start OracleServiceMAG01

net start OracleDBConsolemag01

echo 启动Oracle 11g服务完成,请确认有没有错误发生。

Pause

//关闭Oracle

Stop Oracle.bat

@echo off

echo 确定要停止Oracle 11g 服务吗?

pause

net stop OracleDBConsolemag01

net stop OracleServiceMAG01

net stop OracleOraDb11g_home1TNSListener

echo 停止Oracle 11g服务完成,请确认有没有错误发生。

Pause

不是对集群影响,而是对数据库本身。

每次关停数据库,特别是大型数据库,我们最担心的就是能不能起来,听起来比较可笑是吧,因为见关停的过程中,如果有一个环节出现问题,导致文件内容不一致,那么就可能起不来。而且越是大型的数据库,关停的时间就越长,同时出错的可能性就越大。更不要说直接关服务器了。

假设一个事务正在其中一台上处理,已经处理完了,正要写入磁盘,恰好你关了服务器,那么最好的结果是这个事务没有了,最烂的结果是数据库一致性被破坏了,也就是说两台集群数据库的检查点不一致了,那么就只能呵呵了。并不是一定不能恢复,不过可能需要时间,而且恢复的效果,真的不能保证。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/6769451.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-28
下一篇 2023-03-28

发表评论

登录后才能评论

评论列表(0条)

保存