The prerequisite is that the
oracledatabase must be installed on the computer. First, start the command line window and
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:
create tablespace asus_tb_space datafile 'F:\tbspace/asus_tb_space.dbf' size 400m;
create user asus identified by asus123;
alter user asus default tablespace asus_tb_space;
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.
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
Successfully log in to the
oracledatabase with the new user . Then try the query operation:
select * from dual;
dualis a virtual table, which can be used for testing.
The data can be found here, indicating that the user is successfully created and authorized. It is impossible to query without authorization.