shell处理alert日志

每天都检查oracle日志,所以写了一个比较完善的shell,让其自动处理,在运行程序之前,需要在该脚本目录下新建tmp目录

#!/usr/bin/ksh
export LANG=en
#临时目录
tmp_dest=$HOME/check/tmp
#用户名
username=username
#密码
password=password
cd $tmp_dest
sqlplus -s $username/$password<<XFF>/dev/null
set echo on
spool sqlplus.txt
col name format a20
col value format a55
select name,value from v\$parameter where name='background_dump_dest';
spool off
exit
XFF
alert_path_num=$(grep -n "background_dump_dest" $tmp_dest/sqlplus.txt |awk -F":" '{print $1}')
alert_path=$(cat $tmp_dest/sqlplus.txt |sed -n "${alert_path_num}p" | awk -F" " '{print $2}')
first_day=`cat $tmp_dest/first_day.tmp`
d_day=$(date +%e)
if [ $d_day -lt 10 ]
then
###########注意:以下两种方式选择其一###################
#部分系统出现alert日志例如:Tue Aug  7 07:44:59 2012
 last_day=$(date +%a)' '$(date +%b)'.*'$d_day'.*'$(date +%Y)
#部分系统出现alert日志例如:Thu Jun 07 13:56:18 2012
 n_day=`echo $d_day | awk 'gsub(/^ *| *$/,"")'`
 last_day=$(date +%a)' '$(date +%b)'.*0'$n_day'.*'$(date +%Y)
else
 last_day=$(date|cut -c 1-10).*$(date +%Y)
fi
echo $last_day > $tmp_dest/first_day.tmp
first_num=$(grep -n "$first_day" $alert_path/alert_$ORACLE_SID.log |head -1|awk -F":" '{print $1}')
if [ -z "$first_num" ]
then
   first_num=1
fi
#修改$last_day为'.*',表示alert日志结尾
last_num=$(grep -n ".*" $alert_path/alert_$ORACLE_SID.log |tail -1|awk -F":" '{print $1}')
point=1
export=$point
echo "########################## checking alert_log start $first_day ########################## "
sed -n "${first_num},${last_num}p" $alert_path/alert_$ORACLE_SID.log > $tmp_dest/trunc_alert
cat $tmp_dest/trunc_alert|grep ORA-|while read line
do
   line=$(echo "$line"|sed -e 's/\[/\\[/g;s/\]/\\]/g')
   time=$(grep -n "$line" $tmp_dest/trunc_alert | awk -F':' '{print $1}'|wc -l)
if [ "$time" -ge 1 ]
then
   num=$(grep -n "$line" $tmp_dest/trunc_alert|awk -F':' '{print $1}'|tail -1)
   #echo $num
   front_num=$((num-1))
   back_num=$((num+9))
   echo "++++++++++++++++++$point++++++++++++++++++++"
    sed -n "${front_num},${back_num}p" $tmp_dest/trunc_alert
   echo "++++++++++++++++++$point-End++++++++++++++++"
   point=$((point+1))
   flag=1
else
     if [ -z "$time" ]
     then
     flag=0
     fi
fi
done
#rm $tmp_dest/trunc_alert
#rm $tmp_dest/sqlplus.txt
if [ " $flag " -eq 0 ]
   then
   echo "No errors in $first_day !"
fi
echo "########################## checking alert_log end $last_day ########################## "

检查结果

########################## checking alert_log start Fri Jan 27.*2012 ##########################
++++++++++++++++++1++++++++++++++++++++
  Current log# 3 seq# 918 mem# 0: /opt/oracle/oradata/orcl/mcrm/redo03.log
