Presentation is loading. Please wait.

Presentation is loading. Please wait.

10 Copyright © Oracle Corporation, 2002. All rights reserved. User-Managed Backups.

Similar presentations


Presentation on theme: "10 Copyright © Oracle Corporation, 2002. All rights reserved. User-Managed Backups."— Presentation transcript:

1 10 Copyright © Oracle Corporation, 2002. All rights reserved. User-Managed Backups

2 10-2 Copyright © Oracle Corporation, 2002. All rights reserved. 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

3 10-3 Copyright © Oracle Corporation, 2002. All rights reserved. Terminology Whole database backup –Target database may be open or closed –Backup of all datafiles and the control file Partial database backups –Tablespace –Data file –Control file Consistent backups Inconsistent backups

4 10-4 Copyright © Oracle Corporation, 2002. All rights reserved.

5 10-5 Copyright © Oracle Corporation, 2002. All rights reserved. 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

6 10-6 Copyright © Oracle Corporation, 2002. All rights reserved. Querying Views to Obtain Database File Information V$DATAFILE V$CONTROLFILE V$LOGFILE DBA_DATA_FILES

7 10-7 Copyright © Oracle Corporation, 2002. All rights reserved.

8 10-8 Copyright © Oracle Corporation, 2002. All rights reserved. Obtaining Database File Information

9 10-9 Copyright © Oracle Corporation, 2002. All rights reserved. Backup Methods Physical backup Closed database NOARCHIVELOG mode Closed or open database ARCHIVELOG mode

10 10-10 Copyright © Oracle Corporation, 2002. All rights reserved. Consistent Whole Database Backup (Closed Database Backup) Data filesControl files Password file Online or offline storage Parameter file Redo log files

11 10-11 Copyright © Oracle Corporation, 2002. All rights reserved. Advantages of Making Consistent Whole Database Backups Conceptually simple Easy to perform Require little operator interaction

12 10-12 Copyright © Oracle Corporation, 2002. All rights reserved.

13 10-13 Copyright © Oracle Corporation, 2002. All rights reserved. 2 Making a Consistent Whole Database Backup 3 4 SHUTDOWN IMMEDIATE HOST cp /backup/ STARTUP OPEN 1 Control files Password file Parameter file DatafilesRedo log files

14 10-14 Copyright © Oracle Corporation, 2002. All rights reserved.

15 10-15 Copyright © Oracle Corporation, 2002. All rights reserved. Open Database Backup Datafiles Control files Parameter file Archived redo log files Password file Online redo log files

16 10-16 Copyright © Oracle Corporation, 2002. All rights reserved. Advantages of Making Open Database Backups Maintains high database availability Can be done at a tablespace or datafile level Supports nonstop business operations

17 10-17 Copyright © Oracle Corporation, 2002. All rights reserved. ARCHIVELOG mode Online redo log files Archived redo log files ARC0 052 051 053 051 052 053 LGWR 054053 052 051 054 053 051 Open Database Backup Requirements

18 10-18 Copyright © Oracle Corporation, 2002. All rights reserved. Open Database Backup Options Tablespace backup Tablespace USERS users02.dbfusers01.dbf Datafile backup Tablespace USERS users01.dbfusers02.dbf

19 10-19 Copyright © Oracle Corporation, 2002. All rights reserved. Database Backup Datafile 2 144 Datafile 1 143 Making a Backup of an Online Tablespace SQL> ALTER TABLESPACE users 2> BEGIN BACKUP; SQL> !cp / … /users01.dbf /BACKUP/users01.dbf Database Datafile 1Datafile 2 Datafile 3 Control files Redo log file 1 Redo log file 2 145 144 145 144

20 10-20 Copyright © Oracle Corporation, 2002. All rights reserved. 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 Datafile 2 144 Datafile 1 143 Database Datafile 1Datafile 2Datafile 3 Control files Redo log file 1 Redo log file 2 145 144 145

21 10-21 Copyright © Oracle Corporation, 2002. All rights reserved. Backup Status Information V$BACKUP

22 10-22 Copyright © Oracle Corporation, 2002. All rights reserved.

23 10-23 Copyright © Oracle Corporation, 2002. All rights reserved. Failure During Online Tablespace Backup ALTER TABLESPACE users BEGIN BACKUP; cp /…/users01.dbf /BACKUP/users01.dbf Datafile 3 Redo log file 2 Control files Redo log file 1 Datafile 1 Database 144 145 144 Datafile 2 144 Datafile 3 Redo log file 2 Control files Redo log file 1 Datafile 1 Database 146 145 146 Datafile 2 144

24 10-24 Copyright © Oracle Corporation, 2002. All rights reserved. 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 Oracle9 i : ALTER DATABASE DATAFILE ‘ ’ END BACKUP; ALTER DATABASE END BACKUP;

25 10-25 Copyright © Oracle Corporation, 2002. All rights reserved.

26 10-26 Copyright © Oracle Corporation, 2002. All rights reserved. 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

27 10-27 Copyright © Oracle Corporation, 2002. All rights reserved. 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.

28 10-28 Copyright © Oracle Corporation, 2002. All rights reserved. Backup Issues with LOGGING and NOLOGGING Options NOLOGGINGLOGGING 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

29 10-29 Copyright © Oracle Corporation, 2002. All rights reserved. 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;

30 10-30 Copyright © Oracle Corporation, 2002. All rights reserved.

31 10-31 Copyright © Oracle Corporation, 2002. All rights reserved. Backing Up the Initialization Parameter File CREATE PFILE FROM SPFILE; CREATE PFILE = '/backup/init.ora' FROM SPFILE;

32 10-32 Copyright © Oracle Corporation, 2002. All rights reserved. 12 Verifying Backups Using the DBVERIFY Utility DBVERIFY datafiles Online Error reporting Offline 3 4 Online

33 10-33 Copyright © Oracle Corporation, 2002. All rights reserved. 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

34 10-34 Copyright © Oracle Corporation, 2002. All rights reserved.

35 10-35 Copyright © Oracle Corporation, 2002. All rights reserved. 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

36 10-36 Copyright © Oracle Corporation, 2002. All rights reserved. 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

37 10-37 Copyright © Oracle Corporation, 2002. All rights reserved.

38 10-38 Copyright © Oracle Corporation, 2002. All rights reserved.


Download ppt "10 Copyright © Oracle Corporation, 2002. All rights reserved. User-Managed Backups."

Similar presentations


Ads by Google