当前位置:网站首页>table_exists_action=append和table_exists_action=truncate
table_exists_action=append和table_exists_action=truncate
2022-06-10 23:45:00 【柠檬】
table_exists_action=append和table_exists_action=truncate
一、环境准备
1.1 192.168.1.22上创建single01.student表
SQL> select * from single01.student;
ID NAME
------------ --------------------------------------------------------------------
1 xiaoming
expdp导出该表
mkdir -p /backup/expdp0522
create or replace directory dir_dump as '/u01/app/oracle/exp';
expdp \"/ as sysdba\" directory=dir_dump dumpfile=u_single01_202205_%U.dump parallel=2 logfile=u_single01_202205.log schemas=single01
impdp在192.168.1.67中导入该表
export ORACLE_SID=jdedb1
impdp \"/ as sysdba\" directory=dir_dump dumpfile=u_single01_202205_%U.dump parallel=2 schemas=single01 logfile=u_single01_202205.log
在192.168.1.67目标端上,
SQL> select * from single01.student;
ID NAME
---------- --------------------
1 xiaoming
二、验证append参数
1.修改源库数据
SQL> select * from single01.student;
ID NAME
---------- --------------------
1 xiaomingming
2 xiaozhang
2.导出后导入:
impdp \"/ as sysdba\" directory=dir_dump dumpfile=u_student_01modify_202205_%U.dump parallel=2 tables=single01.student logfile=u_student_01_202205.log table_exists_action=append
在192.168.1.67目标端上,
SQL> select * from single01.student;
ID NAME
---------- --------------------
1 xiaoming
1 xiaomingming
2 xiaozhang
可以看见,对不impdp之前得数据,参数append不能分辨已有数据,而是直接在后面全表追加
三、验证truncate参数
1.修改源库数据
SQL> update single01.student set name='xiaozhangzhang' where id=2;
1 row updated.
SQL> insert into single01.student values(3,'xiaoli');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from single01.student;
ID NAME
---------- ----------------------------------------------------------------------
1 xiaomingming
2 xiaozhangzhang
3 xiaoli
2.导出后导入数据
expdp \"/ as sysdba\" directory=dir_dump dumpfile=u_student_02modify_202205_%U.dump parallel=2 logfile=u_student_02modify_202205.log tables=single01.student
impdp \"/ as sysdba\" directory=dir_dump dumpfile=u_student_02modify_202205_01.dump parallel=2 tables=single01.student logfile=u_student_02_202205.log table_exists_action=truncate
此时在192.168.1.67目标端上检查
SQL> select * from single01.student;
ID NAME
---------- ----------------------------------------------------------------------
1 xiaomingming
2 xiaozhangzhang
3 xiaoli
truncate参数是删除目标端67上得原有数据,再将新数据导入
边栏推荐
- SQL audit | "cloud" users can use the SQL audit service with one click
- [network planning] 1.5 seven layer network model and five layer network model
- Installation of phpstudy
- 87.(leaflet之家)leaflet军事标绘-直线箭头修改
- What is the difference between hubs, switches and routers?
- Lucene mind map makes search engines no longer difficult to understand
- Kubernetes入门介绍与基础搭建
- 市值215亿,这个四川80后会让电视机成为历史?
- MySQL
- Safety training management measures
猜你喜欢

How to guarantee the quality of real-time data, the cornerstone of the 100 million level search system (Youku Video Search)? v2020

Décomposition détaillée du problème de chemin le plus court du graphique

圖的最短路徑問題 詳細分解版

大厂是面对深度分页问题是如何解决的(通俗易懂)

Idea setting background picture (simple)

How word removes the header line

Deploy netron services through kubernetes and specify model files at startup

What exactly does Devops mean?

Volatile keyword for concurrent programming

Blocking queue - delayedworkqueue source code analysis
随机推荐
oracle带xy字段值的关系表同步到pg数据库转为几何字段
跳转页面后回不去默认页面
How to install mathtype6.9 and related problem solutions in office2016 (word2016)
微信小程序实现OCR扫描识别
Room第一次使用
[network planning] 2.1.2 transport layer services that can be selected by the application
day01
数的奥秘之幂数与完全平方数
STM32 cannot download again after downloading the code
为什么使用 Golang 进行 Web 开发
Unable to return to the default page after page Jump
[untitled] test
Adapter mode
Loop structure statement
五大类型负载均衡的原理场景详解
[no title] 4555
[network planning] 2.4 DNS: directory service of the Internet
twelve billion three hundred and twenty-four million two hundred and forty-three thousand two hundred and forty-two
系统应用安装时,签名校验失败问题
扎实的基础知识+正确的方法是快速阅读源码的关键