Вы находитесь на странице: 1из 13

Using Oracle Designer

1 Installing software
Oracle Designer software is part of the package of software that came with your textbook. In addition to the Designer software (version 6.0) you should have Developer 6.0 and Personal Oracle 8i for the operating system you have chosen. Normally, you should have the following CDs in your packet: Personal Oracle 8i for Windows 98 or NT Oracle Designer 6.0 for Windows 95/98 or NT Oracle Developer 6.0 for Windows 95/98 or NT Developer Patch for NT

1.1

Identifying System requirements

Oracle recommends that you have at least 96 MB of RAM and at least a Pentium II 266 or higher with a minimum of 4.3 GB hard disk. Network card is not a requirement. It is needed only if you plan to connect via Ethernet to a LAN or WAN. TCP/IP connections to the Internet is possible via dial-up modem connections. Dial-up connections less than 256kbps are not recommended for any of the Oracle tools. Oracle Designer and Developer work well if you have sufficient screen real estate. A 17 inch or higher size monitor with high scan rate is preferred. More screen real estate allows you to handle larger window sizes or more windows.

1.2

Server software

Server version of the Oracle software is needed only if you are running a server installation. Otherwise you must install the Personal Oracle 8I on your machine. Personal Oracle does not have the added features of enterprise version of the software and keeps your installation simple. It does give you easy to use database explorer to manage database tablespace, user management, etc. Prior to installing the software make sure all other applications are terminated. If for any reason your installations do not work well, start with a clean install of the operating system! Oracle installations use a specialised installer, the Oracle Universal Installer. If autorun is enabled, then the installer automatically starts up. Otherwise run setup from the CD. Follow the instructions shown on the screen. Oracle will create a home directory on your machine and name it Ora8 or Oracle8. All Oracle files will be installed in this directory. You can start the database (use Start Database from the Start Menu) and log on. Oracle supplies several predefined accounts, one of which (scott/tiger) could be used to verify that the database installation works well. Log on using the SQL*PLUS 8.0. Since you connect locally, there is no host string needed.

1.3

Client software

The client software are Oracle Designer 6.0 and Developer 6.0. These (called Oracle Tools) software use a different home directory than the one used by Personal Oracle. The multiple home implementation of the tools create some unique problems and opportunities. Before you can install any of the tools, you must stop the database if it is running. To stop the database use Stop Database from the Start menu. The Start and Stop database commands are also available from the application tray at the bottom right hand corner of your screen. If necessary restart the computer. Install the Developer software first! To install, insert the Developer CD in the CD drive. If installer does not start up automatically, run the setup from CD. A differ version of the Oracle Installer is used here. You can not use this installer to install or remove items from Personal Oracle. Follow the instructions on the

screen. If you are installing on an NT machine, install also the Patch. Path software is enclosed in a separate CD. Install the Designer software. Designer comes on two CDs. One CD contains the software and the other contains the pre-configured repository. Use the software CD to install the Designer tool. Follow the instructions on the screen. You may be asked to update Oracle Trace Collection Services. Do so. You will choose custom install and select this option. Select Refresh Currently Installed Products. The tools are installed in the home directory ORAWIN95.

1.3.1

Creating the settings

