Command to create Oracle tablespace and users

Source: Internet
Author: User
This article describes how to use commands to create an Oracle user. SQLPLUS login system user!

This article describes how to use commands to create an Oracle user. SQLPLUS login system user!

This article describes how to use commands to create an Oracle user. SQLPLUS login system user!

-- Create an instance: Database Configuration Assistant creates a Database


1: query the physical path of the data file in the SYSTEM tablespace of the table.

-- SELECT FILE_NAME FROM DBA_DATA_FILES WHERE (TABLESPACE_NAME = 'system ');

Copy the queried tablespace file address and copy the information in the create tablespace file column.


2: Create a tablespace and set automatic expansion of the tablespace
Create tablespace TBS_ORCL_DEMO DATAFILE 'The file address queried 'size 200 m autoextend on next 50 m maxsize unlimited extent management local;
-- If a U_DEMO user exists, delete it first.
-- Drop user "U_DEMO" CASCADE;

3. Create a user
Create user U_DEMO
Identified by 123456 default tablespace TBS_ORCL_DEMO
QUOTA UNLIMITED
ON TBS_ORCL_DEMO
QUOTA 100000 K
ON USERS
Account unlock;

"U_DEMO" indicates the database user, 123456 indicates the user password, and TBS_ORCL_DEMO indicates the created tablespace.


4. Set User Permissions and authorize user roles
Grant connect, RESOURCE, dba to U_DEMO;
Grant create session to U_DEMO;

Grant create procedure to U_DEMO;

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.