Anda di halaman 1dari 5

Introduction to Oracle Application Express (Lesson 1)

1.1 Installation Of Application Express


(Except taken from Oracle Database Express Edition Installation Guide Pages 9-12)

To perform a graphical user interface installation:


1. Go to the following Web site:
http://www.oracle.com/technology/products/database/xe

2. Click Free Download and follow the instructions to select and download the
Microsoft Windows version of Oracle Database XE Server.

3. After downloading the Oracle Database XE installation executable, double-click it.

4. In the Oracle Database 10g Express Edition - Install Wizard welcome


window, click Next.

5. In the License Agreement window, select I accept and then click Next.

6. In the Choose Destination Location window, either accept the default or click
Browse to select a different installation directory. (Do not select a directory
that has spaces in its name.) Then click Next.

7. If you are prompted for a port number, then specify one.


The following port numbers are the default values:
1521: Oracle database listener
2030: Oracle Services for Microsoft Transaction Server
8080: HTTP port for the Oracle Database XE graphical user interface
If these port numbers are not currently used, then the installation uses them
automatically without prompting you. If they are in use, then you will be
prompted to enter an available port number.

8. In the Specify Database Passwords window, enter and confirm the password
to use for the SYS and SYSTEM database accounts. Then click Next.

9. In the Summary window, review the installation settings, and if you are
satisfied, click Install. Otherwise, click Back and modify the settings as
necessary.

10. In the InstallShield Wizard Complete window, to display the Database Home
Page, click Launch the Database homepage. Then click Finish.

1.2 Starting Oracle Application Express


To start the Oracle Application Express Database do the following:

Click on Start  Programs  Oracle Database 10g Express Edition  Start Database
(on MS Windows Vista you will need to right click on the Start Database link and choose “Run as
administrator” option. )

Two services will start OracleServiceXE and OracleTNSListener. These services are essential to the
running of Application Express and if it does not start you will not be able to login via the database home
page.

1 of 5 pages
Introduction to Oracle Application Express (Lesson 1)

1.3 Creating Users


The first step to using Oracle Application Express is to create a new application owner database user.
Oracle database users are used for storing database tables as well as used in associating applications.
Actual application users need not be database users and we will cover this in lesson dealing with security.

1. First log in as the system user on the Database Home Page


Click on Start  Programs  Oracle Database 10g Express Edition  Go to Database Home Page

2. On username type “System” and for password enter the password entered in step 1.1.8 above. Then click
the login button.

3. When logged in you should see four large icons across the top. Click on the top leftmost icon
representing administration  then click database users icon.

4. When a list of users appears, click on the leftmost button at the top – the Create button.

5. This will bring you to a screen where you enter the new user information. Key information to enter
would be the username, password, (ensure the “expire password” option is not checked, and the account
status is unlocked). For user privileges all that is needed for now is Connect and Resource roles checked.

6. When finished click the create button at the top, and ensure that the user is created successfully.

7. Click on the logout link on the top right hand corner of the screen, and then click on the login link on the
page that appears on logout. This should bring you back to the Database Home Page.

8. On username type the username entered in step 5 and the associated password. If all the steps were
followed properly you should now be logged in as the new database user.

Note: On logging in that the application builder option is an additional option which was no available as
the system user. The system user cannot create applications; however other non-system users can create
applications.

1.4 Navigating In Application Express


There are five sections in Application Express:
• Administration
• Object Browser
• SQL Utility
• Utilities
• Application Builder

Administration

Although there are five sections when you log in as the application owner database user, administration
options are generally recommended be accessed as the system user.

The key option in the Administration section is the create user option, additional options are advanced and
become useful when application express is used for the purpose of production multi-user environments.

2 of 5 pages
Introduction to Oracle Application Express (Lesson 1)

Object Browser

The object browser provides a GUI / Wizard based interface for creating and managing database objects.
Note that all the objects created in the Object Browser can also be created by executing SQL – Data
Definition Language statements.