The next step is to modify the LISTENER.ORA to use the loopback address of 127.0.0.1. From the Personal 8i-program group, select Network Administration followed by Net8 Assistant. Once Net8 Assistant has been launched, expand the listener folder and select the listener. In the listening location, modify the address tab for the TCP where the port is 1521. The host should be changed from the hostname of the machine to 127.0.0.1. Save the changes and exit Net8 Assistant. The listener can be edited manually. Manually editing the listener.ora is not recommended for novice Oracle users. Go to the PO8i $ORACLE_HOME/network/admin. Open the listener.ora file. Where the protocol is defined as TCP and the port is 1521, change the host from the hostname to 127.0.0.1 Sample LISTENER.ORA: # G:\ORACLE\NETWORK\ADMIN\LISTENER.ORA Configuration File:g:\oracle\network\admin\listener.ora # Generated by Oracle Net8 Assistant LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (PROTOCOL_STACK = (PRESENTATION = TTC) (SESSION = NS) ) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)) ) (DESCRIPTION = (PROTOCOL_STACK = (PRESENTATION = TTC) (SESSION = NS) ) (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) ) (DESCRIPTION = (PROTOCOL_STACK = (PRESENTATION = GIOP) (SESSION = RAW)

) (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 2481)) ) (DESCRIPTION = (PROTOCOL_STACK = (PRESENTATION = TTC) (SESSION = NS) ) (ADDRESS = (PROTOCOL = IPC)(KEY = po8i)) ) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = g:\oracle) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = po8i.us.oracle.com) (ORACLE_HOME = g:\oracle) (SID_NAME = PO8I) ) ) Stop and restart the listener from listener control. Ensure that the listener is starting without errors. Once the listener is started, verify that it is listener for the instance. LSNRCTL START starts the listener. LSNRCTL STATUS shows the status of the listener. LSNRCTL SERVICES shows what services (SIDs) listener has registered. The next step is to ensure a loopback connection using tcp from the PO8i client. Using Net8 Easy Config, configure the tnsnames.ora file. From start, go to programs, PO8i Oracle Home, Network Administration and select Net8 Easy Config. Select create new net service name, type in the name and click on next. Select the protocol of TCP/IP and select next. Fill in the host as 127.0.0.1, leave the default port of 1521 as the listener is using 1521 by default, and select next. Select the button for Oracle 8i release 8.0 or Previous, fill in the sid name and select next. Skip the test, move to next and finally finish. #This is a SQL*Net Configuration file generated by SQL*Net Easy Configuration. #Attention: Do not modify this file yourself. #If you do, your SQL*Net Easy Configuration may not function properly. Sample TNSNAMES.ORA po8itcp.us.oracle.com =

(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = 127.0.0.1) (Port = 1521) ) (CONNECT_DATA = (SID = po8i) ) ) Sample SQLNET.ORA AUTOMATIC_IPC = OFF TRACE_LEVEL_CLIENT = OFF names.directory_path = (TNSNAMES) names.default_domain = us.oracle.com name.default_zone = us.oracle.com Test to ensure that connectivity to PO8i is working using sqlplus for PO8i. Sqlplus system/manager@alias The next step is to copy the TNSNAMES.ORA file from the PO8i_ORACLE_HOME to the default ORACLE_HOME/NET80/ADMIN. Make sure the names.default_domain and the names.default_zone, in the SQLNET.ORA match with the extension on the service name in the TNSNAMES.ORA. Then test using sqlplus 8.0; ensure sqlplus 8.0 can connect using sqlnet to connect to the PO8i instances. The final step is to copy the SQLNET.ORA and TNSNAMES.ORA from the Default_Oracle_Home/net80/admin to the Default_Oracle_Home/network/admin. Then test using sqlplus 3.3, ensure sqlplus 3.3 can connect using sqlnet to connect to the PO8i instances. *NOTE FOR WINDOWS 98/95 USERS: PO8i is not supported and there are no services in MS Windows 98/95. Because of this, the listener must be started manually from the listener control or could be added to the autoexec.bat. In the autoexec.bat, the command would be: LSNRCTL START When connecting to Oracle through the tools (Designer/Developer) use the alias po8i or tcp-loopback for connect string.

2 2.1

Creating the work environment Install Pre-configured Repository

Installing the Pre-configured Repository is relatively fast and requires a minimum of user intervention. However, the name of the database and the Repository owner are predefined, and you cannot use an existing database for this option. The tablespace sizes and allocations are also predefined, though you can alter these after installation.

