设置自动检测ORACLE ALERT日志,出现问题邮件通知功能
1、在AIX下编辑/etc/inetd.conf 文件,去掉pop3前面的注释,打开外部接收邮件功能。并重启该进程:refresh -s inetd2、编写一个check_ora.sh脚本:#!/usr/bin/kshALERTLOG=/oraclefs/admin/oradb/bdump/alert_ora9i.logSYSOPR=oracle# get template first time# grep "ORA-" $ALERTLOG > /tmp/alertlog.tmpltgrep "ORA-" $ALERTLOG > /tmp/alertlog.cmp# Compare both files.# If no difference, let's sleep againif ! ( cmp -s /tmp/alertlog.tmplt /tmp/alertlog.cmp )thenbanner error( date; diff /tmp/al
oracle 10G RAC 归档设置
首先查看数据库现有模式可使用以下语句:select name,log_mode from v$database;也可以用下面的语句:archive log list;(该方法需要as sysdba)10G RAC更改归档方式:1、登录两个实例后,在每个实例上执行:shutdown immediate2、打开归档(在一个实例上执行):startup mountalter database archivelog;alter database open;3、关闭归档(在一个实例上执行):startup mountalter database noarchivelog;alter database open;4、在另一个实例上执行:startup最好重启crs,使用sqlplus startup是使用pfile启动的(没有spfile)。10G单库更
oracle 查询表字段明细、字段注释、表注释
查询表字段明细select column_name,data_type,data_length,DATA_PRECISION ,DATA_SCALEfrom all_tab_columns where table_name='tablename'字段注释select * from user_col_comments;表注释select * from user_tab_comments;表明细+表注释+字段明细+字段注释select ATC.OWNER,atC.TABLE_NAME,utc.comments,ATC.COLUMN_NAME,ATC.DATA_TYPE,ATC.DATA_LENGTH,ATC.NULLABLE, ucc.comments from(select ATC.OWNER,atC.TABLE_NAME,ATC.COLUMN_NAME,ATC.DATA_TYPE,ATC.DATA_LENGTH,ATC.NULLABLEfrom all_tab_columns ATC where ATC.o