1、数据泵导入导出
create directory dump_file_dir as '/home/oracle/';
grant read,write on directory dump_file_dir to gyj;
expdp gyj/gyj directory=dump_file_dir dumpfile=gyj20121117.dmp nologfile=y;
create user gyj1 identified by gyj1 default tablespace t2;
grant dba to gyj1;
impdp test1/test1 directory=dump_file_dir dumpfile=gyj20120922.dmp remap_schema=gyj:test1 remap_tablespace=USERS:TP50,TP2:TP50,TP12:TP50 nologfile=y
注:select * from dba_datapump_jobs;
expdp gyj/gyj attach=gyj1.SYS_EXPORT_SCHEMA_01;
kill-->yes(kill_job此命令在11g中不能用);
2、表空间传输(Transportable Tablespace):OLTP
A库:
exec dbms_tts.transport_set_check('OLTP',true); //检查是否自包含(如索引,分区表,CLOB等不在一个表空间就不是自包含)
select * from transport_set_violations; //如果返回为空说明满足自包含
create directory dir_prod as ‘/home/oracle/dir’;
alter tablespace oltp read only;
expdp system/oracle dumpfile=oltp.dmp directory=dir_prod TRANSPORT_TABLESPACES=oltp;
scp /u01/app/oracle/oradata/PROD/Disk1/oltp1.dbf oracle@192.168.0.3:/u01/app/oracle/oradata/EMREP/
scp /home/oracle/dir/oltp.dmp oracle@192.168.0.3:/home/oracle/dir
B库:
create directory dir_prod as ‘/home/oracle/dir’;
create user oltp_user identified by oracle;
grant dba to oltp_user;
impdp system/oracle@emrep dumpfile='oltp.dmp' directory= dir_emrep transport_datafiles='/u01/app/oracle/oradata/EMREP/oltp1.dbf','/u01/app/oracle/oradata/EMREP/batch.dbf'
A、B库:
alter tablespace oltp read write;
*************************************
alter database mount;
alter database datafile '/u01/app/oracle/oradata/bxdb/tp1.dbf' offline drop ;
alter database open;
drop tablespace tp1 including contents and datafiles cascade constraints;
***************************************
3、SQL*Loader
(1)建表
create table gyj_yktjsxxb(sfzh varchar2(20),xm varchar2(20));
(2)记事本中的数据
vi t_jzgxx_sm.txt
432325197810254019|Tom|
433101196303180048|Joe|
433101195709120024|Rose|
43310119691229004x|Jack|
433101196711270050|Linda|
433101197306101514|Jeny|
vi ytkjsxx.ctl
load data
infile '/home/oracle/t_jzgxx_sm.txt'
into table gyj_yktjsxxb
fields terminated by '|'
(sfzh,xm)
sqlldr userid=gyj/gyj control=/home/oracle/ytkjsxx.ctl
4、外部表
(1)、Loader生成外部表加载文件:Administrator's Guide 15章结尾 create external table
In the scripts directory, you will find prod_master.dat and prod_master.ctl. Using the information found in these files,
create an external table names PROD_MASTER in the SH schema of the PROD database.
[oracle@rptdb1 external]$ cat prod_master.ctl
load data
infile '/home/oracle/dir/prod_master.dat'
append
into table costs
fields terminated by ","
(channel_id,prod_id,promo_id,time_id,unit_cost,unit_price)
[oracle@rptdb1 external]$
[oracle@rptdb1 external]$ cat prod_master.dat
6,6,6,6,6,600
7,7,7,7,7,700
create directory dir as '/opt/oracrs/external';
grant read,write on directory dir to sh;
create table costs(channel_id number,prod_id number,promo_id number,time_id number,unit_cost number,unit_price number
);
sqlldr gyj/gyj control=prod_master.ctl external_table=GENERATE_ONLY
(2)、Datapump外部表卸载:Database Data Warehousing Guide 12章结尾部分Extracting into Export Files Using External Tables
CREATE TABLE ext_t1
ORGANIZATION external
(
TYPE ORACLE_DATAPUMP
DEFAULT DIRECTORY dump_file_dir
location ('t1.dat')
)
as SELECT * FROM T1 WHERE ID=1;
(3)、Datapump外部表加载
SQL> create table ext_t1
(id number,
name varchar2(100)
)
organization external
(
type oracle_datapump
default directory DUMP_FILE_DIR
location ('t1.dat')
);
**********本博客所有内容均为原创,如有转载请注明作者和出处!!!**********
Name: guoyJoe
QQ: 252803295
Email: oracledba_cn@hotmail.com
Blog:http://blog.csdn.net/guoyJoe
ITPUB:http://www.itpub.net/space-uid-28460966.html
OCM:http://education.oracle.com/education/otn/YGuo.HTM
_____________________________________________________________
加群验证问题:哪些SGA结构是必需的,哪些是可选的?否则拒绝申请!!!
答案在:http://blog.csdn.net/guoyjoe/article/details/8624392
Oracle@Paradise 总群:127149411
Oracle@Paradise No.1群:177089463(已满)
Oracle@Paradise No.2群:121341761
Oracle@Paradise No.3群:140856036
分享到:
相关推荐
由于大数据里面涉及到非关系型数据库如hive、kudu、hbase等的数据迁移,目前涉及到的迁移工具都没有支持hive数据库的事务表的迁移,如果hive库里面存在大量的事务表的时候,目前的工具都是不支持的,例如华为的CDM,...
Oracle导Mysql适用于百、千万级别数据迁移,速度是kettle的10倍以上数据库迁移 数据迁移 千万级 亿万级数据,MySQL oracle关系型 现需要开发一套程序用来快速迁移数据库,要求如下: 1.使用人员可以指定迁移数据库...
1、新旧redis集群迁移 2、支持redis集群的存量和增量数据迁移 3、支持redis集群数据的离线迁移
数据迁移服务V200R100C00----VMware虚拟机数据迁移方案.doc
表数据迁移 表中的数据量在几亿以下
去年年底做了不少系统的数据迁移,大部分系统由于平台和版本的原因,做的是逻辑迁移,少部分做的是物理迁移,有一些心得体会,与大家分享。 首先说说迁移流程,在迁移之前,写好方案,特别是实施的方案步骤一定...
然后,逐个执行存储过程,将原来数据迁移到新的表中。 5,删除存储过程,清理临时过程。 6,删除第1步中重命名的表。 7,分析新创建的表,生成表的统计信息 8,删除新创建的分区表。 9,创建原来存储过程使用的临时...
Oracle 数据迁移是比较麻烦的,对菜鸟来说更是如此。最近由于更换服务器,需要将Oracle迁移到另外一台机器,在两个服务器环境相同,以及 Oracle版本相同的前提下,通过直接拷贝数据文件到新服务器,就可以直接迁移...
yugong 是阿里巴巴推出的去Oracle数据迁移同步工具(全量 增量,目标支持MySQL/DRDS)。2008年左右,阿里巴巴开始尝试MySQL的相关研究,并开发了基于MySQL分库分表技术的相关产品,Cobar/TDDL(目前为阿里云DRDS产品),...
oracle 数据迁移技术汇总,各种姿势都行。需要数据迁移的技术完整手册
数据迁移和数据集成
主要介绍了Redis数据导入导出以及数据迁移的4种方法详解,需要的朋友可以参考下
AIX数据迁移
用友NC56、57到NC63数据迁移工具V1.0操作手册,用友NC56、57到NC63数据迁移工具V1.0操作手册
可以将Oracle、SQL、MDB、MySQL、Txt、Excel等多种数据源中的数据自由进行转换和数据迁移的软件,类似ETL的软件,并针对Oracle加入了备份和恢复功能 具有如下特点: 1.可以把一个数据库中所需要的记录导入到另一个...
postgreSQL数据迁移到达梦数据库操作
通过EXP/IMP可以实现产品系统的跨平台的迁移,需要迁移的数据库已经部署了高级复制环境,打算进行一系列的测试,测试包含高级复制环境数据库在通过 EXP/IMP工具迁移...文中通过实例介绍了利用EXP/IMP工具实现数据迁移。
1.该文档包含了下载,安装,与mysql数据迁移到金仓数据库 2.windows, kingbase SE V8
mysql数据迁移到postgresql最简单的方式,亲测可以成功迁移。
数据迁移方法概述