1. Trang chủ
  2. » Công Nghệ Thông Tin

OCA /OCP Oracle Database 11g A ll-in-One Exam Guide- P65 doc

10 177 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 132,05 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

with DELETE OBSOLETE, which will remove the records of any such backups from the repository and physically remove the backup files from disk or tape.. For example, RMAN> report obsolete;

Trang 1

with DELETE OBSOLETE, which will remove the records of any such backups from the repository and physically remove the backup files from disk or tape For example,

RMAN> report obsolete;

will apply the configured retention policy and list all copies and backup sets that are

no longer required Then,

RMAN> delete obsolete;

will remove the backups deemed surplus to requirements

RMAN> report obsolete redundancy 2;

lists all backups that take the number of backups of an object to three or more Then

to remove the superfluous backups,

RMAN> delete obsolete redundancy 2;

The DELETE command can also be used to remove individual backups, by

number or by tag:

RMAN> delete backupset 4;

RMAN> delete copy of datafile 6 tag file6_extra;

Archival Backups

In Oracle terminology, an archival backup is a backup that you want to keep long term,

possibly forever It will not usually be necessary to recover from an archival backup: it should be possible to restore it in order to recreate the database as it was at the time the backup was made, but you won’t want to apply archived logs to it to bring it further forward in time Often, archival backups are made purely to satisfy legislation regarding retention of records; they have little or no technical significance An archival backup does not count toward compliance with the configured retention policy, and neither will it be deleted automatically by a DELETE OBSOLETE command

Even though it will not usually be necessary to keep the archive logs needed to recover an archival backup up to the present day, if the archival backup is an open backup then it will be necessary to keep all the archive logs generated while the backup was being taken This is because they will be needed to make the open backup consistent,

in the event of having to restore it

The syntax to create an archival backup is

BACKUP KEEP { FOREVER | UNTIL TIME 'date_expr' }

[ RESTORE POINT rsname ] ;

The clause defining what to back up can be anything: a datafile, a tablespace, the whole database, incremental, compressed, encrypted, and so on It can be directed to either tape or disk However, usually, the only sensible backup target is a full backup

of the whole database, and it will probably be directed through a tape channel to a tape library The date expression can be an actual date or a calculation An example is

Trang 2

backup database as compressed backup set keep until time 'sysdate + 90'

restore point quarterly_backup ;

This command will write out a compressed backup, which will be considered obsolete

(and therefore deletable) after 90 days If the database is open at the time, the relevant

archivelogs will be included

The Dynamic Performance Views

A number of views populated from the target database controlfile can be used to

report on RMAN’s backups By querying these, you can develop your own reports,

rather than relying on RMAN’s LIST command

v$backup_files One row for each file that has been backed up, which may be a datafile,

the spfile, the controlfile, or an archive log Also, one row for each piece that RMAN has created The column FILE_TYPE distinguishes which type of file the row refers to.

v$backup_set One row per backup set

v$backup_piece One row per backup piece

v$backup_redolog One row for each archived log that has been backed up

v$backup_spfile One row for each backup that has been made of the spfile

v$backup_datafile One row for backup of a datafile

v$backup_device Names of SBT devices that have been linked to RMAN

v$rman_configuration One row for every configuration setting, excluding all those on default

Join columns in the various views will let you construct comprehensive reports

on what has been backed up, where the backups are located, and the size and type

of each backup

Crosschecking Backups

The information used by the RMAN commands REPORT and LIST, and the information

displayed in the dynamic performance views, is drawn from the RMAN repository: data

stored in the controlfile of the target database It says nothing about reality—whether

the backup files actually still exist To confirm that the backups do exist, use the

CROSSCHECK command For example:

RMAN> crosscheck backup of database;

using channel ORA_DISK_1

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/app/oracle/flash_recovery_area/orcl/backupset/2008_10_20/

o1_mf_nnnd0_backup_orcl_000002_1_4hs9zcn8_.bkp RECID=5 STAMP=668623611

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/app/oracle/flash_recovery_area/orcl/backupset/2008_10_21/

o1_MF_nnnd1_tag20081020t165738_4hsbmv14_.bkp RECID=8 STAMP=668624267

Trang 3