Tue Jan 31 22:00:22 2012
Errors in file /opt/oracle/admin/mcrm/bdump/mcrm_j001_23329.trc:
ORA-01114: IO error writing block to file 201 (block # 550944)
ORA-27072: File I/O error
Linux-x86_64 Error: 28: No space left on device
Additional information: 4
Additional information: 550944
Additional information: -1
ORA-01114: IO error writing block to file 201 (block # 550922)
ORA-27072: File I/O error
Additional information: 4
Additional information: 550922
++++++++++++++++++1-End++++++++++++++++
++++++++++++++++++2++++++++++++++++++++
Additional information: 550944
Additional information: -1
ORA-01114: IO error writing block to file 201 (block # 550922)
ORA-27072: File I/O error
Additional information: 4
Additional information: 550922
Additional information: 114688
Wed Feb  1 07:24:02 2012
Thread 1 advanced to log sequence 919 (LGWR switch)
  Current log# 1 seq# 919 mem# 0: /opt/oracle/oradata/orcl/mcrm/redo01.log
Wed Feb  1 07:24:02 2012
Errors in file /opt/oracle/admin/mcrm/bdump/mcrm_arc1_3624.trc:
ORA-19504: failed to create file "/opt/oracle/oradata/archivelog/1_918_741262746.dbf"
++++++++++++++++++2-End++++++++++++++++
########################## checking alert_log end Sun Feb 12.*2012##########################

Timesten安装与试用

1.安装timesten

[oracle@bas linux8664]$ ./setup.sh
NOTE: Each TimesTen installation is identified by a unique instance name.
      The instance name must be a non-null alphanumeric string, not longer
      than 255 characters.
Please choose an instance name for this installation? [ tt1122 ] xifenfei
Instance name will be 'xifenfei'.
Is this correct? [ yes ] yes
Of the three components:
  [1] Client/Server and Data Manager
  [2] Data Manager Only
  [3] Client Only
Which would you like to install? [ 1 ] 1
Of the following options :
  [1] /home/oracle
  [2] /home/oracle/timesten
  [3] Specify a location
  [q] Quit the installation
Where would you like to install the xifenfei instance of TimesTen? [ 1 ] 2
Where would you like to create the daemon home directory? [ /home/oracle/timesten/TimesTen/xifenfei/info ]
The daemon logs will be located in /home/oracle/timesten/TimesTen/xifenfei/info
Would you like to specify a different location for the daemon logs? [ no ]
Installing into /home/oracle/timesten/TimesTen/xifenfei ...
Uncompressing ...
NOTE: If you are configuring TimesTen for use with Oracle Clusterware, the
      daemon port number must be the same across all TimesTen installations
      managed within the same Oracle Clusterware cluster.
NOTE: All installations that replicate to each other must use the same daemon
      port number that is set at installation time. The daemon port number can
      be verified by running 'ttVersion'.
The default port number is 53396.
Do you want to use the default port number for the TimesTen daemon? [ yes ]
The daemon will run on the default port number (53396).
NOTE: For security, we recommend that you restrict access to the
      TimesTen installation to members of a single OS group. Only members of
      that OS group will be allowed to perform direct mode connections to
      TimesTen, and only members of that OS group will be allowed to perform
      operations that access TimesTen data stores, TimesTen files and shared
      memory. The OS group defaults to the primary group of the instance
      administrator. You can default to this group, choose another OS group
      or you can make this instance world-accessible. If you choose to make
      this instance world-accessible, all database files and shared memory
      are readable and writable by all users.
Restrict access to the the TimesTen installation to the group 'oinstall'? [ yes ] yes
NOTE: Enabling PL/SQL will increase the size of some TimesTen libraries.
Would you like to enable PL/SQL for this instance? [ yes ] yes
      TNS_ADMIN was not set in your environment but there is a tnsnames.ora
      file in /opt/app/oracle/product/10.2.0/db_1/network/admin.
Would you like to use this TNS_ADMIN setting for the In-Memory Database Cache? [ yes ] yes
TNS_ADMIN will be set to /opt/app/oracle/product/10.2.0/db_1/network/admin
You can change TNS_ADMIN later by running <install_dir>/bin/ttmodinstall.
NOTE: It appears that you are running version 3.4 or higher of the g++
      compiler. TimesTen ships with multiple sets of client libraries and server
      binaries : one built for compatibility with g++ 3.4.6 and one with
      g++ 4.1.0. The installer has created links to the 3.4.6 library in the
      <install_dir>/lib directory and to the 3.4.6 server binary in the
      <install_dir>/bin directory. If you want to use a different compiler,
      please modify the links to point to the desired library and server binary.
Installing server components ...
What is the TCP/IP port number that you want the TimesTen Server to listen on? [ 53397 ]
Do you want to install QuickStart and the TimesTen Documentation? [ no ] no
Would you like to install the documentation (without QuickStart)? [ yes ]
Where would you like to create the doc directory (s=skip)? [ /home/oracle/timesten/TimesTen/xifenfei/doc ] s
Installing client components ...
Would you like to use TimesTen Replication with Oracle Clusterware? [ no ] no
NOTE: The TimesTen daemon startup/shutdown scripts have not been installed.
Run the 'setuproot' script :
        cd /home/oracle/timesten/TimesTen/xifenfei/bin
        ./setuproot -install
This will move the TimesTen startup script into its appropriate location.
The startup script is currently located here :
  '/home/oracle/timesten/TimesTen/xifenfei/startup/tt_xifenfei'.
The documentation was not installed.
To manually install the documentation, run the command 'setup.sh -installDoc'
The 11.2.2.2 Release Notes are located here :
  '/home/oracle/timesten/TimesTen/xifenfei/README.html'
Starting the daemon ...
TimesTen Daemon startup OK.
End of TimesTen installation.
--设置开机启动
[root@bas linux8664]# cd /home/oracle/timesten/TimesTen/xifenfei/bin/
[root@bas bin]# ./setuproot -install
Would you like to install the TimesTen daemon startup scripts into /etc/init.d? [ yes ] yes
Copying /home/oracle/timesten/TimesTen/xifenfei/startup/tt_xifenfei to /etc/init.d
Successfully installed the following scripts :
/etc/init.d/tt_xifenfei
/etc/rc.d/rc0.d/K45tt_xifenfei
/etc/rc.d/rc1.d/K45tt_xifenfei
/etc/rc.d/rc2.d/S90tt_xifenfei
/etc/rc.d/rc3.d/S90tt_xifenfei
/etc/rc.d/rc5.d/S90tt_xifenfei
/etc/rc.d/rc6.d/K45tt_xifenfei

2.配置DSN

[root@bas info]# pwd
/home/oracle/timesten/TimesTen/xifenfei/info
[root@bas info]# more sys.odbc.ini
[ODBC Data Sources]
TT_1122=TimesTen 11.2.2 Driver
[TT_1122]
Driver=/home/oracle/timesten/TimesTen/xifenfei/lib/libtten.so
DataStore=/home/oracle/timesten/TimesTen/xifenfei/info/TT_1122
DatabaseCharacterSet=ZHS16GBK
PermSize=300
TempSize=64
OracleNetServiceName=orcl_tt

Driver = the TimesTen Direct Linked ODBC Driver
DataStore = the location and the name of the database files
LogDir = the directory for the transaction logs
PermSize = the size of the permanent region of the database. In the above example, this is configured for 40MB
TempSize = the size of the temporary region of the database. In the above example, this is configured for 32MB
DatabaseCharacterSet = the character set used by the database
OracleNetServiceName = the TNS service name to the Oracle database. This attribute is required for In-Memory Database Cache only.

3.查看相关文件和进程

[root@bas info]# ps -ef|grep timesten|grep -v grep
oracle   30391     1  0 00:01 ?        00:00:00 /home/oracle/timesten/TimesTen/xifenfei/bin/timestend -initfd 13
oracle   30395 30391  0 00:01 ?        00:00:00 /home/oracle/timesten/TimesTen/xifenfei/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1000000 -facility user
oracle   30396 30391  0 00:01 ?        00:00:00 /home/oracle/timesten/TimesTen/xifenfei/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1000001 -facility user
oracle   30397 30391  0 00:01 ?        00:00:00 /home/oracle/timesten/TimesTen/xifenfei/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1000002 -facility user
oracle   30398 30391  0 00:01 ?        00:00:00 /home/oracle/timesten/TimesTen/xifenfei/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1000003 -facility user
oracle   30400 30391  0 00:01 ?        00:00:00 /home/oracle/timesten/TimesTen/xifenfei/bin/ttcserver -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1000004 -p 53397 -facility user -group oinstall
[root@bas TimesTen]# pwd
/home/oracle/timesten/TimesTen
[root@bas TimesTen]# ls -l
total 4
drwxr-x---  17 oracle oinstall 4096 Feb 12 00:01 xifenfei
[root@bas TimesTen]# cd xifenfei
[root@bas xifenfei]# ls -l
total 140
drwxr-x---  4 oracle oinstall  4096 Feb 12 00:01 3rdparty
drwxr-x---  2 oracle oinstall  4096 Feb 12 00:43 bin
drwxr-x---  3 oracle oinstall  4096 Dec 24 00:23 include
drwxr-x---  2 oracle oinstall  4096 Feb 12 00:18 info
drwxr-x---  2 oracle oinstall  4096 Feb 12 00:00 lib
drwxr-x---  2 oracle oinstall  4096 Dec 24 00:23 mibs
drwxr-x---  3 oracle oinstall  4096 Dec 24 00:23 network
drwxr-x---  3 oracle oinstall  4096 Dec 24 00:23 nls
drwxr-x---  2 oracle oinstall  4096 Dec 24 00:23 oraclescripts
drwxr-x---  4 oracle oinstall  4096 Feb 11 23:59 PERL
drwxr-x---  8 oracle oinstall  4096 Dec 24 00:23 plsql
-r--r-----  1 oracle oinstall 74764 Feb 12 00:00 README.html
drwxr-x---  2 oracle oinstall  4096 Feb 11 23:59 startup
drwxr-x---  2 oracle oinstall  4096 Dec 24 00:23 support
drwxrw----  5 oracle oinstall  4096 Feb 12 00:00 ttclasses
drwxr-x---  3 oracle oinstall  4096 Feb 11 23:59 ttoracle_home

4.试用Timesten

[oracle@bas bin]$ ttisql -version
TimesTen Release 11.2.2.2.0
[oracle@bas info]$ ttisql TT_1122
Copyright (c) 1996-2011, Oracle.  All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
connect "DSN=TT_1122";
Warning 01S00: Undefined connection attribute "ConnectionCharacte" on line 144 of file /home/oracle/timesten/TimesTen/xifenfei/info/sys.odbc.ini
Connection successful: DSN=TT_1122;UID=oracle;DataStore=/home/oracle/timesten/TimesTen/xifenfei/info/TT_1122;DatabaseCharacterSet=ZHS16GBK;ConnectionCharacterSet=US7ASCII;DRIVER=/home/oracle/timesten/TimesTen/xifenfei/lib/libtten.so;PermSize=300;TempSize=64;TypeMode=0;OracleNetServiceName=orcl_tt;
(Default setting AutoCommit=1)
Command> tables;
0 tables found.
Command> create table t_xff(id number,name varchar2(100));
Command> tables;
  ORACLE.T_XFF
1 table found.
Command> desc t_xff;
Table ORACLE.T_XFF:
  Columns:
    ID                              NUMBER
    NAME                            VARCHAR2 (100) INLINE
1 table found.
Command> insert into t_xff values(1,'xifenfei');
1 row inserted.
Command> insert into t_xff values(2,'www.xifenfei.com');
1 row inserted.
Command> commit;
Command> select * from t_xff;
< 1, xifenfei >
< 2, www.xifenfei.com >
2 rows found.
Command> update t_xff set name='xff' where id=1;
1 row updated.
Command> select * from t_xff;
< 1, xff >
< 2, www.xifenfei.com >
2 rows found.
Command> delete from t_xff where id=1;
1 row deleted.
Command> commit;
Command> select * from t_xff;
< 2, www.xifenfei.com >
1 row found.
Command> help
Use "help all" to get a description of all commands or use "help <cmd>" to
limit it to that command.
?                         free                      sqlcolumns
!                         functions                 sqlgetinfo
@@                        globalprocessing          sqlquerytimeout
accept                    help                      sqlstatistics
allfunctions              history                   sqltables
allindexes                host                      statsclear
allpackages               if                        statsestimate
allprocedures             indexes                   statsupdate
allsequences              isolation                 synonyms
allsynonyms               monitor                   tables
alltables                 tblsize                   timing
allviews                  multipleconnections       tryglobalprocessing
autocommit                ncharencoding             tryhash
builtins                  optfirstrow               trymaterialize
cachegroups               optprofile                trymergejoin
cachesqlget               packages                  trynestedloopjoin
clearhistory              passthrough               tryrowid
clienttimeout             prefetchcount             tryrowlocks
close                     prepare                   tryserial
closeall                  print                     trytbllocks
cmdcache                  procedures                trytmphash
columnlabels              quantify                  trytmptable
commit                    prompt                    trytmprange
commitdurable             remark                    tryrange
compact                   repschemes                undefine
compare                   retryconnect              unsetjoinorder
connect                   rollback                  unsetuseindex
define                    run                       use
describe                  savehistory               variable
disconnect                sequences                 verbosity
dssize                    set                       version
e:                        setjoinorder              vertical
exec                      setuseindex               views
execandfetch              setvariable               waitfor
exit                      show                      whenever
explain                   showjoinorder             xlabookmarkdelete
fetchall                  showplan                  <sql_statement>
fetchone                  sleep
Command> exit
Disconnecting...
Done.

nmon使用说明

Nmon 工具是 IBM 提供的免费的监控 AIX 系统与 Linux 系统资源的工具。该工具可实时监控系统性能,也可以将服务器的系统资源耗用情况收集起来并输出一个特定的文件,并可利用 excel 分析工具进行数据的统计分析,非常利用 UNIX 或者 Linux 系统的性能数据分析。

1.下载地址
nmon官网
NMON_Analyser官网
本地下载nmon
本地下载nmon_analyser

2.安装nmon
在压缩包中找到相应的版本,上传至服务器,然后授予执行权限

3.主要操作说明

+-HELP---------most-keys-toggle-on/off------------------------------------------+
|h = Help information     q = Quit nmon             0 = reset peak counts       |
|+ = double refresh time  - = half refresh          r = ResourcesCPU/HW/MHz/AIX |
|c = CPU by processor     C=upto 128 CPUs           p = LPAR Stats (if LPAR)    |
|l = CPU avg longer term  k = Kernel Internal       # = PhysicalCPU if SPLPAR   |
|m = Memory & Paging      M = Multiple Page Sizes   P = Paging Space            |
|d = DiskI/O Graphs       D = DiskIO +Service times o = Disks %Busy Map         |
|a = Disk Adapter         e = ESS vpath stats       V = Volume Group stats      |
|^ = FC Adapter (fcstat)  O = VIOS SEA (entstat)    v = Verbose=OK/Warn/Danger  |
|n = Network stats        N=NFS stats (NN for v4)   j = JFS Usage stats         |
|A = Async I/O Servers    w = see AIX wait procs   "="= Net/Disk KB<-->MB       |
|b = black&white mode     g = User-Defined-Disk-Groups (see cmdline -g)         |
|t = Top-Process --->     1=basic 2=CPU-Use 3=CPU(default) 4=Size 5=Disk-I/O    |
|u = Top+cmd arguments    U = Top+WLM Classes       . = only busy disks & procs |
|W = WLM Section          S = WLM SubClasses)                                   |

4.实时监控结果
1)监控内存使用情况

| Memory -----------------------------------------------------------------------|
|          Physical  PageSpace |        pages/sec  In     Out | FileSystemCache |
|% Used       93.8%     34.3%  | to Paging Space   0.0    0.0 | (numperm) 44.3% |
|% Free        6.2%     65.7%  | to File System    0.0  257.9 | Process   18.2% |
|MB Used    1786.0MB   175.8MB | Page Scans        0.0        | System    31.4% |
|MB Free     118.0MB   336.2MB | Page Cycles       0.0        | Free       6.2% |
|Total(MB)  1904.0MB   512.0MB | Page Steals       0.0        |           ------|
|                              | Page Faults     279.9        | Total    100.0% |
|------------------------------------------------------------ | numclient 44.3% |
|Min/Maxperm     361MB( 19%)  1443MB( 76%) <--% of RAM        | maxclient 75.8% |
|Min/Maxfree     960   1088       Total Virtual    2.4GB      | User      58.4% |
|Min/Maxpgahead    2      8    Accessed Virtual    0.9GB 40.1%| Pinned    28.6% |
|-------------------------------------------------------------------------------|

2)监控cpu使用情况

