oracle创建表空间和用户及导入dmp文件

/*
说明:若已经存在相应的用户和表空间,则需要先删除相应的用户和表空间
然后再全部重新建立
*/
–删除用户
drop user xhfundweb cascade;

–删除表空间
drop tablespace XHFUND_DATA_TEMP including contents and datafiles;
drop tablespace XHFUND_DATA including contents and datafiles;

–创建临时表空间
create temporary tablespace XHFUND_DATA_TEMP tempfile ‘XHFUND_DATA_TEMP.DBF’
size 500M autoextend on;

–创建表空间
create tablespace XHFUND_DATA logging datafile ‘XHFUND_DATA.DBF’
size 510M autoextend on;

–创建用户并指定表空间
create user xhfundweb
identified by xhfundweb
default tablespace XHFUND_DATA
temporary tablespace XHFUND_DATA_TEMP
profile default;

–给用户授予角色权限
grant connect to xhfundweb ;
grant resource to xhfundweb ;
grant dba to xhfundweb ;

–给用户授予系统权限
grant unlimited tablespace to xhfundweb ;

imp xhfundweb/[email protected]:1521/orcl file = E:\xhfundweb.dmp full=y
–建议(导入dmp文件打印日志)
imp userid=hthtWeb/hthtWeb fromuser=hthtWeb touser=hthtWeb tablespaces=WEBSITE compile=y ignore=n file=D:\oracle_impdp\web1.dmp log=D:\oracle_impdp\111.log

猜你喜欢

转载自blog.csdn.net/qq_33157669/article/details/81556905