Add Scott users to Oracle

Source: Internet
Author: User

Yesterday, I suddenly found that the Oracle server I installed does not have scott users, so I cannot import it manually.

Specific Method:

First, log on with the system user.

Import the scott. SQL script (which can be found in the oracle installation directory). For example, import the local path and write it as follows:

@ D: \ app \ Administrator \ product \ 11.2.0 \ dbhome_1 \ RDBMS \ ADMIN \ scott. SQL

 

Next, enter:

Alter user scott identified by tiger; change scott Password

Alter user scott account unlock; unlock a user

Conn scott/tiger (login in scott Mode)
How user (check whether the current user is scott)

Select * from emp;

Then we can see:

SQL> select * from emp;

EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
-----------------------------------------------------------------------------------
7369 smith clerk 7902-12-80 800 20
7499 allen salesman 7698 20-2 month-81 1600 300 30
7521 ward salesman 7698 22-2 month-81 1250 500 30
7566 jones manager 7839 2975-81 20
7654 martin salesman 7698 28-9 month-81 1250 1400 30
7698 blake manager 7839 01-5 months-81 2850 30
7782 clark manager 7839-81 2450 10
7839 king president 17-11 month-81 5000 10
7844 turner salesman 7698 month-81 1500 0 30
7900 james clerk 7698 03-12 months-81 950 30
7902 ford analyst 7566 03-12 months-81 3000 20
7934 miller clerk 7782 23-1 month-82 1300 10

12 rows have been selected.

To delete scott user drop user scott cascade;

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.