1.tnsping:这个命令用于验证在tnsnames.ora文件中配置的数据库主机信息是否有效,如配置了这样一段:
DBS =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.23)(PORT = 1521))
)
(CONNECT_DATA =
(SID = dbs)
(SERVER = DEDICATED)
)
)
为了检测该配置是否生效,就可以用:tnsping dbs
bash[dvbtrain@dvb1:/traindvb/dvbtrain/tomcat/webapps/backup]=>tnsping dbs TNS Ping Utility for Solaris: Version 9.2.0.1.0 - Production on 07-1月 -2009 15:19:07
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
/oracle/ora92/product/9.2.0/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.23)(PORT = 1521))) (CONNECT_DATA = (SID = train) (SERVER = DEDICATED)))
OK (10 msec)
2.oerr
这个命令用于查看oracle的报错编号的含义,使用方式: oerr ora 00600
如:
bash[dvbtrain@dvb1:/traindvb/dvbtrain/tomcat/webapps/backup]=>oerr ora 00600
00600, 00000, "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"
// *Cause: This is the generic internal error number for Oracle program
// exceptions. This indicates that a process has encountered an
// exceptional condition.
// *Action: Report as a bug - the first argument is the internal error number
非常使用,对日常的一些简单的错误可首先查这个。
3.tkprof
这个命令用于对Oracle的trace file进行分析(SQL语句性能分析),使用方式:
tkprof tracefile.trc aa