搜索
查看: 988|回复: 0

【Oracle】Oracle创建用户以及备份还原数据库操作

[复制链接]

205

主题

5

回帖

753

积分

高级会员

积分
753
发表于 2014-10-31 17:01:11 | 显示全部楼层 |阅读模式
  1. -- Create the user
  2. create user XX
  3.   identified by ""
  4.   default tablespace USERS
  5.   temporary tablespace TEMP
  6.   profile DEFAULT
  7.   password expire;
  8. -- Grant/Revoke role privileges
  9. grant connect to XX<span style="font-family: Arial, Helvetica, sans-serif;">;</span>
  10. grant ctxapp to XX;
  11. grant dba to XX;
  12. grant exp_full_database to XX;
  13. -- Grant/Revoke system privileges
  14. grant alter any index to XX;
  15. grant alter any table to XX;
  16. grant create any index to XX;
  17. grant create any table to XX;
  18. grant create session to XX;
  19. grant drop any index to XX;
  20. grant drop any table to XX;
  21. grant select any table to XX;
  22. grant unlimited tablespace to XX;

  23. ---删除用户时,提示无法删除当前用户链接用户

  24. select 'alter system kill session'''|| to_char(a.sid)||','||to_char(serial#)||'''' from v$session a
  25. where a.username=XX;
  26. --执行查询结果,然后再删除用户

  27. ---计划任务

  28. select job,broken,what,interval,t.* from user_jobs t;
  29.   begin
  30. dbms_job.remove(63);
  31.   end;

  32. --导出(排除表T_ATTACHMENT)
  33. expdp switch40/switch40@orcl dumpfile = switch40_0606_1907.dmp schemas=switch40 EXCLUDE=TABLE:"IN ('T_XX')"
  34. --导入,从刚刚备份的用户switch40到新用户SWITCH52
  35. impdp SWITCH52/SWITCH52@orcl dumpfile = switch40_0606_1907.dmp remap_schema=switch40:SWITCH52
复制代码


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

 
 
大数据行业交流
大数据行业交流
大数据求职招聘
大数据求职招聘
站长电话:
15010106923
微信联系:
hb-0310
站长邮箱:
ab12-120@163.com
大数据中国微信

QQ   

版权所有: Discuz! © 2001-2013 大数据.

GMT+8, 2024-4-29 02:58 , Processed in 0.089374 second(s), 24 queries .

快速回复 返回顶部 返回列表