Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Saturday 9 August 2014

Oracle Architecture

Now let’s see what the actual oracle architecture is:-


What is oracle instance?

Oracle instance is a collection of memory structure and background processes. Oracle allocates a memory area called the System Global Area (SGA) and starts one or more Oracle processes.

What is SGA?

The SGA is a shared memory area that contains data and control information for the particular instance. Multiple users can share data within this memory area and information stored in the SGA can avoid repeated access from physical disk, a time consuming operation.

SGA consist of:-
·       
  Shared pool
  ·         Large pool
  ·         database buffer cache
  ·         Redo log buffer cache
  ·         Java pool
  ·         Streams pool

What is shared pool?
The shared pool caches information that can be shared among users. Some examples:
  • SQL statements are cached so that they can be reused.
  • Information from the data dictionary such as user account data, table and index descriptions, and privileges is cached for quick access and reusability.
  • Stored procedures, which are executable code that is stored in the database, can be cached for faster access.
What is large pool?

This is an optional area that is used for buffering large I/O requests for various server processes.

What is database buffer cache?

Before any data stored in the database can be queried or modified, it must be read from disk and stored in memory. The buffer cache is the component of the SGA that acts as the buffer to store any data being queried or modified. All user processes connected to the database share access to the buffer cache.

What is redo log buffer cache?

This buffer improves performance by caching redo information (used for instance recovery) until it can be written at once and at a more opportune time to the physical redo log files that are stored on disk.

What is java pool?

The Java pool memory is used for all session-specific Java code and data within the Java Virtual Machine (JVM).

What is streams pool?

The Streams pool is used by the Oracle Streams product.

What are the Background processes?

Oracle creates a set of background processes for an instance that interact with each other and with the operating system to manage memory structure, asynchronously perform I/O to write data to disk. They asynchronously perform I/O and monitor other Oracle processes to provide increased parallelism for better performance and reliability. There are many background processes but we will look into the major ones only:-
      ·         SMON
      ·         PMON
      ·         DBWR
      ·         LGWR
      ·         CKPT
What is SMON?

SMON stands for system monitor. The system monitor performs crash recovery when a failed instance starts up again.

For example, I you are updating a table and all of us sudden power gets’ down you don’t have backup and your server is shutdown. When you again startup the oracle database that time system monitor (SMON) will make sure that your database is in the state on which it was when power shutdown occurs.

What is PMON?

PMON stands for Process monitor. PMON monitors the other background processes and performs process recovery when a server or dispatcher process terminates abnormally.

For example, PMON resets the status of the active transaction table, releases locks that are no longer required, and removes the process ID from the list of active processes.

What is DBWR?

DBWR stands for database writer. It is use to write contents of database buffer to database files. It also writes modified buffers to data files. DBWR background process writes data on data file periodically.

For example, if you have updated records and commit that update statement, it means you are ready to permanently save the changes. Periodically check point process runs on the database which tells DBWR process to write data on the data file.

What is CKPT?

CKPT stands for checkpoint .The checkpoint background process, updates the control file and data file headers with checkpoint information and signals DBWR to write blocks to disk.
What is LGWR?

LGWR stands for log writer. The log writer process (LGWR) manages the redo log buffer. LGWR writes one continuous portion of the buffer to the online redo log. By separating the tasks of modifying database buffers, performing scattered writes of dirty buffers to disk, and performing fast sequential writes of redo to disk, the database improves performance.

What are the different types of files?

·         Data file
·         Redo Log Files
·         Control Files
·         Parameter File
·         Archive File
·         Trace File
·         Alert log file
What is data file?

Data files are physical files of the operating system that store the data of all logical structures in the database. In simple words data file holds the actual data of the database.


What is redo log file?

The most crucial structure for recovery operations is the redo log, which consists of two or more pre-allocated files that store all changes made to the database as they occur. Every instance of an Oracle Database has an associated redo log to protect the database in case of an instance failure.

What is control file?

Every Oracle Database has a control file, which is a small binary file that records the physical structure of the database. The control file includes:
·         The database name
·         Names and locations of associated data files and redo log files
·         The timestamp of the database creation
·         The current log sequence number
·         Checkpoint information

What is parameter file (PFile)?

A parameter file is a file that contains a list of initialization parameters and a value for each parameter. You specify initialization parameters in a parameter file that reflect your particular installation. Oracle supports the following two types of parameter files:
  • Server Parameter Files
  • Initialization Parameter Files
Server Parameter Files
A server parameter file is a binary file that acts as a repository for initialization parameters. The server parameter file can reside on the machine where the Oracle database server executes. Initialization parameters stored in a server parameter file are persistent, in that any changes made to the parameters while an instance is running can persist across instance shutdown and startup.

Initialization Parameter Files:-

An initialization parameter file is a text file that contains a list of initialization parameters. The file should be written in the client's default character set.

What is archive file?

When your database is in Archive log mode, archive log file starts or stops automatic archiving of online redo log files, manually archives specified redo log files, or displays information about redo log files.

What is trace file?

Trace files are stored in the Automatic Diagnostic Repository, in the trace directory under each ADR home. To help you locate individual trace files within this directory, you can use data dictionary views. For example, you can find the path to your current session's trace file or to the trace file for each Oracle Database process.

What is alert log file?

The alert log file is a chronological log of messages and errors written out by an Oracle Database. You can find messages in this file like: database startup, shutdown, log switches, space errors, etc. A good database administrator constantly monitors this file to detect unexpected errors and corruption.


Read Also:-  What is PL/SQL?

No comments:

Post a Comment

Please provide your feedback in the comments section above. Please don't forget to follow.