In Oracle databases, backup scripts can be executed on the command line, but cannot be executed on crontab. How to determine whether crontab is available for oracle users in Linux?
In Oracle databases, backup scripts can be executed on the command line, but cannot be executed on crontab. How to determine whether crontab is available for oracle users in Linux?
In Oracle databases, backup scripts can be executed on the command line, but cannot be executed on crontab.
How to determine whether crontab is valid for oracle users in Linux.
You can write a simple script that contains only the date command and input the script to a log file. For example:
30 23 ** 0-6/u01/app/rmanBackup/date. SQL>/u01/app/rmanBackup/date. log
Date. SQL requires sufficient execution permissions.
If you can regularly execute the date command, you can use the crontab command in oracle.
Oracle scripts cannot be executed because the related commands in oracle cannot be found in crontab. Therefore, you need to add export to set environment variables. An export is not set and cannot be executed.
For example, full backup:
[@ Linuxidc rmanBackup] $ vi backupFull. SQL
Content:
# Script.: bakupFull. SQL
# Creater: mengzhaoliang
# Date: 2010/12/28
# Desc: backup full database datafile in archive with rman
# Connect database
Export ORACLE_BASE =/u01/app/oracle
Export ORACLE_HOME =/u01/app/oracle/product/11.2.0/dbhome_1
Export ORACLE_SID = hyoms
Export PATH = $ ORACLE_HOME/bin: $ PATH
Rman target/<EOF_RMAN
Run {
Allocate channel c1 type disk;
Backup tag 'full' format'/u01/app/rmanBackup/db0 _ % d _ % T _ % s' database include current controlfile;
Delete noprompt obsolete;
Release channel c1;
}
# End
For example, crontab
[Oracle @ ~] $ Crontab-e
30 23 ** 0-6/u01/app/rmanBackup/backupFull. SQL>/u01/app/rmanBackup/backupFull. log