Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Oracle Database 11g.pdf
Скачиваний:
78
Добавлен:
10.06.2015
Размер:
12.69 Mб
Скачать

Lab 7.1: Monitoring RMAN Backups 

723

searching for all files in the recovery area cataloging files...

cataloging done

List of Cataloged Files

=======================

File Name: C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\AUTOBACKUP\2008_10_03 \O1_MF_S_667144857_4GDYJ29H_.BKP

using channel ORA_DISK_1 starting media recovery

archived log for thread 1 with sequence 4 is already on disk as file C:\ORACLE\ORADATA\ORCL\REDO01.LOG

archived log file

name=C:\ORACLE\ORADATA\ORCL\REDO01.LOG thread=1 sequence=4 media recovery complete, elapsed time: 00:00:00

Finished recover at 10/03/2008 14:03:59

10. Open the database with the alter database open resetlogs command.

RMAN> alter database open resetlogs; database opened

The database is open. This concludes the exercise.

Lab 7.1: Monitoring RMAN Backups

In this exercise, we will monitor the progress of RMAN backups. We will also experiment with the duration command.

1.Log into RMAN, connecting to your recovery catalog.

C:\Documents and Settings\Robert>set oracle_sid=orcl C:\Documents and Settings\Robert>rman target=/ catalog=rcat_user/rcat_user@rcat

Recovery Manager: Release 11.1.0.6.0 - Production on Sun Oct 19 14:51:06 2008

Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: ORCL (DBID=1195614221) connected to recovery catalog database

2.From another command-line window, log into SQL*Plus.

C:\Documents and Settings\Robert>set oracle_sid=orcl C:\Documents and Settings\Robert>sqlplus / as sysdba

724  Appendix A  n  Lab Exercises

SQL*Plus: Release 11.1.0.6.0 - Production on Sun Oct 19 22:07:29 2008 Copyright (c) 1982, 2007, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, OLAP, Data Mining

and Real Application Testing options SQL>

3.From the RMAN session, start an RMAN backup. We assume you have configured RMAN for backups as discussed in Chapter 2.

RMAN> Backup as compressed backupset database plus archivelog delete input;

4.While the RMAN backup is running, change to the SQL*Plus session and query the

V$SESSION_LONGOPS view, as shown here.

SQL> Select sid, serial#, opname, time_remaining

2From v$session_longops

3Where sid in (select sid from v$session

4

 

 

Where program like ‘%rman%‘)

5

And time_remaining > 0;

 

 

SID

SERIAL#

OPNAME

TIME_REMAINING

---------- ----------

------------------------------ --------------

 

133

14

RMAN: aggregate input

87

 

126

33

RMAN: full datafile backup

179

5.Rerun the query listed in step 4, monitoring the TIME_REMAINING column. This will give you an idea of how long the backup will take.

6.When the backup completes, note how long it took to run. Ours took 4 minutes and 55 seconds, as shown here.

channel ORA_DISK_1: backup set complete, elapsed time: 00:04:55 Finished backup at 19-OCT-08

7.Once the RMAN backup is complete, run a second RMAN backup using the duration command with the minimize load database option as shown here.

RMAN> Backup as compressed backupset duration 1:00 minimize load database;

8.Monitor the backup with the V$SESSION_LONGOPS view again. How has the TIME_ REMAINING column changed since you used the duration command? Here is what we saw when we queried the view. Note that TIME_REMAINING is now much higher.

SQL> Select sid, serial#, opname, time_remaining 2 From v$session_longops

Lab 7.2: One of My Backups Is Missing! 

725

3Where sid in (select sid from v$session

4

 

 

Where

program like ‘%rman%‘)

5

And time_remaining > 0;

 

 

 

SID

SERIAL#

OPNAME

 

TIME_REMAINING

---------- ----------

------------------------------ --------------

 

126

33

RMAN: full

datafile backup

3130

9.When the backup ends, note how the runtime has changed.

Lab 7.2: One of My Backups Is Missing!

Sometimes it happens—the unexpected. This lab is about one of those cases.

1.Log into RMAN, connecting to your recovery catalog.

C:\Documents and Settings\Robert>set oracle_sid=orcl C:\Documents and Settings\Robert>rman target=/ catalog=rcat_user/rcat_user@rcat

Recovery Manager: Release 11.1.0.6.0 - Production on Sun Oct 19 14:51:06 2008

Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: ORCL (DBID=1195614221) connected to recovery catalog database

2.List all of the archived redo logs currently in the control file. Note that these are not backups of the archived redo logs, but the actual archived redo logs themselves.

RMAN> list archivelog all;

List of

Archived Log

Copies for database with db_unique_name ORCL

=====================================================================

Key

Thrd

Seq

S Low Time

-------

----

-------

- ---------

1773

1

23

A 18-OCT-08

 

Name: C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00023_0667833490.001

1779

1

24

A 19-OCT-08

 

Name: C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00024_0667833490.001

1787

1

25

A 19-OCT-08

 

Name: C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00025_0667833490.001

726  Appendix A  n  Lab Exercises

3.Next, remove the last archived redo log listed.

RMAN> Host ‘del C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ ARC00025_0667833490.001’;

host command complete

4.Now try to execute a backup.

RMAN> Backup as compressed backupset database plus archivelog delete input; Starting backup at 20-OCT-08

current log archived using channel ORA_DISK_1

RMAN-00571: ===========================================================

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

RMAN-00571: ===========================================================

RMAN-03002: failure of backup plus archivelog command at 10/20/2008 00:34:26

RMAN-06059: expected archived log not found, lost of archived log compromises

recoverability

ORA-19625: error identifying file C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00025_0667833490.001 ORA-27041: unable to open file

OSD-04002: unable to open file

O/S-Error: (OS 2) The system cannot find the file specified.

5.Notice that the backup failed because of the missing archived redo log. Run the command crosscheck archivelog all to mark the archived redo log as expired. This will allow you to rerun the backup.

RMAN> Crosscheck archivelog all; released channel: ORA_DISK_1 allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=126 device type=DISK validation succeeded for archived log

archived log file name=C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ ARC00023_0667833490.001 RECID=43 STAMP=668556384 validation succeeded for archived log

archived log file name=C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ ARC00024_0667833490.001 RECID=45 STAMP=668556995 validation failed for archived log

archived log file name=C:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ ARC00025_0667833490.001 RECID=47 STAMP=668557334

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]