Oracle creates tablespaces, creates users, and grants and views permissions. oracle Permissions

Source: Internet
Author: User

Oracle creates tablespaces, creates users, and grants and views permissions. oracle Permissions

Create temporary tablespace


Create temporary tablespace test_temp
TEMPFILE 'C: \ oracle \ product \ 10.1.0 \ oradata \ orcl \ test_temp01.dbf'
SIZE 32 M
AUTOEXTEND ON
NEXT 32 m maxsize 2048 M
Extent management local;

Create user tablespace


Create tablespace test_data
LOGGING
DATAFILE 'C: \ ORACLE \ PRODUCT \ 10.1.0 \ ORADATA \ ORCL \ test_data01.dbf'
SIZE 32 M
AUTOEXTEND ON
NEXT 32 m maxsize 2048 M
Extent management local;

Create a user and create a tablespace


Create user username identified by password
Default tablespace TEST_DATA
Temporary tablespace TEST_TEMP;

Grant permissions to users


GRANT
Create session, create any table, create any view, create any index, create any procedure,
Alter any table, alter any procedure,
Drop any table, drop any view, drop any index, drop any procedure,
Select any table, insert any table, update any table, DELETE ANY TABLE
TO username;

Grant the role "role" to username, that is, enable the user "username" to manage and use resources owned by role.

GRANT role TO username;


----------------------------------------------- View User Permissions ---------------------------------------------------------

View All Users


SELECT * FROM DBA_USERS;
SELECT * FROM ALL_USERS;
SELECT * FROM USER_USERS;

View User System Permissions


SELECT * FROM DBA_SYS_PRIVS;
SELECT * FROM USER_SYS_PRIVS;

View user objects or role Permissions


SELECT * FROM DBA_TAB_PRIVS;
SELECT * FROM ALL_TAB_PRIVS;
SELECT * FROM USER_TAB_PRIVS;

View All roles


SELECT * FROM DBA_ROLES;

View roles owned by a user or role


SELECT * FROM DBA_ROLE_PRIVS;
SELECT * FROM USER_ROLE_PRIVS;


------- EncounteredNo privileges on tablespace 'tablespace'

Alter user userquota 10 M [unlimited] on tablespace;
How Does oracle authorize users to create tables only in the specified tablespace?

First, view the permissions that the user has, revoke irrelevant permissions, and then view the permissions of the user on the table space.
1. view User Permissions
1. view the system permissions of the current user
Select * from session_privs;
2. view all roles in the database
Selec * from dba_roles;
3. view the maximum number of roles supported by the database
SQL> show parameter role

Max_enabled_roles integer 150 -- this value can be modified

OS _roles boolean FALSE

Remote_ OS _roles boolean FALSE
4. view the roles of the current user
Select * from session_roles;

5. view the nested relationship of the role and the assigned user
Select * from dba_role_privs order by 1;

6. Other commands for viewing roles and permissions
Select * from role_sys_privs;
Select * from dba_sys_privs;

2. view User tablespace Permissions
SQL> select * from user_ts_quotas;
If you can operate on other tablespaces, modify the user;

How does an Oracle database create a user and create a tablespace for the user?

Create a tablespace
Create tablespace table name datafile 'data filename 'size tablespace size;

Create user
Create user Username identified by password default tablespace table;

After creating a user, you must authorize the user to use it. First, you must authorize the login permission.
Grant create session to user name
Then grant other permissions.

Related Article

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.