15
HTML DB User Guide Contents 1. Introduction................................................ 2 2. Logging in to HTML DB.......................................2 Username......................................................2 HTML DB Components............................................2 3. Using the SQL Command Processor.............................3 Reviewing Results in the SQL Query Results Window.............5 4. Saving a SQL Statement in the SQL Archives..................6 Managing Scripts in the SQL Archives..........................7 5. Using the Command History...................................8 6. Using the Script Repository.................................9 Creating a Script............................................10 Uploading a Script...........................................10 Viewing Scripts..............................................11 Running Scripts..............................................11 7. Browsing Database Objects..................................11 Browsing Data Dictionary Objects.............................12 8. Contacting the Academy.....................................12 Oracle Academy HTML DB User Guide 1 November 2004

academy.oracle.com · Web viewOracle Academy students and instructors can log in to HTML DB by going to Enter your School, Username, and Password information. (This information was

Embed Size (px)

Citation preview

HTML DB User Guide

Contents1. Introduction..................................................................................................................22. Logging in to HTML DB................................................................................................2

Username.....................................................................................................................2HTML DB Components................................................................................................2

3. Using the SQL Command Processor...........................................................................3Reviewing Results in the SQL Query Results Window................................................5

4. Saving a SQL Statement in the SQL Archives.............................................................6Managing Scripts in the SQL Archives.........................................................................7

5. Using the Command History........................................................................................86. Using the Script Repository.........................................................................................9

Creating a Script.........................................................................................................10Uploading a Script......................................................................................................10Viewing Scripts...........................................................................................................11Running Scripts..........................................................................................................11

7. Browsing Database Objects.......................................................................................11Browsing Data Dictionary Objects..............................................................................12

8. Contacting the Academy............................................................................................12

Oracle Academy HTML DB User Guide 1 November 2004

1. Introduction

This document will help Oracle Academy students and instructors become familiar with how to use Oracle HTML DB and each of its components from an end user’s perspective. If you would like to learn more about the Teacher Capabilities of HTML DB, please refer to the Oracle HTML DB – Teacher Guide.

2. Logging in to HTML DB

Oracle Academy students and instructors can log in to HTML DB by going to http://iacademy.oracle.com

Enter your School, Username, and Password information. (This information was given to Academy instructors via email from [email protected] . If you did not receive this information, please email [email protected]. You must be a registered and paid DF/DP instructor.) Students obtain their account information from their instructor.

UsernameThe Username is broken down into 4 parts: 1. Country (US), State (CA), 2. School naming convention given to you by Academy (ORACLE), 3. the SQL section (SQL01) – if you teach more than one class you may have students in SQL02, SQL03, etc, and 4. student number (S01).

HTML DB ComponentsOnce you log into HTML DB you will see the Welcome to HTML DB page. This page displays all of the components of HTML DB.

Oracle Academy HTML DB User Guide 2 November 2004

Application Builder: Allows you to assemble an HTML interface or an application on top of database objects

SQL Workshop: Allows you to execute SQL statements. You can create, manage, and view the database objects from a Web browser using SQL Workshop.

Data Workshop: Allows you to import data to and export data from the hosted database.

SQL Workshop is the main component that is used with the DF/DP curriculum, although Application Builder is also used later in the DP course. Note that the tabs at the top of the page provide quick access to frequently used components.

3. Using the SQL Command Processor The SQL Command Processor is a tool within the SQL Workshop component of HTML DB. It is where you will be spending most of your time entering and practicing SQL coding in the DF/DP course. To use this tool, click SQL Command Processor from the SQL Workshop home page.

Oracle Academy HTML DB User Guide 3 November 2004

You can use the SQL Command Processor to run SQL statements on any Oracle database schema for which you have privileges.

There are a few things to note about the SQL Command Processor window:

1. Schema: Students only have access to their own schemas.2. Statement window: Notice above the window where you enter your commands, it

says “Enter a SQL or PL/SQL Statement.” You will only be learning SQL in the

Oracle Academy HTML DB User Guide 4 November 2004

DF/DP course. PL/SQL (Procedural Language SQL) is Oracle’s extension to the SQL language. It will not be taught in the DF/DP course.

3. Run SQL button: Click this button to execute the SQL statement.4. Save button: You have the ability to run your SQL statement or save it for future

use. Saving your SQL statements helps when you are learning so that you do not have to type the statement multiple times.

5. Archived statements: Saved SQL statements can be accessed by clicking Archive.

Reviewing Results in the SQL Query Results WindowAfter a SQL statement is executed, the results are displayed in the SQL Query Results page.

There are a few things to note about the SQL Query Results page:

1. Max Rows: You can increase the number of rows returned by selecting a number from the Max Rows menu. This will help in reducing the number of pages you need to flip through to see all of the rows returned.

2. Output to Excel: You can choose to have the output of your command displayed on the screen or saved to a Microsoft Excel spreadsheet.

Oracle Academy HTML DB User Guide 5 November 2004

4. Saving a SQL Statement in the SQL Archives You may find yourself typing the same SQL statement over and over. Rather than retyping the statement every time, you can save the statement in the SQL Archives for quick access. To save a SQL statement, follow these steps:

1. Click on the ‘Save’ button in either the Results or the SQL Command Processor page.

2. When you click the Save button, you are prompted for a name for the statement. You can also provide an optional description of the script. Click the Save button to save the statement in the database.

Oracle Academy HTML DB User Guide 6 November 2004

3. The script is now saved in the database.

Managing Scripts in the SQL ArchivesScripts that are saved in the database can be accessed, executed, and deleted using the SQL Archives page.

1. Accessing archived scripts: To access archived scripts, click the Archive link.2. Searching for files: You can search for scripts by entering the script name in the

Find field and clicking Go. This is helpful if you archive a lot of scripts.3. Executing scripts: To run your statement, click the Run link under the Action

column.4. Deleting archived scripts: To remove a file from the Archive page, first select the

file by clicking on the box to the left of the file name (4a). Next, click Delete Checked (4b).

Note that scripts in the Archive cannot be edited, rather, they can only be deleted. The Script Repository allows you to edit as well as execute scripts. The Script Repository will be discussed later in this document in 6. Using the Script Repository.

Oracle Academy HTML DB User Guide 7 November 2004

5. Using the Command History The History page displays the 200 most recent commands and scripts that have been executed. To access the command history, click the History link.

The most recent commands are listed in the SQL Command History window. You can run a SQL command again by clicking it in the list.

Oracle Academy HTML DB User Guide 8 November 2004

6. Using the Script Repository You can use the SQL Script Repository to view, edit, and run scripts. Scripts that are stored in the Script Repository are different from scripts stored in the archives in the following ways:

Scripts in the Script Repository:o Can be uploaded from your desktop or created via the Script Repository

interfaceo Can be editedo Can include comments

Scripts in the Archiveso Are saved from commands entered in the SQL Command Processoro Cannot include commentso Cannot be edited

To access the Script Repository, click the Scripts tab.

From the Script Repository, you can: Delete a script by selecting it and clicking Delete Checked Upload a script by clicking Upload Create a script by clicking Create View details about a script by clicking the view icon Edit a script by clicking the edit icon

Oracle Academy HTML DB User Guide 9 November 2004

Run a script by clicking Run in the Actions column

Creating a ScriptThere are two ways you can start to create a script. One is by clicking the Create button and the other is by clicking the Create Script link found on the left hand side of the page. Once you click on either of these, follow the 5 easy steps as noted on the left hand side of the page. Your completed script will be saved in the Script Repository. The nice thing about saving it in the Script Repository instead of on your hard drive is that when the database gets backed up/saved, your script will be, too! You can always search for your script by typing the name of the script in the Find field.

Uploading a ScriptBefore you upload a script into the Script Repository, you must first create it in a text editor on your desktop. When saving your script, make sure to save it as a .sql file. Sometimes programs will add an extension to your .sql and cause problems. For example, cre_dept.sql may sometimes be saved as cre_dept.sql.doc. If this is a problem, place double quotes around the title of the script when saving – “cre_dept.sql”.

Oracle Academy HTML DB User Guide 10 November 2004

There are two ways you can upload a script. One is by clicking Upload and the other is by clicking the Upload Script link found on the left hand side of the page.

Once you click on either of these, you can provide a title for your script. This is the name for the script that is listed in Script Repository.

Click Browse and select your script from your hard drive, floppy, or disc. Click Add Script once you have selected your script.

Viewing ScriptsTo view scripts in the Script Repository, click the Scripts tab found in the upper right hand corner of the page. Here you can edit the script (pencil and paper icon), view the details of the script (magnifying glass icon), see other information about the script (date it was created, person who created it, size), and run the script.

Running ScriptsTo run a script, click the Run link. Important: If your script includes SELECT or INSERT statements, you will not see the results displayed when you click the Run link. To see the results, you must copy and paste your code into the SQL Command Processor window.

7. Browsing Database Objects What if you needed to know the columns in a table? Or the object types of the columns in a table? Or whether the columns are NULL or NOT NULL? The answers to these questions plus more can be answered by clicking the Browse tab.

Oracle Academy HTML DB User Guide 11 November 2004

Notice that database objects can be selected from the Type menu. If there are many objects, you can also Search for a particular object name.

To view the metadata about an object, simply click on the magnifying glass icon to the left of the object name. For table objects, you can see the column names, column types, whether or not they can be NULL, foreign key relationships to other tables, and any indexes that have been created on the table.

Browsing Data Dictionary ObjectsThe Data Dictionary is the brain behind the database. It holds important information about all users, privileges, database objects, locations, and other system parameters that are out of the scope of this course. However, to help prepare for the Oracle Certified exam, you will need to familiarize yourself with some of these objects. The course material will point out the important ones. Be sure to view these objects under the Data Dictionary link found on the top green bar.

Oracle Academy HTML DB User Guide 12 November 2004

8. Contacting the Academy If you have any questions about how to use HTML DB or about the Academy in general, please email [email protected]

Oracle Academy HTML DB User Guide 13 November 2004