如何查看数据库查看alert日志志文件

如何查看数据库alert日志文件_oracle数据库_ThinkSAAS
如何查看数据库alert日志文件
如何查看数据库alert日志文件
1、查看操作系统版本 SQL& select * from v$ BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod PL/SQL Release 10.2.0.1.0 - Production CORE 10.2.0.1.0 Production TNS for Linux: Version 10.2.0.1.0 - Production NLSRTL Version 10.2.0.1.0 - Production SQL& 2、查看预警日志文件(alert_sid.log)的位置 SQL& show parameter dump NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ background_core_dump string partial background_dump_dest string /u01/oracle/admin/bdump core_dump_dest string /u01/oracle/admin/cdump max_dump_file_size string 10240 shadow_core_dump string partial user_dump_dest string /u01/oracle/admin/udump 3、创建目录alert 注意:directory不是实体,只是一个指向,指向os中一个路径 SQL& create or replace directory alert as &/u01/oracle/admin/bdump&; Directory created. SQL& 4、创建外部表alert SQL& create table alert 1 (log varchar2(1000)) 2 organization external 3 (type oracle_loader 4 default directory alert 5 access parameters 6 (records delimited by newline) 7 location (&alert_PROD.log&)) 8 re Table created. 5、查看alert中的内容 SQL& select * from alert where rownum&20; LOG -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Wed Feb 27 11:05:11 2013 Starting ORACLE instance (normal) Cannot determine all dependent dynamic libraries for /proc/self/exe Unable to find dynamic library libocr10.so in search paths RPATH = /ade/aime1_build2101/oracle/has/lib/:/ade/aime1_build2101/oracle/lib/:/ade/aime1_build2101/oracle/has/lib/: LD_LIBRARY_PATH is not set! The default library directories are /lib and /usr/lib Unable to find dynamic library libocrb10.so in search paths Unable to find dynamic library libocrutl10.so in search paths Unable to find dynamic library libocrutl10.so in search paths LICENSE_MAX_SESSION = 0 LICENSE_SESSIONS_WARNING = 0 Picked latch-free SCN scheme 2 Using LOG_ARCHIVE_DEST_1 parameter default value as /u01/oracle/product/10.2.0/db_1/dbs/arch Autotune of undo retention is turned on. IMODE=BR ILAT =10 LICENSE_MAX_USERS = 0 SYS auditing is disabled 19 rows selected. SQL& 6、看看数据库有哪些 可爱的ORA- 错误吧 SQL& select * from alert where log like &%ORA-%&; LOG -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ORA-959 signalled during: alter database default tablespace users... ORA-959 signalled during: drop tablespace uses... ORA-12919 signalled during: drop tablespace users... ORA-1549 signalled during: drop tablespace users... ORA-1505 signalled during: alter database add logfile group 1 ORA-1184 signalled during: alter database add logfile group 1 ORA-1013 signalled during: alter tablespace tts read only... ORA-1013 signalled during: alter tablespace tts read only... ORA-1013 signalled during: alter tablespace users read only... ORA-1539 signalled during: alter tablespace users read only...
PHP开发框架
开发工具/编程工具
服务器环境
ThinkSAAS商业授权:
ThinkSAAS为用户提供有偿个性定制开发服务
ThinkSAAS将为商业授权用户提供二次开发指导和技术支持
让ThinkSAAS更好,把建议拿来。
开发客服微信博客访问: 2826480
博文数量: 234
注册时间:
认证徽章:
刘盛,网名leonarding,the first ACEA in china,
Oracle OCM10g&11g RHCE,
ACOUG Core Member Blogger,
DATAGURU Oracle数据库版主,
ITPUB HADOOP版版主,
DB2中国专家组成员,
专注于&Oracle&Hadoop&Nosql&SAS,
提倡“分享技术~成就梦想”,
新浪微博:@itpub_leonarding
ITPUB论坛APP
ITPUB论坛APP
APP发帖 享双倍积分
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
分类: Linux
外部表:表中的数据以操作系统文件的方式来存放,现在表中的数据不是放在数据库中了而是放在操作系统上面,Oracle提供了一种直接读取外部数据的机制。外部表好处:1.数据二次开发& && && &&&2.大数据量迁移& && && &&&3.充分利用操作系统空间& && && &&&4.不占用数据库空间& && && &&&5.支持标准SQL条件检索外部表也需要目录对象的支持,通过目录对象可以知道从哪个目录读取文本数据LEO1@LEO1>create directory alert as'/u02/app/oracle/diag/rdbms/leo1/LEO1/trace';Directory created.这是Oracle 11g 告警日志目录grant read,write on dire& && && && &对这个目录对象授予读/写权限,并授予所有用户LEO1@LEO1>select * from dba_OWNER& && && &DIRECTORY_NAME& && && && && &&&DIRECTORY_PATH--------------------------------------------------------------------------------------------------------------SYS& && && && & EXP_DUMP& && && && && && && & /home/oracle/exp_dumpSYS& && && && &XMLDIR& && && && && && && && & /u02/app/oracle/product/11.2.0/db_1/rdbms/xmlSYS& && && && & ALERT& && && && && && && && & /u02/app/oracle/diag/rdbms/leo1/LEO1/traceSYS& && && && & DATA_PUMP_DIR& && && && && & /u02/app/oracle/admin/LEO1/dpdump/SYS& && && && & ORACLE_OCM_CONFIG_DIR& && & /u02/app/oracle/product/11.2.0/db_1/ccr/state我们下面就是Oracle告警日志文件当作数据库的一个外部数据源来访问,我们使用外部表的方式抽取alert日志数据,然后使用标准SQL语句来检索“ora-错误信息”。下面我们就来创建一个外部表LEO1@LEO1>create table leo_alert(content varchar2(4000))& &&&alert日志数据量多因此字符串设置的大一点organization external(type oracle_loader& && && && && && && && && && && && && &如果你设置的是oracle_datapump请修改为loaderdefault directory alert access parameters (records delimited by newline& && && && && && && && && && & 每条记录用换行区分nobadfile& && && && && && && && && && && && && && && &&&没有坏文件,丢弃文件,日志文件nodiscardfilenologfile)location ('alert_LEO1.log')& && && && && && && && && && && & 加载告警日志文件内容); 2& & 3& & 4& &5& & 6& & 7& &8& & 9& &10&&11& &12& &13&&LEO1@LEO1>select count(*) fromleo_& && && && && && & 一共7198条&&COUNT(*)----------------& &&&7198我们抽取其中10条ORA-开头的错误记录显示出来LEO1@LEO1>select * from leo_alert wherecontent like '%ORA-%' and rownum<=10;CONTENT------------------------------------------------------------------------------------------------------------------------------------------------------------------ORA-210 signalled during: create tablespacetest datafile '/u02/app/oracle/oradata/LEO1/test01.dbf' size 10m autoextendoff...ORA-00210: cannot open the specifiedcontrol fileORA-00202: control file:'/u02/app/oracle/oradata/LEO1/control01.ctl'ORA-27041: unable to open fileORA-00210: cannot open the specifiedcontrol fileORA-00202: control file:'/u02/app/oracle/oradata/LEO1/control01.ctl'ORA-27041: unable to open fileORA-00210: cannot open the specifiedcontrol fileORA-00202: control file:'/u02/app/oracle/oradata/LEO1/control01.ctl'ORA-27037: unable to obtain file status10 rows selected.小结:这里需要注意几个问题,我们在创建外部表的时候需要设置没有坏文件,丢弃文件,日志文件参数否则会报错ORA-29913: error in executing ODCIEXTTABLEOPEN callout。sql*loader& &&&exp/imp& && & expdp/impdp& && & organization_external& && & direct北京&summer分享技术~成就梦想Blog:
阅读(4396) | 评论(0) | 转发(1) |
相关热门文章
给主人留下些什么吧!~~
请登录后评论。查看: 2886|回复: 7
AIX下查看oracle的alert日志怎样查看具体某一天的日志
论坛徽章:0
alter日志这个文件很大,大家在查看alter日志时都是怎样查的,如何快速定位到自己想要查看的某个时间点。本人正在学习中,还请高人指点.......
论坛徽章:0
tail -n 2222 /oracle/....alertxxx.log|more
我都是这么查看最近的日志
论坛徽章:10
view : X$DBGALERTEXT
论坛徽章:0
binhu 发表于
view : X$DBGALERTEXT
是9i,公司是好几年前的数据库,本人用的是10g,没有这个视图唉
论坛徽章:10
那个view是11g才有的,旧版本的oracle的我也是用2楼的方法
论坛徽章:5
shell大神写个脚本应该可以实现。
我都是cat *.log|gre ORA.
没有报错就不在细看了。
论坛徽章:31
建议定期备份该文件,然后清空&&cat /dev/null & alert&sid&.log,
求职 : 认证徽章论坛徽章:123
itpub.net All Right Reserved. 北京皓辰网域网络信息技术有限公司版权所有    
 北京市公安局海淀分局网监中心备案编号: 广播电视节目制作经营许可证:编号(京)字第1149号11g的alert日志路径
11g的alert日志路径
一个测试库,11g,没有sys账户,无法用show parameter dump
查看alert日志的路径,以前也碰到过,但后来就不了了之了。
这次深挖下,也参考了下一些网上的帖子,于是找到了:
$ORACLE_HOME/rdbms/sid/sid/trace
同时11g还支持xml格式的alert日志,路径是:
$ORACLE_HOME/rdbms/sid/sid/alert
(window.slotbydup=window.slotbydup || []).push({
id: '2467140',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467141',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467142',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467143',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467148',
container: s,
size: '1000,90',
display: 'inlay-fix'}

我要回帖

更多关于 数据库alert日志 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信