Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

DBA - Fundamemtal

Back


DBA Responsibilities

# Explicitly connect with the SYSDBA role:
$ rman target "'/ as sysbackup'"
# connected to target database: ORCL (DBID=1297344416)

# For backward compatibility
rman target / connects as SYSDBA.

Categories of Failure

Failures can generally be divided into the following categories:


Statement Failure

Typical Problems Possible Solutions
Attempts to enter invalid data into a table Work with users to validate and correct data.
Attempts to perform operations with insufficient privileges Provide the appropriate object or system privileges.
Attempts to allocate space that fails Enable resumable space allocation. Increase owner quota. Add space to the tablespace.
Logic errors in applications Work with developers to correct program errors.

User Process Failure

Typical Problems Possible Solutions
A user performs an abnormal disconnect. A DBA’s action is not usually needed to resolve user process failures.
A user’s session is abnormally terminated. Instance background processes roll back uncommitted changes and release locks.
A user experiences a program error that terminates the session. The DBA should watch for trends.

Network Failure

Typical Problems Possible Solutions
Listener fails Configure a backup listener and connect-time failover.
Network interface card (NIC) fails Configure multiple network cards.
Network connection fails Configure a backup network connection.

User Error

Typical Problems Possible Solutions
User inadvertently(疏忽地) deletes or modifies data Roll back a transaction and dependent transactions or rewind the table
User drops a table Recover the table from recycle bin; Recover the table from a backup

Instance Failure


Media Failure


Data Failures


Instance Recovery


The Checkpoint (CKPT) Process

ckpt


Redo Log Files and the Log Writer (LGWR) Process

lgwr01


Database Log Mode

NOARCHIVELOG mode ARCHIVELOG mode
Closed database Open database
Recovery to the last backup Recovery to last committed transaction
Suitable for training and test environments, for data warehouses with infrequent loads Suitable for production environments

logmode


Automatic Instance Recovery or Crash Recovery


Phases of Instance Recovery

  1. Instance startup (data files are out of sync)
  2. Roll forward (redo)
  3. Committed and uncommitted data in files
  4. Database opened
  5. Roll back (undo)
  6. Committed data in files

instance_recovery01


Tuning Instance Recovery

tunning01


Using the MTTR Advisor


Restoring and Recovering

restore_recovery01


Comparing Complete and Incomplete Recovery

complete_pitr


The Complete Recovery Process

complete_recovery01

The following steps describe what takes place during complete recovery:

  1. Damaged or missing files are restored from a backup.
  2. Changes from incremental backups, archived redo log files, and online redo log files are applied as necessary.
    • The redo log changes are applied to the data files until the current online log is reached and the most recent changes have been reapplied.
    • Undo blocks are generated during this entire process.
    • This is referred to as rolling forward or cache recovery.
  3. The restored data files may now contain committed and uncommitted changes.
  4. The undo blocks are used to roll back any uncommitted changes.
    • This is sometimes referred to as transaction recovery.
  5. The data files are now in a recovered state and are consistent with the other data files in the database.

The Point-in-Time Recovery Process

pit_recovery01


Oracle Data Protection Solutions

Backup and Recovery Objective Recovery Time Objective (RTO) Oracle Solution
Physical data protection Hours/Days Recovery Manager; Oracle Secure Backup
Logical data protection Minutes/Hours Flashback Technologies
Recovery analysis Minimize time for problem; identification and recovery planning Data Recovery Advisor
Disaster Recovery Objective Recovery Time Objective (RTO) Oracle Solution
Physical data protection Seconds/Minutes Data Guard;Active Data Guard

Flashback Technology




TOP