• No results found

Creating an Archival Backup Overview

In document D78850GC20_ag (Page 103-109)

Practices for Lesson 7: Improving Your Backups

Practice 7-2: Creating an Archival Backup Overview

In this practice, you create an archival backup, that is, a backup that is not under your normal retention policies and it is not in your normal FRA destination. This KEEP FOREVER database backup could be used for recovery if some of your later hands-on activities were to require it. Archival backups can be created with an open or with a mounted database.

Assumptions

You are in a terminal window as the oracle OS user, pointing to the orcl database instance.

Tasks

1. Log in to RMAN by using the recovery catalog.

$ rman target "'/ as sysbackup'" catalog rcatowner@rcat ...

recovery catalog database Password: oracle_4U <<<not displayed connected to recovery catalog database

RMAN>

2. Shut down and restart the database instance so you can create a backup copy of the entire database in a mounted state.

RMAN> SHUTDOWN IMMEDIATE;

starting full resync of recovery catalog full resync complete

database closed database dismounted

Oracle instance shut down

RMAN> STARTUP MOUNT;

connected to target database (not started) Oracle instance started

database mounted

Total System Global Area 536870912 bytes

Fixed Size 2926472 bytes

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Practices for Lesson 7: Improving Your Backups

Chapter 7 - Page 14

3. Backup your ORCL database as an archival backup. Expect an error. RMAN> backup as copy database keep forever; Starting backup at 2014-12-11:09:10:27

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=12 device type=DISK backup will never be obsolete

archived logs required to recover from this backup will be backed up

channel ORA_DISK_1: starting datafile copy input datafile file number=00005

name=/u01/app/oracle/oradata/orcl/example01.dbf

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/11/2014 09:10:29

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run channel ORA_DISK_1: starting datafile copy

input datafile file number=00003

name=/u01/app/oracle/oradata/orcl/sysaux01.dbf

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/11/2014 09:10:29

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run channel ORA_DISK_1: starting datafile copy

input datafile file number=00001

name=/u01/app/oracle/oradata/orcl/system01.dbf

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/11/2014 09:10:29

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run channel ORA_DISK_1: starting datafile copy

input datafile file number=00004

name=/u01/app/oracle/oradata/orcl/undotbs01.dbf

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/11/2014 09:10:30

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run channel ORA_DISK_1: starting datafile copy

input datafile file number=00006

name=/u01/app/oracle/oradata/orcl/users01.dbf

RMAN-00571:

=========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571:

=========================================================== RMAN-03002: failure of backup command at 12/11/2014 09:10:30 ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

RMAN>

Question: Why did the backup command fail?

Possible answer: It failed because a backup with the KEEP attribute (an archival backup) cannot be written to the Flash Recovery Area. Allowing this has the potential of causing the Flash Recovery Area to quickly run out of space. This error forces you to specify a different location.

4. Create an archival backup with a FORMAT clause that creates the backup in the /u01/backup directory.

RMAN> BACKUP DATABASE FORMAT '/u01/backup/%U' TAG keep_db_tag KEEP forever RESTORE POINT KEEPDB;

Starting backup at 2014-12-11:09:13:36

using channel ORA_DISK_1 backup will never be obsolete

archived logs required to recover from this backup will be backed up

channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00005

name=/u01/app/oracle/oradata/orcl/example01.dbf input datafile file number=00003

name=/u01/app/oracle/oradata/orcl/sysaux01.dbf input datafile file number=00001

name=/u01/app/oracle/oradata/orcl/system01.dbf input datafile file number=00004

name=/u01/app/oracle/oradata/orcl/undotbs01.dbf input datafile file number=00006

name=/u01/app/oracle/oradata/orcl/users01.dbf

channel ORA_DISK_1: starting piece 1 at 2014-12-11:09:13:36

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Practices for Lesson 7: Improving Your Backups

Chapter 7 - Page 16 using channel ORA_DISK_1

backup will never be obsolete

archived logs will not be kept or backed up

channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current SPFILE in backup set

channel ORA_DISK_1: starting piece 1 at 2014-12-11:09:14:33 channel ORA_DISK_1: finished piece 1 at 2014-12-11:09:14:34 piece handle=/u01/backup/0tppsr3p_1_1 tag=KEEP_DB_TAG

comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

using channel ORA_DISK_1 backup will never be obsolete

archived logs will not be kept or backed up

channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set

channel ORA_DISK_1: starting piece 1 at 2014-12-11:09:14:36 channel ORA_DISK_1: finished piece 1 at 2014-12-11:09:14:37 piece handle=/u01/backup/0uppsr3r_1_1 tag=KEEP_DB_TAG

comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 2014-12-11:09:14:37

RMAN>

5. Open the database and exit RMAN. RMAN> alter database open; Statement processed

RMAN> exit $

6. For an alternate view of the backups, optionally, log in to Cloud Control as the SYSMAN user and navigate to Availability > Backup & Recovery > Manage Current Backups. (Look for the KEEP_DB_TAG tag.)

7. If you do not see your archival backup (that is, there is no backup with Forever in the Keep column), then:

a. Set the NC_ORCL_HOST_ORACLE host credentials at the bottom of the page, click Crosscheck All.

b. Execute the job Immediately. Click Submit Job > View Job to confirm that the job execution succeeds.

c. When the job succeeded, navigate again to the Manage Current Backups page (for example via: History > orcl > Availability > Backup & Recovery > Manage Current Backups).

Note: The Backup Sets tabbed page shows the archival CONTROLFILE, SPFILE, and DATAFILE.

8. Optionally, to view your restore points In Cloud Control, navigate: Availability > Backup & Recovery > Restore Points.

Question: Does a non-guaranteed restore point use additional space?

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Practices for Lesson 7: Improving Your Backups

Chapter 7 - Page 18

Listed in the following are recovery steps using the archival backup. DO NOT EXECUTE THESE STEPS AT THIS TIME!

Recovery steps for possible later use of the archival backup:

a. With your environment variables pointing to the ORCL instance, log in to RMAN and connect to the RMAN catalog:

rman target "'/ as sysbackup'" catalog rcatowner@rcat b. Confirm the name of the restore point to be used, KEEPDB in this example:

LIST RESTORE POINT ALL;

c. Restore and recover your database by using your restore point: RESTORE DATABASE UNTIL RESTORE POINT 'KEEPDB'; RECOVER DATABASE UNTIL RESTORE POINT 'KEEPDB';

d. Because your database is now at an earlier point in time, open it with the RESETLOGS option, and display the newly created DBID:

ALTER DATABASE OPEN RESETLOGS; SELECT DBID FROM V$DATABASE;

e. In most environments, Oracle recommends to perform a new backup after a recovery: BACKUP DATABASE PLUS ARCHIVELOG DELETE INPUT;

Practices for Lesson 8: Using

In document D78850GC20_ag (Page 103-109)