From any window on your desktop, telnet to NPAC using the account name and password given in lab:
> telnet osprey7.npac.syr.eduWe have installed a .cshrc configuration file for you. If you want to look at it, type
> more .cshrcOne of the commands in this file is an alias to change directories to the web document directory of this account. This is the directory where you will do your work. To go to this directory, type
> webhomeIn this directory, we have placed several examples for you to work with during these labs. To see the content, type
> lsYou can continue to use commands cd dirname to change to a directory named dirname, ls to list directories, and cd ..to go back up one directory level.
Later in the lab, you will need to edit Unix files. On osprey7, you can use xemacs, vi, or pico. If you're not familiar with a Unix text editor, we recommend pico. Just type pico with the name of the file you want to edit:
> pico myfile
In the directory Demo, you will find files to set up the person database. Look at the files personcreate.sql, person.ctl, person.db, and demo.sql.
Now login to the Oracle's sqlplus system where you can give SQL commands interactively to the Oracle database server, using the database name and password given in the lab.
>sqlplus dbname/dbpasswordThe SQL command to create the person database is stored in a file, which we can execute with the "@" symbol:
% @personcreate;Now individual data records can be added with the SQL insert command, but we can insert many rows at one time by loading them from a file. We quit from sqlplus:
% quit;In Unix, we can execute a utility function which uses the file person.ctl to load the data in person.db:
> sqlload person.ctlNow log back in to sqlplus and you can see the person database by typing a query for all columns and all rows:
% select * from persontable;Now practice some SQL commands. Here are some ideas:
% select name,age from persontable;% select name,age from persontable where name=tom;% update persontable set age='11' where name='dana';% insert into persontable values ('fred','30','student');% delete from persontable where name='nora';At any time, you can see the effect of changes to the database by again selecting all columns and rows.Additional information about SQL commands is found in your lab handout "What is SQL?". This handout can also be found on-line at http://osprey7.npac.syr.edu:3768/reference-docs/cwou/database/sql/sql.html.
The person database has some PL/SQL query procedures found in demo.sql. You can install these into the database by executing this file as an SQL command in sqlplus:
% @demo.sql
Additional information about writing PL/SQL is found in your lab handout "What is PL/SQL?". This handout can also be found on-line at http://osprey7.npac.syr.edu:3768/reference-docs/cwou/database/plsql/plsql.html.
In addition, we have prepared three HTML web pages that link to the three PL/SQL procedures through the Oracle Web Server. You can look at the name query page from the Unix command line by typing:
> more search_name.html
Now from your browser at ARL, you can bring up this HTML page by giving the URL:
http://osprey7.npac.syr.edu:3768/arlspring98-docs/vxx/Demo/search_name.htmlwhere vxx is your lab userid.
Type your query information into the form and press submit to link to the PL/SQL procedure.
The main activity of this lab is to make your own database and follow the steps above to install the database, make PL/SQL procedures, and link to them from an HTML page.
In this problem, you would need to modify the files personcreate.sql, person.ctl, person.db, demo.sql, and search_name.html.
You may also want to explore the two table phone database found in the directory Phonebook.