Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing.

Similar presentations


Presentation on theme: "1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing."— Presentation transcript:

1 1 Oracle Architectural Components

2 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing a query Listing the stages in processing a DML statement Listing the stages in processing COMMITS Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing a query Listing the stages in processing a DML statement Listing the stages in processing COMMITS

3 1-3 The Oracle Server Server Application/ network server Users Oracle server

4 1-4 Connecting to a Database User Client Server Server process Oracle server User process

5 1-5 User Process Runs on the client machine Is spawned when a tool or an application is invoked Runs the tool or application (SQL*Plus, Server Manager, Oracle Enterprise Manager, Developer/2000) Includes the User Program Interface (UPI) Generates calls to the Oracle server Runs on the client machine Is spawned when a tool or an application is invoked Runs the tool or application (SQL*Plus, Server Manager, Oracle Enterprise Manager, Developer/2000) Includes the User Program Interface (UPI) Generates calls to the Oracle server

6 1-6 Server Process Runs on the server machine (host) Services a single user process in the dedicated server configuration Uses an exclusive PGA Includes the Oracle Program Interface (OPI) Processes calls generated by the client Returns results to the client Runs on the server machine (host) Services a single user process in the dedicated server configuration Uses an exclusive PGA Includes the Oracle Program Interface (OPI) Processes calls generated by the client Returns results to the client

7 1-7 Oracle Instance Background processes An Oracle instance: Is a means to access an Oracle database Always opens one and only one database An Oracle instance: Is a means to access an Oracle database Always opens one and only one database Instance SGA

8 1-8 Oracle Database Control files Redo log files Data files Password file Parameter file Archived log files Database

9 1-9 Other Key Physical Structures Archived log files Password file Parameter file

10 1-10 Processing a Query Parse: Parse: - Search for identical statement -Check syntax, object names, privileges - Lock objects used during parse -Create and store execution plan Execute: identify rows selected Execute: identify rows selected Fetch: return rows to user process Fetch: return rows to user process

11 1-11 User process Server process Processing a Query (cont.) Parse Statement OK Handle Execute OK Handle Fetch Results SELECT * FROM emp ORDER BY ename; SELECT * FROM emp ORDER BY ename;

12 1-12 The Shared Pool Size defined by SHARED_POOL_SIZE Library cache contains statement text, parsed code, and an execution plan Data dictionary cache contains table and column definitions and privileges Size defined by SHARED_POOL_SIZE Library cache contains statement text, parsed code, and an execution plan Data dictionary cache contains table and column definitions and privileges Shared pool Library cache Data dictionary cache

13 1-13 Database Buffer Cache Number of buffers defined by DB_BLOCK_BUFFERS Size of a buffer based on DB_BLOCK_SIZE Stores the most recently used blocks Number of buffers defined by DB_BLOCK_BUFFERS Size of a buffer based on DB_BLOCK_SIZE Stores the most recently used blocks

14 1-14 Program Global Area (PGA) Not shared and not writable Contains – Sort area – Session information – Cursor state – Stack space Not shared and not writable Contains – Sort area – Session information – Cursor state – Stack space PGA Server process

15 1-15 Processing a DML Statement 1.If data blocks not in the buffer, server process reads them into the buffer 2.Server process places locks on rows to be modified 3.The redo log buffer is modified with the changed values 4.The data blocks are changed 5.Before image is recorded in the rollback block

16 1-16 Instance SGA Shared pool Library cache Redo log buffer Database buffer cache Data dictionary cache UPDATE emp SET sal=sal*1.1 WHERE empno=7369 UPDATE emp SET sal=sal*1.1 WHERE empno=7369 Processing a DML Statement (cont.) 1 Server process Control files Redo log files Data files Database 2 3 4 5

17 1-17 Rollback Segment DML statement Old image New image Rollback segment Table

18 1-18 Redo Log Buffer Size defined by LOG_BUFFER Records changes made through the instance Used sequentially Circular buffer Size defined by LOG_BUFFER Records changes made through the instance Used sequentially Circular buffer

19 1-19 Other Instance Processes Other required processesOther required processes - Database Write (DBW0) - Log Writer (LGWR) - Process Monitor (PMON) - System Monitor (SMON) - Checkpoint (CKPT) Archive process (ARC0) is optional; is used in production databaseArchive process (ARC0) is optional; is used in production database

20 1-20 Instance SGA Shared pool DBWR Database buffer cache Database Writer (DBWR) Control files Redo log files Data files DBW0 writes when: There are many dirty buffers There are many dirty buffers There are few free buffers There are few free buffers Timeout occurs Timeout occurs Checkpoint occurs Checkpoint occurs

21 1-21 Instance SGA Shared pool Redo log buffer LGWR Log Writer (LGWR) Control files Redo log files Data files LGWR writes when: There is a commit There is a commit The redo log buffer is one-third full The redo log buffer is one-third full There is more than 1MB of redo There is more than 1MB of redo Before DBW0 writes Before DBW0 writes

22 1-22 COMMIT Processing 1.Server process places a commit record and system change number (SCN) in redo log buffer. 2.LGWR writes redo log to redo log files. 3.User is informed COMMIT is complete 4.Server process records trans. Is complete and locks can be released.

23 1-23 Shared pool Redo log buffer LGWR Control files Redo log files Data files Database COMMIT Processing (cont.) Server process 1 2 User process 3 Database buffer cache 4 SGA Instance

24 1-24 SMON: System Monitor Automatically recovers the instance Automatically recovers the instance -Rolls forward changes in redo logs -Opens the database for user access -Rolls back uncommitted transactions Coalesces free spaces Coalesces free spaces Deallocates temporary segments Deallocates temporary segments

25 1-25 PMON: Process Monitor Cleans up after failed processes by: Rolling back the transaction Rolling back the transaction Releasing locks Releasing locks Releasing other resources Releasing other resources

26 1-26 Archiving Database archive mode Database archive mode - NOARCHIVELOG for databases that do not require recovery after disk failure - ARCHIVELOG mode for production ARC0 processARC0 process Automatically archives online redo log files Automatically archives online redo log files Preserves the record of all changes made to the database Preserves the record of all changes made to the database

27 1-27 Instance SGA Shared pool DBWRLGWR Database Control files Data files Redo log files User process Server process PGA Summary Password file Archived log files Parameter file

28 1-28 Summary (cont.) You should have learned: Explain the SGA, Instance, memory structures Explain the SGA, Instance, memory structures Explain the database files Explain the database files Explain the primary background processes (DBW0, LGWR, CKPT, PMON, SMON, ARC0) Explain the primary background processes (DBW0, LGWR, CKPT, PMON, SMON, ARC0) Explain SQL processing stepsExplain SQL processing steps Explain the COMMIT processExplain the COMMIT process


Download ppt "1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing."

Similar presentations


Ads by Google