Oracle Basics

Oracle Architecture 

Oracle server:  An Oracle server includes an Oracle Instance and an Oracle database.  
·        An Oracle database includes several different types of files:  datafiles, control files, redo log files and archive redo log files.  The Oracle server also accesses parameter files and password files. 
·        This set of files has several purposes. 
o   One is to enable system users to process SQL statements. 
o   Another is to improve system performance. 
o   Still another is to ensure the database can be recovered if there is a software/hardware failure.
·        The database server must manage large amounts of data in a multi-user environment. 
·        The server must manage concurrent access to the same data. 
·        The server must deliver high performance.  This generally means fast response times.

Oracle instance:  An Oracle Instance consists of two different sets of components:
·        The first component set is the set of background processes (PMON, SMON, RECO, DBW0, LGWR, CKPT, D000 and others). 
o   These will be covered later in detail – each background process is a computer program. 
o   These processes perform input/output and monitor other Oracle processes to provide good performance and database reliability. 
·        The second component set includes the memory structures that comprise the Oracle instance. 
o   When an instance starts up, a memory structure called the System Global Area (SGA) is allocated. 
o   At this point the background processes also start. 
·        An Oracle Instance provides access to one and only one Oracle database.   

Oracle database: An Oracle database consists of files. 
·        Sometimes these are referred to as operating system files, but they are actually database files that store the database information that a firm or organization needs in order to operate. 
·        The redo log files are used to recover the database in the event of application program failures, instance failures and other minor failures.
·        The archived redo log files are used to recover the database if a disk fails. 
·        Other files not shown in the figure include:
o   The required parameter file that is used to specify parameters for configuring an Oracle instance when it starts up. 
o   The optional password file authenticates special users of the database – these are termed privileged users and include database administrators. 
o   Alert and Trace Log Files – these files store information about errors and actions taken that affect the configuration of the database.

User and server processes:  The processes shown in the figure are called user and server processes.  These processes are used to manage the execution of SQL statements.
·        Shared Server Process can share memory and variable processing for multiple user processes.
·        Dedicated Server Process manages memory and variables for a single user process.


Ref : http://www.siue.edu/~dbock/cmis565/module1-architecture.htm


Difference between Rolling back and Rolling forward

Rolling back and Rolling forward are the two most common operations performed during instance recovery.

Have a look how they are different in nature.However first rolling forward occurs then rolling back 
during crash recovery:


Rolling forward: 

During this operation, the Oracle server will update all datafiles with the information from the redo log files. 
The online redo log files are always written to before the data is recorded in the datafiles. 
Thus, an instance recovery may usually leave the online log files “ahead” of the datafiles.

Rolling back: 

During this operation, uncommitted changes that were added to the datafiles during the rollforward operation are rolled back. Oracle does this by using the undo tablespace contents to return uncommitted changes to their original states. 
At the end of the rollback stage, only committed data at the time of the instance failure is retained in the datafiles.







Source  :   http://vishwanath-dbahelp.blogspot.com

No comments:

Post a Comment

Oracle row type vs PostgreSQL record

The Oracle row type concept can be accomplished with the record type in PostgreSQL. Example: Oracle: CURSOR travel_cur IS  SELECT  c.travel_...