purpors: exp pro data to uat data

exp and imp will not create user

expdp and impdp will create user

1.from table to table

-> IN PROD TS

exp TS/TEST_Data130@TSprod file=D:\projects\TS\TS_TS_20160908_update.dmp  log=D:\projects\TS\eais_all_exp_2016_09_02.log  TABLES=(TS_record_his,TS_record)

->IN UAT

imp TS/gatepassuat_data2@TSuat file=D:\projects\TS\TS_TS_20160908_update.dmp log=D:\projects\TS\TS_upd_imp_2016_09_05.log  fromuser=TS touser=TS tables=(TS_record_his,TS_record)

expdp/impdp

-> IN PROD user:TS

expdp system/oracle123@TSprod file=TS_TS_20160908_update.dmp  directory=TMP_DIR log=TS_all_exp_2016_09_02.log  tables=('TS.TS_record_his','TS.TS_record')

->IN UAT

impdp system/oracle123_@TSuat  directory=DUMP_DIR dumpfile=TS_TS_20160908_update.dmp  log=TS_all_imp_2016_09_02.log table_exists_action=replace remap_schema=TS:TS

--tables=('TS_record_his','TS_record') table_exists_action=replace remap_schema=TS:TS;

--tables=TS.TS_record_his,TS.TS_record remap_schema=TS:TS;

-> in prod SQL> select * from dba_directories;

OWNER                          DIRECTORY_NAME ------------------------------ ------------------------------ DIRECTORY_PATH ------------------------------------------------------------------------ SYS                            TMP_DIR D:\dba\tmp

SYS                            XMLDIR D:\app\Administrator\product\11.2.0\dbhome_1\rdbms\xml

SYS                            ORACLE_OCM_CONFIG_DIR D:\app\Administrator\product\11.2.0\dbhome_1/ccr/state

OWNER                          DIRECTORY_NAME ------------------------------ ------------------------------ DIRECTORY_PATH ------------------------------------------------------------------------ SYS                            DATA_PUMP_DIR D:\app\Administrator/admin/TSprod/dpdump/

SYS                            ORACLE_OCM_CONFIG_DIR2 D:\app\Administrator\product\11.2.0\dbhome_1/ccr/state

-> in UAT SQL> select * from dba_directories;

OWNER                          DIRECTORY_NAME ------------------------------ ------------------------------ DIRECTORY_PATH -------------------------------------------------------------------------------- SYS                            DUMP_DIR D:\dba\dump

SYS                            XMLDIR D:\app\Administrator\product\11.2.0\dbhome_1\rdbms\xml

SYS                            ORACLE_OCM_CONFIG_DIR D:\app\Administrator\product\11.2.0\dbhome_1/ccr/state

OWNER                          DIRECTORY_NAME ------------------------------ ------------------------------ DIRECTORY_PATH -------------------------------------------------------------------------------- SYS                            DATA_PUMP_DIR D:\app\Administrator/admin/TSuat/dpdump/

SYS                            ORACLE_OCM_CONFIG_DIR2 D:\app\Administrator\product\11.2.0\dbhome_1/ccr/state

2.from schema to schema

-Prepare:
c:\app\oracle\dump: datapump

select count(*) from dba_objects where owner IN
(select username from dba_users where account_status='OPEN' and username not in ('SYS','SYSTEM','OPER','BACKUPDB'))

select owner,object_name from dba_objects where owner IN
(select username from dba_users where account_status='OPEN' and username not in ('SYS','SYSTEM','OPER','BACKUPDB'))
and statuS='INVALID';

-charater
SELECT * FROM v$nls_parameters WHERE PARAMETER='NLS_CHARACTERSET';   
set NLS_LANG="AMERICAN_AMERICA.AL32UTF8"

-rollout

in prod

expdp system/oracle123@testuat file=TS_TS_20160928_update.dmp  directory=datapump log=TS_all_exp_2016_09_28.log  SCHEMAS='etestquery','testrusr','testdata' parallel=2

in uat

impdp tuser/tuser file=TS_TS_20160928_update.dmp  directory=datapump 'etestquery','testrusr','testdata' table_exists_action=replace parallel=2;

in prod

expdp system/oracle123@testuat file=TS_TS_20160928_update.dmp  directory=DATA_PUMP_DIR log=TS_all_exp_2016_09_28.log  SCHEMAS='etestquery','testrusr','testdata' parallel=2;

in uat

impdp tuser/tuser file=TS_TS_20160928_update.dmp  directory=DATA_PUMP_DIR SCHEMAS='etestquery','testrusr','testdata' table_exists_action=replace parallel=2  log=TS_all_imp_2016_09_28.log;

执行@$ORACLE_HOME/rdbms/admin/utlrp.sql脚本编译数据库失效对象。

Run the utlrp.sql script as SYS user.
@%ORACLE_HOME%/rdbms/admin/utlrp.sql

3.ps

