How to create scott and run the
oracle sqlplus demo table creation script.
Create scott and run the oracle sqlplus demo table creation script
by following the instructions below.
Scott is the standard example schema used to run queries and scripts to show how Oracle works.
Scott schema creation.
Create the scott user on your database if it does not already exist.Connect to the database as a dba user, like sys or system.
SQL> create user scott identified by tiger
default tablespace users temporary tablespace temp profile default;
User created.
SQL> grant connect, resource to scott;
Grant succeeded.
SQL> alter user scott account unlock;
User altered.
default tablespace users temporary tablespace temp profile default;
User created.
SQL> grant connect, resource to scott;
Grant succeeded.
SQL> alter user scott account unlock;
User altered.
Demobuild execution.
The script to create the tables (demobld.sql) is located in%oracle_home%\sqlplus\demo\demobld.sql
or
$ORACLE_HOME/sqlplus/demo/demobld.sql,
for either windows or unix.
Depending on which version of Oracle you use, it will create the following tables:
- EMP
- DEPT
- BONUS
- SALGRADE
- DUMMY
How to run it:
SQL> connect scott/tiger
Connected.
SQl> @?/sqlplus/demo/demobld.sql
Building demonstration tables. Please wait.
Demonstration table build is complete.
Connected.
SQl> @?/sqlplus/demo/demobld.sql
Building demonstration tables. Please wait.
Demonstration table build is complete.
To drop the demo tables, run the demodrop.sql script in the same directory.