• expdp.sh and impdp.sh


     ####expdp.sh

    ###### ------------- --   UAT   -- -------------

    @D:dbachangeUATeaisenvenv_eaisuat.sql

    -------------- --   PROD   -- -------------- --

    @D:dbachangePRODeaisenvenv_eaisprod.sql

    conn &v_system_un/&v_system_pw@&V_CONN_STR;

    col dt new_value dt noprint

    select to_char(sysdate, 'YYYYMMDD_HH24MISS') dt from dual;

    define v_log_file=.log1_rollout_&dt..log spool &v_log_file

    set echo on feedback on verify on

    ------------------------------------------ --   1. Check Invalid Ojbect (before)   -- ------------------------------------------

    --

    conn &v_system_un/&v_system_pw@&V_CONN_STR;

    @chk_invalid.sql

    ------------------------------------------ --   2. Check dba_direcotry (before)   -- ------------------------------------------

    conn &v_system_un/&v_system_pw@&V_CONN_STR;

    select DIRECTORY_NAME,DIRECTORY_PATH from dba_directories;  

    ------------------------------------------ --   3. spool exp scripts   -- ------------------------------------------

    set feedback off

    set pagesize 0

    set heading off

    set verify off

    set linesize 200

    set trimspool on

    spool c:/数据库备份.bat;

    select 'expdp &v_system_un/&v_system_pw@&V_CONN_STR file=&V_CONN_STR&dt..dmp directory=DATA_PUMP_DIR log=&V_CONN_STR&dt..log schemas=''&v_eaisdata_un'',''&v_eaisusr_un'',''&v_eaisquery_un'',''&v_eaispatch_un'' parallel=2' from dual;

    spool off

    set feedback on

    set pagesize 9999

    set heading on

    set verify on exit

     ####impdp.sh

    ###### ------------- --   UAT   -- -------------

    @D:dbachangeUATeaisenvenv_eaisuat.sql

    -------------- --   PROD   -- -------------- --

    @D:dbachangePRODeaisenvenv_eaisprod.sql

    conn &v_system_un/&v_system_pw@&V_CONN_STR;

    col dt new_value dt noprint

    select to_char(sysdate, 'YYYYMMDD_HH24MISS') dt from dual;

    define v_log_file=.log1_rollout_&dt..log spool &v_log_file

    set echo on feedback on verify on

    ------------------------------------------ --   1. Check Invalid Ojbect (before)   -- ------------------------------------------

    --conn &v_system_un/&v_system_pw@&V_CONN_STR;

    @chk_invalid.sql

    ------------------------------------------ --   2. Check dba_direcotry (before)   -- ------------------------------------------

    conn &v_system_un/&v_system_pw@&V_CONN_STR;

    select DIRECTORY_NAME,DIRECTORY_PATH from dba_directories;

      ------------------------------------------ --   3. spool exp scripts   -- ------------------------------------------

    set feedback off

    set pagesize 0

    set heading off

    set verify off

    set linesize 200

    set trimspool on

    spool c:/数据库恢复.bat;

    select 'impdp &v_system_un/&v_system_pw@&V_CONN_STR file=&1.dmp directory=DATA_PUMP_DIR log=&V_CONN_STR&dt..log schemas=''&v_eaisdata_un'',''&v_eaisusr_un'',''&v_eaisquery_un'',''&v_eaispatch_un'' table_exists_action=replace  parallel=2' from dual;

    spool off

    set feedback on

    set pagesize 9999

    set heading on

    set verify on exit

    ####设计思路

    ## expdp.sh输入变量

    用户名: 密码: 文件名: 目录名: schema名字

    输出变量 生成文件:

    ## 思路如下: 1. 2.

    ## impdp.sh输入变量

    用户名: 密码: 文件名: 目录名: schema名字

    输出变量 导入之前失效对象 生成文件:导出日志 导入之后失效对象

    ## 思路如下: 1. 2.

  • 相关阅读:
    [转]你每天90%的注意力被浪费了
    通过浏览器navigator获取当前经纬度位置
    Sublime Text 3 安装、插件与个人配置
    ios判断手机号是否可用
    AFNetworking提示3840 Unescaped control character around character XXX
    理解OC“属性”这一概念
    熟悉Objective—C
    如何在自己的应用中打开第三方应用程序
    ios多线程开发总结
    UIView的Touch事件UIControlEvents详解
  • 原文地址:https://www.cnblogs.com/feiyun8616/p/5944746.html
Copyright © 2020-2023  润新知