How to grant permissions to Oracle users
Step 1: Connect to the Oracle database
Use SQL*Plus or other Oracle client to connect to the target database.
Step 2: Grant permissions to specific objects
To grant permissions to a specific table, use the following syntax:
<code>GRANT <权限> ON <表名> TO <用户名>;</p>
<p>For example, to To grant user <code>scott</code> <code>SELECT</code> and <code>UPDATE</code> permissions on table <code>EMPLOYEES</code>, use: </p>
<pre class="brush:php;toolbar:false"><code>GRANT SELECT, UPDATE ON EMPLOYEES TO scott;</code> Copy after login
Step 3: Grant permissions to schema objects
To grant permissions to all objects within the schema, use the ALL
keyword:
<code>GRANT <权限> ON <架构名>.ALL_OBJECTS TO <用户名>;</code> Copy after login
For example, to grant For user scott
to have SELECT
permissions on all objects within schema HR
, use:
<code>GRANT SELECT ON HR.ALL_OBJECTS TO scott;</code> Copy after login
Step 4: Grant system permissions
To grant system-wide permissions, such as CREATE USER
, use SYSTEM
Special schema:
<code>GRANT <权限> ON SYSTEM.<对象名> TO <用户名>;</code> Copy after login
For example, to grant user scott
To create permissions for a user, use:
<code>GRANT CREATE USER ON SYSTEM.USER TO scott;</code> Copy after login
Step 5: Revoke Permissions
To revoke previously granted permissions, useREVOKE
Statement:
<code>REVOKE <权限> ON <对象名> FROM <用户名>;</code> Copy after login
The above is the detailed content of How to authorize oracle user. For more information, please follow other related articles on the PHP Chinese website!
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
2024-11-21 18:07:47
2024-11-21 18:07:16
2024-11-21 18:06:52
2024-11-21 15:07:20
2024-11-21 15:07:08
2024-11-21 15:06:54
2024-11-21 15:06:40
2024-11-21 15:03:54
2024-11-21 15:03:44
2024-11-21 15:03:32