Oracle creates tablespaces, creates users, and grants and views Permissions

Source: Internet
Author: User

Create temporary tablespace

Create temporary tablespace test_temp

TEMPFILE 'C: oracleproduct10.1.0oradataorcltest _ temp01.dbf'

SIZE 32 M

AUTOEXTEND ON

NEXT 32 m maxsize 2048 M

Extent management local;

Create a tablespace

CREATE TABLESPACE HISTDB

Datafile 'd: oracleproduct10.2.0oradataZJGIStest _ temp03.dbf'

SIZE 32 M

AUTOEXTEND ON

NEXT 32 m maxsize 2048 M

Extent management local;

Create a user and specify 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;

..........................

/* Divided into four steps */

/* Step 2: create a temporary tablespace */

Create temporary tablespace user_temp

Tempfile 'd: oracleoradataOracle9iuser_temp.dbf'

Size 50 m

Autoextend on

Next 50 m maxsize 20480 m

Extent management local;

/* Step 2: create a data table space */

Create tablespace user_data

Logging

Datafile 'd: oracleoradataOracle9iuser_data.dbf'

Size 50 m

Autoextend on

Next 50 m maxsize 20480 m

Extent management local;

/* Step 2: create a user and specify the tablespace */

Create user username identified by password

Default tablespace user_data

Temporary tablespace user_temp;

/* Step 4: grant permissions to users */

Grant connect, resource, dba to username;

Bytes ----------------------------------------------------------------------------------------------------------

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

View All Users

View All Users

SELECT * FROM DBA_USERS;

SELECT * FROM ALL_USERS;

SELECT * FROM USER_USERS;

View User System Permissions

View User System Permissions

SELECT * FROM DBA_SYS_PRIVS;

SELECT * FROM USER_SYS_PRIVS;

View user objects or role Permissions

View user object permissions

SELECT * FROM DBA_TAB_PRIVS;

SELECT * FROM ALL_TAB_PRIVS;

SELECT * FROM USER_TAB_PRIVS;

View All roles

View All Users

SELECT * FROM DBA_ROLES;

View roles owned by a user or role

View roles owned by a user or role

SELECT * FROM DBA_ROLE_PRIVS;

SELECT * FROM USER_ROLE_PRIVS;

Delete new user

Delete a user

Drop user username

Delete new tablespace

Delete a user

Drop tablespace tablespaceName

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.