Tuesday, November 12, 2013

SCOTT schema in Oracle

What is SCOTT?
Scott is a database user in Oracle, used for demos and examples.
The SCOTT schema used to be installed by default in earlier versions of Oracle. Not anymore. Oracle 9i onwards, new sample schemas like HR and OE are available that are more suited for demoing newer Oracle features.
How to install SCOTT?
You might still want to have the SCOTT schema in the database, for trying out examples from old manuals, or maybe because you’ve used it so much it’s like an old friend.
Good news – there’s a script to do the installation with a single command. Here’s how:
  1. Login to SQLPLUS as a DBA user (e.g. SYSTEM).
  2. Run the script %ORACLE_HOME%\RDBMS\ADMIN\SCOTT.sql. [IfORACLE_HOME is not set, replace with the actual directory path.]
That’s it! Login with scott/tiger to verify that it works.
Below is an actual runtime output of the installation of SCOTT schema:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
C:\>sqlplus system/manager
 
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Oct 29 18:47:38 2009
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
 
SQL> @%ORACLE_HOME%\RDBMS\ADMIN\SCOTT.sql
SQL> connect scott/tiger
Connected.
 
SQL>
Why SCOTT, Why TIGER?
Have you wondered why these names were chosen?
Wikipedia says that the schema was named after Bruce Scott, one of the first employees of Oracle, and the password was the name of his cat, Tiger.

No comments:

Post a Comment