Академический Документы
Профессиональный Документы
Культура Документы
com/interview_discuss/discuss/114/Oracle-11g-DBA-Interview-
Questions-and-Answers-For-Freshers/Which-file-is-accessed-first-when-Oracle-database-is-started?
SGA Details:
SGA (System Global Area) is a memory area allocated during an instance start up.
SGA size is controlled by DB_CACHE_SIZE parameter defined in initialization parameter file (init.ora file
or SPFILE).
PGA Details:
PGA (Program or Process Global Area) is a memory area that stores a user session specific information.
SGA is used to store shared information across all database users.It mainly includes Library cache, Data
Dictionary cache, Database Buffer Cache, Redo log Buffer cache, Shared Pool.
Data Dictionary Cache - It contains the definition of Database objects and privileges granted to users.
Data Base buffer cache - It holds copies of data blocks which are frequently accessed so that they can be
retrieved faster for any future requests.
Redo log buffer cache - It records all changes made to the data files.
SYSAUX tablespace
UNDO tablespace
TEMP tablespace
UNDO & TEMP tablespace are optional when you create a database.
Relational Database Management System (RDBMS) and Hierarchical Storage Management System
(HSM)
Most databases use RDBMS model, Oracle also uses RDBMS model.
You can’t make any changes to PFILE when the database is up.
SPFILE parameters changes are checked before they are accepted as it is maintained by Oracle server
thereby reducing the human typo errors
An instance is a combination of oracle background process (SMON, PMON, DBWR, LGWR) and memory
structure (SGA, PGA). An instance can mount and open only a single database, ever.
You can get the SCN number by querying select SCN from a v$database from SQLPLUS.
What is Database Writer (DBWR) and when does DBWR write to the data file?
DBWR is a background process that writes data blocks information from Database buffer cache to
datafiles.
There are seven important situations when DBWR writes to data file:
Every 3 seconds.
When server process needs free space in database buffer cache to read new blocks.
Timeout occurs.
When any tablespace is taken offline, read only, drop or truncated & when to begin the backup
How can you find out if the database is using PFILE or SPFILE?
You can query Dynamic performance view (v$parameter) to know your database is using PFILE or
SPFILE.
Init<SID>.ora parameter file or SPFILE is accessed first( SID is instance name).Settings required for
starting a database are stored as parameters in this file.
PFILE contains details for starting up an instance whereas SPFILE (Server Parameter File) is for
starting up a database.PFILE is accessed first and then SPFILE
In archive log mode, the database will makes archive of all redo log files that are filled, called as archived
redo logs or archive log files.
- By default your database runs in NO ARCHIVE LOG mode, so we can’t perform online backup’s (HOT
backup).
- You must shut down database to perform offline backup (COLD backup) and recovery can be done to
the previous backup state.
- Archive log files are stored in a default location called FRA (Flash Recovery Area).
- We can also define our own backup location by setting LOG_ARCHIVE_DEST parameter.
What is the difference between SPFILE and PFILE?
SPFILE is by default created during database creation whereas PFILE should be created from SPFILE.
PFILE is client side text file whereas SPFILE is server side binary file.
SPFILE is a binary file (it can’t be opened) whereas PFILE is a text file we can edit it and set parameter
values.
Changes made in SPFILE are dynamically effected with running database whereas PFILE changes are
effected after bouncing the database.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
https://community.oracle.com/thread/904540?start=0&tstart=0
SGA (System Global Area) is an area of memory (RAM) allocated when an Oracle Instance starts up. The
SGA's size and function are controlled by initialization (INIT.ORA or SPFILE) parameters.
Contents
In general, the SGA consists of the following sub-components, as can be verified by querying the
V$SGAINFO:
* Data buffer cache - cache data and index blocks for faster access.
* Redo Log Buffer - committed transactions that are not yet written to the redo log files.
NAME VALUE
-------------------- ----------
PGA (Program or Process Global Area) is a memory area (RAM) that stores data and control information
for a single process. For example, it typically contains a sort area, hash area, session cursor cache, etc.
PGA areas can be sized manually by setting parameters like hash_area_size, sort_area_size etc.
To allow Oracle to auto tune the PGA areas, set the WORKAREA_SIZE_POLICY parameter to AUTO and
the PGA_AGGREGATE_TARGET to the size of memory that can be used for PGA. This feature was
introduced in Oracle 9i.
****************************************************************************8
SGA : A group of shared memory structures that contain data and control information for one Oracle
database instance. If multiple users are concurrently connected to the same instance, then the data in
the instance's SGA is shared among the users. Consequently, the SGA is sometimes referred to as the
shared global area.
PGA : A memory buffer that contains data and control information for a server process. A PGA is created
by Oracle when a server process is started. The information in a PGA depends on the Oracle
configuration.
OR
The SGA is a read/write memory area that stores information shared by all database processes and by all
users of the database (sometimes it is called theShared Global Area).
This information includes both organizational data and control information used by the Oracle Server.
The size of the SGA can be established by a DBA by assigning a value to the parameter SGA_MAX_SIZE
in the parameter file—this is an optional parameter.
The SGA is allocated when an Oracle instance (database) is started up based on values specified in the
initialization parameter file (either PFILE or SPFILE).
The SGA has the following mandatory memory structures:
Java Pool
Streams Pool
o Library Cache
Other structures (for example, lock and latch management, statistical data)
Large Pool
One PGA exists for each Server Process and each Background Process. It stores data and control
information for a single Server Process or a single Background Process.
It is allocated when a process is created and the memory is scavenged by the operating system
when the process terminates. This is NOT a shared part of memory – one PGA to each process
only.
The collection of individual PGAs is the total instance PGA, or instance PGA.
Database initialization parameters set the size of the instance PGA, not individual PGAs.
The Program Global Area is also termed the Process Global Area (PGA) and is a part of memory
*******************************************************************************8
http://dbaforums.org/oracle/index.php?showtopic=2465
OR
all the memory segments that said processes allocate. An instance may or may not
have a database mounted (meaning controlfile is opened), and if it's mounted, it may
also open said database (all datafiles are online, instance is ready to accept user
connections).
SGA - "shared global area" or "system global area". This is the shared memory that's
allocated from the O/S at instance startup. It is SHARED. That is, all oracle server
processes have access to it. It contains many components which must be shared
among all users, the most popular examples being the buffer cache (Oracle's in-memory
image of datafile blocks), log buffer (Oracle's in-memory image of logfile blocks (well,
sort of, close enough, for now)), and the shared pool, (made up primarily of all the
PGA - "program global area" or "private global area". This is private, non-shared program
memory which only an individual server process has access to. It is mostly made up
of the process state object, which is a memory image of the work that's currently in
progress by that server process. (The process state object contains pointers to all
the other state objects that are currently being used by the process, such as session
There are also things called the UGA and CGA, but I don't want to go too far. Keeping
it simple....;-)
Hope that helps clarify these concepts. If you still have any question about the basic
functions of these components, read the Concepts Manual, read the Concepts Manual,
read the Concepts Manual. And, once you done that you should, that's right you guessed
read the Steve Adams book, Oracle 8i Internals! Don't be put off by the 8i reference
in the name, it's an *excellent* book, and in the area of internal database architecture,
while things have changed a bit, the fundamentals are still very much the same!
I have a question like how data is written in to datafiles and redo log files.
LGWR is used to write redo logs from RLBC to Online Redo Log Files.