sql server 創立暫時表的應用解釋。本站提示廣大學習愛好者:(sql server 創立暫時表的應用解釋)文章只能為提供參考,不一定能成為您想要的結果。以下是sql server 創立暫時表的應用解釋正文
在網上查了幾天的材料,測驗考試綜合消除告警日記內容及建內部表的方法來處理這一成績。
一:備份並消除告警日記內容
將天天的告警日記備份好,然落後行消除。
1:備份報警日記
在$ORACLE_HOME/SID/bdump/ 目次下,
按日期備份alert_ORACLE_你的實例名.LOG這個文件,如:alert_ORACLE_orcl_201408111639_bak.LOG。
2:消除日記內容
翻開報警日記文件,用true > 文件名 可消除失落外面的內容
詳細示例:
假設,我如今第一次停止該設置,我先把現有的告警日記停止備份,如:
--備份文件稱號:明天16點24分前的告警日記信息
[oracle@rac2 bdump]$ cp alert_orcl2.log alert_orcl2_before_201408111624_bak.log
-清空報警日記
[oracle@rac2 bdump]$ true > alert_orcl2.log
如今告警日記是空的。
切換下歸檔日記,檢討報警日記裡能否湧現了新內容:
SQL> alter system switch logfile; System altered.
則如今alert_orcl2.log記載的是2014年8月11日16點24分後至你下次對報警日記停止備份,截取前的信息。
二:建內部表檢查報警日記毛病
假如已樹立了一個用戶,並賦響應的權限,所以直接樹立目次對象並樹立內部表便可以了。
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的內容
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.
測試勝利
然後我們測試查報警信息'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
--假設,你的報警日記文件只包括明天的信息(可以經由過程備份並消除告警日記內容完成),則經由過程內部表可以查到當天發生了哪些毛病。