Oracle DBMS_SERVER_TRACE
Version 12.1.0.1

General Information
Library Note Morgan's Library Page Footer
The Library is currently in the process of being upgraded from Oracle Database Version 11.2.0.3 to 12.1.0.1. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.
Purpose Converts all trace data for the specified input file from binary to text format and outputs to the specified output file

This package is not supported for external use and should be limited to use by only DDR and internal development. This package makes Trusted Callouts to the kernel.
AUTHID DEFINER
Dependencies
DBMS_SERVER_TRACE_LIB    
Documented No
First Available Not Known
Security Model Owned by SYS with EXECUTE granted to the DBA role
Source {ORACLE_HOME}/rdbms/admin/dbmstcv.sql
 
CONVERT_BINARY_TRACE_FILE
The built-in package used by TKPROF for trace file conversion

And again, thank you to Richard Foote, for the "Bowie stuff."
dbms_server_trace.convert_binary_trace_file(
infile  IN VARCHAR2,
outfile IN VARCHAR2,
fmode   IN BOOLEAN)  -- TRUE if default format, FALSE if user defined
conn uwclass/uwclass@pdbdev

SQL> CREATE TABLE bowie_stuff (
2 album VARCHAR2(30),
3 year NUMBER,
4 rating VARCHAR2(30));

Table created.

SQL> INSERT INTO bowie_stuff VALUES ('Man Who Sold The World', 1970, 'Bloody Good!!');

1 row created.

SQL> INSERT INTO bowie_stuff VALUES ('Diamond Dogs', 1974 , 'Brilliant');

1 row created.

SQL> INSERT INTO bowie_stuff VALUES ('Outside', 1995, 'Underrated Masterpiece');

1 row created.

SQL> COMMIT;

Commit complete.

SQL> SELECT album,
2 dbms_rowid.rowid_to_absolute_fno(rowid, 'UWCLASS', 'BOWIE_STUFF') ABSOLUTE_FNO, dbms_rowid.rowid_block_number(rowid) BLOCKNO, dbms_rowid.rowid_row_number(rowid) ROWNUMBER
3 FROM bowie_stuff
4 WHERE album LIKE '%Dogs%';

ALBUM                          ABSOLUTE_FNO    BLOCKNO  ROWNUMBER
------------------------------ ------------ ---------- ----------
Diamond Dogs                              6       8586          1

SQL> conn sys@pdbdev as sysdba
Connected.
SQL> ALTER SYSTEM DUMP DATAFILE 6 BLOCK 8586;

System altered.

SQL> exec dbms_server_trace.convert_binary_trace_file( 'c:\temp\ukoug_ora_1428.trc', 'c:\temp\trace_output.txt', TRUE);
BEGIN dbms_server_trace.convert_binary_trace_file( 'c:\temp\ukoug_ora_1428.trc', 'c:\temp\trace_outp
*
ERROR at line 1:
ORA-02488: Error encountered when accessing file [c:\temp\ukoug_ora_1428.trc]
for trace conversion
ORA-27046: file size is not a multiple of logical block size
OSD-04012: file size mismatch (OS 35739)
ORA-06512: at "SYS.DBMS_SERVER_TRACE", line 10
ORA-06512: at line 1


/* So while one might expect it to work this way ... it does not. If anyone can suggest a solution please do so. It appears it wants a trace file that is exactly 8K which hardly seems likely. */

Related Topics
Packages
TKPROF
Tracing

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2014 Daniel A. Morgan All Rights Reserved