Check whether crontab is valid for Oracle users in Linux.

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.