|                           0----------25-----------50----------75----------100
|CPU User%  Sys% Wait% Idle%|           |            |           |            |
|  0   0.0   0.0   0.0 100.0|>                                                |
|  1   0.0   0.0   0.0 100.0|>          |
|  2   0.0   0.0   0.0 100.0|>                                                |
|  3   0.0   0.0   0.0 100.0|>                                                |
|Physical Averages          +-----------|------------|-----------|------------+
|All   0.2   2.5   0.7  96.6|>                                                |
|                           +-----------|------------|-----------|------------+

3)监控进程状态

| Top-Processes-(147) -----Mode=3  [1=Basic 2=CPU 3=Perf 4=Size 5=I/O 6=Cmds]-----------------------------|
|  PID       %CPU     Size      Res     Res      Res     Char    RAM      Paging         Command          |
|            Used       KB      Set     Text     Data     I/O     Use   io   other repage                 |
| 1908868     0.8    30508    29764      132    29632        2    2%      0      3      0 secldapclntd    |
| 2306196     0.7      512      512        0      512        0    0%      1      8      0 trclogio        |
| 2732116     0.6     2520        0        0        0        0    0%      0     33      0 <defunct Zombie>|
|  340036     0.2     1416      296       72      224        0    0%      0      0      0 dtgreet         |

5.监控一段时间性能

-f            spreadsheet output format [note: default -s300 -c288]
optional
 -s <seconds>  between refreshing the screen [default 2]
 -c <number>   of refreshes [default millions]
 -t            spreadsheet includes top processes
