RMAN - подскажите где ошибка

Maxman
Дата: 24.09.2004 10:16:07
Здравствуйте.
Скрипты такие
arch.rman:
run {
allocate channel ch1 type disk;
set limit channel ch1 kbytes = 2097150;
backup
full
tag full_backup_tma
format '/home/oracle/backup/tma/db_%d_%U'
(database include current controlfile);
sql 'alter system archive log current';
backup filesperset 3
format '/home/oracle/backup/tma/arc/arc_%d_%U'
(archivelog all);
release channel ch1;
}


Для тестирования использую (archivelog all) но позже заменю на (archivelog
from time 'SYSDATE-1' delete input);

restore.rman:

run {
allocate channel ch1 type disk;
allocate channel ch2 type disk;
allocate channel ch3 type disk;
restore controlfile;
alter database mount;
restore archivelog all;
restore database;
recover database;
sql "alter database open resetlogs";
release channel ch1;
release channel ch2;
release channel ch3;
}

Начну описание проблемы по порядку.
Я создал каталог, зарегистрировал в нем базу. все нормально. База находится в
режиме archive log.
Сделал первый бекап. все хорошо сбекапилось.
Решил проверить.
Опустил БД и смонтировал ее в nomount. Удалил все файлы данных. Запустил
востановление вышенаписанным скриптом restore.rman.

[oracle@tma work]$ rman target sys/sys@tma rcvcat rman_tma/tma@rman
<./restore.rman

Recovery Manager: Release 8.1.7.4.0 - Production

RMAN-06006: connected to target database: tma (not mounted)
RMAN-06008: connected to recovery catalog database

RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14>
RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: ch1
RMAN-08500: channel ch1: sid=10 devtype=DISK

RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: ch2
RMAN-08500: channel ch2: sid=11 devtype=DISK

RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: ch3
RMAN-08500: channel ch3: sid=12 devtype=DISK

RMAN-03022: compiling command: restore

RMAN-03022: compiling command: IRESTORE
RMAN-03023: executing command: IRESTORE
RMAN-08016: channel ch1: starting datafile backupset restore
RMAN-08502: set_count=11 set_stamp=537533211 creation_time=22-SEP-04
RMAN-08021: channel ch1: restoring controlfile
RMAN-08505: output filename=/home/oracle/app/oradata/tma/control01.ctl
RMAN-08023: channel ch1: restored backup piece 1
RMAN-08511: piece handle=/home/oracle/backup/tma/db_TMA_0bg0k6or_1_1
tag=FULL_BACKUP_TMA params=NULL
RMAN-08024: channel ch1: restore complete
RMAN-08058: replicating controlfile
RMAN-08506: input filename=/home/oracle/app/oradata/tma/control01.ctl
RMAN-08505: output filename=/home/oracle/app/oradata/tma/control02.ctl
RMAN-08505: output filename=/home/oracle/app/oradata/tma/control03.ctl

RMAN-03022: compiling command: alter db
RMAN-06199: database mounted

RMAN-03022: compiling command: restore
RMAN-03025: performing implicit partial resync of recovery catalog
RMAN-03023: executing command: partial resync
RMAN-08003: starting partial resync of recovery catalog
RMAN-08005: partial resync complete

RMAN-03022: compiling command: IRESTORE
RMAN-03023: executing command: IRESTORE
RMAN-08017: channel ch1: starting archivelog restore to default destination
RMAN-08022: channel ch1: restoring archivelog
RMAN-08510: archivelog thread=1 sequence=1
RMAN-08022: channel ch1: restoring archivelog
RMAN-08510: archivelog thread=1 sequence=2
RMAN-08017: channel ch2: starting archivelog restore to default destination
RMAN-08022: channel ch2: restoring archivelog
RMAN-08510: archivelog thread=1 sequence=3
RMAN-08022: channel ch2: restoring archivelog
RMAN-08510: archivelog thread=1 sequence=4
RMAN-08022: channel ch2: restoring archivelog
RMAN-08510: archivelog thread=1 sequence=5
RMAN-08017: channel ch3: starting archivelog restore to default destination
RMAN-08022: channel ch3: restoring archivelog
RMAN-08510: archivelog thread=1 sequence=6
RMAN-08023: channel ch1: restored backup piece 1
RMAN-08511: piece handle=/home/oracle/backup/tma/arc/arc_TMA_0cg0k6qa_1_1
tag=null params=NULL
RMAN-08024: channel ch1: restore complete
RMAN-08023: channel ch3: restored backup piece 1
RMAN-08511: piece handle=/home/oracle/backup/tma/arc/arc_TMA_0eg0k6qd_1_1
tag=null params=NULL
RMAN-08024: channel ch3: restore complete
RMAN-08023: channel ch2: restored backup piece 1
RMAN-08511: piece handle=/home/oracle/backup/tma/arc/arc_TMA_0dg0k6qb_1_1
tag=null params=NULL
RMAN-08024: channel ch2: restore complete
RMAN-03023: executing command: partial resync
RMAN-08003: starting partial resync of recovery catalog
RMAN-08005: partial resync complete

