Common Oracle commands-memo

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.