0
votes

I would like to backup an Oracle 10G as simple as possible. It is in NOARCHIVELOG mode and I can shut down for backup (it is only a development server).

After reading tons of documentation abour rman I tried this way in rman:

shutdown immediate;
startup mount
backup database;
sql 'alter database open';

As I see it works fine, list backup shows backups.

Than I made some modifications (droping some tables, adding data) and I tried to restore backup:

shutdown immediate;
startup mount
restore database;
recover database;
sql 'alter database open';

It also seems to work fine but I can't get back the previous state of the database. I don't understand why. I also don't understand why need to use recover.

Thanks

Hubidubi

1

1 Answers

1
votes

The "restore database;" command will read the backup from the backup media media so that your database files are exactly like they were when the last backup was taken. It does not restore control files.

The "recover database;" command will apply incremental backups (not applicable - your example only has a full backup) and apply archive logs (also not applicable, you're in "NOARCHIVELOG" mode.) It may also write to the control files - if it does, you can see why it's required.

After the restore/recover/open commands you issued in your question your database is as it was at the time of the backup. Any transactions committed after the backup are lost and can't be recovered because you're in "NOARCHIVELOG" mode. You need to be in "ARCHIVELOG" mode to do a complete "point in time" recovery.

byw, what files, if any did you delete, rename or move to really simulate a true media failure? I'll bet you didn't delete one of your control files. You need to practice that scenario.