zoukankan      html  css  js  c++  java
  • oracle 数据库备份脚本(数据泵1-全库)

    #!/bin/sh
    # ##################################################################
    # Powered by Ironfo
    # ##################################################################
    # Oracle Environment settings
    ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
    ORACLE_HOME=$ORACLE_BASE/product/db_1; export ORACLE_HOME
    export ORACLE_SID=实例名
    export PATH=$PATH:$ORACLE_HOME/bin
    backup_dir=/bak
    #创建数据泵目录directory,DBBAK
    #SQL>CREATE DIRECTORY DBBAK as '/bak';
    #SQL>grant read,write on directory DBBAK to 用户;
    DMP_FILE=PH_$(date +%Y%m%d_%H%M%S).dmp
    LOG_FILE=PH_$(date +%Y%m%d_%H%M%S).log
    #
    # Let's start with an export of the database
    expdp 用户名/密码@ip/实例名(或 TNS)   full=y directory=DBBAK DUMPFILE=$DMP_FILE logfile=$LOG_FILE ;

    #
    # Let's delete the backups and logs that are more than 1 days old
    # 删除2天前PH_开头的dmp文件
    #
    cd $backup_dir
    find $backup_dir -mtime +7 -name "PH_*" -exec rm -f {} ;

  • 相关阅读:
    LeetCode 773. Sliding Puzzle
    oracle latch工作原理
    Oracle关于锁的几种类型和参数
    Java的反射机制
    JAVA多线程与并发学习总结
    Spring 概念详解
    Spring的AOP
    spring面试题 对DI , AOP概念的理解
    双11的架构
    Java线程的定义
  • 原文地址:https://www.cnblogs.com/zhm1985/p/12667118.html
Copyright © 2011-2022 走看看