具体信息nmon -h

例如:nmon -f -t -s 30 -c 120
-s 30:每30秒进行一次数据采集
-c 120:一共采集120次

6.分析数据
打开nmon analyser,设置宏的安全级别是低 ,之后点击 Analyser NMON data 按钮 输入文件 保存成excel格式即可。

Easy Connect Naming Method与EZCONNECT关系

Easy Connect Naming Method这个东西是Oracle 10g推出的东东,我想不用我解释它的好,dba和开发人员都喜欢它,以前一直都用它,从没有关注到它和sqlnet.ora中的NAMES.DIRECTORY_PATH的关系,昨天一朋友和我说到了EZCONNECT,今天查询了一些资料和做了一些实验,使得自己对NAMES.DIRECTORY_PATH和EZCONNECT有了新的认识,也怪自己一致忽略了这个知识点。

1.NAMES.DIRECTORY_PATH= (TNSNAMES)

[oracle@node1 samples]$ more $ORACLE_HOME/network/admin/sqlnet.ora
#NAMES.DIRECTORY_PATH= (EZCONNECT)
NAMES.DIRECTORY_PATH= (TNSNAMES)
[oracle@node1 samples]$ sqlplus hr/xifenfei@127.0.0.1/ecp
SQL*Plus: Release 10.2.0.5.0 - Production on Wed Feb 8 23:12:12 2012
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

证明sqlnet.ora中的NAMES.DIRECTORY_PATH设置为TNSNAMES时,Easy Connect Naming Method不能工作。

2.NAMES.DIRECTORY_PATH= (EZCONNECT)

[oracle@node1 samples]$ more $ORACLE_HOME/network/admin/sqlnet.ora
NAMES.DIRECTORY_PATH= (EZCONNECT)
#NAMES.DIRECTORY_PATH= (TNSNAMES)
[oracle@node1 samples]$ sqlplus hr/xifenfei@127.0.0.1/ecp
SQL*Plus: Release 10.2.0.5.0 - Production on Wed Feb 8 23:13:21 2012
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>

登录成功,其实这里生效是因为设置了NAMES.DIRECTORY_PATH为EZCONNECT的功效,从EZCONNECT的上面也可以看出是

3.NAMES.DIRECTORY_PATH为默认值

[oracle@node1 samples]$ more $ORACLE_HOME/network/admin/sqlnet.ora
#NAMES.DIRECTORY_PATH= (EZCONNECT)
#NAMES.DIRECTORY_PATH= (TNSNAMES)
[oracle@node1 samples]$ sqlplus hr/xifenfei@127.0.0.1/ecp
SQL*Plus: Release 10.2.0.5.0 - Production on Wed Feb 8 23:13:49 2012
Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>

当NAMES.DIRECTORY_PATH为默认值时,使用Easy Connect Naming Method也可以登录成功(正是因为这个原因,导致我忽略了EZCONNECT的存在).

4.sqlnet.ora中关于NAMES.DIRECTORY_PATH说明

#names.directory_path
#
#Syntax:  <adapter-name>
#Default: TNSNAMES,ONAMES,HOSTNAME
#
# Sets the (ordered) list of naming adaptors to use in resolving a name.
# The default is as shown for 3.0.2 of sqlnet onwards. The default was
# (TNSNAMES, ONAMES) before that. The value can be presented without
# parentheses if only a single entry is being specified. The parameter is
# recognized from version 2.3.2 of sqlnet onward. Acceptable values include:
#  TNSNAMES -- tnsnames.ora lookup
#  ONAMES   -- Oracle Names
#  HOSTNAME -- use the hostname (or an alias of the hostname)
#  NIS      -- NIS (also known as "yp")
#  CDS      -- OSF DCE's Cell Directory Service
#  NDS      -- Novell's Netware Directory Service

5.关于NAMES.DIRECTORY_PATH参数的补充说明

tnsnames:local naming naming method
Set to resolve a net service name through the tnsnames.ora file on the client.
hostname:host naming method
Set to resolve a host name alias through an existing names resolution service or a centrally-maintained set of /etc/hosts files.
onames:Oracle Names method
Set to resolve database objects through a Oracle Names server.
ldap:directory naming naming method
Set to resolve a database service name, net service name, or net service alias through a directory server.
cds:Cell Directory Services (CDS) external naming method
Set to resolve an Oracle database name in a Distributed Computing Environment (DCE) environment.
nis:Network Information Service (NIS) external naming method
Set to resolve service information through an existing NIS.
Ezconnect:The easy connect naming method eliminates the need for service name lookup in the tnsnames.ora files for TCP/IP environments; in fact, no naming or directory system is required if you use this method.

ORA-00600[4454]

数据库版本信息

SQL> select * from gv$version;
   INST_ID BANNER
---------- ----------------------------------------------------------------
         1 Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
         1 PL/SQL Release 9.2.0.8.0 - Production
         1 CORE 9.2.0.8.0       Production
         1 TNS for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production
         1 NLSRTL Version 9.2.0.8.0 - Production
         2 Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
         2 PL/SQL Release 9.2.0.8.0 - Production
         2 CORE 9.2.0.8.0       Production
         2 TNS for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production
         2 NLSRTL Version 9.2.0.8.0 - Production
10 rows selected.

早上检查某运营商的结算数据库时发现

Mon Feb  6 16:03:23 2012
Errors in file /oracle9/app/admin/settl/udump/settl1_ora_1355948.trc:
ORA-00600: internal error code, arguments: [4454], [], [], [], [], [], [], []
Mon Feb  6 16:03:23 2012
Errors in file /oracle9/app/admin/settl/udump/settl1_ora_1355948.trc:
ORA-00600: internal error code, arguments: [4454], [], [], [], [], [], [], []

trace文件信息

*** SESSION ID:(100.35758) 2012-02-06 16:03:23.223
*** 2012-02-06 16:03:23.223
ksedmp: internal or fatal error
ORA-00600: internal error code, arguments: [4454], [], [], [], [], [], [], []
Current SQL statement for this session:
select trim(operator_id) into :b1  from b_sys_proc where program_name=:b2
----- Call Stack Trace -----
calling              call     entry                argument values in hex
location             type     point                (? means dubious value)
-------------------- -------- -------------------- ----------------------------
ksedmp+0148          bl       ksedst               1029746CC ?
ksfdmp+0018          bl       01FD4010
kgeriv+0118          bl       _ptrgl
kgeasi+00cc          bl       kgeriv               1101FAF48 ? 110248038 ?
                                                   00000000C ? 110235978 ?
                                                   000000040 ?
ktcsptg+00c4         bl       kgeasi               1100062D8 ? 110389E88 ?
                                                   116600001166 ? 200000002 ?
                                                   000000000 ? 70000010738F0E8 ?
                                                   0FFFFFFFF ? 0FFFFFFFF ?
opiexe+0524          bl       ktcsptg              000000000 ? 000000000 ?
opiefn0+01c0         bl       opiexe               49FFFFA640 ? 4900000001 ?
                                                   FFFFFFFFFFFA5C8 ?
opiefn+0100          bl       opiefn0              01000CF60 ? 1029C61B0 ?
                                                   000000002 ? FFFFFFFFFFFC1BC ?
                                                   000000001 ? 00000000C ?
                                                   00000000B ? 110061F50 ?
