Oracle tablespace and users

Source: Internet
Author: User

After Oracle is installed, there is a default database. In addition to this default database, we can also create our own database.

For beginners, you can use the 'database Configuration asmap' Wizard to create a Database to avoid troubles.

After creating a database, you cannot create tables in the database immediately. You must first create a user for the database and specify a tablespace for the user.

The procedure for creating a database user is as follows:

1. if a database named 'News' has been created, the news directory already exists in the F: \ oracle \ product \ 10.1.0 \ oradata \ directory (Note: My Oracle10g is installed in F: \ oracle, if your Oracle is installed in another directory, the new database directory will be under * \ product \ 10.1.0 \ oradata ).

2. Before creating a user, create a tablespace:

The format is: Format: create tablespace table name datafile 'data filename 'size tablespace size;

For example:

SQL> create tablespace news_tablespace datafile 'f: \ oracle \ product \ 10.1.0 \ oradata \ news \ news_data.dbf' size 500 M;

'News _ tablespace' is the name of your custom tablespace, which can be named at will; 'f: \ oracle \ product \ 10.1.0 \ oradata \ news \ news_data.dbf 'is the storage location of data files, 'news _ data. dbf' the file name is also arbitrary; 'size m' specifies the size of the data file, that is, the tablespace size.

3. Now the table space named 'news _ tablespace 'has been created. Now you can create a user:

The format is: Format: create user username identified by password default tablespace table;

For example:

SQL> create user news identified by news default tablespace news_tablespace;

The default tablespace 'default tablespace' uses the tablespace created above.

4. Authorize the new user:

SQL> grant connect, resource to news; -- grants connect and resource permissions to news users.

SQL> grant dba to news; -- grant dba permission to news users

Authorization successful.

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.