oracle create user and table space

The prerequisite is that the oracledatabase must be installed on the computer. First, start the command line window and

Insert picture description here


enter the user name and enter the password
as shown in the figure below. If you don’t remember the password, you can refer to this article to modify the password: Modify system user password As shown in the figure above, it means successful login. Next, we need to prepare a folder to install the data files. Here I create a new folder under the F drive , as shown in the figure below, it is now an empty file. Then enter the command in the command line window: This command creates a tablespace named with the name of the data file and the size of the space . If the syntax is not wrong, it will prompt that the table space has been created. Open the folder just now, you can see that a rough data file table space is created, and then create a new user, and specify that the data that this user operates is the data in this table space. Create user: This statement creates a user named asus, and the password is . Specify table space:, here is the table space specified for user operations . Of course, you can also directly specify the tablespace when creating a user:

Insert picture description here


system

Insert picture description here



tbspace

Insert picture description here


create tablespace asus_tb_space datafile 'F:\tbspace/asus_tb_space.dbf' size 400m;asus_tb_spaceasus_tb_space.dbf400M

Insert picture description here


400M

Insert picture description here



create user asus identified by asus123;asus123

Insert picture description here


alter user asus default tablespace asus_tb_space;asusasus_tb_space

Insert picture description here


create user asus identified by asus123 default tablespace asus_tb_space;

Next, you need to assign permissions to users: grant dba to asus;
as shown in the figure below, the authorization is successful.

Insert picture description here


Here is a description. The dbapermissions are very large. For specific descriptions, please refer to systemthe link to [Change User Password] in the front of the article. You can practice writing SQL statements yourself during the learning phase. Simply Playing.
Next, test the operation just now. First, exit to exit the connection and reopen the sqlplusinterface.

Insert picture description here


Successfully log in to the oracledatabase with the new user . Then try the query operation:

select * from dual;

This dualis a virtual table, which can be used for testing.

Insert picture description here


The data can be found here, indicating that the user is successfully created and authorized. It is impossible to query without authorization.