RMAN-03022: compiling command: restore

RMAN-03022: compiling command: IRESTORE
RMAN-03023: executing command: IRESTORE
RMAN-08016: channel ch1: starting datafile backupset restore
RMAN-08502: set_count=11 set_stamp=537533211 creation_time=22-SEP-04
RMAN-08089: channel ch1: specifying datafile(s) to restore from backup set
RMAN-08523: restoring datafile 00001 to
/home/oracle/app/oradata/tma/system01.dbf
RMAN-08523: restoring datafile 00002 to
/home/oracle/app/oradata/tma/tools01.dbf
RMAN-08523: restoring datafile 00003 to /home/oracle/app/oradata/tma/rbs01.dbf
RMAN-08523: restoring datafile 00004 to
/home/oracle/app/oradata/tma/temp01.dbf
RMAN-08523: restoring datafile 00005 to
/home/oracle/app/oradata/tma/users01.dbf
RMAN-08523: restoring datafile 00006 to
/home/oracle/app/oradata/tma/indx01.dbf
RMAN-08023: channel ch1: restored backup piece 1
RMAN-08511: piece handle=/home/oracle/backup/tma/db_TMA_0bg0k6or_1_1
tag=FULL_BACKUP_TMA params=NULL
RMAN-08024: channel ch1: restore complete
RMAN-03023: executing command: partial resync
RMAN-08003: starting partial resync of recovery catalog
RMAN-08005: partial resync complete

RMAN-03022: compiling command: recover

RMAN-03022: compiling command: recover(1)

RMAN-03022: compiling command: recover(2)

RMAN-03022: compiling command: recover(3)
RMAN-03023: executing command: recover(3)
RMAN-08054: starting media recovery

RMAN-03022: compiling command: recover(4)
RMAN-06050: archivelog thread 1 sequence 6 is already on disk as file
/home/oracle/app/admin/tma/arch/arch_1_6.arc
RMAN-03023: executing command: recover(4)
RMAN-08515: archivelog filename=/home/oracle/app/admin/tma/arch/arch_1_6.arc
thread=1 sequence=6
RMAN-08060: unable to find archivelog
RMAN-08510: archivelog thread=1 sequence=7
RMAN-03026: error recovery releasing channel resources
RMAN-08031: released channel: ch1
RMAN-08031: released channel: ch2
RMAN-08031: released channel: ch3
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure during compilation of command
RMAN-03013: command type: recover
RMAN-03006: non-retryable error occurred during execution of command:
recover(4)
RMAN-07004: unhandled exception during command execution on channel default
RMAN-20000: abnormal termination of job step
RMAN-06054: media recovery requesting unknown log: thread 1 scn 30710

RMAN>

Recovery Manager complete.

Как видно получил то что нет 7-го arcloga... но ведь его и не было в бекапе...
когда он делался...

Соответственно, я потом руками сам делал alter database open resetlogs в
sqlplus. и БД востанавливалась... но после этого попытка сделать бекап
рманом говорила что
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20003: target
database incarnation not found in recovery catalog

Я понимаю что это проблема явилась следствием вышеописанной проблемы....
Так где ошибки?
Вячеслав Любомудров
Дата: 24.09.2004 10:24:44
killed
Дата: 25.09.2004 00:58:20
копия controlfile в бэкапе не знает о последующем sql 'alter system archive log current'; и сгенерированном арх.логе

Из-за этого тебе пришлось сделать:

alter database open resetlogs

Что в свою очередь приводит к созданию новой database incarnation.
Для RMAN'a это таже база, но в новой инкарнации, поскольку все старые бэкапы для нее бесполезны. Но в рман-каталоге текущей инкарнацией по-прежнему считается старая, поскольку ты обресетил базу, зайдя сбоку "плюсом" и рману про это ничего не известно.

Gридется тебе в rman'e сказать:

RESET DATABASE;