ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 将ALERT LOG当成一个外部表进行访问

将ALERT LOG当成一个外部表进行访问

原创 Linux操作系统 作者:netfairy 时间:2012-07-10 17:01:28 0 删除 编辑

将ALERT LOG当成一个外部表进行访问,可以更方便的读取ALERT LOG。


首先查到DUMP的目录:
SELECT * FROM v$parameter WHERE NAME LIKE '%dump%';
对DUMP的目录建立一个DIRECTORY:
CREATE DIRECTORY DIR_DUMP AS '/home/oracle/oracle/product/10.2.0/admin/beta01/bdump';
将ALERT LOG定义成一个外部表:
create table alert_log
( text varchar2(4000))
 organization external(
 type oracle_loader
 default directory DIR_DUMP
 access parameters(
  records delimited by newline
  nobadfile
  nodiscardfile
  nologfile)
 location('alert_beta01.log')
)reject limit UNLIMITED;
查询ALERT_LOG表就可以直接读到ALERT LOG的日志。
select * from alert_log where rownum < 20;

Mon Oct 10 09:17:57 2011
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Shared memory segment for instance monitoring created
Picked latch-free SCN scheme 1
Using LOG_ARCHIVE_DEST_10 parameter default value as USE_DB_RECOVERY_FILE_DEST
Autotune of undo retention is turned on.
IMODE=BR
ILAT =18
LICENSE_MAX_USERS = 0
SYS auditing is disabled
ksdpec: called for event 13740 prior to event group initialization
Starting up ORACLE RDBMS Version: 10.2.0.1.0.
System parameters with non-default values:
  processes                = 150
  nls_language             = SIMPLIFIED CHINESE
  nls_territory            = CHINA
  sga_target               = 1845493760

 

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

请登录后发表评论 登录
全部评论

注册时间:2011-11-17

  • 博文量
    14
  • 访问量
    61301