Data Changes Flashcards

1
Q

When is the logbuffer refreshed?

A

The log buffer is 1/3rd full

Log buffer has 1mb of redo data

Three seconds since last flush

Commit has been performed

Checkpoint occurs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What can end a change?

A

COMMIT or ROLLBACK

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the process for instance recovery?

A

Recover data files

Apply redo logs files (roll forward)

Apply undo data from undo tbspc (roll back uncommitted changes).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the process for a transaction?

A
  • Statement is issued
  • Optimizer determines best way to retrieve data and pushes it to buffer cache
  • Change is made to buffer cache data (uncommitted yet)
  • Old data is written to undo tbspc and to redo log buffer.
  • Any other users see the DB as DB+Undo (old state before commit)
  • Redo log buffer gets flushed at least every 3 seconds to redo log files by LGWR.
  • Upon commit, committed change is written to redo log buffer.
  • Upon checkpoint, changes (dirty blocks in buffer cache) are written to data files by DBWn.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

UNDO_MANAGEMENT

A

Requires restart

MANUAL or AUTO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

UNDO_TABLESPACE

A

When in automatic undo mgmt mode, this specifies the undo tbspc to use for read consistency.

If this initparam is not specified, the first available undo tbspc is assigned at startup. Use SHOW PARAMETER to see which one it chose.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

UNDO_RETENTION

A

Specifies, in seconds, how long committed undo info should be retained until it is overwritten.

Setting to 0 turns on automatic undo retention tuning, tuned to satisfy the longest running query to date.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Flashback Query

A

Query data as it existed in the past.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Flashback version query

A

Query versions of rows that existed for a specified window of time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Flashback transaction

A

Backs out a transaction and its dependent transactions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Flashback Table

A

Point in time recovery of an individual table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

RETENTION GUARANTEE

A

Not an initparam. Used in ALTER like this:

ALTER TABLESPACE undotbs1 RETENTION GUARANTEE

Prioritizes undo retention over DML failure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

V$UNDOSTAT

A

Collects 10-minute snapshots of the undo tbspc consumption.

OEM uses it in conjunction with UNDO_RETENTION parameter and DB block size to provide an optimal undo tbspc size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

SELECT … FOR UPDATE

A

Select that locks corresponding rows.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Table lock mode: Row Share

A

Permits concurrent access to locked table but prohibits exclusive table locks from other users.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Table lock mode: Row Exclusive

A

Permits concurrent access to locked table but prohibits exclusive or share mode locks from other users. Default for UPDATE, INSERT, DELETE.

17
Q

Table lock mode: Share

A

Permits concurrent queries but prohibits updates to the table. Required and used by default on CREATE INDEX.

18
Q

Table lock mode: Share Row Exclusive

A

Permits queries but prohibits Share mode locks from other users or row updates.

19
Q

Table lock mode: Exclusive

A

Permits queries but prohibits DML from other users. Required and default for DROP TABLE.

20
Q

NOWAIT mode

A

LOCK TABLE employees IN EXCLUSIVE MODE NOWAIT

Works for any mode. Returns control to user if locks exist rather than waiting through the lock queue.

21
Q

WAIT mode

A

LOCK TABLE employees IN EXCLUSIVE MODE WAIT 60

Works for any mode. If locks exist, it enters the lock queue but exits and returns control after the specified number of seconds.