0
votes

I am newbie to Oracle DBA, the programming world in general. I have been exploring some database backup and recovery options for my databases and despite the wealth of information there is available for Oracle, I am quite lost.

Background: I have automated the running of some scripts in R and sql by scheduling chron jobs for them. I have an interface that allows me to schedule these jobs. Running the scripts allows me to update my Oracle databases holding temporal data on a regular basis. My databases are on one server machine. Oracle recommends using RMAN to administer the backup and recovery of databases. I am using the Oracle Database 11g R2 version and have the Enterprise Manager Database Control for the same version.

My goal is to be able to have a script that I can schedule in jobs to automatically perform backups without always running the Enterprise Manager or manually opening the RMAN client.

  1. Would the Enterprise Manager be able to generate such a script for RMAN if I set the initial backup and recovery parameters for a database? To clarify, can I use Enterprise Manager for a one-time generation of a script that I can repeatedly use for automatically running RMAN by scheduling it as a chron job to back-up my database ?

  2. If not, is it possible to just write a script myself for RMAN and schedule it as a job and not have the enterprise manager involved at all?

  3. Or given my requirements, do I need to write a SQL script for backup and recovery on my own and not have RMAN and Enterprise Manager involved at all for this?

I would really appreciate any input on this. Thank you very much.

1

1 Answers

0
votes

Unfortunately I have no "Enterprise Manager Database Control" because I'm using Grid/Cloud Control in my environment, but i think it should work similar.

You should prepare your own RMAN script. For example (Incremental level 0 (full) backup of database + backup of Archivelogs + Delete Archivelogs older than 2 days)

run {
BACKUP INCREMENTAL LEVEL 0 DATABASE;
BACKUP ARCHIVELOG ALL;
DELETE NOPROMPT ARCHIVELOG UNTIL TIME 'SYSDATE-2';
}

This script You can start directly from Enterprise Manager or using OS script.

If you prefer to start RMAN job Directly from EM you should go JOBS tab in EM. On this Tab there is text "Create Job" You should chose "Rman Script" and click on "GO" button.