oracle权限操作.txt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. 创建用户并分配权限:
  2. -- 创建用户
  3. create user hjzx
  4. identified by hjzx
  5. default tablespace USERS
  6. temporary tablespace TEMP
  7. profile DEFAULT;
  8. -- 分配权限
  9. grant connect to hjzx;
  10. grant resource to hjzx;
  11. grant dba to hjzx;
  12. 授权sql:把tsxt用户的某些表的查询权限分配给hjzx用户:
  13. grant select on tsxt.DIC_CARDTYPE to hjzx;
  14. grant select on tsxt.DIC_COMPLAINSECTION to hjzx;
  15. grant select on tsxt.DIC_LEVELTYPE to hjzx;
  16. grant select on tsxt.DIC_MANAGEFRUIT to hjzx;
  17. grant select on tsxt.DIC_NETWORKMODE to hjzx;
  18. grant select on tsxt.DIC_ORGTYPE to hjzx;
  19. grant select on tsxt.DIC_PERSONALLY to hjzx;
  20. grant select on tsxt.DIC_SOURCETYPE to hjzx;
  21. grant select on tsxt.DIC_STATUSTYPE to hjzx;
  22. -- 创建用户
  23. create user hjzx
  24. identified by hjzx
  25. default tablespace USERS
  26. temporary tablespace TEMP
  27. profile DEFAULT;
  28. -- 分配权限
  29. grant connect to hjzx;
  30. grant resource to hjzx;
  31. grant dba to hjzx; grant select on tsxt.DIC_TRANSACTMODE to hjzx;
  32. grant select on tsxt.J_REGION to hjzx;
  33. grant select on tsxt.X_VISIT to hjzx;
  34. 视图查询sql:
  35. select * from tsxt.X_VISIT
  36. 字典同步查询sql:
  37. select * from tsxt.DIC_CARDTYPE
  38. select * from tsxt.DIC_COMPLAINSECTION
  39. select * from tsxt.DIC_LEVELTYPE
  40. select * from tsxt.DIC_MANAGEFRUIT
  41. select * from tsxt.DIC_NETWORKMODE
  42. select * from tsxt.DIC_ORGTYPE
  43. select * from tsxt.DIC_PERSONALLY
  44. select * from tsxt.DIC_SOURCETYPE
  45. select * from tsxt.DIC_STATUSTYPE
  46. select * from tsxt.DIC_TRANSACTMODE
  47. select * from tsxt.J_REGION