opiodr+08cc          bl       _ptrgl
ttcpip+0cc4          bl       _ptrgl
opitsk+0d60          bl       ttcpip               11000CF60 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
opiino+0758          bl       opitsk               000000000 ? 000000000 ?
opiodr+08cc          bl       _ptrgl
opidrv+032c          bl       opiodr               3C00000018 ? 4101FAF48 ?
                                                   FFFFFFFFFFFF790 ? 0A000EEA8 ?
sou2o+0028           bl       opidrv               3C0C000000 ? 4A0147B50 ?
                                                   FFFFFFFFFFFF790 ?
main+0138            bl       01FD3A28
__start+0098         bl       main                 000000000 ? 000000000 ?
………………
SO: 70000010738f0e8, type: 4, owner: 7000001043acd90, flag: INIT/-/-/0x00
    (session) trans: 70000010dde1dd8, creator: 7000001043acd90, flag: (100041) USR/- BSY/-/-/-/-/-
              DID: 0001-0064-7625733A, short-term DID: 0000-0000-00000000
              txn branch: 7000001147dbed8
              oct: 0, prv: 0, sql: 700000117b7f778, psql: 0, user: 24/SETTLE
    O/S info: user: settle, term: , ospid: 1400836, machine: zwq_jies2
              program: /settlement/pkg01/bin/long/long_app@zwq_jies2 (T
    application name: /settlement/pkg01/bin/long/long_app@zwq_jies2 (T, hash value=0
    last wait for 'SQL*Net message from client' blocking sess=0x0 seq=483 wait_time=240
                driver id=54435000, #bytes=1, =0

查询MOS,发现是Bug# 1402161(虽然在mos中声明该bug是在9.2.0.1中已经被修复,但是这里的trace文件中的Call Stack Trace和mos中记录一致,而且网络上也存在很多9.2.0.8中关于该bug的情况),trace文件最后一段可以看出是在节点2上(zwq_jies2)运行/settlement/pkg01/bin/long/long_app程序导致出现该错误
产生该错误原因:

This exception is signalled because the savepoint number is not what was
  expected.
The current transaction savepoint is less than the beginning savepoint of
  the transaction.

解决方法:
把/settlement/pkg01/bin/long/long_app中的需要运行的程序分割成几个小程序运行。

Break the job into smaller chunks and reconnect for each part of the job
  to reset the savepoint number.

PL/SQL Developer编译过程引起ora-600[15419]

数据库版本

SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
PL/SQL Release 9.2.0.8.0 - Production
CORE    9.2.0.8.0       Production
TNS for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production
NLSRTL Version 9.2.0.8.0 - Production

alert中发现错误

Sun Feb  5 16:32:33 2012
Errors in file /oracle9/app/admin/crm/udump/crm2_ora_2434040.trc:
ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL execution], [], [], [], [], [], []
ORA-06544: PL/SQL: internal error, arguments: [2603], [], [], [], [], [], [], []
ORA-06553: PLS-707: unsupported construct or internal error [2603]
Sun Feb  5 16:32:33 2012
Trace dumping is performing id=[cdmp_20120205163233]
Sun Feb  5 16:32:45 2012
Errors in file /oracle9/app/admin/crm/udump/crm2_ora_2732864.trc:
ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL execution], [], [], [], [], [], []
ORA-06544: PL/SQL: internal error, arguments: [2603], [], [], [], [], [], [], []
ORA-06553: PLS-707: unsupported construct or internal error [2603]

trace文件内容

----- Call Stack Trace -----
calling              call     entry                argument values in hex
location             type     point                (? means dubious value)
-------------------- -------- -------------------- ----------------------------
ksedmp+0148          bl       ksedst               1029746FC ?
ksfdmp+0018          bl       01FD4014
kgeriv+0118          bl       _ptrgl
kgesiv+0080          bl       kgeriv               FFFFFFFFFFF3AF0 ?
                                                   700000D072A1238 ?
                                                   FFFFFFFFFFF3A80 ?
                                                   3592393502A3F478 ?
                                                   100112038 ?
ksesic1+005c         bl       kgesiv               000000000 ? 700000000003BC8 ?
                                                   2FFFFFEFFFF40C8 ?
                                                   7000002E147A6E0 ? 110002A20 ?
kkxexe+0308          bl       ksesic1              3C3B00003C3B ? 000000001 ?
                                                   000000024 ? 102A1143C ?
                                                   000000009 ? 110362830 ?
                                                   000000002 ? 000007FFF ?
opiexe+274c          bl       kkxexe               1103B5B50 ?
opiodr+08cc          bl       _ptrgl
rpidrus+008c         bl       opiodr               4103A2A20 ? 300000000 ?
                                                   FFFFFFFFFFF6A70 ? 50000F618 ?
skgmstack+00d0       bl       _ptrgl
rpidru+0090          bl       skgmstack            0FFFF5F30 ? 1101FAF78 ?
                                                   110006448 ? FFFFFFFFFFF6AD8 ?
                                                   700000C7CF68900 ?
rpiswu2+0358         bl       _ptrgl
rpidrv+07fc          bl       rpiswu2              700000C386E8718 ? 500000000 ?
                                                   1103B7908 ? FFFFFFFFFFF6E40 ?
                                                   000000000 ? 2E00000000 ?
                                                   1101E9CA8 ? 000000000 ?
rpiexe+0034          bl       rpidrv               5FFFF6A68 ? 400000A20 ?
                                                   FFFFFFFFFFF6A70 ? 00000002E ?
psdevnCallback+00d4  bl       rpiexe               FFFFFFFFFFF71D0 ?
rpiswu2+0358         bl       _ptrgl
psdevn+0068          bl       rpiswu2              700000C386E8718 ?
                                                   10803D00008 ? 000000000 ?
                                                   102A1BA98 ? 1103B7210 ?
                                                   2E00000008 ? 108000003D0 ?
                                                   000000000 ?
pbedeevn+0350        bl       _ptrgl
pbeevnd+0198         bcl      pevm_CHSNULL+01c0    FFFFFFFFFFF7370 ? 000000000 ?
                                                   100AE4A10 ? 000000000 ?
                                                   11035F738 ? 11035FB76 ?
pfrrun+0ce4          bl       pbeevnd              1103B7210 ? 1103B7278 ?
                                                   700000CE62919A6 ?
peicnt+01b8          bl       pfrrun               1103B7210 ?
kkxexe+01f8          bl       peicnt               FFFFFFFFFFF8F80 ? 1103B7210 ?
opiexe+274c          bl       kkxexe               1103B7908 ?
opiall0+102c         bl       opiexe               4FFFFFFB0 ? FFFFFFFFFFFBBB0 ?
                                                   FFFFFFFFFFFA0A0 ?
kpoal8+0a78          bl       opiall0              5EFFFFBED4 ? 22FFFFBC18 ?
                                                   FFFFFFFFFFFA5B8 ? 000000000 ?
                                                   FFFFFFFFFFFA508 ? 1102A6498 ?
                                                   5B00000070 ? 24000000007FFF ?
opiodr+08cc          bl       _ptrgl
ttcpip+0cc4          bl       _ptrgl
opitsk+0d60          bl       ttcpip               11000CF90 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
opiino+0758          bl       opitsk               000000000 ? 000000000 ?
opiodr+08cc          bl       _ptrgl
opidrv+032c          bl       opiodr               3C00000018 ? 4101FAF78 ?
                                                   FFFFFFFFFFFF7B0 ? 0A000F350 ?
