zoukankan      html  css  js  c++  java
  • oracle dmp文件导出与导入

    ORACLE 10g导入 ORACLE 11g

    一、expdp.sh导出dmp文件
    export PATH=$PATH:$HOME/bin
    export ORACLE_BASE=/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/11.2.0.4.0/dbhome_1
    export PATH=$PATH:$ORACLE_HOME/bin
    export ORACLE_USER=USER_NAME
    export ORACLE_USER_PASSWORD=PASSWORD
    export VERSION=patch3.1.0.1[R]
    export DIR_NAME=backup
    DMP_FILE=${ORACLE_USER}_${VERSION}_['date + %Y%m%d'].dmp
    LOG_FILE=expdp_${ORACLE_USER}_${VERSION}_['date + %Y%m%d'].log
    expdp $ORACLE_USER/$ORACLE_USER_PASSWORD@$ORACLE_SID  dumpfile=$DMP_FILE schemas=$ORACLE_USER directory=$DIR_NAME logfile=$LOG_FILE version=10.2.0.3.0
    -- version为目标(导入)oracle版本

    二、创建表空间
    sqlplus / as sysdba
    --WINDOWS
    drop tablespace tablespace_temp including contents cascade constraints;
    drop tablespace tablespace_data including contents cascade constraints;

    create temporary tablespace tablespace_temp  
    tempfile 'D:oracleproduct10.2.0oradata empfile ablespace_temp.dbf'
    size 1024m   
    autoextend on  
    next 50m maxsize 30240m  
    extent management local;  

    create tablespace tablespace_data  
    logging  
    datafile 'D:oracleproduct10.2.0oradatadatafile ablespace_data.dbf'
    size 1024m  
    autoextend on  
    next 50m maxsize 30240m  
    extent management local;

    --LINUX
    drop tablespace tablespace_temp including contents cascade constraints;
    drop tablespace tablespace_data including contents cascade constraints;

    --创建tablespace_data临时表空间
    create temporary tablespace tablespace_temp  
    tempfile '/u01/tempfile/tablespace_temp.dbf'
    size 1024m   
    autoextend on  
    next 50m maxsize 30240m  
    extent management local;  

    --创建tablespace_data数据表空间
    create tablespace tablespace_data  
    logging  
    datafile '/u01/datafile/tablespace_data.dbf'
    size 1024m  
    autoextend on  
    next 50m maxsize 30240m  
    extent management local;

    三、创建用户及赋权
    grant dba to USER_NAME;
    grant connect,resource to USER_NAME ;
    grant create public database link,drop public database link to USER_NAME ;
    grant execute on dbms_job to USER_NAME;
    grant create job to USER_NAME;
    grant debug connect session to USER_NAME;
    grant manage scheduler to USER_NAME;

    四、创建目录及赋权
    system或sysdba登录
    CREATE OR REPLACE DIRECTORY DIR_NAME AS 'D:BACKUP';
    GRANT READ, WRITE ON DIRECTORY DIR_NAME TO USER_NAME;

    五、导入数据库
    impdp user_name/password directory=DIR_NAME dumpfile=xxx.dmp logfile=kdbase.impdp.log TABLE_EXISTS_ACTION=append version=10.2.0.3.0
    -- version为目标(导入)oracle版本

  • 相关阅读:
    免费webservice接口
    sql server按符号截取字符串
    javaweb项目部署到tomcat服务器
    sql server导出数据结构
    Mabits简单应用 2017.8.3
    部署项目到tomcat步骤参考如下 2017.7.10
    没事多看文档 2017.7.8
    ssh商城源码 2017.6.30
    axios的详细用法以及后端接口代理
    用Vue来实现音乐播放器(八):自动轮播图啊
  • 原文地址:https://www.cnblogs.com/Jiphen/p/5217704.html
Copyright © 2011-2022 走看看