< go > Create a user for an Oracle database

Source: Internet
Author: User

After Oracle is installed, there is a default database in which we can create our own database, in addition to the default database.

For beginners, to avoid trouble, you can create a database with the ' Database Configuration Assistant ' Wizard.

After you create a database, you cannot immediately build a table in the database, you must first create the user for the database, and specify a tablespace for the user.

The following are the specific procedures for creating a database User:

1. If a database named ' News ' has been built now, the news directory already exists under the f:/oracle/product/10.1.0/oradata/directory (note: My oracle10g is installed under F:/oracle, If your Oracle is installed in a different directory, your new database directory will be in the */product/10.1.0/oradata/directory.

2. Before creating a user, create a tablespace:

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

Such as:

sql> Create tablespace news_tablespace datafile ' F:/oracle/product/10.1.0/oradata/news/news_ DATA.DBF ' size 500M;

Where ' News_tablespace ' is your custom tablespace name and can be named arbitrarily;' f:/oracle/product/10.1.0/oradata/news/news_data.dbf ' is where the data file is stored, ' News_data.dbf ' file name is also arbitrary; ' Size 500M ' Specifies the size of the data file, which is the size of the table space.

3. Now that the table space named ' News_tablespace ' has been built, the user can be created below:

The format is: Format: Create user username identified by password default Tablespace table space table;

Such as:

Sql> create user news identified by news default Tablespace news_tablespace;

The default tablespace, ' default Tablespace ', uses the table space created above.

4. Then grant to the newly created user:

Sql> Grant Connect,resource to news; --Means to grant Connect,resource permissions to news users

Sql> Grant DBA to news; --Means granting DBA authority to news users

Authorization is successful.

Ok! Database user creation is complete, and now you can create a data table with that user!

< go > Create a user for an Oracle database

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.