To modify the owner and permissions of a RAC resource by using Crs_setperm

Source: Internet
Author: User

In an Oracle RAC cluster, there are also issues with owners and permissions for the management of various resources. Crs_getperm and crs_setperm are such a pair of commands, mainly used to view and modify resource in the cluster owner,group and permissions, and so on, the following specific demonstration to get its use.

[Python]View PlainCopyprint?
  1. 1. View resources in the current cluster
  2. #下面的查询可知, there are two service in the current cluster environment
  3. [Email protected]:~> crs_stat-ls | grep SRV
  4. Ora .... O4a.srv Oracle Oinstall rwxrwxr--
  5. Ora .... 0g1.srv Oracle Oinstall rwxrwxr--
  6. #获得service的全称
  7. [Email protected]:~> crs_stat-p | grep SRV
  8. Name=ora. GOBO4. Gobo4_srv. Gobo4a.srv
  9. Name=ora.ora10g.hr_ora10g.ora10g1.srv
  10. Description=ora.ora10g.hr_ora10g.ora10g1.srv
  11. #下面通过crs_getperm获得资源的所有者即权限
  12. [Email protected]:~> crs_getperm ora.ora10g.hr_ora10g.ora10g1.srv
  13. Name:ora.ora10g.hr_ora10g.ora10g1.srv
  14. Owner:oracle:rwx,pgrp:oinstall:rwx,other::r--,
  15. #上面owner即为所有者, Pgrp represents the owner, and other is the other user, each followed by its corresponding permissions
  16. 2. Usage of crs_getperm and crs_setperm
  17. [Email protected]:~> crs_getperm-h
  18. Usage:crs_getperm resource_name [-u user|-g Group] [-Q]
  19. #crs_getperm用法较为简单, followed by the resource name, optional for the user or group
  20. [Email protected]:~> crs_setperm-h #此命令稍微较crs_getperm复杂
  21. Usage:crs_setperm resource_name-u aclstring [-Q]
  22. Crs_setperm resource_name-x aclstring [-Q]
  23. Crs_setperm resource_name-o user_name [-Q]
  24. Crs_setperm resource_name-g group_name [-Q]
  25. -U Update the ACL string
  26. -X Delete the ACL string
  27. -O Change the owner of the resource
  28. -G Change the primary group of the resource
  29. Aclstring is one of the following:
  30. User:<username>:rwx
  31. Group:<groupname>:r-x #当心这里的group用法, you will receive an error message if you modify permissions directly using Group
  32. other::r--
  33. 3. Demo using Crs_setperm
  34. [Email protected]:~> su
  35. Password:
  36. #下面分别修改资源hr_ora10g的资源所有者和所属组, change all of them to Roo permissions
  37. Bo2dbp:/users/oracle # crs_setperm Ora.ora10g.hr_ora10g.ora10g1.srv-o Root
  38. Bo2dbp:/users/oracle # crs_setperm ora.ora10g.hr_ora10g.ora10g1.srv-g Root
  39. #查看修改之后, the owner and genus of the resource have changed
  40. Bo2dbp:/users/oracle # crs_getperm Ora.ora10g.hr_ora10g.ora10g1.srv
  41. Name:ora.ora10g.hr_ora10g.ora10g1.srv
  42. Owner:root:rwx,pgrp:root:rwx,other::r--,
  43. #修改属组的权限, change it to read, execute
  44. Bo2dbp:/users/oracle # crs_setperm ora.ora10g.hr_ora10g.ora10g1.srv-u pgrp:root:r-x
  45. Bo2dbp:/users/oracle # crs_getperm Ora.ora10g.hr_ora10g.ora10g1.srv
  46. Name:ora.ora10g.hr_ora10g.ora10g1.srv
  47. Owner:root:rwx,pgrp:root:r-x,other::r--,
  48. #使用同样的方式将其修改回去.
  49. Bo2dbp:/users/oracle # crs_setperm Ora.ora10g.hr_ora10g.ora10g1.srv-o Oracle
  50. Bo2dbp:/users/oracle # crs_setperm ora.ora10g.hr_ora10g.ora10g1.srv-g oinstall
  51. Bo2dbp:/users/oracle # crs_setperm ora.ora10g.hr_ora10g.ora10g1.srv-u pgrp:oinstall:rwx
  52. Bo2dbp:/users/oracle # crs_getperm Ora.ora10g.hr_ora10g.ora10g1.srv
  53. Name:ora.ora10g.hr_ora10g.ora10g1.srv
  54. Owner:oracle:rwx,pgrp:oinstall:rwx,other::r--,
  55. Bo2dbp:/users/oracle # su-oracle
  56. #所有者的权限不允许修改
  57. [Email protected]:~> crs_setperm ora.ora10g.hr_ora10g.ora10g1.srv-u owner:oracle:r-x
  58. crs-0248:acl operation failed
  59. [Email protected]:~> crs_setperm ora.ora10g.hr_ora10g.ora10g1.srv-u owner:oracle:rw-
  60. crs-0248:acl operation failed
  61. [Email protected]:~> crs_setperm ora.ora10g.hr_ora10g.ora10g1.srv-u owner:oracle:-wx
  62. crs-0248:acl operation failed
  63. #组权限可以修改
  64. [Email protected]:~> crs_setperm ora.ora10g.hr_ora10g.ora10g1.srv-u pgrp:oinstall:r-x
  65. [Email protected]:~> crs_getperm ora.ora10g.hr_ora10g.ora10g1.srv
  66. Name:ora.ora10g.hr_ora10g.ora10g1.srv
  67. Owner:oracle:rwx,pgrp:oinstall:r-x,other::r--,
  68. #other也可以修改
  69. [Email protected]:~> crs_setperm ora.ora10g.hr_ora10g.ora10g1.srv-u other::rwx
  70. [Email protected]:~> crs_getperm ora.ora10g.hr_ora10g.ora10g1.srv
  71. Name:ora.ora10g.hr_ora10g.ora10g1.srv
  72. OWNER:ORACLE:RWX,PGRP:OINSTALL:R-X,OTHER::RWX,
  73. #Author: Robinson
  74. #Blog: http://blog.csdn.net/robinson_0612
  75. #根据下面的查看结果可知, changes have been made and it is recommended to change it to the original state
  76. [Email protected]:~> crs_stat-ls |grep SRV
  77. Ora .... O4a.srv Oracle Oinstall rwxrwxr--
  78. Ora .... 0g1.srv Oracle Oinstall rwxr-xrwx
  79. Ext.: http://blog.csdn.net/leshami/article/details/8219242

To modify the owner and permissions of a RAC resource by using Crs_setperm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.