设为首页 加入收藏

TOP

oracle导入导出(用得比较多)
2015-07-24 11:00:01 来源: 作者: 【 】 浏览:1
Tags:oracle 导入 导出 比较

1.创建目录directory(角色system/sys)

create directory hello_file as 'd:\dupmfile';
--查看所有已创建的directory
--select * from dba_directories;
--drop directory删除路径用的.

--drop directory exp_dir;

2.创建表空间(可以使用其默认表空间)

2.1创建临时表空间

create temporary tablespace hello_temp
tempfile 'f:\oracle\data\hello_temp.dbf'
size 1024m
autoextend on
next 32m
extent management local;


2.2创建数据表空间

create tablespace hello_data
logging
datafile 'f:\oracle\data\hello_data.dbf'
size 512m
autoextend on
next 32m

extent management local;

3.创建用户并修改表空间

conn system/system@orcl;
--删除之前用户
drop user hello_user cascade;
--创建用户(如果有表空间,则加上)
create user hello_user identified by pass default;-- tablespace hello_data temporary tablespace hello_temp;

4.赋权限

--用户的权限
grant resource,connect,dba to hello_user;
--目录的权限
grant read,write on directory hello_file to hello_user;

5.导出

expdp original_user/pass@orcl directory=hello_file dumpfile=data20141014.dmp schemas=original_user
--导出到所建的directory的目录下d:\dupmfile

6.导入

--remap_tablespace改表空间

--remap_schema将original_user用户导入到hello_user中,如果用户名相同,这句可以省略

--data20141014.dmp导出的数据库文件名

impdp hello_user/pass@orcl directory= hello_filedumpfile= data20141014.dmp remap_tablespace= original_data:hello_data remap_schema=original_user:hello_user
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇oracle创建索引 下一篇大批量数据导入数据库,dbf导入or..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Redis 分布式锁全解 (2025-12-25 17:19:51)
·SpringBoot 整合 Red (2025-12-25 17:19:48)
·MongoDB 索引 - 菜鸟 (2025-12-25 17:19:45)
·What Is Linux (2025-12-25 16:57:17)
·Linux小白必备:超全 (2025-12-25 16:57:14)