Oracle表的导出、导入
有些情况下,需要单独导出某些表,用或者分析数据。
下面记录Oracle表的导出导入方法
1. 表的导出
./exp $username/$passwd@$ORACLE_SID file=/$file_path/$file_name.dmp tables=table1,table2,...
# username 数据库用户名
# passwd 数据库用户密码
# ORACLE_SID 数据库实例名
# file_path 导出文件路径
# file_name 导出文件名称
2. 表的导入
./imp $username/$passwd file=/$file_path/$file_name.dmp log=/$log_path/$log_name.log fromuser=$uname
# username 数据库用户名
# passwd 数据库用户密码
# file_path 导入文件路径
# file_name 导入文件名称
# log_path 导入日志路径
# log_name 导入日志名称
# uname 导出数据库用户名
示例:
1. 导出
[oracle@ufdb39 bin]$ ./exp cwy_init/init_123456789@orcl file=/u01/20230116.dmp tables=sys_usermanage,ma_emp Export: Release 11.2.0.4.0 - Production on Mon Jan 16 15:00:38 2023 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. EXP-00056: ORACLE error 28002 encountered
ORA-28002: the password will expire within 4 days
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set About to export specified tables via Conventional Path ...
. . exporting table SYS_USERMANAGE 10082 rows exported
. . exporting table MA_EMP 10166 rows exported
Export terminated successfully without warnings.
2. 导入:
[oracle@ufdb39 bin]$ ./imp cwy_init/init_123456789 file=/u01/20230116.dmp log=/u01/20230116.log fromuser=cwy_init Import: Release 11.2.0.4.0 - Production on Mon Jan 16 15:02:10 2023 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. IMP-00058: ORACLE error 28002 encountered
ORA-28002: the password will expire within 4 days
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options Export file created by EXPORT:V11.02.00 via conventional path
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing CWY_INIT's objects into CWY_INIT
. importing CWY_INIT's objects into CWY_INIT
Oracle表的导出、导入的更多相关文章
- [CMD]oracle数据库的导出导入
除了推荐使用PL/SQL Developer 工具对oracle进行导出导入(http://www.cnblogs.com/whylaughing/p/5983490.html )之外,比较常用的还有 ...
- [PL/SQL]oracle数据库的导出导入
一.PL/SQL Developer工具一般对oracle的导入导出有以下4中方式: 1.Oracle导出导入方式 这种方式导出导入为.dmp的文件格式,.dmp文件是二进制的,可以跨平台,还能包含权 ...
- 实验:Oracle数据泵导出导入之序列问题
今天同事提出了一个问题: 使用数据泵expdp导出1个schema,有个表主键是触发器自增的id,导入测试库测试时,发现表里的数据比自增序列的值要大.导致插入数据报错. 最终结论是: 由于数据库先进行 ...
- Oracle数据泵导出导入(expdp/impdp)
一.创建表空间 create tablespace atp logging datafile 'D:\oracle\oradata\orcl\atp.dbf' size 50m autoextend ...
- oracle服务端导出/导入方式expdp/impdp
1. expdp导出步骤 1.1 用sys管理员登录sqlplus [root@hxjk_test_mysql_redis_file oracle]# sqlplus SQL*Plus: Releas ...
- oracle数据泵导出导入
先创建一个目录:比如 Create or Replace directory DATA_PUMP_DIR as 'D:\DataPipe'; 然后给导入导出的用户赋权限: Grant read ...
- oracle按用户导出导入表
查看备份目录:select * from dba_directories where directory_name='DATA_PUMP_DIR'; 导入导出的文件名默认都是以备份目录为相对路径. 按 ...
- oracle之PLSQL导出-导入-表-存储过程等操作--亲测好用
1.背景 实际开发中考虑到安全,不会将生产库的数据和本地开发数据进行同步操作,而是采用导入导出sql语句的方式操作; 例如在开发环境写好的存储过程要更新到生产环境,那么就需要使用导出和导入功能. 2. ...
- Oracle expdp/impdp导出导入命令及数据库备份
使用EXPDP和IMPDP时应该注意的事项: EXP和IMP是客户端工具程序,它们既可以在客户端使用,也可以在服务端使用. EXPDP和IMPDP是服务端的工具程序,他们只能在ORACLE服务端使用, ...
- Oracle expdp/impdp导出导入命令及数据库备份(转)
使用EXPDP和IMPDP时应该注意的事项: EXP和IMP是客户端工具程序,它们既可以在客户端使用,也可以在服务端使用. EXPDP和IMPDP是服务端的工具程序,他们只能在ORACLE服务端使用, ...
随机推荐
- 2020-10-13:hash与B+tree的区别?
福哥答案2020-10-13: [答案来自知乎:](https://www.zhihu.com/question/425378511/answer/1522000015) 这里我从数据库索引的层面回答 ...
- docker安装es,单机集群模式.失败。
操作系统:mac系统. docker run -d --name es1 -p 9201:9200 -p 9301:9300 elasticsearch:7.14.0 docker run -d -- ...
- tkinter的Entry设置为不可编辑状态
前 首先我们知道,tkinter中有许许多多的控件,其中使用频繁的控件之一就是Entry(输入框),那么怎么设置它为不可编辑状态呢? state选项 一般我们在写Entry的时候只传入了一个maste ...
- Deferred Components-实现Flutter运行时动态下发Dart代码 | 京东云技术团队
导读 Deferred Components,官方实现的Flutter代码动态下发的方案.本文主要介绍官方方案的实现细节,探索在国内环境下使用Deferred Components,并且实现了最小验证 ...
- 浅析HTTPS的通信机制
什么是HTTPS? HTTPS 是在HTTP(Hyper Text Transfer Protocol)的基础上加入SSL(Secure Sockets Layer),在HTTP的基础上通过传输加密和 ...
- Java并发(九)----线程join、interrupt
1.join 方法详解 1.1 为什么需要 join? 下面的代码执行,打印 r 是什么? static int r = 0; public static void main(String[] arg ...
- input 文件上传 formdata
需求背景 后端给定接口 传xlsx文件 参数:后台需要的参数 格式: formdata 需要 token 1 saveEditIn (e) { 2 this.sheetAll = [] 3 // ...
- @Deprecated注解的使用
被注解@Deprecated标记的程序元素是不鼓励使用的程序元素,通常是因为它很危险,或者是因为存在更好的替代方案. 除了对象自身引用自己用@Deprecated标记的方法外,其他情况使用@Depre ...
- docker 对容器中的文件进行编辑
用途 有一些情况下,例如docker安装的redis.nacos.mysql等等,在docker容器中的安装未进行文件的映射,当需要对其进行更改配置信息时,就会遇到这种情况,需要去容器中进行编辑配置文 ...
- C++ Tips of the Week-01 string_view
1: string_view ref https://abseil.io/tips/1 函数参数需要是一个字符串的时候,通常的实现有以下几种: // C Convention void TakesCh ...