在oracle的安裝目錄下,找NETWORK\ADMIN目錄,比如C:\app\xxxx\product\11.2.0\dbhome_1\NETWORK\ADMIN
創(chuàng)新互聯(lián)是專業(yè)的巴林右旗網(wǎng)站建設(shè)公司,巴林右旗接單;提供成都網(wǎng)站制作、網(wǎng)站建設(shè),網(wǎng)頁設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行巴林右旗網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來合作!
在這個(gè)目錄下找tnsnames.ora,用一般的文本編輯程序都可以打開
或者直接在電腦中用搜索功能,搜索文件tnsnames.ora
在oracle的服務(wù)器上直接敲命令oerr錯(cuò)誤類型、錯(cuò)誤編號,oracle會(huì)告訴你錯(cuò)在什么地方,怎么解決這個(gè)錯(cuò)誤,或者到oracle的網(wǎng)站上下載她的技術(shù)文檔,然后打開,進(jìn)入主頁,在左上角有errormessage。點(diǎn)擊進(jìn)入,然后查找你要查看的error信息。
首先了解什么是外部表,與其它表的區(qū)別,建立一個(gè)簡單的外部表(主要看操作過程),最后我們用外部表查看ORACLE報(bào)警日志
1.了解oracle外部表
外部表定義:結(jié)構(gòu)被存放在數(shù)據(jù)字典,而表數(shù)據(jù)被放在OS文件中的表
作用:在數(shù)據(jù)庫中查詢OS文件的數(shù)據(jù),還可以將OS文件數(shù)據(jù)裝載到數(shù)據(jù)庫中
與其它表的區(qū)別:在外部表上不能執(zhí)行DML操作,也不能在外部表上建索引,只能執(zhí)行select操用
2.建一個(gè)簡單的外部表1.建一個(gè)OS上的文件
因?yàn)橥獠勘碇饕遣榭碠S上的文件,首先在OS上建一個(gè)文件
mkdir -p /oracle/ext
vi /oracle/ext/ext.dat
10,20,30
40,50,60
70,80,90
2.授予用戶權(quán)限,并建立目錄對象
在此我們先建一個(gè)新用戶
create user test identified by “123” default tablespace test quota unlimited on test;
用戶授權(quán)
SQL grant create any directory to test;
建立目錄對象
SQL conn test / 123
Connected.
SQL create directory ext as '/oracle/ext';
Directory created.
3.建立外部表
SQL create table exttable(
id number,name varchar2(10),i number
)organization external
(type oracle_loader
default directory ext
access parameters
(records delimited by newline
fields terminated by ','
)location('ext.dat')
);
4.測試
SQL select * from exttable;
ID NAMEI
---------- ---------- ----------
10 20 30
40 50 60
70 80 90
測試成功,可見在數(shù)據(jù)庫中可以查詢OS文件的數(shù)據(jù)
2. 使用外部表查看oracle報(bào)警日志
由于在上面實(shí)驗(yàn)中已建立了一個(gè)用戶,并賦相應(yīng)的權(quán)限,而且也有了OS文件(即報(bào)警文件alert_SID.log),所以在此直接建立目錄對象并建立外部表就可以了。
1.建立目錄對象
SQL conn test / 123
Connected.
SQL create directory bdump as '/oracle/u01/app/oracle/admin/db2/bdump';
Directory created.
2.建立外部表
SQL create table alert_log(
text varchar2(400)
)organization external
(type oracle_loader
default directory bdump
access parameters
(records delimited by newline
)location('alert_db2.log')
);
3.測試
首先查看能否查到alert_db2.log的內(nèi)容
SQL select * from alert_log where rownum 10;
TEXT
--------------------------------------------------------------------------------
Thu Jun 11 00:51:46 2009
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/:/a
de/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
9 rows selected.
測試成功
然后我們測試查報(bào)警信息’ORA-%’
SQL select * from alert_log where text like 'ORA-%';
TEXT
--------------------------------------------------------------------------------
ORA-00202: control file: '/oracle/u01/app/oracle/product/10.2.0/db2/dbs/cntrldb2
.dbf'
ORA-27037: unable to obtain file status
ORA-205 signalled during: ALTER DATABASE MOUNT…
ORA-00301: error in adding log file '/home/oracle/oracle/oradata/testdb/redo01.l
og' - file cannot be created
ORA-27040: file create error
ORA-1501 signalled during: CREATE DATABASE db2
ORA-00200: control file could not be created
TEXT
--------------------------------------------------------------------------------
ORA-00202: control file: '/oracle/u01/app/oracle/product/10.2.0/db2/dbs/cntrldb2
.dbf'
ORA-27038: created file already exists
ORA-1501 signalled during: CREATE DATABASE db2
ORA-00200: control file could not be created
ORA-00202: control file: '/oracle/u01/app/oracle/product/10.2.0/db2/dbs/cntrldb2
.dbf'
ORA-27038: created file already exists
ORA-1501 signalled during: CREATE DATABASE db2
測試成功,
可見我們可以使用外部表來方便的查看ORACLE的報(bào)警信息
要獲得邏輯驅(qū)動(dòng)器或存儲(chǔ)卷的性能計(jì)數(shù)器數(shù)據(jù),必須在命令提示符下鍵入diskperf –yv。
默認(rèn)情況下,操作系統(tǒng)使用diskperf –yd命令包含物理驅(qū)動(dòng)器數(shù)據(jù)。
使用命令diskperf的詳細(xì)信息,請?jiān)诿钐崾痉骆I入diskperf -?。