Installing on an existing database requires more user intervention, but provides a greater degree of control. If you choose this option a new, local database is created, and a new, ready-to-use Repository is installed, automatically. The following names are predefined:
Name Database name (also known as the SID Repository owner username/password Database internal username/password Value d704 repos/manager internal/internal

To install the Preconfigured Repository, do the following at a machine where the latest release of the Oracle Designer client-side software has been installed: 1. 2. 3. 4. Log on to Windows NT using an Administrator account for that client; do not log on as the network administrator or any other user. This step does not apply if you are using Windows 98. Ensure that SQL*Net has been configured for the new database (see "Configuring SQL*Net for the Database Connection" earlier see TSNAMES.ORA). For an Oracle8 server, ensure that Net8 has been configured for the new database (see "Configuring Net8 for the Database Connection" earlier see TSNAMES.ORA). Ensure that no Oracle database services are running (works for NT only) a. b. Choose Start Settings Control Panel Services. In the Services dialog box, locate the services whose names start with "Oracle...".

c. For each of the Oracle services whose status is shown as Started, highlight the service name and click Stop. Reply OK to confirmation messages or messages about stopping additional services. d. 5. 6. 7. Stop database from the Start menu or the application tray for Windows 98. Insert the Pre-configured Repository CD into your CD-ROM drive. Start the Oracle Installer (see "Running the Oracle Installer" earlier). At the installation dialog box, do one of the following: With the Oracle Designer Packaged Install option selected, click OK and, in the next dialog box: a. b. c. 8. Check the "Pre-configured Repository" box. Clear all unwanted options. Click OK.

Choose "Custom Installation/De-installation", click OK and, in the Software Asset Management dialog box: a. Under "Available Products", click "Oracle Designer and ODD Pre-configured Repository Product". b. Click Install.

9.

Reply Yes to the Confirmation message about the database SID and Oracle services.
Reply OK (or choose directory and reply OK) OK Effect Installs product to directory shown Acknowledges message

10. If you see any of the following message types, reply as indicated:
Message Type Directory Selection General Information

Install Products Required Products

OK OK

Acknowledges message Acknowledges message

11. When you see the message "Installation Completed", click OK to acknowledge it. 12. In the Software Asset Manager dialog box, click Exit to close the Oracle Installer. Reply Yes or OK to subsequent messages from the Installer. 13. Reboot the client workstation. 14. Ensure that the services named OracleTNSListener80, OracleStartD704 and OracleServiceD704 are started (these services were stopped in step 4). 15. Close any SQL*Plus windows that are open. 16. Click the Start button and choose Programs Oracle Designer R6.0 Repository Administration Utility. 17. In the Connect dialog box, fill in the fields as follows
Field User Name Password Connect String Enter repos manager The database alias (see "Configuring SQL*Net for the Database Connection" earlier)

18. Continue from "Checking for Invalid or Missing Repository Objects".

2.1.1

Checking for Invalid or Missing Repository Objects

It is a good idea, once the installation has completed, to check that there are no invalid or missing Repository objects. From the Repository Administration Utility window, click the (View Objects) button. Choose Object Status Continue and, in the next dialog box, select INVALID from the Status dropdown list, then select MISSING. Note the names of any objects listed in these categories, then click Cancel repeatedly to return to the Repository Administration Utility window. If any objects are invalid, click the (Recreate) button on the Repository Administration Utility window, then choose Recompile Objects Start. If any objects are missing, click the Recreate button, choose Indexes, Views, Triggers or Packages as appropriate, then click Start or Continue. It is also good practice to perform this check periodically on the Repository.

3 3.1

Connecting to remote server Configuring SQL*Net for the Database Connection

For Oracle Designer to communicate with the database server, SQL*Net must be configured for the correct database connection. (Note, however, that if you have a local Oracle8i database, SQL*Net configuration is not necessary.) To configure SQL*Net, proceed as follows at the client workstation: 1. Start the SQL*Net Easy Configuration utility: click Star ProgramsOracle for Windows 95/98/N SQL Net Easy Configuration. If you see a

message that the SQLNET.ORA file is missing, click Yes to use the sample version of this file. If you see a message that the TNSNAMES.ORA file has been modified but SQL*Net Easy Configuration did not make the modification, click Yes to revert to the previous version of the file. The modified version is saved with the name TNSNAMES.nnn. If SQL*Net has not been correctly installed on the client, you will see a message to this effect. Restart the Installer, choose Custom Installation and install SQL*Net correctly, then restart the SQL*Net Easy Configuration utility. 2. To check whether the configuration has already been done for the database you will be using, select View Configuration Information in the SQL*Net Easy Configuration dialog box, and click OK. Doing so displays a list of the database aliases that have been created. If you want to add a database alias, click the Back button and continue from step 3. If you just want to see existing configuration information, double-click a database alias name, then click OK to return to the previous dialog box. To add a database alias, choose the Add Database Alias option button and click OK. In the Choose Database Alias dialog box, type the name you want to use to identify the database and click OK. The alias is the name that you and any other users will enter when starting up Oracle Designer and connecting to this database. Make a note of this name for possible future use during the installation process. If the Choose Protocol dialog box is displayed choose the option button corresponding to the network protocol to be used for the database connection, then click OK. In the Choose protocol/server Name and Database Instance dialog box: a. In the first field, type the name of the host computer where the database is located. b. In the Database Instance field, type the name (not the alias) of the database if it is different from the default, ORCL. For the Pre-configured Repository, enter d704 c. 7. 8. Click OK, then reply Yes to the Confirm message. To exit from the utility, either click Cancel or select Exit SQL*Net Easy Configuration, then click OK. Click OK to acknowledge the Notification message.

3. 4.

5. 6.

3.1.1

Configuring Net8 for the Database Connection

If the Repository resides on an Oracle8i database, you must configure the Net8 network software for the correct database connection (in addition to configuring SQL*Net). Configuring Net8 is a two-stage process:
s

Create a Listener entry at the server Create a TNSNAMES entry at the client

3.1.2
1.

Creating a Listener Entry at the Server

At the database server machine, locate the Listener configuration file. Under Windows, this file is named oracle_home\NET80\ADMIN\LISTENER.ORA, where oracle_home is the directory where the Oracle software is installed, for example, C:\ORANT or C:\ORAWIN95 Open the Listener configuration file and check whether it is set up correctly. Under Windows, doubleclick the file name in Explorer (you may need to associate an editor with the file if this has not been done yet.

2.

The file should contain entries similar to the following (do not try to edit the file at this stage):
PASSWORDS_LISTENER = (oracle) STARTUP_WAIT_TIME_LISTENER = 0

LISTENER = (ADDRESS_LIST = (ADDRESS= (PROTOCOL= protocol) ; edit this line if not using TCP/IP (Host= hostname) ; edit if desired host not shown (Port= 1521) ) (ADDRESS= (PROTOCOL= protocol) ; edit this line if not using TCP/IP (Host= 127.0.0.1) ; do not edit (Port= 1521) ) ) CONNECT_TIMEOUT_LISTENER = 10 SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = hostname) ; edit if desired host not shown (SID_NAME = database_name) ; edit if desired database not shown ) (SID_DESC = (SID_NAME = extproc) (PROGRAM=extproc) ) ) TRACE_LEVEL_LISTENER = 0

