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

  • 相关阅读:
    从安装、管理到防御_阿里云安骑士全向测评
    云架构师前(钱)景这么好_我们该如何转型?这有两位阿里云云架构总监多年心得
    Infrastructure_as_Code——Kubernetes一键编排实践
    大中华地区(含港澳台)空气质量接口参加阿里云API_as_a_Service_大赛
    E-MapReduce集群启停HDFS/YARN服务
    云服务器ECS还原安全组规则功能介绍_安全组规则的备份与还原
    E-MapReduce集群中HDFS服务集成Kerberos
    FastReport中如何加入自定义函数
    查找算法总结
    八大排序算法总结
  • 原文地址:https://www.cnblogs.com/Jiphen/p/5217704.html
Copyright © 2011-2022 走看看