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.