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