Your browser does not support JavaScript. This help page requires JavaScript to render correctly. Installing the Sample Application
Skip Headers
Previous
Previous
 
Next
Next

Installing the Sample Application

To install the sample application, you run the installation script files that you created in the tutorials in "Creating Installation Script Files", in this order:

  1. 2day_tables.sql

  2. 2day_package.sql

  3. 2day_other.sql

  4. 2day_data.sql

You can either run the files one at a time, or you can create and run a master SQL script file that runs them in order.

The following master SQL script runs the files in order, commits the changes, and writes server messages to a log file:

spool C:\my_exports\create_log.txt
@C:\my_exports\2day_tables.sql
@C:\my_exports\2day_package.sql
@C:\my_exports\2day_other.sql
@C:\my_exports\2day_data.sql
commit;
spool off

The SQL*Plus command @file_name.sql runs a file.

Typically, you run the master script file in SQL*Plus. However, if the master script specifies the full path names of the individual files (as in the preceding example), you can run it in SQL Developer.

The following procedure uses SQL Developer to install the sample application by running the installation script files one at a time, in order.

Note: The deployment environment must be different from the development environment, and is assumed to be another standard HR schema.

To install the sample application using SQL Developer:

  1. Connect to Oracle Database as user HR in the deployment environment.

    For instructions, see "Connecting to Oracle Database as User HR from SQL Developer". For Connection Name, enter a name other than hr_conn (for example, hr_conn_2).

  2. In the navigation frame, click the tab Files.

    The Files pane appears, showing the directories on your computer.

  3. Navigate to the directory C:\my_exports.

  4. Expand my_exports.

    The list of installation script files appears.

  5. Right-click 2day_tables.sql.

    A list of choices appears.

  6. Select Open.

    In the SQL Worksheet, a new 2day_tables.sql pane appears, showing the content of the 2day_tables.sql file.

  7. Click the icon Run Script.

    The Select Connection window opens.

  8. For Connection, on the drop-down menu, select the connection to the deployment environment (created in step 1).

  9. Click OK.

    The result of each statement in 2day_tables.sql is displayed in the Script Output pane.

  10. Click the icon Clear.

    The title of the 2day_tables.sql pane is now in italic font, indicating that the changes have not been committed, and the SQL Worksheet is blank.

  11. Repeat steps 5 through 10 for 2day_package.sql.

  12. Repeat steps 5 through 10 for 2day_other.sql.

  13. Repeat steps 5 through 10 for 2day_data.sql.

  14. Click the icon Commit.

    The changes are committed.

When you are sure that the individual installation script files run without errors, you can create a master SQL script (.sql) file that runs them in order, commits the changes, and writes the results to a log file. For example:

spool C:\my_exports\create_log.txt
@C:\my_exports\2day_tables.sql
@C:\my_exports\2day_package.sql
@C:\my_exports\2day_other.sql
@C:\my_exports\2day_data.sql
commit;
spool off

Typically, you run the master file in SQL*Plus. However, if the master file specifies the full path names of the individual files (as in the preceding example), you can open and run it in SQL Developer.

Related Topics

Oracle Database SQL Developer User's Guide

SQL*Plus User's Guide and Reference

Deploying an Oracle Database Application