05.11.2015 Views

Apress.Expert.Oracle.Database.Architecture.9i.and.10g.Programming.Techniques.and.Solutions.Sep.2005

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

80<br />

CHAPTER 3 ■ FILES<br />

File Locations<br />

Whether you use SQL_TRACE or the extended trace facility, <strong>Oracle</strong> will start generating a trace<br />

file on the database server machine in one of two locations:<br />

• If you are using a dedicated server connection, the trace file will be generated in the<br />

directory specified by the USER_DUMP_DEST parameter.<br />

• If you are using a shared server connection, the trace file will be generated in the directory<br />

specified by the BACKGROUND_DUMP_DEST parameter.<br />

To see where the trace files will go, you may either issue SHOW PARAMETER DUMP_DEST from<br />

SQL*Plus or query the V$PARAMETER view directly:<br />

ops$tkyte@ORA10G> select name, value<br />

2 from v$parameter<br />

3 where name like '%dump_dest%'<br />

4 /<br />

NAME<br />

VALUE<br />

------------------------------ -------------------------------<br />

background_dump_dest<br />

/home/ora10g/admin/ora10g/bdump<br />

user_dump_dest<br />

/home/ora10g/admin/ora10g/udump<br />

core_dump_dest<br />

/home/ora10g/admin/ora10g/cdump<br />

This shows the three dump (trace) destinations. Background dump destination is used by<br />

any “server” process (see Chapter 5 for a comprehensive list of <strong>Oracle</strong> background processes<br />

<strong>and</strong> their functions).<br />

If you are using a shared server connection to <strong>Oracle</strong>, you are using a background process;<br />

hence the location of your trace files is defined by BACKGROUND_DUMP_DEST. If you are using a<br />

dedicated server connection, you are using a user or foreground process to interact with <strong>Oracle</strong>;<br />

hence your trace files will go in the directory specified by the USER_DUMP_DEST parameter. The<br />

CORE_DUMP_DEST parameter defines where a “core” file would be generated in the event of a<br />

serious <strong>Oracle</strong> internal error (such as a segmentation fault on UNIX) or if <strong>Oracle</strong> Support were<br />

to have to you generate one for additional debug information. In general, the two destinations<br />

of interest are the background <strong>and</strong> user dump destinations. As a note, unless otherwise stated,<br />

we will be using dedicated server connections in the course of this book.<br />

In the event you do not have access to the V$PARAMETER view, you may use DBMS_UTILITY to<br />

access the values of most (but not all) parameters. The following example demonstrates that<br />

all you need is the CREATE SESSION privilege in order to, at the very least, see this information:<br />

ops$tkyte@ORA10G> create user least_privs identified by least_privs;<br />

User created.<br />

ops$tkyte@ORA10G> grant create session to least_privs;<br />

Grant succeeded.<br />

ops$tkyte@ORA10G> connect least_privs/least_privs<br />

Connected.<br />

least_privs@ORA10G> declare

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!