当前位置:网站首页>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上得原有数据,再将新数据导入
边栏推荐
- [network counting] 1.4 network delay, packet loss and throughput
- QT program plug-in reports an error plugin xcb
- 阿里云配置SLB(负载均衡)实例
- Promise
- [论文阅读] BoostMIS: Boosting Medical Image Semi-supervised Learning with Adaptive Pseudo Labeling
- SLAM卡尔曼滤波&&非线性优化
- A simple understanding of B tree
- 网络工程师必修课防火墙安全区域及安全策略基础操作
- 大厂是面对深度分页问题是如何解决的(通俗易懂)
- Using solrj to add, delete, modify, and query Solr is too simple
猜你喜欢

Dual wing layout

Kubernetes入门介绍与基础搭建

MESI cache consistency protocol for concurrent programming

招聘 | 南京 | TRIOSTUDIO 三厘社 – 室内设计师 / 施工图深化设计师 / 装置/产品设计师 / 实习生等
![[network counting] 1.4 network delay, packet loss and throughput](/img/a8/74a1b44ce4d8b0b1a85043a091a91d.jpg)
[network counting] 1.4 network delay, packet loss and throughput

Block queue - delayedworkqueue Source Analysis

阻塞隊列 — DelayedWorkQueue源碼分析

Adapter mode
![[论文阅读] BoostMIS: Boosting Medical Image Semi-supervised Learning with Adaptive Pseudo Labeling](/img/10/a60cfe830e2238de00121d7bd95ad6.png)
[论文阅读] BoostMIS: Boosting Medical Image Semi-supervised Learning with Adaptive Pseudo Labeling

Random points in non overlapping rectangles
随机推荐
How word inserts a guide (dot before page number) into a table of contents
循环结构语句
Wechat applet to realize OCR scanning recognition
亿级搜索系统(优酷视频搜索)的基石,如何保障实时数据质量?v2020
[network planning] 2.1.1 brief introduction to client server system and P2P system
Pirate OJ 146 character string
浅谈有赞搜索质量保障体系 v2021
网络工程师必修课防火墙安全区域及安全策略基础操作
Deploy netron services through kubernetes and specify model files at startup
systemd 下开机启动的优化,删除无用的systemd服务
Kubeflow 1.2.0 installation
Pirate OJ 148 String inversion
The driver has not received any packets from the server
海贼oj#146.字符串
STM32下载代码后出现无法再次下载的问题
BGP基础概念及IBGP基本配置
[network planning] 2.4 DNS: directory service of the Internet
SLAM卡尔曼滤波&&非线性优化
[论文翻译] Recent Advances in Open Set Recognition: A Survey
Alicloud configures SLB (load balancing) instances