【Vegas原创】同一database里建测试tablespace

2年前 (2022) 程序员胖胖胖虎阿
112 0 0

起因:一个PC已经装了3个数据库,现开发人员要求再建一个测试数据库,想来想去,决定在开发数据库orcl中建立test表空间,test用户,导入测试用户his的数据文件。当测试完毕,drop掉test tablespace及datafile即可。

 

操作:

1, 导出his用户的数据:

>exp his/his@orcl file='E:\orcldmp20100804.dmp' log='E:\orcldmp20100804imp.log' 

 

2, 创建test表空间:

SQL>create tablespace TEST 
datafile 'D:\ORADATA\ORCL\TEST01.DBF' size 26000M 
autoextend on next 50m 
maxsize unlimited; 

 

3, 建test用户:

SQL>create user test identified by test default tablespace test temporary tablespace temp; 

 

4, 赋予test用户权限:

SQL>grant connect,resource,dba to test; 

 

5, 导入his用户数据:

>imp test/test@orcl  file='E:\orcldmp20100804.dmp' fromuser=his touser=test log='E:\orcldmp20100804imp.log'
版权声明:程序员胖胖胖虎阿 发表于 2022年10月31日 上午12:08。
转载请注明:【Vegas原创】同一database里建测试tablespace | 胖虎的工具箱-编程导航

相关文章

暂无评论

暂无评论...