Create a tablespace in Oracle and grant permissions

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 specific process for creating database users 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 in the format of: 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 your custom tablespace name, you can name it at will. 'f: \ oracle \ product \ 10.1.0 \ oradata \ news \ news_data.dbf' is the storage location of the data file, '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 we have created a tablespace named 'news _ tablespace '. Now we can create a user in the format of: create user username identified by password default tablespace table; for example: SQL> create user news identified by news default tablespace news_tablespace; default tablespace 'default tablespace' uses the tablespace created above. 4. then authorize the new user: SQL> grant connect, resource to news; -- grant the connect and resource permissions to the news user SQL> grant dba to news; -- indicates that the dba permission is successfully granted to the news user. OK! The database user has been created. Now you can use this user to create a data table!

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.