Oracle7 Administrator's Reference for UNIX
Building and Running Demonstrations
Loading PL/SQL Demonstrations
The PL/SQL distribution includes a number of sample programs you can load. Demonstration and message files are in the rdbms directory. Perform the following steps with the Oracle7 Server open and mounted:
1. Invoke Server Manager and connect with the user/password scott/tiger:
$ cd $ORACLE_HOME/plsql/demo
$ svrmgrl
SVRMGR > connect scott/tiger
2. To load the demonstrations, invoke exampbld.sql from Server Manager:
SVRMGR > @exampbld
Note: Build the demonstrations under any Oracle account with sufficient permissions. Run the demonstrations under the same account you used to build them.
Running PL/SQL Demonstrations
Table 5 - 1 lists the kernel demonstrations.
Kernel Demonstrations
|
|
|
|
examp1.sql
| examp5.sql
| examp11.sql
| sample1.sql
|
examp2.sql
| examp6.sq
| examp12.sq
| sample2.sql
|
examp3.sql
| examp7.sql
| examp13.sql
| sample3.sql
|
examp4.sql
| examp8.sql
| examp14.sql
| sample4.sql
|
Table 5 - 1. PL/SQL Version 2 Kernel Demonstrations
Table 5 - 2 lists the precompiler demonstrations.
Precompiler Demonstrations
|
|
|
|
examp9.pc
| examp10.pc
| sample5.pc
| sample6.pc
|
Table 5 - 2. PL/SQL Version 2 Precompiler Demonstrations
To run the kernel demonstrations, invoke SQL*Plus to connect to the kernel, using the same user/password you used to create the demonstrations. Start the demonstration by typing an at sign (@) or the word start before the demonstration name. For example, to start the examp1 demonstration, enter:
$ sqlplus scott/tiger
SQLPLUS > @examp1
To build the precompiler demonstrations, enter:
$ cd $ORACLE_HOME/proc/demo
$ make -f sqlplus.mk demos
If you want to build a single demonstration, enter its name as the argument in the make command. For example, to make the examp9.pc executable, enter:
$ make -f sqlplus.mk examp9
To start the examp9 demonstration from your current shell, enter:
$ examp9
Oracle Call Interface (OCI) Demonstrations
OCI demonstrations must be compiled and linked using oracle.mk in the $ORACLE_HOME/rdbms/admin directory. Use the following commands, depending on the demonstrations you want to build:
For C OCI programs:
$ make -f oracle.mk demos
For COBOL OCI programs:
$ make -f oracle.mk cobdemos
For FORTRAN OCI programs:
$ make -f oracle.mk fordemos
For C++ OCI programs:
$ make -f oracle.mk c++demos
OCI Demonstration Notes
Before running OCI demonstrations:
- oci01 requires the user/password oci/ocitest to be created in advance. Do this manually, or by running another ocin demonstration, which creates the user/password automatically.
- cdemo4 requires you to run the calldemo.sql script as the user scott/tiger from Server Manager (line mode).
- Some ocin demonstrations require arguments. If you run a demonstration without the required arguments, you receive an error message providing the required syntax.
This is an example from cdemo1:
Connected to ORACLE as SCOTT
Enter employee name (or CR to EXIT): SMITH
Enter employee job: AGENT
Enter employee salary: 3000
Enter employee dept: 30
SMITH added to the SALES department as employee number 7964
Enter employee name (or CR to EXIT):
Exiting...
G'day
SQL*Loader Demonstrations
SQL*Loader demonstrations require that:
- the user scott/tiger has CONNECT and RESOURCE privileges
- the EMP and DEPT tables exist and are empty
To create and run a demonstration:
1. Connect to the database as the user/password scott/tiger from Server Manager (line mode).
2. Run the ulcasen.sql corresponding to the demonstration you want to run.
3. As scott/tiger, invoke the demonstration from the command line:
$ sqlldr scott/tiger ulcasen
As scott/tiger, run the SQL*Loader demonstrations in the following order:
- ulcase1: Follow steps 1 - 3 above.
- ulcase3: Follow steps 1 - 3 above.
- ulcase4: Follow steps 1 - 3 above.
- ulcase5: Run the ulcase*.sql script as scott/tiger, then enter
the following at the command line:
$ sqlldr scott/tiger ulcase*
- ulcase2: Invoke the demonstration (you do not have to run the
ulcase2.sql script).
- ulcase6: Run the ulcase6.sql script as scott/tiger, then enter
the following at the command line:
$ sqlldr scott/tiger ulcase1 DIRECT=true
- ulcase7: Run the ulcase6.sql script as scott/tiger, then enter
the following at the command line:
$ sqlldr scott/tiger ulcase7