This command queries the repository to find details of what whole backups have been made of the database, and then goes to the storage device(s) to see if the pieces do

in fact exist For pieces on disk, the disk directory is read and the file header validated; for pieces on tape, only the tape directory is read Any pieces that no longer exist are flagged in the repository as EXPIRED An expired backup will not be considered by RMAN when it works out how to carry out a restore and recover operation In some circumstances (such as if a file system or a tape drive is taken offline), a crosscheck may mark many backups as expired; rerunning the crosscheck when the device is brought back into use will reset their status to AVAILABLE

A related command is

RMAN> delete expired;

This command will not delete any files from disk It will, however, remove from the repository all references to backups previously marked EXPIRED by a crosscheck

At many installations, the tape library will automatically delete files according to their age: if this is happening, then a crosscheck followed by DELETE EXPIRED will update the RMAN repository to make it aware of what has happened

EXAM TIP A DELETE EXPIRED command does not delete any files, it only

updates the RMAN repository A DELETE OBSOLETE will delete files and update the repository accordingly

Exercise 15-4: Manage Backups After putting the RMAN configured settings back to defaults, use the BACKUP, LIST, REPORT, and DELETE commands to create and remove backups

1 Connect to your database with SQL*Plus, and query the state of your flash recovery area:

select * from v$flash_recovery_area_usage;

2 Connect to your database with RMAN using operating system authentication:

rman target /

3 Ensure that your retention policy is set to the default, REDUNDANCY 1:

RMAN> configure retention policy clear;

4 Delete all your backup sets and image copies:

RMAN> delete backupset all;

RMAN> delete copy all;

If any backups are listed, enter YES to confirm deletion.

5 List the items that need backing up, according to the configured retention policy:

RMAN> report need backup;

This will list all your datafiles.

6 Choose a datafile, and back it up In the example that follows, file 6 has been chosen:

Trang 4

Repeat the command to take a second backup of the same file.

7 Repeat the command from Step 4 The file that has been backed up will not

be listed

8 In your SQL*Plus session, rerun the query from Step 1 and note that there is

some reclaimable space

9 List your backups with

RMAN> list backup;

10 Report and delete the backup that is unnecessary according to the configured

retention policy:

RMAN> report obsolete;

RMAN> delete obsolete;

This will remove the first backup made in Step 5, because it is redundant

following the creation of the second backup

11 In your SQL*Plus session, rerun the query from Step 1 and note the difference

in usage

Two-Minute Drill

Create Consistent Database Backups

• If the database is in noarchivelog mode, then whole consistent backups (full

or incremental) are the only type of backup possible

• An RMAN-consistent backup is taken with the database in mount mode,

following a clean shutdown

Back Up Your Database Without Shutting It Down

• An open backup of the database must also include a backup of the archivelog

files, either included in the same backup set or in a separate backup set

• Open backups, for which the database must be in archivelog mode, can be

whole or partial, full or incremental

Create Incremental Backups

• A level 1 incremental or cumulative backup cannot be based on a full backup,

only a level 0 incremental backup

• Unless block change tracking is enabled, an incremental backup must scan the

entire database

• An RMAN backup set, whether full or incremental, never includes unused

blocks

Trang 5

Automate Database Backups

• Oracle Enterprise Manager (Database Control or Grid Control) can schedule the running of backup jobs

Manage Backups, View Backup Reports, and

Monitor the Flash Recovery Area

• The LIST command shows what backups have been made, and the REPORT command shows what backups are needed or are redundant

• The flash recovery area is the default destination for RMAN disk backups

• RMAN can automatically delete files considered to be obsolete from the flash recovery area

Define, Apply, and Use a Retention Policy

• The backup retention policy may be based on redundancy (keeping a certain number of copies) or recovery window (guaranteeing the possibility of point-in-time recovery)

• Backups considered obsolete according to the retention policy can be

automatically deleted

Create Image File Backups

• An image copy is identical to the source file

• Image copies can be directed only to disk

• Image copies can be made of datafiles, the controlfile, and archivelog files

Create a Whole Database Backup

• A whole RMAN backup is the full set of datafiles, the spfile, and the controlfile

• RMAN does not back up online logs, tempfiles, or the password file

