1. log on to Oracle AS A DBA
A: Start Oracle services.
B: Run cmd to open the command window.
C: Enter "sqlplus sys/root as sysdba" in the command line. The root is the logon password.
In this way, you can successfully log on to Oracle.
2. query all usernames in the Oracle database
Select username from dba_users
3. Use of sqlplus/nolog
Use this command to only enable SQL * Plus, but not log on to the Oracle database. Then you need to use the connect command to connect to Oracle.
Note: The help information about sqlplus is as follows:
4. Create a new user to log on to Oracle
A: Create a new user. First, log on to Oracle as an administrator. Then, run the following command to create a new user:
Create user "username" identified by "password" Example: create user Lei identified by lei
B: new users log on to Oracle
Because the newly created user does not have the permission to create a session, login is denied;
Next, connect to the Administrator to log on, authorize the user you just created, and then log on to the new user:
5. delete an oracle user
Drop User Username cascade;
This drop statement deletes all objects under the user in a cascading manner.
6. manually create sample data under the Scott user-"EMP, DEPT, salgrade, bonus"
Under the Oracle installation directory-"rdbms/admin/", find the "utlsampl. SQL" file and execute this script to create the relevant database sample data.