Oracle-Week 1


Week 1


The instructions below are now deprecated!



In week 1 you will be learning how to connect to your Oracle instance using SQL*Plus, the command line utility for Oracle Database. You will also run a script to initially set up the project for the course.


Lab Hints

To connect to the Oracle Instance in our pre-built Fedora Image, you just have to log in using SQL*Plus. SQL*Plus is the command-line program used by Oracle to manage the database. Within it, we can send commands and send SQL to the database. In return, it can give us data.

To login to the database using SQL*Plus:

  1. Open a Terminal
  2. Start the SQL*Plus program and login
    1. sqlplus student/student
  3. You should see a SQL> prompt. You are now connected to the database!


For the lab you also need to run the create_oracle_store.sql script that is located in the ~/Data/cit225/oracle/lib directory. We can run scripts in SQL*Plus using the @filename command. So to run the script we can run the following command:

SQL> @~/Data/cit225/oracle/lib/create_oracle_store.sql

You should see the database being created very quickly. When it is finished you will see the SQL> prompt again. We can verify this worked by running the following SQL query:

SQL> SELECT   table_name
FROM     user_tables
WHERE    table_name NOT IN ('EMP','DEPT')
AND NOT  table_name LIKE 'DEMO%'
AND NOT  table_name LIKE 'APEX%'
ORDER BY table_name;

It should return a list of tables that are in your database. Take a screenshot and submit it.