您的位置:首页 > 数据库 > Oracle

oracle 导入导出数据

2010-02-06 13:20 274 查看
假设现在一个数据库 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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: