oracle 导入导出数据

假设现在一个数据库 orcl ,里面有一个表空间,表空间里有两个用户 scott 和 coder ,如果这里两个用户都用 dba 的权限,如果我们想把 orcl 的数据导出,然后导入另一个数据库(other)中,我把步骤记录下来:

1.从 orcl 中导出数据 (首先保证 oracle 目录中的 bin 路径已经添加到 path 环境变量里)

复制代码
运行 cmd;

输入 exp;

输入用户名
/密码; (scott/tiger)

一路确定;

知道看见输入用户名:输入scott;

就会导出了。

复制代码

2.创建新的数据库 other

3.在新的数据库上建立新用户和表空间

复制代码
create user scott identified by tiger; --创建用户 scott

create user coder identified by tiger;
--创建用户 coder

create tablespace other_data datafile
'E:/oracle/other_data.dbf' size 200M;
--创建表空间 other_data ,设定位置和大小

alter user scott
default tablespace other_data;
--添加 scott 到 other_data 空间里

alter user coder
default tablespace other_data;
--添加 coder 到 other_data 空间里

grant dba to scott;
-- 授权 dba 权限
grant dba to coder;
复制代码

4.导入数据

复制代码
运行 cmd;

imp;

scott
/tiger;

...

scott;
复制代码
posted @   XueM  Views(247)  Comments(0Edit  收藏  举报
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· [AI/GPT/综述] AI Agent的设计模式综述
点击右上角即可分享
微信分享提示