使用imp进行数据导入时,若表已经存在,要先drop掉表,再进行导入。

而使用impdp完成数据库导入时,若表已经存在,有四种的处理方式:

1)  skip:默认操作

2)  replace:先drop表,然后创建表,最后插入数据

3)  append:在原来数据的基础上增加数据

4)  truncate:先truncate,然后再插入数据

EXP AND IMP的更多相关文章

  1. ORACLE 导出(exp) & 导入(imp)

    导出(exp) & 导入(imp)     利用Export可将数据从数据库中提取出来,就是将select的结果存到一个FS二进制文件上    利用Import则可将提取出来的数据送回到Ora ...

  2. oracle的exp和imp命令的使用【转载】

    oracle的exp和imp命令的使用     我们通常要对ORACLE的数据进行导入,导出,在没有expdb,impdb以前(10G以前),我们都是使用exp 导出,imp命令来实现导入.   打开 ...

  3. exp和imp的使用场合

    1.检测冲突 使用exp工具,在数据库中预先检测到物理或逻辑冲突. 导出的同时,将全扫描数据库中的每张表,读出所有行.如果某处表中有个损坏的块,必然能找到它. 2.可以用来快速恢复数据库. 使用exp ...

  4. exp和imp的工作原理

    --1.exp和imp的输入都是名字和值对: 如:exp parameter_name=value 或exp parameter_name=(value1,value2,value3..) --2.e ...

  5. exp和imp导入导出时表空间问题【未完】

    准备工作 第一步: 创建教师和学生用户 教师用户/密码 TEACHER/t123456 学生用户/密码 STUDENT/s123456 参考链接 http://www.cnblogs.com/what ...

  6. sqlplus、exp、imp不是内部或外部命令,也不是可运行的程序

    oracle 想exp导出数据库,参考网上的作业,进入CMD命令,黑屏后输入命令出现EXP后出现EXP不能内部或外部命令. 网上找到下列解决方法 摘自:http://blog.csdn.net/suz ...

  7. (转)oracle使用expdp、impdp和exp、imp导入导出表及表结构

    使用expdp.impdp和exp.imp时应该注重的事项: 1.exp和imp是客户端工具程序,它们既可以在客户端使用,也可以在服务端使用. 2.expdp和impdp是服务端的工具程序,他们只能在 ...

  8. oracle 之 EXP、IMP 使用简介

    注:DOS命令行中执行exp.imp 导出导入ORACLE数据,ORACLE操作者具有相应的权限! 1.1.导出整库或当前用户:关键字:full语法:exp 用户/密码@数据库实例名 file=导出文 ...

  9. oracle的exp、imp命令

    1.EXP a>完全模式 full=y EXP USER/PASSWORD@DB (AS ROLE) BUFFER=64000 FILE=C:\FULL.DMP FULL=Y b>用户模式 ...

随机推荐

  1. JavaScript忍者秘籍——函数(下)

    概要:本篇博客主要介绍函数的一些类型以及常见示例 1.匿名函数 使用匿名函数的常见示例: window.onload = function(){ assert(true,'power!'); }; / ...

  2. 最短路径Shortest Path algorithm

    最短路径问题: 如果从图中某一顶点(称为端点)到达另一顶点(称为终点)的路径可能不止一条,如何找到一条路径使得沿此路径上各边上的权值总和达到最小. (1)Dijkstra 算法 (2) Floyd 算 ...

  3. ubuntu安装docker

    uname -r #查看内核版本要大于3.10apt-get updateapt-get install linux-image-generic-lts-trusty wget -qO- https: ...

  4. WimTool(Wim映像处理工具) V1.30.2011.501 免费绿色版

    软件名称: WimTool(Wim映像处理工具) V1.30.2011.501 免费绿色版软件语言: 简体中文授权方式: 免费软件运行环境: Win7 / Vista / Win2003 / WinX ...

  5. Asp.Net MVC 在后台获取PartialView、View文件生成的字符串

    在Asp.net MVC的实际开发中,有时需要在后台代码中获取某个View 或者 PartialView 生成的字符串,示例如下: 1. 将View文件输出为字符串: /// <summary& ...

  6. Windows 小端存储

    小端->高高低低(高位存在高地址,低位存在低地址)

  7. Centos6.6安装Nginx

    1.在安装nginx之前,需要先安装该模块需要依赖包 yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel 2.安 ...

  8. js或jquery实现图片轮播

    如: 1.//3个div的统一class = 'div' var index =0; //3秒轮播一次 var timer = setInterval(function(){     index =  ...

  9. TCP/IP体系结构

    如果你确实还没接触过网络.数据通信方面的技术,那么咱们的路还很长,至少我认为软件测试并非只停留在上层的应用,而测试的最高境界应该是对底层核心技术的测试,通过架构分析.协议数据包分析等等来测试出结果-- ...

  10. selenium C#下的zencart自动化测试(WFloginUrlPayment)环境4.0

    using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using Sy ...