where: protocol identifies the network protocol you are using. For example, use the default value TCP for a TCP/IP connection. hostname is the name of the database server machine. database_name is the name of the database, also known as the SID. If you are installing the Preconfigured Repository, use the default name d704. 3. If the Listener configuration file does not need editing, close the file and continue from "Creating a TNSNAMES Entry at the Client". If you need to edit the Listener configuration file, note that you will need to restart the TNS Listener service afterwards. Proceed as follows. At the server, shut down the OracleTNSListener80 service, as follows: Under Windows, click Start Settings Control Panel Services. In the Services dialog box, select OracleTNSListener80 and click the Stop button and reply Yes to the confirmation message. Do not close the dialog box, as you will return to it later. Under Windows, edit the file oracle_home\NET80\ADMIN\LISTENER.ORA. (Note: A sample file is supplied as oracle_home\DESREP10\NET80\LISTENER.ORA; you can copy entries from this file.)

4.

5.

6. 7.

Save the edited LISTENER.ORA file. Restart the OracleTNSListener80 service, as follows: Under Windows, in the Services dialog box, select OracleTNSListener80 and click the Start button. Check that you have a service handler running for the database instance, as follows: Under Windows, open a Command Prompt window (for example, click Start Command Prompt). Using the cd command, change to the ORANT directory (for example, cd c:\orant) and enter the command lsnrctl80 status. In either case, under the heading "Services Summary", check that there is an entry reading "database_name has 1 service handler(s)".

