If you're looking for an overview of the Oracle database architecture, keep reading. This article series focuses on what you need to know to use the Oracle Database XE home page. It is excerpted from chapter 28 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
In Chapter 27, you installed the Oracle database component and performed the basic configuration steps to round out your PHP environment. In this chapter, we’ll cover an overview of the Oracle architecture and how to use several Oracle-supplied utilities, and give you a whirlwind tour of the other tools available at the Oracle Database XE home page.
While your focus as a PHP/Oracle developer is primarily as, well, a developer, your DBA duties will most likely take a small fraction of the time you spend with Oracle Database XE. However, in an environment where you are using Oracle Database XE, you are most likely wearing many different hats, and one of them is the DBA hat. As a result, you need to know the basics of being an Oracle DBA when the need arises.
You’ll see some of the tools we introduce in this chapter covered in more depth in Chapter 29. These tools, such as SQL Commands in the Oracle Database XE Web interface or SQL*Plus on the command line are useful regardless of whether you’re a developer, a database administrator, or a casual user who needs an occasional ad hoc query against the company’s sales history database.
Understanding the Oracle Architecture
As they say, you don’t have to know how a car’s antilock brakes work to drive a car, and you don’t need to be able to design a cell phone to call someone on a cell phone. The same could be said about the architecture of Oracle Database XE: you don’t necessarily need to know how Oracle stores data blocks on disk, but knowing the general disk and memory architecture model goes a long way to help you design and use the database efficiently. You also need to know the terminology surrounding Oracle components: tablespaces, datafiles, segments, and extents. Even if you’re only an occasional database administrator for your Oracle Database XE installation, the architectural overview in the next few sections will help you be an effective application developer as well.
An Oracle server contains both a database and an instance. The database consists of the files on disk. These files store the data itself; the state of the database, in a small, most likely replicated file called the control file; and changes to the database’s data, in files called redo log files. The instance refers to the Oracle memory processes and memory structures that reside in your server’s memory and access the database in the disk files. This distinction becomes more obvious when you are using Real Application Clusters (RAC), which is two or more Oracle instances sharing one database for performance, scalability, or availability.
If you are still convinced that the database will never need any manual tuning (which may very well be the case with Oracle Database XE!), or your database storage needs will be relatively static over time, feel free to skip ahead to the section “Connecting to the Database.”
Oracle Storage Structures
It’s important to distinguish the logical database storage structure from the physical database structure. As with most computing paradigms, the logical version hides the implementation of the paradigm in the physical implementation, either to make application development easier or to help communicate the architectural details to managers who are not involved in the technical aspects of a database computing environment on a daily basis.
From a database perspective, then, the logical database structures represent components such as tables, indexes, and views—what you see from a user’s or a developer’s point of view. The physical database structures, on the other hand, are the underlying storage methods on the disk file system including the physical files that compose the database.
Don’t worry if the next few sections seem a bit dry; you won’t need them to get into the trenches with Oracle. Most, if not all, of the storage and memory structures are tuned quite well by Oracle anyway; see Chapter 38 for more details. Skip to the section titled “Connecting to the Database” and come back here if and when you’re curious as to what’s going on under the hood.