(Using SQL * Plus) Oracle creates tablespaces, users, and grants permission commands to switch between current users

Source: Internet
Author: User

Create a data table space:

Create tablespace test_data
Logging
Datafile 'e:/Oracle/product/10.2.0/oradata/testserver/test_data01.dbf'
Size 32 m
Autoextend on
Next 32 m maxsize 2048 m
Extent management local;
 

Create a user and specify the tablespace:

Create User Username identified by password
Default tablespace test_data
Temporary tablespace test_temp;
// The last line does not seem to need to be used. I don't know if it will affect future use.

 

Grant permissions to users:

Grant connect, resource to username;

Log on with this user. Any database objects created belong to the test_temp and test_data tablespaces. Therefore, you do not need to specify a tablespace for each object created.

 

Create temporary tablespace:

Create temporary tablespace test_temp
Tempfile 'e:/Oracle/product/10.2.0/oradata/testserver/test_temp01.dbf'
Size 32 m
Autoextend on
Next 32 m maxsize 2048 m
Extent management local;
This command was not used during the test and no temporary tablespace was created.

 

Switch the current user in SQL * Plus:

Connect username/password @ yourdb

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.