Oracle basic tutorial-Oracle user management

Source: Internet
Author: User

Oracle user management
========================================================== ============================
Create a user whose username is bkjia and password is 88181
Creat user bkjia identified by 88181

Change User Password:
SQL> password Username
If you change a password for someone else, you must have dba permissions or alter permissions.

User's system Permissions
SQL> alter user Username identified by new password

Delete a user
Overview: You can delete a user as a dba.

The user must have the permission to drop the user.
You cannot delete yourself.
For example, drop user Username [cascade]

Note the following when deleting a user: If the deleted user has already created a table

You need to include the cascade parameter when deleting the object.

Tables created by users are also deleted.
========================================================== ============================
Authorization:
Grant bkjia logon permission
Grant connect to bkjia

Grant bkjia permission to view scott's emp table
Grant select on emp table to chenghuang
When querying: select * from scott. emp;

For object permissions
Grant select on emp table to chenghuang with grant option


For system permissions:
Grant connect to chenghuang with admin option

Revoke permissions
Scott wants to revoke the query permission on chengchuang to emp
Revoke select on emp from bkjia
========================================================== ============================
Oracle has the following permissions: system permissions and object permissions.
System permission: the user's permissions on the database
Object permission: the user's permission to access or operate on Data Objects of other users
Select
Insert
Update
Delete
All
Creat

Note: Data objects are not just tables, such as tables, views, and functions.
========================================================== ============================
Role:
Roles include custom roles and predefined roles.

========================================================== ============================
Account locking:
Overview: specify the maximum number of times this account (User) can enter a password when logging on.

You can specify the user's lock time, generally the dba identity to execute this command
Example: specify that the user Scott can only try three logon locks at a time of 2

Day, let's see how we implement it
SQL> creat profile lock_account limit
Failed_login_attempts 3 password_lock_time 2;
SQL> alter user tea profile lock_account;

Unlock an account
SQL> alter user tea account unlock;

Termination Password
In order to allow users to change their passwords on a regular basis, they can use the command to terminate the passwords,
Example: create a profile file for the user tea created earlier.

The user needs to change his login password every 10 days. The grace period is two days.

Do
SQL> creat profile myprofile limit password_lift_time 10

Password_grace_time 2;
SQL> alter user bkjia profile myprofile

Password history
Overview: if you do not want to use a previously used password when changing the password, you can

Using the password history, Oracle will store the password modification information in the data

In the dictionary, Oracle compares the old and new passwords when the user changes the password.

When the old and new passwords are the same, the user will be prompted to re-enter the password

Example:
1) create a profile
SQL> creat profile password-history limit

Password_life_time 10 password_grace_time 2

Password_reuse_time 10
Password_reuse_time // specify that the password can be reused after 10 days

2) assign to a user
SQL> alter user bkjia profile password-history


Delete profile
Overview: if you do not need a profile file, you can delete it.
SQL> drop profile password_history

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.