crontab不能自動刪除歸檔日誌
某客戶一套資料庫歸檔太多撐滿磁碟,於是決定使用指令碼自動刪除歸檔,保留15天,指令碼執行沒有任何問題
但是放在crontab裡就是執行不成功,log也沒有產生,查不到原因,後來發現crontab執行完會自動發資訊到mail裡面
於是在/var/spool/mail/路徑下找到oracle檔案:
[oracle@jzh5 2015_07_15]$ cd /var/spool/mail/
[oracle@jzh5 mail]$ ls
oracle root rpc
[oracle@jzh5 mail]$ vi oracle
/bin/sh: /home/oracle/delete_arc.sh: Permission denied
From oracle@jzh5.oracle.com Wed Jul 15 15:19:01 2015
Return-Path:
Received: from jzh5.oracle.com (localhost.localdomain [127.0.0.1])
by jzh5.oracle.com (8.13.8/8.13.8) with ESMTP id t6F7I1nS004101
for; Wed, 15 Jul 2015 15:19:01 +0800
Received: (from oracle@localhost)
by jzh5.oracle.com (8.13.8/8.13.8/Submit) id t6F7I1Lr004098;
Wed, 15 Jul 2015 15:18:01 +0800
Date: Wed, 15 Jul 2015 15:18:01 +0800
Message-Id: <201507150718.t6F7I1Lr004098@jzh5.oracle.com>
From: root@jzh5.oracle.com (Cron Daemon)
To: oracle@jzh5.oracle.com
Subject: Cron /home/oracle/delete_arc.sh
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
/bin/sh: /home/oracle/delete_arc.sh: Permission denied
From oracle@jzh5.oracle.com Wed Jul 15 15:21:01 2015
Return-Path:
Received: from jzh5.oracle.com (localhost.localdomain [127.0.0.1])
by jzh5.oracle.com (8.13.8/8.13.8) with ESMTP id t6F7K1iE004121
for; Wed, 15 Jul 2015 15:21:01 +0800
Received: (from oracle@localhost)
by jzh5.oracle.com (8.13.8/8.13.8/Submit) id t6F7K1Aa004118;
Wed, 15 Jul 2015 15:20:01 +0800
Date: Wed, 15 Jul 2015 15:20:01 +0800
Message-Id: <201507150720.t6F7K1Aa004118@jzh5.oracle.com>
From: root@jzh5.oracle.com (Cron Daemon)
To: oracle@jzh5.oracle.com
Subject: Cron /home/oracle/delete_arc.sh
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
/bin/sh: /home/oracle/delete_arc.sh: Permission denied
原來是delete_arc.sh指令碼沒有許可權,修改許可權[oracle@jzh5 ~]$ chmod 775 delete_arc.sh 後就OK了。
但是放在crontab裡就是執行不成功,log也沒有產生,查不到原因,後來發現crontab執行完會自動發資訊到mail裡面
於是在/var/spool/mail/路徑下找到oracle檔案:
[oracle@jzh5 2015_07_15]$ cd /var/spool/mail/
[oracle@jzh5 mail]$ ls
oracle root rpc
[oracle@jzh5 mail]$ vi oracle
/bin/sh: /home/oracle/delete_arc.sh: Permission denied
From oracle@jzh5.oracle.com Wed Jul 15 15:19:01 2015
Return-Path:
Received: from jzh5.oracle.com (localhost.localdomain [127.0.0.1])
by jzh5.oracle.com (8.13.8/8.13.8) with ESMTP id t6F7I1nS004101
for
Received: (from oracle@localhost)
by jzh5.oracle.com (8.13.8/8.13.8/Submit) id t6F7I1Lr004098;
Wed, 15 Jul 2015 15:18:01 +0800
Date: Wed, 15 Jul 2015 15:18:01 +0800
Message-Id: <201507150718.t6F7I1Lr004098@jzh5.oracle.com>
From: root@jzh5.oracle.com (Cron Daemon)
To: oracle@jzh5.oracle.com
Subject: Cron
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
/bin/sh: /home/oracle/delete_arc.sh: Permission denied
From oracle@jzh5.oracle.com Wed Jul 15 15:21:01 2015
Return-Path:
Received: from jzh5.oracle.com (localhost.localdomain [127.0.0.1])
by jzh5.oracle.com (8.13.8/8.13.8) with ESMTP id t6F7K1iE004121
for
Received: (from oracle@localhost)
by jzh5.oracle.com (8.13.8/8.13.8/Submit) id t6F7K1Aa004118;
Wed, 15 Jul 2015 15:20:01 +0800
Date: Wed, 15 Jul 2015 15:20:01 +0800
Message-Id: <201507150720.t6F7K1Aa004118@jzh5.oracle.com>
From: root@jzh5.oracle.com (Cron Daemon)
To: oracle@jzh5.oracle.com
Subject: Cron
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
/bin/sh: /home/oracle/delete_arc.sh: Permission denied
原來是delete_arc.sh指令碼沒有許可權,修改許可權[oracle@jzh5 ~]$ chmod 775 delete_arc.sh 後就OK了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10271187/viewspace-1734629/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle dataguard 自動刪除歸檔日誌Oracle
- 如何定期自動刪除歸檔日誌
- oracle rman不能自動刪除歸檔日誌備份解決Oracle
- 手動刪除歸檔日誌
- oracle刪除歸檔日誌Oracle
- 歸檔日誌的刪除
- Oracle歸檔日誌刪除Oracle
- 刪除歸檔日誌檔案
- 備庫自動刪除已應用的歸檔日誌
- 刪除data guard歸檔日誌
- 作用RMAN 刪除歸檔日誌
- 配置rman來自動刪除應用過的歸檔日誌
- 當ORACLE歸檔日誌滿後如何正確刪除歸檔日誌Oracle
- 誤刪歸檔日誌除導致備份歸檔日誌失敗
- 刪除歸檔,保留最近的5個歸檔日誌
- 自動刪除歸檔日誌的指令碼(尤其是dataguard環境)指令碼
- 手工rm刪除歸檔日誌對備份歸檔日誌的影響
- Oralce資料庫關閉歸檔日誌並且刪除歸檔日誌資料庫
- RMAN delete archivelog命令刪除歸檔日誌及歸檔日誌拷貝deleteHive
- oracle 刪除過期的歸檔日誌Oracle
- rman刪除歸檔日誌命令集
- 歸檔日誌刪除的五種方法
- 【Oracle】 rman 刪除歸檔日誌的命令Oracle
- 【警鐘】謹慎刪除歸檔日誌
- 保證歸檔日誌不能隨意被刪除的四種方法
- 如何正確刪除ORACLE歸檔日誌檔案Oracle
- 用rman 正確地刪除歸檔日誌
- rac+dg環境刪除歸檔日誌
- rman刪除舊的歸檔日誌問題
- asm下如何自動刪除standby上已經applied過的歸檔日誌ASMAPP
- DG_保證歸檔日誌不能隨意被刪除的四種方法
- ORA-00257 (線上更改歸檔路徑,刪除歸檔日誌)
- 11gR2 RMAN歸檔日誌刪除策略
- DATAGUARD_standby刪除歸檔日誌的指令碼指令碼
- rman 刪除指定時間點的歸檔日誌
- DataGuard已應用歸檔日誌刪除指令碼指令碼
- RMAN刪除歸檔日誌時將ASM上空目錄同時刪除ASM
- 在Oracle中,如何定時刪除歸檔日誌檔案?Oracle