Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Rman backup, crontab scheduled task did not generate backup files

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Automatic backup of database by crontab execution plan combined with RMAN

Phenomenon:

Using scheduled tasks to perform backups only generates directories but not backup files

1: Perform backup script manually with no problems

2: crontab schedule task, can generate directory, but can not generate backup files, indicating crontab did execute the script

But no backup file is generated, and the problem may lie in the combination of crontab and rman

Understanding:

crontab Although crontab is executed under oracle user, crontab cannot automatically load environment variables, so if there is no backup script,

Read environment variables, automatic backup, naturally will not succeed

Solution:

In the backup script,

###################################################################################################

# set environment variable

source /home/oracle/.bash_profile #Source the file that configures the environment variables

It's being implemented, that is, it can be obtained

Summary:

1: Cannot execute script backup oracle under root, need to make plan task under oracle user

[root@bzdb ~]# crontab -l -u oracle

50 23 * * 0 /script/level0.sh

50 23 * * 1-6 /script/level1.sh

2: crontab cannot automatically load environment variables, you need to put the environment variable source in the script

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report