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版本

  • 相关阅读:
    mysql 查看数据库及表大小以及数据库扩容评估
    idea中配置mybatis 映射文件模版及 mybatis plus 自定义sql
    mybatis plus 中增删改查及Wrapper的使用
    mybatis plus 主键策略
    搭建 spring boot + mybatis plus 项目框架并进行调试
    jeecg datagrid重新指定数据源
    java 日志脱敏框架 sensitive-新版本0.0.2-深度拷贝,属性为对象和集合的
    java 实现敏感词(sensitive word)工具详解使用说明
    java 日志脱敏框架 sensitive,优雅的打印脱敏日志
    互联网公司OpenAPI链接
  • 原文地址:https://www.cnblogs.com/Jiphen/p/5217704.html
Copyright © 2011-2022 走看看