On clicking on the Object Browser an interface appears where on the left hand side at the top corner the
object class is displayed (default is Table Class) to narrow search criteria together with a search box to
further narrow the search.

Underneath this is a listing of objects of the given class, example by default the table class is specified and
therefore all tables owned by the logged in user will display.

On the right hand side of this, depending on the object selected different options will appear. For instance if
a table is selected then the first tab across the top would be table and below this would be a summary of the
table definition – the database columns and the associated data types.

Always at the top right hand side is a create button, this button is used to launch a wizard for creating
database objects.

SQL Utilities

There are three major SQL Utilities in this section:

SQL Commands:

Allows you to execute SQL statements, they can either be query type statements, pl/sql statements or data
definition statements. Multiple Statements cannot be executed, to execute multiple statements utilize the
SQL Scripts Utility, however, multiple SQL Statements can be executed by selecting (highlighting) the text
of the SQL statement and clicking on the Run button.

SQL Scripts:

This utility allows for the storage and therefore execution of SQL Scripts, the utility shows execution report
at the end of running a script and stores the scripts for future use.

Query Builder:

This utility is a powerful utility for building query (select) statements quickly. This utility can be used to
select columns to be displayed, setting join conditions and sort and selection criteria. This utility allows you
to quickly build a base query, however your thorough understanding of SQL statements is important in
developing meaningful applications in Application Express.

Utilities

The utilities section has three major options of use.

Data Load / Unload:

This section allows you to load data into database tables, via text files. Also it allows you to unload data
onto text files from the database. There are wizards to guide you through each option making easy to do the
specified task.

Generate DDL:

3 of 5 pages
Introduction to Oracle Application Express (Lesson 1)

This section allows you to generate Data Definition language for objects stored on the database. It can be
used as the basis for creating those objects on another database or just another user.

Recycle Bin:

The Recycle bin is a very useful utility option, as it is a means for version control of deleted objects.
Typically Oracle does not support the reversal of deletion of items, this option used with the object browser
allows the object – be it a table, constraint, trigger, etc. to be identified and restored.

Application Builder

There are five major sections of use in the Application Builder

Create Application Wizard:

This wizard guides you thorough the initial building of a base application. It provides step by step guidance
as to what decisions need to be made at each step.

View Applications:

This screen allows you to view and manage applications built on the database by the application owner
database user.

Demonstrations:

This wizard allows you to create pre-built demonstration applications which can be used as the template for
building your applications or to explore features available in Oracle Application Express.

Export and Import Options:

Provides a means for backing up and restoring applications developed, please note that this process does
not backup and restore application tables and other objects, including data stored. Use the Export/Import
command line utility to backup and restoring tables (with data) and other objects.

1.5 Using the Command Line Import and Export Utilities


In the previous section we learnt about the import and export utility to backup and restore application logic
for applications stored on Oracle Application Express. However to backup and restore the tables and data
associated with the application we need to use the Oracle Import and Export command line utilities.

Exporting Table Data:

1. Go to command prompt: Start  Programs  Accessories  Command Prompt

2. When the command prompt appears, change directory to the directory for backing up and restoring data
backups. Be sure that the directory exists.
E.g. cd\jrs

3. Type the following to backup the database


exp [username]/[password] file=[filename.dmp] log=[filename.log]

e.g. exp class/class file=jrs.dmp log=jrs.log

4 of 5 pages
Introduction to Oracle Application Express (Lesson 1)

Importing Table Data:

1. Go to command prompt: Start  Programs  Accessories  Command Prompt

2. When the command prompt appears, change directory to the directory for backing up and restoring data
backups. Be sure that the directory exists.
E.g. cd\jrs

3. Type the following to restore the database


imp [username]/[password] file=[filename.dmp] full=y log=[filename.log]

e.g. imp class/class file=jrs.dmp full=y log=jrs.log

5 of 5 pages

Anda mungkin juga menyukai