Professional Documents
Culture Documents
ARCHITECTURE
1. 2. 3. 4. 5. is SGA,PGA,UGA is Shared pool, library cache, dictionary cache is buffer cache and redo log buffers are background processes are dirty buffers 6. constitute an Oracle instance? 7. is the function of checkpoint (ckpt)? 8. does dbwr write to the database ? 9. does lgwr write to the database ? 10. Undo management and UNDO_RETENTION 11. How to avoid snapshot too old error? 12. What is an Oracle Rollback Segment? 13. What does a Control file Contain? 14. Difference between db_name and db_unique_name 15. Difference between SID and service name 16. What are consistent gets/DB block gets and current mode gets? 17. Difference between Locks,Latches,Enquees? 18. What is logical IO? 19. Gets vs Readss What What What What What What What When When
What is SGA,PGA,UGA
Program Global area (pga) is a memory buffer that contains data and control information for a server process.
The User Global Area (UGA) is memory that is associated with a user session. The UGA normally comes from the SGA to allow migration of sessions across processes. session migration is disabled, UGA memory will be allocated from the PGA.
If
The Process Global Area (PGA) is memory which is physically private to a process (cannot be accessed by another process). Note that an OS process and an Oracle session are not equivalent. The PGA, unlike the SGA, can grow at runtime. So, in dedicated server mode, when session migration is not needed, the UGA is in the PGA is in the individual process.
Undo management
Storing Undo Records Undo records can be stored in either rollback segments or undo tablespaces. Rollback Segment Undo Rollback segments have traditionally stored undo information used by several functions of Oracle. During database recovery, after all changes recorded in the redo log have been applied, Oracle uses rollback segment information to undo any uncommitted transactions. Because rollback segments are stored in the database buffers, this important recovery information is automatically protected by the redo log. UNDO_MANAGEMENT=MANUAL Automatic Undo Automatic undo management enables a DBA to exert control over how long undo records are retained before being overwritten. Automatic undo management mode is more efficient, and less complex to implement and manage than rollback segment undo. UNDO_MANAGEMENT=AUTO Managing Undo The UNDO_POOL directive enables DBAs to control runaway transactions by grouping users into consumer groups, with each group assigned a maximum undo space limit. Whenever the total undo space consumed by a group exceeds the limit, its users are not allowed to make any further updates, until undo space is freed up by other members (after their transactions commit or abort).
In addition to space management, a DBA can specify an UNDO_RETENTION period to minimise occurences of the "snapshot too old" error. You can set this at startup or with the ALTER SYSTEM statement. e.g. set retention to 20 minutes (1200 seconds): ALTER SYSTEM SET UNDO_RETENTION = 1200; An important caveat with this is that Oracle will not reuse space (wrap the rollback segment back around over itself) while there is an active transaction. So if you run a one hour long transaction and have a 20 minute retention - then the undo tablespace will still continue to grow for the whole hour. If the undo space is less than the longest running transaction, you will get a 'failure to extend' error and the transaction will fail and roll back. Even when the retention period has passed Oracle does not actively delete data from undo, it will simply be overwritten by the next transaction.
What are consistent gets/DB block gets and current mode gets?
A 'db block get' is a current mode get. That is, it's the most up-to-date copy of the data in that block, as it is right now, or currently. There can only be one current copy of a block in the buffer cache at
any time. Db block gets generally are used when DML changes data in the database. In that case, row-level locks are implicitly taken on the updated rows. A 'consistent get' is when Oracle gets the data in a block which is consistent with a given point in time, or SCN. Explanation with example:
CurrentModeSession1.sql
CurrentModeSession2.sql