Oracle-user management and permission allocation

Source: Internet
Author: User
The following are examples of how to use Oracle to understand the knowledge point of User Logon (jump off the user name and password logon): sqlplusnologconnectassysdba 1. User 1.

The following are examples of how to use Oracle to understand the knowledge point of User Logon (jump off the user name and password logon): sqlplus/nolog connect/as sysdba 1. User 1.

The following are examples of Oracle knowledge points.

User Logon (switch the user name and password to log on ):

Sqlplus/nolog

Connect/as sysdba

1. Users

1. Create a user (example)

Create user olay identified by 123;

2. delete a user (delete together with the object owned by the user)

Drop user olay cascade;

3. Change the User Password)

Alter user olay identified by 123456;

4. Unlock the Locked User

Alter user olay account unlock;

Ii. tablespace

1. Create a tablespace (create an olay user with a password of 123, set the default tablespace to users, and the temporary tablespace to temp)

Create user olay identified by 123 default tablespace users temporary tablespac e temp;

If the user can use up to 10 MB space on the users tablespace

Create user olay identified by 123 default tablespace users temporary tablespace temp

Quota 10 m on users;

If the user uses users tablespaces not controlled by the size

Create user olay identified by 123 default tablespace users temporary tablespace temp

Quota unlimited on users;

Note: To disable a user from using a tablespace, set the quota to 0 through quota.

2. Delete the tablespace (XXX is the tablespace name)

Drop tablespace XXX including contents and datafiles;

Tip:

After creating a user, pay attention to the following points:

1. If you do not specify the default tablespace when creating a user, oracle uses the System tablespace as the user's default tablespace.

2. If you do not specify a temporary tablespace when creating a user, oracle uses the default tablespace as the user's temporary tablespace.

3. If you do not have any permissions when creating a user, you must authorize the user before the user can operate.

4. If the created user does not set the user's usage in the tablespace, the user's quota in the tablespace is 0.

Iii. user permission management

Oracle Database has two types of permissions: system permissions and object permissions.

The following describes two permissions:

1. System Permissions

(1) system permission refers to the right to execute specific types of SQL commands. It is used to control one or more database operations that users can perform.

Oracle provides more than 160 system permissions, which are commonly used:

Create session connection database create table create view create public synonym create synonym

Create procedure function package create trigger create cluster build trigger

More data dictionaries (system_privilege_map)

Select * from system_privilege_map order by name;

(2) Authorization

If the database administrator uses the grant command to grant the system permission to user A with admin option, user A has the permission to grant the system permission to user B. In this case,

If the Administrator uses the revoke command to revoke the system permissions of user A, the system permissions of user B are still valid (this is different from the object permissions)

Case: create two user tokens, tom. System grants two permissions (create session and create table) to the user ken, with the admin option

Grant create session, create table to ken with admin option;

In this case, the token can forward the two permissions it obtains to other users. In this way, you can log on to the ken user to authorize tom.

Revoke system Permissions

Revoke create session, create table from ken;

2. Object Permissions

The permission to access objects in other schemes. Users can directly access objects in their own schemes. However, to access objects in other schemes, they must have the permission to access these objects.

Common Object permissions include:

Alter delete select insert update index (index) references (reference) execute (execution)

For more information, see all the object permissions provided by oracle.

Select distinct privilege from aba_tab_privs;

For example, if the smith user wants to access the scott. emp table (scott: solution, emp: Table), he must have the object permission on the scott. emp table.

Grant select, insert, delete on scott. emp to smith;

Reclaim object permissions

Revoke select, insert, delete on scott. emp from smith;

Tip:

If the database administrator uses the revoke command to revoke the object permissions of user A, the object permissions of user B are also revoked.

Refer:

Oracle Tutorial: User-managed backup

Recommended reading:

Basic Oracle tutorial-copying a database through RMAN

Reference for RMAN backup policy formulation

RMAN backup learning notes

Oracle Database Backup encryption RMAN Encryption

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.