DBAII_R1_1_Les10_E

Views:
 
Category: Education
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

User-Managed Backups : 

User-Managed Backups

Objectives : 

Objectives After completing this lesson, you should be able to do the following: Describe user-managed backup and recovery operations Discuss backup issues associated with read-only tablespaces Perform closed database backups Perform open database backups Back up the control file Perform cleanup after a failed online backup Use the DBVERIFY utility to detect corruption

Terminology : 

Terminology Whole database backup Target database may be open or closed Backup of all datafiles and the control file Partial database backups Tablespace Datafile Control file Consistent backups Inconsistent backups

User-Managed Backup and Recovery : 

User-Managed Backup and Recovery Files are backed up with operating system commands Backups are restored with operating system commands Recovery is accomplished using SQL and SQL*Plus commands

Querying Views to Obtain Database File Information : 

Querying Views to Obtain Database File Information V$DATAFILE V$CONTROLFILE V$LOGFILE DBA_DATA_FILES

Obtaining Database File Information : 

Obtaining Database File Information

Backup Methods : 

Backup Methods Physical backup Closed database NOARCHIVELOG mode Closed or open database ARCHIVELOG mode

Consistent Whole Database Backup(Closed Database Backup) : 

Consistent Whole Database Backup(Closed Database Backup) Datafiles Control files Passwordfile Online or offline storage Parameterfile Redo logfiles

Advantages of Making Consistent Whole Database Backups : 

Advantages of Making Consistent Whole Database Backups Conceptually simple Easy to perform Require little operator interaction

Making a Consistent Whole Database Backup : 

2 Making a Consistent Whole Database Backup 3 4 SHUTDOWN IMMEDIATE HOST cp <files> /backup/ STARTUP OPEN 1 Control files Passwordfile Parameter file Datafiles Redo log files

Open Database Backup : 

Open Database Backup Datafiles Control files Parameter file Archived redolog files Password file Online redolog files

Advantages of MakingOpen Database Backups : 

Advantages of MakingOpen Database Backups Maintains high database availability Can be done at a tablespace or datafile level Supports nonstop business operations

Open Database Backup Requirements : 

ARCHIVELOG mode Online redo log files Archived redo log files ARC0 052 051 053 051 052 053 LGWR 054 053 052 052 051 054 053 051 Open Database Backup Requirements

Open Database Backup Options : 

Open Database Backup Options Tablespace backup Tablespace USERS users02.dbf users01.dbf Datafile backup Tablespace USERS users01.dbf users02.dbf

Making a Backup of an Online Tablespace : 

Database Backup 144 143 Making a Backup of an Online Tablespace SQL> ALTER TABLESPACE users 2> BEGIN BACKUP; SQL> !cp /…/users01.dbf /BACKUP/users01.dbf Database Datafile 3 145 145 145 144 145 144

Ending the Online Tablespace Backup : 

Ending the Online Tablespace Backup SQL> ALTER TABLESPACE users 2> BEGIN BACKUP; SQL> !cp /…/users01.dbf /BACKUP/users01.dbf SQL> ALTER TABLESPACE users 2> END BACKUP; Database Backup 144 143 Database 145 145 145 144 145 145

Backup Status Information : 

Backup Status Information Dynamic views V$BACKUP V$DATAFILE_HEADER

Failure During Online Tablespace Backup : 

Failure During Online Tablespace Backup ALTER TABLESPACE usersBEGIN BACKUP; cp /…/users01.dbf /BACKUP/users01.dbf

Ending the Online Backup : 

Ending the Online Backup Query V$BACKUP to check backup status Issue the ALTER DATABASE command to change the status and unfreeze the header: Or use this command in Oracle9i: ALTER DATABASE DATAFILE ‘<filename>’ END BACKUP; ALTER DATABASE END BACKUP;

Read-Only Tablespace Backup : 

Read-Only Tablespace Backup ALTER TABLESPACE query_data READ ONLY; SCN 1 SCN 2 SCN 1 backup copy 1 2 SCN 2 3 4 Users File 1 File 1 Users File 2 Query_Data File 1 DBW0

Read-Only Tablespace Backup Issues : 

Read-Only Tablespace Backup Issues Only one backup is needed after altering the tablespace to read-only. Resume a normal backup schedule for that tablespace after making it read-write. The control file must correctly identify the tablespace in read-only mode; otherwise you must recover it.

Backup Issues with Logging and Nologging Options : 

Backup Issues with Logging and Nologging Options Nologging Logging All changes recorded to redo Minimal redo recorded Fully recoverable from last backup Not recoverable from last backup No additional backup May require additional backup

Manual Control File Backups : 

Manual Control File Backups Creating a binary image Creating a text trace file ALTER DATABASE BACKUP CONTROLFILE TO ‘control1.bkp`; ALTER DATABASE BACKUP CONTROLFILE TO TRACE;

Backing Up the Initialization Parameter File : 

Backing Up the Initialization Parameter File CREATE PFILE FROM SPFILE; CREATE PFILE = ‘/backup/init.ora’ FROM SPFILE;

Verifying Backups Using the DBVERIFY Utility : 

1 2 Verifying Backups Using the DBVERIFY Utility DBVERIFY Datafiles Online Errorreporting Offline 3 4 Online

DBVERIFY Command-Line Interface : 

DBVERIFY Command-Line Interface External command-line utility Used to ensure that a backup database or datafile is valid before a restore Can be a helpful diagnostic aid when data corruption problems are encountered %dbv file=/ORADATA/u03/users01.dbf logfile=dbv.log

Summary : 

Summary In this lesson, you should have learned how to: Determine which files require backup and when they should be backed up Make user-managed backups Backup the control file Backup the server initialization parameter file End an online backup that did not complete due to instance failure Use dynamic views to determine the status of backup operations Use DBVERIFY to verify the backup

Practice 10 Overview : 

Practice 10 Overview This practice covers the following topics: Performing a full offline database backup Performing an online backup of a tablespace datafile Creating a trace file of the control file

authorStream Live Help