zoukankan      html  css  js  c++  java
  • oracle备份脚本

    !/bin/sh

    export ORACLE_BASE=/opt/app
    export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0.4/dbhome_1
    export ORACLE_SID=ora11g
    export NLS_LANG='AMERICAN_AMERICA.AL32UTF8'
    export PATH=.:$PATH:$ORACLE_HOME/bin                                                   oracle变量在  /etc/profile 中可以看到。
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib                  注:oracle变量,不添加脚本无法在crontab 定时任务中自动执行。

     

    FILEPATH=/home/oracle/bachup         存储目录                          

    PW=hello1234!                                      密码

    expdp xny_absorptive/$PW DUMPFILE=xny_absorptive.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_absorptive     备份数据
    sleep 5       
    expdp xny_common/$PW DUMPFILE=xny_common.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_common
    sleep 5
    expdp xny_environment/$PW DUMPFILE=xny_environment.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_environment
    sleep 5
    expdp xny_intracompany/$PW DUMPFILE=xny_intracompany.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_intracompany

    sleep 5
    expdp xny_load/$PW DUMPFILE=xny_load.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_load
    sleep 5
    expdp xny_manufacturer/$PW DUMPFILE=xny_manufacturer.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_manufacturer
    sleep 5
    expdp xny_newtechnology/$PW DUMPFILE=xny_newtechnology.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_newtechnology
    sleep 5
    expdp xny_planningplan/$PW DUMPFILE=xny_planningplan.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_planningplan
    sleep 5
    expdp xny_policyresearch/$PW DUMPFILE=xny_policyresearch.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_policyresearch
    sleep 5

    leep 5
    expdp xny_resources/$PW DUMPFILE=xny_resources.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_resources
    sleep 5
    expdp xny_gis/$PW DUMPFILE=xny_gis.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_gis
    sleep 5
    expdp xny_splydemand/$PW DUMPFILE=xny_splydemand.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_splydemand
    sleep 5
    expdp xny_tariffsubsidy/$PW DUMPFILE=xny_tariffsubsidy.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_tariffsubsidy
    sleep 5
    expdp xny_assistmakepolicy/$PW DUMPFILE=xny_assistmakepolicy.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_assistmakepolicy
    sleep 5
    expdp xny_bigdata/$PW DUMPFILE=xny_bigdata.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_bigdata
    sleep 5
    expdp xny_statistics/$PW DUMPFILE=xny_statistics.DMP DIRECTORY=DATA_PUMP_DIR schemas=xny_statistics
    cd /opt/app/admin/ora11g/dpdump/
    mv *.DMP $FILEPATH

  • 相关阅读:
    [转]实现财务自由的6大步骤
    [转] js 实现table每列可左右拖动改变列宽度
    [转]在Excel中使用SQL语句实现精确查询
    [书目20150727]有效沟通-余世维
    [书目20150727]选择重于一切(扎克伯格给年轻人的37个人生忠告)
    [转]把汉字写“绝”了
    [转]《间架结构92法》
    深圳社保转入
    广州社保转出
    [转]利用telnet进行SMTP的验证
  • 原文地址:https://www.cnblogs.com/L1-5551/p/12750276.html
Copyright © 2011-2022 走看看