Oracle10g manual create scott (tiger) Method

Source: Internet
Author: User


In oracle 9i/10g, if the database instance does not have the scott mode, you can manually create it as follows:
Log on to the database

Create scott user

Assign permissions to scott users
 
Use scott to log on to www.2cto.com

1. Execute the following SQL statement
Drop table emp; drop table dept; drop table bonus; drop table salgrade; drop table dummy; create table emp (empno number (4) not null, ENAME VARCHAR2 (10 ), JOB VARCHAR2 (9), mgr number (4), hiredate date, sal number (7, 2), comm number (7, 2), deptno number (2 )); www.2cto.com insert into emp values (7369, 'Smith ', 'cler', 7902, TO_DATE ('17-DEC-1980', 'dd-MON-YYYY '), 800, NULL, 20 ); insert into emp values (7499, 'allen ', 'Salesman', 7698, TO_DATE ('20-FEB-1981 ', 'dd-MON-YYYY'), 1600,300, 30); insert into emp values (7521, 'ward ', 'salesman', 7698, TO_DATE ('22-FEB-1981 ', 'dd-MON-YYYY'), 1250,500, 30); insert into emp values (7566, 'Jones ', 'manager', 7839, TO_DATE ('2-APR-1981 ', 'dd-MON-YYYY'), 2975, NULL, 20); insert into emp values (7654, 'martin ', 'salesman', 7698, TO_DATE ('28-SEP-1981 ', 'dd-MON-YYYY'), 1250,140 0, 30); I Nsert into emp values (7698, 'bucke', 'manager', 7839, TO_DATE ('1-MAY-1981 ', 'dd-MON-YYYY'), 2850, NULL, 30); insert into emp values (7782, 'clark', 'manager', 7839, TO_DATE ('9-JUN-1981 ', 'dd-MON-YYYY'), 2450, NULL, 10); insert into emp values (7788, 'Scott ', 'analyst', 7566, TO_DATE ('09-DEC-1982', 'dd-MON-YYYY '), 3000, NULL, 20); insert into emp values www.2cto.com (7839, 'King', 'President ', NULL, TO_DATE ('17-NOV-1981 ', 'dd-MON-YYYY'), 5000, NULL, 10); insert into emp values (7844, 'turner ', 'salesman', 7698, TO_DATE ('8-SEP-1981 ', 'dd-MON-YYYY'), 1500, 0, 30); insert into emp values (7876, 'adams', 'cler', 7788, TO_DATE ('12-JAN-1983 ', 'dd-MON-YYYY'), 1100, NULL, 20); insert into emp values (7900, 'James ', 'cler ', 7698, TO_DATE ('3-DEC-1981 ', 'dd-MON-YYYY'), 950, NULL, 30); insert into emp values (7902,' D', 'analyst', 7566, TO_DATE ('3-DEC-1981 ', 'dd-MON-YYYY'), 3000, NULL, 20); insert into emp values (7934, 'miller ', 'cler', 7782, TO_DATE ('23-JAN-1982', 'dd-MON-YYYY '), 1300, NULL, 10 ); create table dept (deptno number (2), DNAME VARCHAR2 (14), LOC VARCHAR2 (13); www.2cto.com insert into dept values (10, 'accounting ', 'New YORK '); insert into dept values (20, 'Research', 'Dallas '); INSERT INTO DEPT VALUES (30, 'sales', 'Chicago '); insert into dept values (40, 'operations', 'boston'); create table bonus (ENAME VARCHAR2 (10 ), JOB VARCHAR2 (9), sal number, comm number); create table salgrade (grade number, losal number, hisal number); insert into salgrade values (1,700,120 0 ); insert into salgrade values (2, 1201,140 0); insert into salgrade values (3, 1401,200 0); insert into salgrade values (4, 2001,300 0); INSE Rt into salgrade values (5, 3001,999 9); www.2cto.com create table dummy (dummy number); insert into dummy values (0); COMMIT; in this way, the scott user and the classic tables under it are created successfully !!

Author luolunz

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.