oracle / docker-images

Official source of container configurations, images, and examples for Oracle products and projects
https://developer.oracle.com/use-cases/#containers
Universal Permissive License v1.0
6.45k stars 5.4k forks source link

RMAN backup and restore to a specific point in time -> getting RMAN-06025 errors #2743

Closed yanivharpaz closed 4 months ago

yanivharpaz commented 6 months ago

on my scenario it's required to perform a recovery to a point in time. (currently with the NFS implementation on docker) I've tried different methods to do that with RMAN: https://github.com/yanivharpaz/oracle-css-il-containers/blob/main/backup-restore-rac.md

sometimes it works and sometimes I get a missing archive log file error. this thing is running only an hour, so I do not have a lot of archives and I do not delete anything.

I tried to backup into a local directory, I tried backup into the shared storage (/oradata fs) it happens on both options.

do u have a specific recommendation how to backup and restore this RAC on docker?

RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of recover command at 12/20/2023 15:26:14 RMAN-06053: unable to perform media recovery because of missing log RMAN-06025: no backup of archived log for thread 1 with sequence 4 and starting SCN of 2931108 found to restore RMAN-06025: no backup of archived log for thread 1 with sequence 11 and starting SCN of 2893667 found to restore

saurabhuja commented 5 months ago

Keeping backup inside container is generally not a good idea as when container is removed, your backups are lost.

If both the containers are in same host machine, i am thinking why not add another docker volume mapping to both rac containers while creating and take backup over there? However i am not sure whether to go with single shared volume for both containers or have dedicated volume for each? I think it would depend upon your customer if he wants some isolation between two disk or ok with shared one?

docker volume create oracle_backup_vol docker run -d <> -v oracle_backup_vol:/home/oracle/backup After backup we can check backed up data in ls /var/lib/docker/volumes/oracle_backup_vol/_data​

Will also try and update you.

saurabhuja commented 5 months ago

Discussed in email to you, i am not rman expert, but you can use rman consistent backup location everytime you connect to rman. may be add that as docker volume as well

--volume rman_backup_volume:/u01/backup:rw \

docker volume create rman_backup_volume

docker exec -it racnode1 bash chown oracle:racdba /u01/backup

docker exec -it racnode2 bash chown oracle:racdba /u01/backup

RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u01/backup/%U'; --then do backup and point in time recovery---

Can also validate backup in location in host machine-

ls -lrt /var/lib/docker/volumes/rman_backup_volume/_data/

yanivharpaz commented 4 months ago

by using ASM as the only location for the archive logs, it was resolved. thank you Saurabh and thank you Jyoti :-)

sqlplus "/ as sysdba" alter system set db_recovery_file_dest='+DATA' scope=spfile; alter system set db_recovery_file_dest_size=100G scope=spfile;

alter system set log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST';