We have successively implemented the backup of Oracle on Linux but are struggling to implement the similar scripts on Windows, due to the lack of Windows skills and Oracle on Windows.
I wonder if someone in the Forum had done it or could help us translating the equivalent of the linux/Oracle scripts to Windows/Oracle scripts. Thanks
echo Freeze: $(date) >> /var/log/snap
chkconfig dbora --level 345 off
su - oracle << BOF 2>&1
sqlplus /nolog <<EOF 2>&1
connect / as sysdba
alter system archive log current;
alter database begin backup;
EOF
BOF
hi, which version of Oracle are you using?
there are VSS Writers avilable for Oracle on Windows (needs to be installed manualy)
but your "alter" commands schould also work on windows.
rman target / <<EOF1 2>&1
allocate channel for delete type disk;
delete noprompt archivelog all completed before 'SYSDATE -3';
release channel ;
but I tried several combinaisons of it in the windows scripts and taking note of your examples, but I am afraid both my windows and oracle skills are not up to it.
In the mean time, I have a separate batch job that deletes those archivelogs via Windows Scheduler, which keeps the disk size under control, but it does not solve the fact that Oracle does not update its internal info (I have been told!).
Sorry to bother you with this. Before Veeam we used HP Dataprotector with Oracle Agents and I did not need to do all this.
Correct, RMAN is the only solution to delete the logs and update log tracking inside Oracle at the same time.
have you tried to run the commands directly inside rman interface to check what error comes out?
Luca Dell'Oca Principal EMEA Cloud Architect @ Veeam Software
Sorry for previous reply, i was partially wrong, and I'd like to give a better explanation (thanks Tom for the note in mail).
Archive logs are managed by oracle and rman in two different ways, and without interfering with each other:
- oracle has a parameter into its config file "control_file_record_keep_time", default is 7 days, so archive logs simply don't grow infinitely, but are deleted after this age
- rman stores archive logs as part of its backup activities, and simply marks archive logs as "already backed up X times"
So if an archive log is already saved into rman, once it's deleted from disk it does not creates any additional issue.
If you are NOT using rman to do backups (I see in the first scripts you use alter database) so there's no need to inform rman of the status of archive logs, simply remove them from file system.
Sorry again for previous confusion.
Luca Dell'Oca Principal EMEA Cloud Architect @ Veeam Software
I have a couple of questions concerning Oracle Backup on Windows Systems.
- Can we manage to Purge archivelogs by scripts when oracle is backed up with Application-aware processing(VSS)? I was thinking of executing a post-thaw script only on the application processing script tab. Or do i have to switch to a completely scripted based backup way?
- Online backups allows instances to be restored at snapshot time. Is it possible to replay Archivelogs after a crash with this backup model? If yes how can i proceed. Oracle DBAs said that in this case i had to start from an offline backup and replay all archive logs from this backup. Online backup only allows point in time restore. Is that correct?