How to get trace file from getbfno.sql gettrcname.sql
2012-07-15 03:15
471 查看
根据块rdba地址,找到文件号,块号.
getbfno.sql
引自http://www.eygle.com/archives/2007/07/function_rdba_convert.html
gettrcname.sql
引自http://www.eygle.com/archives/2007/05/script_gettrcname.html
getbfno.sql
CREATE OR REPLACE FUNCTION getbfno (p_dba IN VARCHAR2) RETURN VARCHAR2 IS l_str VARCHAR2 (255) DEFAULT NULL; l_fno VARCHAR2 (15); l_bno VARCHAR2 (15); BEGIN l_fno := DBMS_UTILITY.data_block_address_file (TO_NUMBER (LTRIM (p_dba, '0x'), 'xxxxxxxx' ) ); l_bno := DBMS_UTILITY.data_block_address_block (TO_NUMBER (LTRIM (p_dba, '0x'), 'xxxxxxxx' ) ); l_str := 'datafile# is:' || l_fno || CHR (10) || 'datablock is:' || l_bno || CHR (10) || 'dump command:alter system dump datafile ' || l_fno || ' block ' || l_bno || ';'; RETURN l_str; END; /
引自http://www.eygle.com/archives/2007/07/function_rdba_convert.html
gettrcname.sql
SELECT a.VALUE || b.symbol || c.instance_name || '_ora_' || d.spid || '.trc' trace_file FROM (SELECT VALUE FROM v$parameter WHERE NAME = 'user_dump_dest') a, (SELECT SUBSTR (VALUE, -6, 1) symbol FROM v$parameter WHERE NAME = 'user_dump_dest') b, (SELECT instance_name FROM v$instance) c, (SELECT spid FROM v$session s, v$process p, v$mystat m WHERE s.paddr = p.addr AND s.SID = m.SID AND m.statistic# = 0) d;
引自http://www.eygle.com/archives/2007/05/script_gettrcname.html
相关文章推荐
- How to Use Oradebug to Get Trace File Name and Location
- [cernRoot]How to get tree name from root file
- How To Get Application Path,And How To Get The Path's Directory,File Name,And Type Info(如何得到运行程序的路径,以及如何得到路径的文件夹,文件名,以及类型等等信息)
- How to get real file offset in NAND by file name?
- how to get file from classpath using jboss7.x.1 --reference
- How to get file from classpath
- How to get file extension from string in C++
- how to make&get trace file
- HOWTO get multiple value from the same name checkbox elements or radiobution elements
- How to use script to get all oracle EBS Form name and corresponding fmb file name
- How to get the "connection string" from web.config file
- How to get current page file name
- Use regular expression to get filename from a file full path name.
- How to get the SQL Server name (Database server)?
- How to get file name when user select a file via <input type=“file” />?
- How To Load CLOB Data from a File into a CLOB column using PL/SQL
- How to get file name on disk (sting thing on any OS)?
- how to get charset from string and file
- How To Get Log, Trace Files In OA Framework Pages And Concurrent Request Programs
- ffmpeg示例一:how to use libavformat and libavcodec to read video from a file.