8.

3.1.3
1. 2. 3.
For

Creating a TNSNAMES Entry at the Client

You perform the following task at the client workstation. At the client workstation, start the Net8 Easy Configuration utility: Click Start Programs Oracle for Windows 95/98/NT Oracle Net8 Easy Config. If you see a message about comment information in the network configuration file, reply Yes. Add a new service with the same name as the database alias: Choose "Add New Service" and follow the on-screen instructions to create the new service. Use the following values:
Enter The database alias. Be sure to use the same one that you specified under "Configuring SQL*Net for the Database Connection". The name of the database server machine. 1521 The name of the database, also known as the SID. Be sure to use the same one that you specified under "Configuring SQL*Net for the Database Connection". For the Pre-configured Repository, use d704.

New Service Name Host Name Port Number Database SID

4. 5. 6. 7. 8.

After you enter a value, click the Next button to go on to the next parameter. At the end, you can test the new service, provided that the database has been created. For the username and password, use system and its password or, for the Pre-configured Repository (if it has already been installed), use repos/manager. Click the Test button to test the connection. (If the test is unsuccessful, the error message descriptions in Appendix C may help.) Click Done, then Next, then Finish to exit.

4 4.1

Overview of Designer Components of Designer

Designer components allow for transforming business requirements into business applications. The components address two complementary features of any systems development effort, namely, process requirements and information requirements. Each of these in turn is divided into analysis, design, and build operations. Designer components support these operations. The following illustration shows how the Designer components may be used in systems development. Process modeling, data flow modeling, and function hierarchy modeling are used to capture requirements, analyze these and develop logical designs. Entity relationship diagram is used to model the data

requirements and conduct data analysis. Once analysis is completed the designs are transformed to physical designs through the application design transformer and the database design transformer. The design editor is then called on to invoke the different generators to produce the applications and physical databases. Designer thus provides an end-to-end solution for systems development. The key components of the Designer are Client tools, utilities and service Multi-user repository On-line documentation

4.1.1
4.1.1.1

Client tools, utilities and services


Client Tools

The client side toolkit includes analysis and modeling tools, transformers, and the Design editor. Analysis tools include the Process Modeller, the Entity Relationship Diagrammer, the Function Hierarchy Diagrammer, and the Dataflow Diagrammer. You should use the analysis tools to record the information requirements of the users. Once the models are built they provide input to the transformers.

Business Process Information

Analyze

Process Models, Data Flow Models, Function Hierarchy Diagram App. Design Transf ormer

Entity Relationship Diagram Database Design Transf ormer

Design

Module, Module Structure Diagram

Serv er Model

Build

Design Editor Generators

Application

Figure 1 Designer Role in System Development

4.1.1.2

Transformers

The Application Design Transformer and the Database Design Transformer are utilities that convert the analysis definitions (models created using client tools) into an initial design of the applications. The transformers automate many of the tedious and error prone tasks of system design.

4.1.1.3

Design Editor

The Design Editor provides a consistent, unified, and single environment for all design and generation activities. It includes diagrammers (module structure diagrammer and server model diagrammer) for application and data design. In addition, it provides a navigator and a graphical workarea interface.

4.1.1.4

The Generators

Designer can generate database objects for both Oracle 7 and Oracle 8 database. But it can also generate database objects for a number ODBC databases like SQL Server, DB2, etc. Other genrators provided with the Designer are application generators to produce Oracle Developer Forms and Reports, Web Application Server applications, Visual Basic generators, and MS Help files.

4.1.2

Utilities and Services

Designer comes wit four utilities. The Repository Object navigator (RON) is the only tool that gives you access to all the objects in the repository. If you are an application system administrator the RON allows you to control various aspects of the application system. The RON is also an indispensable tool for the repository application user. The Matrix diagrammer is a tool that allows you to crosscheck elements of different types. For example, you can use this tool to crosscheck business function and entities. It does play a significant role in quality checking. There are a number of pre-built repository reports available to you to verify the design effort. In addition to these reports (over 100) you can create your own as well. The administrative utility is a tool reserved for the repository owner, who has to have DBA privileges. The tool enables the administrator to create users, assign them different roles, and maintain the health of the repository.

