Oracle database creates tablespace + user + authorization

--Import test database
--connect sys/password as sysdba
---Delete tablespace
drop tablespace pt6 INCLUDING CONTENTS;
drop tablespace br INCLUDING CONTENTS;
drop tablespace cbb INCLUDING CONTENTS;

create tablespace pt6 datafile '&1\pt6.dbf' size 100m autoextend on next 10m;
create tablespace br datafile '&1\br.dbf' size 100m autoextend on next 10m;
create tablespace cbb datafile '&1\cbb.dbf' size 100m autoextend on next 10m;


--删除用户
drop user pt6 CASCADE;
drop user br CASCADE;
drop user cbb CASCADE;

--创建用户
create user pt6 identified by cape default tablespace pt6;
create user br identified by cape default tablespace br;
create user cbb identified by cape default tablespace cbb;


--赋权限
grant dba to pt6;
grant dba to br;
grant dba to cbb;


grant all on dual to pt6 with grant option;
grant all on dual to br with grant option;
grant all on dual to cbb with grant option;

-- with grant option means cascading cancellation when revoking permissions

-- with admin option means not to cascade when revoking permissions


-- drop directory dir_dp;
create directory dir_dp as 'E:\oracle\dir_dp';
Grant read,write on directory dir_dp to pt6;

--Disk create dir_dp folder directory


--In the server-side data pump guide library:

--Enter the dos command window:
expdp pt6/cape@localhost/IMBR(data source instance name) schemas=pt6,br,cbb directory=dir_dp dumpfile=IMBR_2015040101.dmp logfile=IMBR_2015040101.log; impdp pt6/cape@localhost/
IMBR_test (instance name) schemas=pt6,br,cbb directory=dir_dp dumpfile=IMBR_2015040101.dmp nologfile=yes;


--Remote data pump guide library:

--Remote guide library

--Enter the dos command window
exp pt6/[email protected]/IMBRV6R3 file=d:\cap20101230.dmp owner=(pt6,br,cbb)
imp pt6/cape@localhost/IMBR file=d:\cap20101230.dmp fromuser =pt6 touser=pt6 fromuser=br touser=br fromuser=cbb touser=cbb




Guess you like

Origin blog.csdn.net/weixin_42306823/article/details/120367005