Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle 11g R2 user and Mode (schema)

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Syntax for creating a user:

Create user username identified by password default tablespace tablespace quota size on tablespace

Note: although the user name is lowercase when creating a user, it is uppercase when it is stored in the data dictionary, such as create user tom. If you have to use lowercase, the user name needs to be enclosed in double quotation marks create user "tom"

The created user does not have any permissions, not even the right to log in to the database.

If a user's quota for a tablespace is not set, it cannot be written even if the user has write access to the tablespace.

Examples are as follows:

View the status of HR users

Change the password of the HR user to oracle

Manually set expiration

Unlock the user

Give an example to illustrate the permission granted and revoked by oracle.

Before creating a user, create a tablespace xxx

Create a tablespace xxx

Createtablespace xxx datafile'/ u01bind xxx.dbf' size100m autoextend on next 10m maxsize unlimited

Create user tom

Create user tom identified by oracle

User tom created by query

Although the tom is created in lowercase, what is stored in the data dictionary is uppercase, so the query also needs to be uppercase.

Delete tom user

Drop user tom

Create user "tom" identified by oracle

Delete tom user

The correct way to delete should be:

Drop user "tom"

Create user tom. The default tablespace is "XXX" and no quota is specified, so tom users cannot create objects on the xxx tablespace.

Results of using tom users to connect to the database

SQL > connsys/oracle as sysdba

Drop user tom; deletes tom users

When creating tom users, you specify that the default tablespace is xxx,tom users and the disk quota is 10m.

You can use the dba_ts_quotas view to view disk quotas for each user

The tom user we just tested did not even have permission to create a session.

Grant permissions to users

Grant session permissions to tom users

SQL > conn sys/oracle as sysdba

SQL > grant create session to tom

Authorization successful.

Test the connection.

Test whether tom users can create tables

Grant tom users the right to create tables

Create an aa table

Test whether tom users can insert records for the table, and you can insert records.

Revoke the authority

View the permissions currently owned by the tom user

Revoke the create table rights of the tom user

Test tom users can view the emp table under SCOTT users

Use sys users to connect to the database

Authorize the permissions of the emp table under the selectscott user for the tom user

Use tom users to connect to the database

If you are interested, please scan the QR code below for more details for free

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report