oracle下导出某用户所有表的方法
oracle下导出某用户所有表的方法
scott/tiger是用户名和密码,handson是导出的实例名
按用户方式导出数据(owner当中写的是用户名) exp scott/tiger@handson file=scott_back owner=scott
按表方式导出数据(talbes当中写的是全部表的名称) exp scott/tiger@handson tables=(emp, dept) file=scott_back_tab
按表空间方式导出数据(tablespaces当中写的是表空间名称) exp system/handson@handson tablespaces=(users) file=tbs_users
使用参数文件导出数据 exp system/handson parfile='C:\parameters.txt
1、cmd->exp->username/passwd@sid-->.....一路回车--->输入导出库得名字 就把所有的表、视图、存储过程、函数、作业等乱七八糟的都导出来了;
2、pl/sql-->工具---〉导出用户对象 可以找到你要导的东东。
两者都可以的很方便!
导出表: exp scott/tiger@mycon tables=(dept,emp) file=tab1.dmp
导出用户: exp system/manager@mycon owner=scott file=usr1.dmp
导出数据库:
1.完全导出 exp system/manager@mycon full=y inctype=complete file=full1.dmp
2.2.增量导出 exp system/manager@mycon full=y inctype=incremental file=inc1.dmp
3.3.累积导出 exp system/manager@mycon full=y inctype=cumulative file=cum1.dmp
4.导入表: imp system/manager@mycon file=c:\tab1.dmp tables=(dept,emp) touser=scott
5.导入用户: imp system/manager@mycon file=usr1.dmp fromuser=scott touser=scott
导入数据库:
1.全库导入 imp system/manager@mycon file=full1.dmp full=y
2.2.增量导入
1)导入数据库最新信息 imp system/manager@mycon inctype=system full=y file=inc7.dmp
2)2)导入最近完全导出文件 imp system/manager@mycon inctype=restore full=y file=full1.dmp 3)导入所有累积导出文件 imp system/manager@mycon inctype=restore full=y file=cum1.dmp 4)导入最近一次增量导出的文件 imp system/manager@mycon inctype=restore full=y file=inc1.dmp
常用的命令
Exp user/password@instance file=file.dmp rows=y log=log_name 其中username/password为导出用户的用户名和密码 Instance为导出的实例名
Rows是指定是否要导入表中的行
导出一个用户下的表结构为sql文件: 使用命令好像导出的都是dmp文件 可以使用plsql软件在tools--àexport user object 如果不要到处table space ,不要勾include storage 选择导出的路径文件名,export可以直接导出了
例子1:(本方法限oracle9i版本以上)
例子2: 首先在sqlplus下以该用户登录到oracle数据库,然后将以下内容粘贴到sqlplus中: set feedback off; set pagesize 0; set heading off; set verify off; set linesize 200; set trimspool on; spool c:\数据库备份.bat; select 'exp username/ffffff@yourdb TABLES='||table_name||' FILE='||table_name||'.dmp TRIGGERS=N' from user_tables; spool off; set feedback on; set pagesize 9999; set heading on; set verify on; exit 完成后在找到 c:\数据库备份.bat 文件,编辑该批处理文件,将第一行和最后一行删掉,保存后运行该批处理文件就可全部导出该用户下的所有表。
oracle下导入某用户所有表的方法
将整个文件导入数据库 imp system/handson@handosn file=item_back.dmp ignore=y full=y 将scott用户的表导入到martin用户 imp system/handson@handosn file=scott_back fromuser=scott touser=martin tables=(emp,dept)
使用参数文件导入数据 imp system/oracle parfile='C:\parameters.txt
常用命令 Imp username/password file=file.dmp fromuser=user1 touser=user2 rows=y
其中username/password为导入到数据库的用户名和密码 Fromuser为备份数据库时的用户 Touser为导入数据库的用户,一般和username同
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架