zoukankan      html  css  js  c++  java
  • crontab定时任务

    创建一个定时任务,用于删除一天前的归档日志。用oracle用户创建的,收到报错邮件

    /home/oracle/del_arc.sh: line 4: rman: command not found

    找不到命令,那是环境变量的问题,加入了ORACLE_HOME和ORACLE_HOME,还是报错

    Message file RMAN<lang>.msb not found

    Verify that ORACLE_HOME is set properly

    改成source  .bash_profile后正常。

    $ cat del_arc.sh
    #!/bin/bash
    #export ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1/
    #export ORACLE_SID=SCPRD
    source .bash_profile
    rman target / nocatalog log /home/oracle/delete_arch.log <<EOF
    run
    {
    allocate channel c1 type disk;
    delete noprompt archivelog all completed before 'sysdate-1';
    release channel c1;
    }
    EOF

  • 相关阅读:
    test14
    test13
    test12
    test11
    Xcode常用快捷键
    OC弱语法
    对象的结构体属性的成员修改
    IOS 获取手机各种信息
    IOS app启动过程
    iOS退出键盘的两种方式
  • 原文地址:https://www.cnblogs.com/historynote/p/13825611.html
Copyright © 2011-2022 走看看