Oracle database Scott user introduction

Oracle has 3 types of users: system, sys, scott

The difference between system and sys
lies in whether you can create a database, and you can use sys user login to create data; while scott is a user for beginners to learn, learners can use scott to log in to the system, and after scott users log in, they can use Oracle to provide The database and data table of Oracle, these are provided by Oracle, learners do not need to create the database and data table by themselves, directly use these databases and data tables to practice SQL.

Note: By default, the scott user is locked, as follows:
Insert picture description here
Insert picture description here

How to do it?

We first log in as the sys user, and then unlock the scott user.

$ sqlplus / as sysdba;

SQL> alter user scott account unlock;

User altered.
SQL> alter user scott identified by 12345;        

User altered.

Try again to successfully log in.

At this time, we can use show user to view the logged-in user, and it is scott to directly practice.

select user from dual;

Insert picture description here
Enter the show emp test, you can display that the login is successful, you can practice, emp is a data table provided by oracle

Now, we do a query test to query the emp table data.

select * from emp; 

Insert picture description here
Next, more mysteries of the database, waiting for the lovely ones to explore myself!

Guess you like

Origin blog.csdn.net/Ruishine/article/details/115250729