当前位置:Gxlcms > 数据库问题 > Oracle创建用户以及备份还原数据库操作

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

时间:2021-07-01 10:21:17 帮助过:66人阅读

  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


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

标签:database   _id   snippet   where   ora   base   数据   tracking   switch   

人气教程排行