sou2o+0028           bl       opidrv               3C0C000000 ? 4A00E8B50 ?
                                                   FFFFFFFFFFFF7B0 ?
main+0138            bl       01FD3A28
__start+0098         bl       main                 000000000 ? 000000000 ?
--------------------- Binary Stack Dump ---------------------
………………
SO: 700000c386e8718, type: 4, owner: 700000c3c7779a0, flag: INIT/-/-/0x00
    (session) trans: 0, creator: 700000c3c7779a0, flag: (41) USR/- BSY/-/-/-/-/-
              DID: 0002-02FA-00A04E87, short-term DID: 0000-0000-00000000
              txn branch: 0
              oct: 47, prv: 0, sql: 700000d85e7a0d8, psql: 7000002615ef140, user: 46/DBMARK
    O/S info: user: yuyangah, term: LENOVO-C18854BA, ospid: 5624:5632, machine: WORKGROUP\LENOVO-C18854BA
              program: plsqldev.exe
    application name: PL/SQL Developer, hash value=1190136663
    action name: 测试窗口 - procedure PRC_MARK_UP, hash value=3097949562
    last wait for 'pipe get' blocking sess=0x0 seq=42 wait_time=122
                handle address=700000cd07bddb8, buffer length=1000, timeout=e10
temporary object counter: 0

通过这里可以看出,WORKGROUP\LENOVO-C18854BA机上的yuyangah用户在使用PL/SQL Developer操作PRC_MARK_UP过程的时候,产生了该错误。查询mos[ID 436359.1]发现有相关记录
解决方法:
1.在编译包/过程/函数时,不要选中在pl/sql dev中的Tools > Preferences > Debugger >Add debug information when compiling

2.检查的版本pl/sql dev是否和数据库兼容,建议使用新版本

查看Aix进程占用内存大小

内存从大到小排序

-bash-3.00$ ps aux | head -1 ; ps aux | sort -rn +3 | head -10
USER         PID %CPU %MEM   SZ  RSS    TTY STAT    STIME  TIME COMMAND
root     1908868  0.1  2.0 30508 29724      - A      Dec 21 235:34 /usr/sbin/secld
zhldang  2728188  0.0  0.0 1208 1288 pts/15 A    11:20:20  0:00 -bash
zhldang  1421376  0.0  0.0 2036 1056      - A    11:20:15  0:00 sshd: zhldang@p
zerbo625 2482224  0.0  0.0 1164 1244 pts/24 A    11:04:35  0:00 -bash
zerbo625 1523730  0.0  0.0 1796 1036      - A    11:04:29  0:00 sshd: zerbo625@
yxq198sm 2429092  0.0  0.0  152  156      - A    12:24:48  0:00 sleep 30
yxq198sm 1327254  0.0  0.0 1600 1872      - A      Feb 01  0:06 /usr/bin/bsh /u
yanmotia 1274070  0.0  0.0 1164  768 pts/22 A      Dec 23  0:00 -bash
xinximai 2658402  0.0  0.0 1156  760 pts/83 A      Dec 28  0:00 -bash
xifengke 2330668  0.0  0.0 1160  756 pts/80 A      Dec 05  0:00 -bash 

内存从大到小排序(详细执行命令)

-bash-3.00$ ps -ealf | head -1 ; ps -ealf | sort -rn +9 | head  -10
       F S      UID     PID    PPID   C PRI NI ADDR    SZ    WCHAN    STIME    TTY  TIME CMD
  240001 A     root  188582       1   0  60 20 2823c400 36708        *   Jan 03      - 676:39 /usr/sbin/secldapclntd
  240001 A     root 1908868       1   0  60 22 6648400 30508        *   Dec 21      - 235:40 /usr/sbin/secldapclntd
  240001 A     root  331840   86176   0  60 20 205f8400  4088            Sep 15      - 11:04 /usr/lpp/X11/bin/X -D /usr/lib/X11//rgb -T -force :0 -auth /var/dt/A:0-0xukaa
  240001 A     root 2216054  233648   0  60 20 142a400  3992 f100060002c9e8c8 11:19:59      -  0:00 sshd: zhldang [priv]
  240001 A     root 1515620  233648   0  60 20 2075f400  3992 f100060003bb0cc8 12:21:48      -  0:00 sshd: undeadbird [priv]
  240001 A     root 2719848  233648   0  60 20 916a400  3988 f100060002b068c8 13:07:55      -  0:00 sshd: wangyh0313 [priv]
  240001 A     root 2003106  233648   0  60 20 3428400  3876 f1000600038f94c8 11:02:58      -  0:00 sshd: intrepid [priv]
  240001 A     root 2560234  233648   0  60 20 44a8400  3816 f1000600018264c8 11:01:54      -  0:00 sshd: xifenfei [priv]
  240001 A     root 2846944  233648   0  60 20 22c7b400  3784 f100060003b050c8 11:04:12      -  0:00 sshd: zerbo625 [priv]
  200001 A undeadbi 2220232 1007670   0  60 20 2355f400  3104 f100060001c2c878 13:03:08  pts/9  0:00 /usr/bin/smitty

查找某个进程使用内存

-bash-3.00$ ps aux | head -1 ; ps aux | grep xifenfei
USER         PID %CPU %MEM   SZ  RSS    TTY STAT    STIME  TIME COMMAND
xifenfei 2494532  0.0  0.0 1836 1044      - A    11:02:05  0:00 sshd: xifenfei@
xifenfei 2666546  0.0  0.0 1148 1228 pts/20 A    11:02:10  0:00 -bash
root     2560234  0.0  0.0 3816 3024      - A    11:01:54  0:00 sshd: xifenfei
xifenfei 2220230  0.0  0.0  912  940 pts/20 A    13:03:06  0:00 ps aux
xifenfei 1310908  0.0  0.0  228  240 pts/20 A    13:03:06  0:00 grep xifenfei 

查找某个进程使用内存(详细执行命令)

-bash-3.00$ ps -ealf | head -1 ;ps -ealf|grep xifenfei
       F S      UID     PID    PPID   C PRI NI ADDR    SZ    WCHAN    STIME    TTY  TIME CMD
   40001 A xifenfei 2494532 2560234   0  60 20 37575400  1836          11:02:05      -  0:00 sshd: xifenfei@pts/20
  200001 A xifenfei 2510946 2666546   1  60 20 14045400   960          12:57:25 pts/20  0:00 ps -ealf
  200001 A xifenfei 2543730 2666546   0  60 20 10cc6400   228 f100010017976ca0 12:57:25 pts/20  0:00 grep xifenfei
  240001 A     root 2560234  233648   0  60 20 44a8400  3816 f1000600018264c8 11:01:54      -  0:00 sshd: xifenfei [priv] 

ORA-00600[ktspNextL1:4]

在检查某运营商的客服数据库时发现如下错误

