oracle表空间的创建及dmp 文件的导入(推荐)

发布时间:2022-04-20 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了oracle表空间的创建及dmp 文件的导入(推荐)脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_360_0@--用oracle系统权限的账号 登陆

-- 1.创建用户
create user u_name identified by "u_password";
--2.赋予权限
grant dba, resource, connect to u_name; 
grant create session to u_name;
grant create table to u_name;
grant create view to u_name;
grant create tablespace to u_name;
grant unlimITed tablespace to u_name;
grant select any table to u_name;
grant select any dictionary to u_name;
--3.创建目录 dictionary
create directory directory_name as 'D:\oracleenv\Oracle\PRoduct\11.2.0\db\backup'; --路径可以自己指定
--4.赋予目录权限
GRANT read,write ON DIRECTORY directory_name TO u_name;
--5.创建表空间
create tablespace table_space_name
datafile 'D:\oracleEnv\Oracle\product\11.2.0\dbhome_1\oradata\table_space_name.DBF'
size 2500M
autoextend on next 500M maxsize 12000M; 
--6.修改表空间配置
ALTER USER table_space_name DEFAULT TABLESPACE u_name;
--8.查看表空间
select tablespace_name , file_id,bytes From dba_data_files where tablespace_name='my_table_space_name';
-- 9.导入数据
-简单版 
impdp u_name/u_password@ORCL dumpfile=file_path full=y table_exists_action=replace
--常用版
impdp u_name/u_password@ip_address/space_name directory=my_director full=y dumpfile=my_dmp_file.DMP LOGfile=my_dmp_file.log table_exists_action=replace;
--高级版
impdp u_name/u_password@ip_address/space_name directory=my_director full=y dumpfile=my_dmp_file.DMP logfile=my_dmp_file.log
[remap_schema=user_1:user_2] [remap_tablespace =table_space_1:table_space_2] [table_exists_action=replace]

总结

以上所述是小编给大家介绍的oracle表空间的创建及dmp 文件的导入,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本宝典网站的支持!

脚本宝典总结

以上是脚本宝典为你收集整理的oracle表空间的创建及dmp 文件的导入(推荐)全部内容,希望文章能够帮你解决oracle表空间的创建及dmp 文件的导入(推荐)所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。