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.
Relationship: A large data is divided into several table space, create a few users and then specify the corresponding table space and authorization, so that users can independently operate their own resources, and often user login into the table space in their own new table AH and so on objects, non-interference.
The following are the specific procedures for creating a database User:
1. If a database named ' newdb ' has been built now
The newdb directory already exists in the D:appadministratororadata directory (note: My oracle11g is installed under D, if your Oracle is installed in a different directory, your new database directory is in *: Appadministratororadata directory).
2. Create a temporary tablespace before creating the user, and the default temp table space is temp if not created.
sql> CREATE Temporary tablespace db_temp
Tempfile 'd:appadministratororadatanewdbdb_temp. DBF'
SIZE 32M
Autoextend on
NEXT 32M masize UNLIMITED
EXTENT MANAGEMENT LOCAL;
3. Create the data table space before creating the user, and the default persistent tablespace is system if not created.
sql> CREATE tablespace db_data
LOGGING
DataFile 'd:appadministratororadatanewdbdb_data. DBF'
SIZE 32M
Autoextend on
NEXT 32M MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;
where 'db_data' and 'db_temp' Are your custom data table space names and temporary tablespace names that can be named arbitrarily; ' D:appadministratororadatanewdbdb_data. DBF ' is the location where the data files are stored, ' db_data. DBF ' filename is also arbitrary; ' Size 32M ' Specifies the size of the data file, which is the size of the table space.
4. Now that the table space named ' Db_data ' has been built, the user can be created below:
sql> CREATE USER newuser identified by BD123
Account UNLOCK
DEFAULT tablespace Db_data
Temporary tablespace db_temp;
The default tablespace, ' default Tablespace ', uses the table space name created above: Db_data.
Temporary tablespace ' temporary tablespace ' uses the temporary tablespace name created above: Db_temp.
5. Then grant to the newly created user:
Sql> GRANT Connect,resource to newuser; --Means to grant Connect,resource permissions to news users
Sql> GRANT DBA to NewUser; --Means to grant DBA authority to NewUser users
Authorization is successful.
Ok! Database user creation is complete, and now you can create a data table with that user!
Summary: Creating a user typically has four steps:
First step: Create a temporary table space
Step Two: Create a data table space
Step three: Create a user and make a table space
Fourth step: Grant permissions to the user
Oracle creates table spaces, creates users, and authorizes