Tue Jan 31 22:00:50 2012
Errors in file /oracle10/admin/ahunicom/bdump/ahunicom1_j005_24445074.trc:
ORA-00600: internal error code, arguments: [ktspNextL1:4], [], [], [], [], [], [], []
Tue Jan 31 22:01:18 2012
Trace dumping is performing id=[cdmp_20120131220118]
Tue Jan 31 22:01:18 2012
Errors in file /oracle10/admin/ahunicom/bdump/ahunicom1_j005_24445074.trc:
ORA-00600: internal error code, arguments: [ORA-00600: internal error code, arguments: [ktspNextL1:4], [], [], [], [], [], [], []
ORA-06512: at "SYS.PRVT_ADVISOR", line 1624
ORA-06512: at "SYS.DBMS_ADVISOR", line 186
ORA-06512: at "SYS.DBMS_SPACE", line 1500
ORA-06512: at "SYS.DBMS_SPACE", line 1566
], [], [], [], [], [], [], []

查看trace文件

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
ORACLE_HOME = /oracle10/app/product/db/10.2.0
System name:    AIX
Node name:      zwq_kfdb1
Release:        1
Version:        6
Machine:        00C5C4764C00
Instance name: ahunicom1
Redo thread mounted by this instance: 1
Oracle process number: 192
Unix process pid: 24445074, image: oracle@zwq_kfdb1 (J005)
*** ACTION NAME:(AUTO_SPACE_ADVISOR_JOB) 2012-01-31 22:00:50.874
*** MODULE NAME:(DBMS_SCHEDULER) 2012-01-31 22:00:50.874
*** SERVICE NAME:(SYS$USERS) 2012-01-31 22:00:50.874
*** SESSION ID:(454.44574) 2012-01-31 22:00:50.874
*** 2012-01-31 22:00:50.873
ksedmp: internal or fatal error
ORA-00600: internal error code, arguments: [ktspNextL1:4], [], [], [], [], [], [], []
Current SQL statement for this session:
insert into wri$_adv_objspace_trend_data select timepoint,  space_usage, space_alloc, quality from  table(dbms_space.object_growth_trend(:1, :2, :3, :4, NULL
, NULL,  NULL, 'FALSE', :5, 'FALSE'))
----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
70000010d9a65e0      1834  package body SYS.DBMS_SPACE
70000010d9a65e0      3922  package body SYS.DBMS_SPACE
70000010d9a65e0      4233  package body SYS.DBMS_SPACE
70000011a7d9c88         1  anonymous block
700000180678048       344  SYS.WRI$_ADV_OBJSPACE_TREND_T
700000180678048      1485  SYS.WRI$_ADV_OBJSPACE_TREND_T
7000001334867d0      1535  package body SYS.PRVT_ADVISOR
7000001334867d0      1618  package body SYS.PRVT_ADVISOR
70000011f9f64a8       186  package body SYS.DBMS_ADVISOR
70000010d9a65e0      1500  package body SYS.DBMS_SPACE
70000010d9a65e0      1566  package body SYS.DBMS_SPACE
----- Call Stack Trace -----
calling              call     entry                argument values in hex
location             type     point                (? means dubious value)
-------------------- -------- -------------------- ----------------------------
ksedst+001c          bl       ksedst1              70000017E9975D0 ? 100000001 ?
ksedmp+0290          bl       ksedst               104A2CDB0 ?
ksfdmp+0018          bl       03F2735C
kgerinv+00dc         bl       _ptrgl
kgeasnmierr+004c     bl       kgerinv              000000000 ? 000000001 ?
                                                   000000005 ? 7000000E19760FC ?
                                                   7000000E1976014 ?
ktspGetNextL1ForSca  bl       01F94828
n+0104
ktspScanInit+026c    bl       ktspGetNextL1ForSca  A0A0E1B89 ? 10564BCF4 ?
                              n                    80003000804DC ?
ktspGenExtentMap1+0  bl       ktspScanInit         000000000 ?
0e8
kteinmap1+00bc       bl       ktspGenExtentMap1    000000000 ? 000000001 ?
                                                   FFFFFFFFFFE3A80 ?
kteinmap+0010        bl       kteinmap1            000000000 ? 00000000D ?
kdgini+036c          bl       kteinmap             FFFFFFFFFFE3DA0 ?
kdg_block_auto+018c  bl       kdgini               000000000 ? A0B4A708C ?
                                                   5676A0005676A ?
                                                   80003000804DC ? 000000000 ?
                                                   70000016AD82170 ? 110195498 ?
                                                   70000016AD82148 ?
ktsa_object_space_u  bl       kdg_block_auto       FFFFFFFFFFE4C50 ?
sage+0950                                          FFFFFFFFFFE4CA0 ? 200000780 ?
                                                   70000011A7D9C88 ?

由trace文件中的insert语句可以知道,这个错误是DBMS_SPACE.OBJECT_GROWTH_TREND进行空间分析时被触发
查询MOS[ID 841158.1],发现这个是一个没有公布的bug(5649098),在11.1.0.7中被修复

解决方案:
1.忽略这个错误,因为这个错误是不可重复的,发生的概率不大
2.升级到11.1.0.7及其以上版本
3.如果遇到这个错误,可以手工执行dbms_space.auto_space_advisor_job_proc();

老版本PL/SQL Developer操作数据库导致ORA-00600[17113]

在巡检某运营商的计费库时,发现alert日志中发现如下错误

Thu Feb  2 13:54:52 2012
Errors in file /oracle9/app/admin/bill/udump/bill1_ora_35651918.trc:
ORA-00600: internal error code, arguments: [17113], [0x000000000], [], [], [], [], [], []

查看trace文件

Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.6.0 - Production
ORACLE_HOME = /oracle9/app/product/9.2.0
System name:    AIX
Node name:      zwq_bill_1
Release:        1
Version:        6
Machine:        00F64FF34C00
Instance name: bill1
Redo thread mounted by this instance: 1
Oracle process number: 200
Unix process pid: 35651918, image: oracle@zwq_bill_1 (TNS V1-V3)
*** 2012-02-02 13:54:52.169
*** SESSION ID:(210.1380) 2012-02-02 13:54:52.150
********** Internal heap ERROR 17113 addr=0 *********
******************************************************
HEAP DUMP heap name=""  desc=0
 extent sz=0x0 alt=0 het=0 rec=0 flg=0 opc=0
 parent=0 owner=0 nex=0 xsz=0x0
 Hla: -1
*** 2012-02-02 13:54:52.169
ksedmp: internal or fatal error
ORA-00600: internal error code, arguments: [17113], [0x000000000], [], [], [], [], [], []
Current SQL statement for this session:
declare
  t_owner varchar2(30);
  t_name  varchar2(30);
  procedure check_mview is
    dummy integer;
  begin
    if :object_type = 'TABLE' then
      select 1 into dummy
      from sys.all_objects
      where owner = :object_owner
      and object_name = :object_name
      and object_type = 'MATERIALIZED VIEW'
      and rownum = 1;
      :object_type := 'MATERIALIZED VIEW';
    end if;
  exception
    when others then null;
  end;
