Documente Academic
Documente Profesional
Documente Cultură
05/01/2012
TABLE OF CONTENTS
1. Oracle Architecture Oracle database and instance Archive log mode in Oracle Oracle Storage structures 2. Parameter files (spfile and pfile) 3. Dictionary views 4. Other Important DBA Queries . 5. Shutdown options in Oracle. 6. Basic Unix Commands for DBA. 7.Oracle Shared Server Vs Dedicated Server Architecture.
Domain : Life Sciences and Health Care. Author : Alamuru Prasadu Reddy. Mail id : alamuru.prasadureddy@tcs.com
TCS Public
ORACLE ARCHITECTURE
ORACLE DATABASE AND INSTANCE The database is the set of files stored on disk where as Instance (SGA+ PGA+ Process) is the collection of oracle background processes and memory. An instance can mount and open one and only one database whereas database can be mounted and opened by one or more instances. Multiple instances can run concurrently on the same computer, each accessing its own physical database. In large-scale cluster systems, Oracle Real Application Clusters enables multiple instances to mount a single database.
Internal Use
BACKGROUND PROCESSES : Following are the 5 mandatory Background processes : Data Base Writer Process (DBWn): Database Writer writes from database buffer cache to datafile. Database Writer writes the dirty buffer (modified) and cold buffer (which are not recently used) to the datafile. Database writer writes contents to the datafile when, Server process is not able to find the free buffers after searching a threshold No. of dirty buffers. DBWn periodically writes buffer to advance the checkpoint, which is the position in the redo log from where the instance recovery begins. Log Writer Process (LGWR): It is responsible for writing the contents of Redo log buffer to a redo log file on the disk. Redo is nothing but the information of changes made to the database. LGWR writes one contiguous portion of the buffer to disk. LGWR writes: A commit record when a user process commits a transaction. Redo log buffers o Every three seconds. o When the redo log buffer is one-third full. o When a DBWn process writes modified buffers to disk.
Internal Use
Checkpoint Process (CKPT): When a checkpoint occurs, Oracle must update the headers of all data files to record the details of the checkpoint .It also increments the SCN which acts as the starting point during instance recovery. SCN is the System Change Number that is assigned (& incremented) every time someone commits (i.e. transaction completes) and acts as the internal timestamp For Oracle. This is done by the CKPT process.
System Monitor Process (SMON): The system monitor process (SMON) performs instance recovery, if necessary (when the system shutdowns due to power cut or due the abrupt shut down of system), at instance startup. SMON is responsible for cleaning up of temporary segments that are no longer in use and coalescing contiguous free extents within dictionary managed table space. If any terminated transactions are skipped during instance recovery it recovers them when the table space is brought back online. Process Monitor Process (PMON): The process monitor performs process recovery when a user process fails or terminates abnormally. PMON is responsible for cleaning up the database buffer cache for failed /abnormally terminated process and freeing resources that the user process was using. It also rollbacks all the un committed data for this process.
Internal Use
Internal Use
SGA: (SYSTEM GLOBAL AREA) The System Global Area (SGA) is a group of shared memory areas that are dedicated to an Oracle instance (an instance is your database programs and RAM). SGA consists of database buffer cache, Redo buffer cache, shared pool, large pool, Stream pool, and Java pool. Database buffer cache: The database buffer cache is the portion of the SGA that holds Copies of Data blocks read from data files. The buffers in the cache are organized in two lists: the write list and the least recently used (LRU) list. The write list holds dirty buffers, which contain data that has been Modified but has not yet been written to disk. The LRU list holds Free buffers, pinned buffers, and dirty buffers that have not yet Been moved to the write list. Free buffers do not contain any Useful data and are available for use. Pinned buffers are currently Being accessed. Redo Buffer Cache: The redo log buffer is a circular buffer in the SGA that holds information about changes made to the database by INSERT, UPDATE, DELETE, CREATE, DROP or ALTER. Shared Pool: The shared pool portion of the SGA contains the library cache, the dictionary cache, buffers for parallel execution messages and control structures.
Internal Use
Large Pool (optional): It is used to provide large memory allocations for: Session memory for the shared server and the Oracle XA interface (used where transactions Interact with more than one database). I/O server processes. Oracle backup and restore operations. Java Pool (optional): Java pool memory is used in server memory for all session-specific Java code and data within the JVM. Streams Pool (optional): In a single database, we can specify that Streams of memory be allocated from a pool in the SGA called the Streams pool.
PGA: (PROGRAM GLOBAL AREA) A program global area (PGA) is a memory region that contains data and control information for a server process. It is a non shared memory created by Oracle when a server process is started. The PGA memory can be classified as follows: Private SQL Area: Private SQL area contains data such as bind information and runtime memory structures. Cursors and SQL Areas. Session Memory: Session memory is the memory allocated to hold a session's variables and other information related to the session.
Internal Use
Internal Use
ARCHIVE LOG MODE IN ORACLE Following are the steps to be followed to configure database in archive log mode. Set the Archive redo log destination directories. Shut down the database. Startup the database in mount mode. Then query ALTER DATABASE ARCHIVE LOG Open the database. Significance: When we enable this mode redo logs will be archived before overwriting it. Database backup can be taken even when database is in Open Mode when the database mode is in archive log mode. Database can be recovered till the time of failure if have all the archived log files. We can find out whether the database is in ARCHIVE LOG mode or NO ARCHIVELOG mode using the command . select log_mode from v$database.