Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
As per crontabl syntax, this calls the rman_backup_db.sh script at 21:30 hours on each
day. The script is asked to execute against the FIN1P database by specifying this database
name as the first and only argument.
3. Log on as a DBA to database FIN1P in SQL*Plus and create an externally identified
user :
create user ops$oracle identified externally;
This has the effect that the Oracle UNIX user can log on to SQL*Plus as the Oracle
database user without specifying the passwordin other words, the user is identified
externally. Note that SYSDBA database privileges are needed for taking RMAN backups,
so the Oracle UNIX user should be a member of the dba UNIX group.
This is the technique used most often with scripts that log in to the database, especially
those that require DBA rights for database-level backups. It is not a good idea to hardcode database passwords in scripts, because the scripts are UNIX files and may be
readable by anyone on the computer (unless the file permissions are locked down). So as
a safety precaution, an externally identified Oracle user can be used to log in as the DBA
and perform the backup. This circumvents the need for specifying the database password
in the script.
4. In this approach you would use a Filer volume for the Oracle RMAN backups. Database
standards for the corporate environment maintain that the backup volume must be
mounted as /U99 at the server level.
In /etc/vfstab, make sure that there is an entry for the backup mount point:
ausmelb-corp-netappsfiler-tier3:/vol/vol1/dbbackup - /U99 nfs - yes
hard,vers=3,intr,suid,proto=udp,rsize=32768,wsize=32768
5.
As the root UNIX user, execute the following at the UNIX command prompt:
chown R oracle:dba
/U99
This is to make sure that the /U99 backup mount point and all subdirectories (as specified
by the R argument) under this mount point are owned by the oracle UNIX user and dba
UNIX group, so Oracle RMAN is able to create backup pieces under this mount point.
6. Assuming that /home/oracle is the Oracle UNIX users home directory, perform the
following steps as the Oracle UNIX user:
mkdir
mkdir
mkdir
mkdir
mkdir
mkdir
mkdir
/home/oracle/dba
/home/oracle/dba/scripts
/home/oracle/dba/logs
/home/oracle/dba/work
/U99/FIN1P
/U99/FIN1P/rmancmd
/U99/FIN1P/log
These commands create the UNIX subdirectories into which the UNIX script is placed
and to which the logs are written, as well as creating temporary working directories and
the directories for the generated Oracle RMAN command script and Oracle RMAN
runtime log file.
7. Under the subdirectory /home/oracle/dba/scripts, create the file rman_backup_db.sh using
vi or any UNIX editor. The script, when executed every day at the specified time set in
cron, will generate the following Oracle RMAN command file
/U99/FIN1P/rmancmd/rman_FIN1P.cmd:
#
#
#
Creation
07/06/2008
backed up
expired backups
8.
As can be seen from the Oracle RMAN commands, a recovery window of three days is
specified as the Oracle RMAN retention policy, which means that all backups necessary
to recover up to the last three days of data will be retained. Obviously this setting may
need to be changed, depending on the size of the database and the free space available in
the backup mount point /U99 at any point. The DBA needs to closely monitor this space
and change the recovery window if necessary.
9. Control file autobackup is also configured, so the control file will be automatically
backed up along with every database or archive log backup. This is especially important
because we are using the nocatalog mode of Oracle RMAN, so all the history of our
backups is only in the control file.
10. A parallelism setting of 3 is used, which means that three Oracle RMAN channels will be
used to actually create the backup pieces. This will increase the speed of the backup,
depending on the structure of the disk subsystem.