Database Reference
In-Depth Information
In many test environments, however, this is not the case. On my disk, I might have five separate databases. On the
test machine, at any point in time there is only one instance of Oracle running, but the database it is accessing may be
different from day to day or hour to hour, depending on my needs. By simply having many different parameter files,
I can mount and open any one of these databases. Here, I have one instance at a time but many databases, only one of
which is accessible at any time.
So now when people talk about an instance, you'll know they mean the processes and memory of Oracle. When
they mention the database, they are talking about the physical files that hold the data. A database may be accessible
from many instances, but an instance will provide access to exactly one database (single-tenant or container
database) at a time.
The SGA and Background Processes
You're probably ready now for an abstract picture of what an Oracle instance and database look like, so take a look at
Figure 2-1 .
Instance
Background
Process
Background
Process
Background
Process
Background
Process
Background
Process
Background
Process
SGA
Database
File
File
File
File
File
File
Figure 2-1. Oracle instance and database
Figure 2-1 shows an Oracle instance and database in their simplest form. Oracle has a large chunk of memory
called the SGA that it uses, for example, to do the following:
Maintain many internal data structures that all processes need access to.
Cache data from disk; buffer redo data before writing it to disk.
Hold parsed SQL plans.
And so on.
Oracle has a set of processes that are “attached” to this SGA, and the mechanism by which they attach differs
by operating system. In a UNIX/Linux environment, the processes will physically attach to a large shared memory
segment, a chunk of memory allocated in the OS that may be accessed by many processes concurrently (generally
using shmget() and shmat() ).
Under Windows, these processes simply use the C call, malloc() to allocate the memory, since they are really
threads in one big process and hence share the same virtual memory space.
 
 
Search WWH ::




Custom Search