1.3. The File System

Knowing a bit about the Oracle structure on the file system is extremely useful. In one of the later chapters we'll look at bypassing database enforced access control by accessing the Oracle files directly, so this section covers the basic layout. The base directory in which Oracle is installed is known as the Oracle Home. An environment variable known, not surprisingly, as ORACLE_HOME must be set to this directory in order for most of the Oracle utilities to work. Throughout this book, when I refer to the location of a file, I often precede it with the $ORACLE_HOME environment variable — for example, the main Oracle executable is located at $ORACLE_HOME/bin/oracle on *nix environments and %ORACLE_HOME%\bin\oracle.exe. In fact, most of the Oracle executables and dynamic link libraries are located in this directory. As such, $ORACLE_HOME/bin should be in the PATH environment variable; otherwise, again, the utilities won't work.

Data is stored logically in tablespaces (see "Database Objects") and physically in data files, usually with a .dbf file extension. Normally the data files are found in the $ORACLE_HOME/oradata/SID directory, where SID is the database SID. These data files have a simple binary structure. The file header for Oracle 10g can be described as follows: Byte 2 indicates the file type — 0×A2 seems to indicate a normal data file, 0×C2 is a control file, and 0×22 is a redo log file. The DWORD (4 bytes) at 0×14 to 0×17 indicates the size of each ...

Get The Oracle® Hacker's Handbook: Hacking and Defending Oracle now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.