4.1.3

The Repository

The Designer repository furnishes a common platform where project team members can manipulate repository elements simultaneously. Thus the repository is designed to provide a multi-user work environment with shared access to elements. The repository stores and maintains the various elements of the systems development task. When you work with the elements in the repository, you are not changing the real-world definitions of these elements. Instead you are dealing with logical definitions of the elements. For example, when a new column definition is added to a table definition in the repository no change is made to any physical table. Only the information in the repository is changed. In order to use Designer to develop applications, you must have Designer installed on a client machine. You must also have a Repository residing on either a Oracle 7 or 8 database. The repository can be installed on the same machine as the client. In a multi-user environment it will be better to keep the Repository on a separate server. If you plan on generating applications then corresponding software should also be installed. For example, to develop Developer Forms and Reports you should have Developer tools installed on the client. Finally, you should also have database and client software installed for deploying completed application. To deploy Oracle applications you need Oracle database and Oracle Developer client software. You do not need Designer to deploy applications.

4.1.4

On Line Documentation

Designer comes with an extensive on-line help system. Several context sensitive help files are available for many interface objects, properties, options, etc. In addition you can also find many task-based help for each stage of the development life cycle.

4.2

Application Systems

An Application System in Designer is a collection of related elements such as definitions of functions, entities, and tables. It is also a unit of access control. That is, users are allowed access to the application. Each application system has its own set if users and user controls or privileges. If your development effort is complex involving several related pieces then it is better to partition into a hierarchy of application systems. Each application can share definitions with other applications. For our purposes (for use in teaching) we will use a single application per user or group. Your instructor may create the application for you. If you have Designer installed on your home computer then you can create your own application. See instructions in Appendix.

4.3

Flowdown in the Repository

The term flowdown means information that you enter at one stage of the development cycle is available in the same or changed form at another stage in the development process. Information within an application system flows down from the analysis stage to design stage to implementation stage. For example, say you define valid values for an attribute in analysis. When you transform entity into table, the column definitions are produced from the attribute definitions and the valid values are created as constraint definitions for the column. As you implement the table in Oracle database, the constraints are implemented as check constraints for the column of the table. The advantage of the flowdown is that you need to define anything only once to be used over and over again. In addition to improving productivity the flowdown also reduces errors (Of course, it can also mean errors are carried through!).

Design Tools

Analysis Tools

Build Tools

Figure 2 Designer Launch pad

4.4

Creating a Test Application System

Because you are installing Oracle Designer for the first time, no application systems currently exist. It is a good idea to create a test application system to make sure that you can create element definitions in the Repository. To create a test application system: 1. If the main Oracle Designer window is not active, start it by choosing Start Programs Oracle Designer 6.0 Oracle Designer and continue from step 2. If the Oracle Designer window is active, choose File Change Application System. In the Application System dialog box, type test in the Application System Name field and click Create. With the newly created application system highlighted, click OK. Click the (Entity Relationship) icon on the Oracle Designer window. In the Entity Relationship Diagrammer, click the (New) toolbar button. In the new, empty diagram, create one or two entities. To create an entity, click the (Entity) toolbar button, click anywhere on the drawing surface, complete the Create Entity dialog box and click OK. Choose File Exit. Reply No to the message "Save changes to ERD1?".

2.

Check whether you can use a diagrammer to create element definitions in the Repository: 1. 2. 3. 4. 5.

Finally, check whether you can use the Repository Object Navigator to access details of the newly-created element definitions: 1. 2. 3. 4. 5. Click the (Navigator) icon on the Oracle Designer window. In the list of Repository object groups in the left-hand (Navigator) window, double-click the name Entities or Entity/Relationship Modelling. Double-click the name Entities (if not done in the previous step). Click an entity name to display its properties. Choose File Exit.

Вам также может понравиться