Precautions for creating users and allocating space

Source: Internet
Author: User

Users are mainly concerned with the following aspects:
1. authentication method, such as password and external authentication. Usually Password
2. Assign and revoke permissions. Generally, assign the connect resource role to the user.
Revoke the default unlimited tablespace permission to avoid unlimited use of the default user tablespace.
Permissions required for other applications
3 space allocation generally creates Independent Application-related tablespace for each user
After creating a tablespace, grant the user unlimited tablespace permission on tablespace to use all the space.
4. default tablespace and temporary tablespace are allocated to users.


Related views:
Dba_sys_privs
Dba_ts_quotas;
Dba_tablespaces;
Dba_users;



1. authentication method, such as password and external authentication. Usually Password
SYS:
Create user James identified by James


2. Assign and revoke permissions. Generally, assign the connect resource role to the user.
Revoke the default unlimited tablespace permission to avoid unlimited use of the default user tablespace.

[Email protected]> select * From dba_sys_privs where grantee = 'connect ';

Grantee privilege Adm
-------------------------------------------------------------------------
Connect create session no

[Email protected]> select * From dba_sys_privs where grantee = 'resource ';

Grantee privilege Adm
-------------------------------------------------------------------------
Resource create trigger no
Resource create Sequence No
Resource create type no
Resource create Procedure No
Resource create cluster no
Resource create operator no
Resource create indextype No
Resource create table No

8 rows selected.

Elapsed: 00:00:00. 00
[Email protected]> select * From dba_sys_privs where grantee = 'James ';

Grantee privilege Adm
-------------------------------------------------------------------------
James unlimited tablespace No

Grant connect to James;
Grant resource to James;
Revoke unlimited tablespace from James;


3 space allocation generally creates Independent Application-related tablespace for each user
After creating a tablespace, grant the user unlimited tablespace permission on tablespace to use all the space.


Create tablespace James
Datafile '/export/home/Oracle/oradata/James. dbf'
Size 100 m
Autoextend on
Next 10 m
Maxsize 2048 m
Extent management local uniform size 128 K
Segment space management auto;

[Email protected]> alter user James quota unlimited on James;

[Email protected]> select * From dba_ts_quotas where username = 'James ';

Tablespace_name username bytes max_bytes blocks max_blocks dro
-------------------------------------------------------------------------
James 0-1 0-1 NO

-1 indicates Unlimited


Or assign the required space.
[Email protected]> alter user James quota 10 m on James;

User altered.

[Email protected]> select * From dba_ts_quotas where username = 'James ';

Tablespace_name username bytes max_bytes blocks max_blocks dro
-------------------------------------------------------------------------
James 0 10485760 0 1280 No

4. default tablespace and temporary tablespace are allocated to users.

[Email protected]> alter user James
2 default tablespace James
3 temporary tablespace temp;

[Email protected]> select username, default_tablespace, temporary_tablespace from dba_users where username = 'James ';

Username default_tablespace temporary_tablespace
---------------------------------------------------------------------------
James temp

Precautions for creating users and allocating space

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.