create directory db_bak as 'D:\ ECIMS_DB'
--查看建立的目录 select * from dba_directories --删除已建立的目录 drop directory DB_BAK 格式: drop directory 目录名
expdp XXX/XXX@XXX schemas=XXX dumpfile=XXX_20181130.dump logfile=XXX_20181130.LOG DIRECTORY=DB_BAK 语法: expdp 用户名/密码@实例名 schemas=用户名 dumpfile=导出dump文件名.dump logfile=导出日志文件名.LOG DIRECTORY=DB_BAK
drop user XXX cascade; 格式: drop user 用户名 cascade;
注:若删除不掉,需先删除全部会话!!!sql
select username, sid, serial# from v$session where username='XXX' --找到用户SESSION 格式: select username, sid, serial# from v$session where username='用户名' --找到用户SESSION 注:如有多条会员,需批量删除 alter system kill session '249,57377' --杀掉用户SESSION 'sid,serial#' alter system kill session '250,57376' --杀掉用户SESSION 'sid,serial#' alter system kill session '251,57375' --杀掉用户SESSION 'sid,serial#' 格式: alter system kill session 'sid,serial'
create user XXX identified by XXX default tablespace USERS temporary tablespace TEMP profile DEFAULT; -- Grant/Revoke role privileges grant connect to XXX; grant dba to XXX; grant resource to XXX; -- Grant/Revoke system privileges grant alter any sequence to XXX; grant alter any table to XXX; grant alter any trigger to XXX; grant change notification to XXX; grant create any procedure to XXX; grant create any sequence to XXX; grant create any table to XXX; grant create any type to XXX; grant create any view to XXX; grant unlimited tablespace to XXX; -------------------------------------------------------------- 格式: create user 用户名 identified by 密码 default tablespace USERS temporary tablespace TEMP profile DEFAULT; -- Grant/Revoke role privileges grant connect to 用户名; grant dba to 用户名; grant resource to 用户名; -- Grant/Revoke system privileges grant alter any sequence to 用户名; grant alter any table to 用户名; grant alter any trigger to 用户名; grant change notification to 用户名; grant create any procedure to 用户名; grant create any sequence to 用户名; grant create any table to 用户名; grant create any type to 用户名; grant create any view to 用户名; grant unlimited tablespace to 用户名;
impdp XXX/XXX DIRECTORY=db_bak DUMPFILE=XXX.dump logfile=XXX.log REMAP_SCHEMA=XXX:XXX remap_tablespace=XXX:XXX 格式 impdp 用户名/密码 DIRECTORY=db_bak DUMPFILE=备份文件名.dump logfile=备份日志文件名.log REMAP_SCHEMA=导出用户名:导入用户名 remap_tablespace=导出表空间:导入表空间