Enable Fast Incremental Backup

• Changed blocks are tracked by the change tracking writer process, the CTWR

• The change tracking file is automatically managed; the DBA can choose only its name and location

Create Duplex Backups and Back Up Backup Sets

• The COPIES keyword instructs RMAN to create multiple copies of backup sets

or images

• Backup sets can be backed up into more backup sets with BACKUP BACKUPSET

Trang 6

• The BACKUP RECOVERY AREA and BACKUP RECOVERY FILES commands

can only write to a tape destination

Create an Archival Backup for Long-Term Retention

• The KEEP keyword creates a backup to which the retention policy will not be

applied

• If the archival backup is an open backup, all necessary archive logs will be

automatically included

Create a Multisection, Compressed,

and Encrypted Backup

• The SECTION keyword lets multiple channels back up one file concurrently

• Backup sets can be compressed (unlike image copies), by default with the

BZIP2 algorithm

• Encryption can be enabled using either a wallet or a password

Report on and Maintain Backups

• RMAN will automatically delete backups from the flash recovery area

considered to be obsolete, if the flash recovery area is full

• The DELETE OBSOLETE command will delete all backups considered

obsolete, whether in the flash recovery area or not

Configure Backup Settings

• RMAN’s default behavior is modified with the CONFIGURE command

• Configured defaults are stored in the target database’s controlfile, as part of

the RMAN repository

Allocate Channels to Use in Backing Up

• Channels are of type disk or SBT (or SBT_TAPE) SBT channels are only

available if a suitable device driver has been installed

• Parallelize backups by launching multiple channels, using ALLOCATE

CHANNEL commands within a run block or by configuring a default

Configure Backup Optimization

• Optimization only applies to identical files: archivelogs, or datafiles that are

either offline or read-only

• Optimization is not enabled by default, and if enabled is reliant upon the

retention policy currently in effect

Trang 7

Self Test

1 What file types can be backed up by RMAN? (Choose four answers.)

A Archive log files

B Controlfile

C Online log files

D Password file

E Permanent tablespace datafiles

F Server parameter file

G Static parameter file

H Temporary tablespace tempfiles

2 If your database is in noarchivelog mode, which of the following is possible? (Choose the best answer.)

A Online backups

B Partial backups

C Incremental backups

D All of the above, but only if you use RMAN

3 RMAN backup sets are smaller than RMAN image copies because

(Choose the best answer.)

A They always use compression

B They always skip unused blocks

C They never include tempfiles

D They can be written directly to tape

4 Which of the following statements are correct about RMAN offline backup? (Choose all correct answers.)

A The database must be in NOMOUNT mode

B The database must be in MOUNT mode

C The backup will fail if the shutdown mode was SHUTDOWN IMMEDIATE

D Noarchivelog databases can only be backed up offline

E Archivelog databases cannot be backed up offline

F Offline backups can be incremental

5 You need to back up the control file while the database is open What will work? (Choose the best answer.)

A The controlfile can be included in an RMAN backup set, but not backed

up as an image copy

Trang 8

B The ALTER DATABASE BACKUP CONTROLFILE TO TRACE command will

make an image copy of the controlfile

C You cannot back up the controlfile while it is in use—it is protected by

multiplexing

D None of the above

6 You perform a full backup on Sunday, an incremental level 0 backup on

Monday, an incremental level 1 differential backup on Tuesday, an incremental

level 1 cumulative backup on Wednesday, and an incremental level 1 cumulative

backup on Thursday Which blocks will be included in the Thursday backup?

(Choose the best answer.)

A All blocks changed since Sunday

B All blocks changed since Monday

C All blocks changed since Tuesday

D All blocks changed since Wednesday

7 If you issue this RMAN command,

backup incremental level 1;

and there is no level 0 backup, what will happen? (Choose the best answer.)

A The command will fail

B The incremental backup will be based on the most recent full backup

C RMAN will perform a level 0 backup

D RMAN will perform a level 1 cumulative backup of all blocks that have

ever been changed

8 What processes must be running if an RMAN backup scheduled within the

Oracle environment is to run? (Choose two correct answers.)

A The database instance processes must be running, in MOUNT or

