zoukankan      html  css  js  c++  java
  • export 逻辑备份脚本

    #!/bin/ksh­

    # ##################################################################­

    # nightly_bkup.sh  - nightly backup ­

    #         shell script­

    # ##################################################################­

    # Oracle Environment settings­

    PATH=/usr/bin:/usr/ucb:/etc:.:/usr/X/bin­:/bin   --不同的操作系统,系统命令位置不一样,如date命令,path比较重要

    export PATH­

    ORACLE_SID=PPRD10 ; pw=oracle ; export pw ; export ORACLE_SID­

    ORACLE_BASE=/data/app/oracle ; export ORACLE_BASE­

    ORACLE_HOME=$ORACLE_BASE/10.2.0 ;  export ORACLE_HOME­

    ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data ; export ORA_NLS33­

    TNS_ADMIN=$ORACLE_HOME/network/admin ; export TNS_ADMIN­

    LD_LIBRARY_PATH=$ORACLE_HOME/lib ; export LD_LIBRARY_PATH­

    PATH=$ORACLE_HOME/bin:/usr/local/bin:/usr/ccs/bin:$PATH:/usr/sbin­

    export PATH­

    CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/product/jlib ; export CLASSPATH­

    backup_dir=/data/oradata/BACKUP/PPRD10­

    data_dir=/data/app/oracle/oradata/PPRD10­

    #  Let's start with an export of the database­

    exp system/$pw file=$backup_dir/full_exp_`date +%y%m%d`_PPRD10.dmp full=y \­

        log=$backup_dir/full_exp_`date +%y%m%d`_PPRD10.log consistent=y > /dev/null­

    #采用数据泵要数directory的问题,参考我的数据泵的日志,

    expdp newccs/hfccs123 DIRECTORY=dump_backup_dir DUMPFILE=NewccsTB_`date +%d%m%Y_%H%M%S`.dmp TABLESPACES=newccs logfile=NewccsTB_`date +%d%m%Y_%H%M%S`.log;
    #date  这个date搞了我很长时间,应为没有注意path...

    #如若不能显示,用which date 看下date的位置,加到path里就ok了

    #  Now, we'll shut down the database­

    sqlplus /nolog <<EOF­

    connect / as sysdba­

    shutdown immediate­

    EOF­

    # ...and copy the datafiles­

    cp -p $data_dir/* $backup_dir/datafiles/PPRD10­

    # Finally, we'll restart the database and be done­

    sqlplus /nolog <<EOF­

    connect / as sysdba­

    startup­

    EOF­

    # ­

    # Just to be safe (with space), we'll compress the export file ­

    cd $backup_dir­

    compress *.dmp­

    # Let's delete the backups and logs that are more than 1 days old­

    find $backup_dir -name "full_exp*" -mtime +1 -exec rm {} \;­

    # Cuz we shut down the database, the management server and intelligent­

    # agent need to be restarted -- doh!­

    #oemctrl start oms­

    lsnrctl start­

    # That's all, folks­

  • 相关阅读:
    详解PhpStudy集成环境升级MySQL数据库版本
    Mysql5.5升级到5.7的过程已经踩到的坑
    phpStudy中升级MySQL版本到5.7.17的方法步骤
    Windows上使用Vagrant打造Laravel Homestead可协同跨平台开发环境
    百度云下载加速的
    libsvm的安装,数据格式,常见错误,grid.py参数选择,c-SVC过程,libsvm参数解释,svm训练数据,libsvm的使用详解,SVM核函数的选择
    RBF神经网络的matlab简单实现
    spark mllib docs,MLlib: RDD-based API
    目前所有的ANN神经网络算法大全
    Spark1.6.1 MLlib 特征抽取和变换
  • 原文地址:https://www.cnblogs.com/datalife/p/1985403.html
Copyright © 2011-2022 走看看