begin
  :sub_object := null;
  if :deep != 0 then
    begin
      if :part2 is null then
        select constraint_type, owner, constraint_name
          into :object_type, :object_owner, :object_name
          from sys.all_constraints c
         where c.constraint_name = :part1 and c.owner = user
           and rownum = 1;
      else
        select constraint_type, owner, constraint_name, :part3
          into :object_type, :object_owner, :object_name, :sub_object
          from sys.all_constraints c
         where c.constraint_name = :part2 and c.owner = :part1
           and rownum = 1;
      end if;
      if :object_type = 'P' then :object_type := 'PRIMARY KEY'; end if;
      if :object_type = 'U' then :object_type := 'UNIQUE KEY'; end if;
      if :object_type = 'R' then :object_type := 'FOREIGN KEY'; end if;
      if :object_type = 'C' then :object_type := 'CHECK CONSTRAINT'; end if;
      return;
    exception
      when no_data_found then null;
    end;
  end if;
  :sub_object := :part2;
  if (:part2 is null) or (:part1 != user) then
    begin
      select object_type, user, :part1
      into :object_type, :object_owner, :object_name
      from sys.all_objects
      where owner = user
      and object_name = :part1
      and object_type in ('MATERIALIZED VIEW', 'TABLE', 'VIEW', 'SEQUENCE', 'PROCEDURE', 'FUNCTION', 'PACKAGE', 'TYPE', 'TRIGGER', 'SYNONYM')
      and rownum = 1;
      if :object_type = 'SYNONYM' then
        select s.table_owner, s.table_name
          into t_owner, t_name
          from sys.all_synonyms s
         where s.synonym_name = :part1
           and s.owner = user
           and rownum = 1;
        select o.object_type, o.owner, o.object_name
          into :object_type, :object_owner, :object_name
          from sys.all_objects o
         where o.owner = t_owner
           and o.object_name = t_name
           and object_type in ('MATERIALIZED VIEW', 'TABLE', 'VIEW', 'SEQUENCE', 'PROCEDURE', 'FUNCTION', 'PACKAGE', 'TYPE', 'TRIGGER', 'SYNONYM')
           and rownum = 1;
      end if;
      :sub_object := :part2;
      if :part3 is not null then
        :sub_object := :sub_object || '.' || :part3;
      end if;
      check_mview;
      return;
    exception
      when no_data_found then null;
    end;
  end if;
  begin
    select s.table_owner, s.table_name
      into t_owner, t_name
      from sys.all_synonyms s
     where s.synonym_name = :part1
       and s.owner = 'PUBLIC'
       and rownum = 1;
    select o.object_type, o.owner, o.object_name
      into :object_type, :object_owner, :object_name
      from sys.all_objects o
     where o.owner = t_owner
       and o.object_name = t_name
       and object_type in ('MATERIALIZED VIEW', 'TABLE', 'VIEW', 'SEQUENCE', 'PROCEDURE', 'FUNCTION', 'PACKAGE', 'TYPE', 'TRIGGER', 'SYNONYM')
       and rownum = 1;
    check_mview;
    return;
  exception
    when no_data_found then null;
  end;
  :sub_object := :part3;
  begin
    select o.object_type, o.owner, o.object_name
      into :object_type, :object_owner, :object_name
      from sys.all_objects o
     where o.owner = :part1
       and o.object_name = :part2
       and object_type in ('MATERIALIZED VIEW', 'TABLE', 'VIEW', 'SEQUENCE', 'PROCEDURE', 'FUNCTION', 'PACKAGE', 'TYPE', 'TRIGGER', 'SYNONYM')
       and rownum = 1;
    check_mview;
    return;
  exception
    when no_data_found then null;
  end;
  begin
    if :part2 is null and :part3 is null
    then
      select 'USER', null, :part1
      into :object_type, :object_owner, :object_name
      from sys.all_users u
      where u.username = :part1
      and rownum = 1;
      return;
    end if;
  exception
    when no_data_found then null;
  end;
  begin
    if :part2 is null and :part3 is null and :deep != 0
    then
      select 'ROLE', null, :part1
      into :object_type, :object_owner, :object_name
      from sys.session_roles r
      where r.role = :part1
      and rownum = 1;
      return;
    end if;
  exception
    when no_data_found then null;
  end;
  :object_owner := null;
  :object_type := null;
  :object_name := null;
  :sub_object := null;
end;

通过观察trace的这部分可以知道,是执行这条sql语句导致了ora-600[17113]错误的产生,而这条语句是查询系统对象,初步怀疑是oracle客户端上产生,继续阅读trace文件发现

    SO: 7000000b926f188, type: 4, owner: 7000000bd298b00, flag: INIT/-/-/0x00
    (session) trans: 0, creator: 7000000bd298b00, flag: (41) USR/- BSY/-/-/-/-/-
              DID: 0001-00C8-0009F6EF, short-term DID: 0000-0000-00000000
              txn branch: 0
              oct: 47, prv: 0, sql: 7000000d481ee78, psql: 7000000e086d8d8, user: 567/IBILLAPP
    O/S info: user: Administrator, term: WWW-39A255460E8, ospid: 784:2080, machine: WORKGROUP\WWW-39A255460E8
              program: plsqldev.exe
    application name: PL/SQL Developer, hash value=1190136663
    action name: Main session, hash value=1773317990
    last wait for 'SQL*Net more data from client' blocking sess=0x0 seq=78 wait_time=4
                driver id=54435000, #bytes=34, =0
    temporary object counter: 0

从这里进一步确认是有人使用PL/SQL Developer从WORKGROUP\WWW-39A255460E8的机器上操作该数据库导致,查询mos,果然发现该问题记录[ID 396326.1]。
解决办法:使用新版本的plsql dev工具即可解决问题。

ORA-19583/ORA-27206/ORA-06512

检查alert日志发现近期数据库出现了ORA-19583/ORA-27206/ORA-06512错误

Fri Dec 30 12:22:36 2011
Errors in file /oracle9/app/admin/ykcdb/udump/ykcdb_ora_5390564.trc:
ORA-19583: conversation terminated due to error
ORA-27206: requested file not found in media management catalog
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 625

进一步查看trace文件发现

Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.7.0 - Production
ORACLE_HOME = /oracle9/app/product/9.2.0
System name:    AIX
Node name:      OFFON2
Release:        3
Version:        5
Machine:        000A36B8D600
Instance name: ykcdb
Redo thread mounted by this instance: 1
Oracle process number: 79
Unix process pid: 5390564, image: oracle@OFFON2 (TNS V1-V3)
*** 2011-12-30 12:22:36.051
*** SESSION ID:(32.62184) 2011-12-30 12:22:36.023
FATAL ERROR IN TWO-TASK SERVER: error = 12152
*** 2011-12-30 12:22:36.051
ksedmp: internal or fatal error
ORA-19583: conversation terminated due to error
ORA-27206: requested file not found in media management catalog
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 625
----- Call Stack Trace -----
calling              call     entry                argument values in hex
location             type     point                (? means dubious value)
-------------------- -------- -------------------- ----------------------------
ksedmp+0148          bl       ksedst               1025AE55C ?
opitsk+0968          bl       ksedmp               20289E71C ?
opiino+0798          bl       opitsk               000000000 ? 000000000 ?
opiodr+08c8          bl       _ptrgl
opidrv+032c          bl       opiodr               3C00000018 ? 4101C7F40 ?
                                                   FFFFFFFFFFFF810 ? 0A03547C8 ?
sou2o+0028           bl       opidrv               3C0C000000 ? 4A039C2D0

查看mos发现[ID 558993.1]提供了错误原因和解决方案
错误原因:RMAN backup to tape using veritas netbackup,The MML parameters like NB_ORA_CLIENT and NB_ORA_SERV were not given in proper case while configuring channel in RMAN backup.
解决方法:The NB_ORA_CLIENT and NB_ORA_SERV MML parameters are case sensitive. So make sure to give these parameters in same case while allocating or configuring RMAN channel as it is configure in Veritas server.