OPEN mode

B The database instance processes must be running, in at least

NOMOUNT mode

C The Enterprise Manager processes (either Database Control or the Grid

Control agent) must be running

D The operating system scheduler must be running

9 What is true about the CROSSCHECK command? (Choose the best answer.)

A CROSSCHECK will check the validity of the backup pieces

B CROSSCHECK will delete references to files that no longer exist

C CROSSCHECK will verify the existence of backup set pieces

D CROSSCHECK only works with backup sets, not image copies

Trang 9

10 If the volume of data in the flash recovery area has reached the limit defined

by DB_RECOVERY_FILE_DEST_SIZE, what will happen when RMAN attempts

to write more data to it? (Choose the best answer.)

A If AUTOEXTEND has been enabled and the MAXSIZE has not been reached, the flash recovery area will extend as necessary

B The operation will fail

C This will depend on whether warning and critical alerts have been enabled for the flash recovery area

D RMAN will automatically delete OBSOLETE backups

E RMAN will automatically delete EXPIRED backups

Self Test Answers

1 þ A, B, E, and F These are the database file types that the Recovery Manager

can back up and restore

ý C, D, G, and H RMAN will never back up online redo logs or tempfiles

because it is not necessary to back them up, and it cannot back up a static parameter file or the external password file

2 þ C RMAN can make incremental backups no matter what mode the

database is in

ý A, B, and D Whatever method you use, backups of a noarchivelog mode

database cannot be either partial or online

3 þ B A backup set will never include blocks that have never been used.

ý A, C, and D A is wrong because compression is an option, not enabled by default C is wrong because it applies to image copies as well as backup sets D

is wrong because it is not relevant: an image copy can’t go to tape, because if it did, it wouldn’t be an image

4 þ B, D, and F Offline backups must be done in mount mode This is

the only backup type for a noarchivelog mode database, but it can be incremental

ý A, C, and E A is wrong because the database must be mounted, or RMAN

won’t be able to connect to its repository or find the location of the datafiles

C is wrong because an IMMEDIATE shutdown is clean—it is only an ABORT that would cause problems E is wrong because an archivelog mode database

can certainly be backed up offline—it just isn’t necessary

Trang 10

5 þ D A, B, and C are all incorrect.

ý A, B, and C A is wrong because a copy of the controlfile can be created

while the database is open, via a read-consistent snapshot B is wrong because

this command will generate a CREATE CONTROLFILE script, not a file copy

C is wrong because the file multiplexing is an additional precaution, not the

only one

6 þ B A cumulative backup will include all blocks changed since the last level

0 backup

ý A, C, and D A is wrong because the full backup cannot be used as a base

for an incremental backup C and D are wrong because cumulative backups

always go back to the most recent level 0 backup

7 þ C RMAN will revert to level 0 in this circumstance.

ý A, B, and D A is wrong because the backup will succeed—though perhaps

not in the way you wanted B is wrong because no incremental backup can be

based on a full backup D is wrong because although the effect described is

correct, it will not be recorded as a cumulative backup but as a level 0 backup

8 þ A and C The Enterprise Manager processes will run the backup, and

the database must be mounted or RMAN will not be able to connect to the

repository

ý B, and D B is wrong because NOMOUNT mode is not enough D is

wrong because Oracle-scheduled backups do not use the operating system

scheduler

9 þ C The CROSSCHECK command verifies that the repository does

accurately reflect reality

ý A, B, and D A is wrong because CROSSCHECK does not validate

whether the backups are good—only whether they exist B is wrong because

CROSSCHECK doesn’t delete references to missing backups; it only flags them

as expired D is wrong because CROSSCHECK confirms the existence of both

backup sets and image copies

10 þ D Backups that are OBSOLETE according to RMAN’s retention policy will

be removed

ý A, B, C, and E A is wrong because this describes datafiles, not the flash

recovery area B is wrong because the operation will not necessarily fail—it

may be possible to free up space automatically C is wrong because the

alert system will only report the problem; it won’t fix it E is wrong because

EXPIRED refers to the status of the backup record in the repository, not the

backup itself

Ngày đăng: 06/07/2014, 13:20

TỪ KHÓA LIÊN QUAN