Welcome to the Rose/Oracle8 Quick Start Tutorial

Welcome to the Rose/Oracle8 Quick Start Tutorial! Rose/Oracle8 is the tool of choice for evolving relational databases to object-relational databases.

By simply running the Rose/Oracle8 Analyzer you get a complete model of your existing database schema.

When you’re ready to add new Oracle8 object functionality to your database, the Rose/Oracle8 Mapping Wizard walks you through the process of adding objects to your database model.

As you add objects to the model, let Rose/Oracle8 automatically check for syntax errors, generate your updated schema and apply it to your database.

How To Use This Tutorial

This tutorial  provides you with two ways to get up and running with Rose/Oracle8.  Choose the one that suits you best:

•	The Printed Tutorial
The printed version of the Quick Start tutorial provides you with step-by-step instructions, liberally illustrated with screen shots of the actual Rose/Oracle8 application.  Follow the instructions in this booklet while seated at your computer with Rose/Oracle8 up and running. Compare your results with the screen shots to keep yourself on track.

•	The Online Tutorial
The online version of the Quick Start tutorial comes to you as an online help file.  Like the printed tutorial, the online tutorial provides complete step-by-step instructions to get you up and running in the Rose/Oracle8 environment.  It also gives you something extra: Movies.  At the end of each lesson, you’ll find a videocam icon.  Click on the icon and you’ll see a movie that demonstrates the entire lesson.

Both versions are comprised of four lessons.  Each lesson builds upon the activities of the previous lessons, so be sure to do the lessons in order.

What You Need To Run The Tutorial

Here’s a list of of what you need to run the Rose/Oracle8 Quick Start Tutorial:

•	A Windows 95 or Windows NT system with:

−	Oracle8 client software

−	Rose/Oracle8 software (early access version)

•	Access to an Oracle8 server with DEMO database

Note:	 The DEMO database is a sample database that is packaged with the Oracle8 server software.

Go to Lesson 1

Tell Me More About Rational Rose


Lesson 1:  Reverse Engineering Your Current Relational Database

Let’s assume that you have brought an existing Oracle database into the Oracle8 environment and you’re ready to enter the world of objects.  To start off, you want to create a model from your database.  We call this reverse engineering.

Now, you could analyze all your schema and create the model yourself, or you could do it the easy way, by letting Rose/Oracle8 do it for you.

Follow these simple instructions to let Rose/Oracle8 reverse engineer your current database:

1.	Start Rose/Oracle8.

2.	On the Tools menu, point to Oracle8 and then click Analyzer.

3.	Fill in the database login dialog.

•	Enter DEMO in the Schema field; (DEMO is a sample provided with your Oracle8 system.  If this database is not available to you, you can use another Oracle database.)

•	Enter your own database server name, user id and password in the remaining fields.

4.	Click OK.

5.	Watch as the Analyzer reads your database, creates a model, and displays a class diagram called Demo Schema Coverage.

6.	Adjust the class diagram display by clicking Layout Diagram on the Tools menu.

7.	Look at the Browser in the upper left portion of the Rose Oracle8 window.  Notice that Demo has been added to the Logical View.

8.	Click the + sign next to the Demo package to expand it in the Browser and view the database elements it contains.

9.	Select Save As from the File menu to name and save the Demo model.

	1. Click the videocam to watch a demo movie. 2. Close the movie window to return to the tutorial.
Go to Lesson 2


Lesson 2:  Working with a Subset of Your Database

When it reverse engineered your database, Rose/Oracle8 created a single class diagram that covers every element in the schema.  That class diagram provides a valuable view of your database, but it’s a lot to work with at one time.

You’ll probably want to work with several separate diagrams, each one dealing with some logical part of the database.  The problem is knowing how to divide the database elements into logical subsets.

Rose/Oracle8 provides an easy solution to this problem.  Once you select a model element to copy to a new class diagram, Rose/Oracle8 can check the model for all other elements that are related to it and bring those elements along to the new diagram.

Follow these steps to create a new class diagram that shows a subset of your complete database model:

1.	If the model you created in Lesson 1 is no longer open, select Open from the File menu to open it.

2.	Display the DEMO Schema Coverage diagram by doing the following:

•	Click the [image]  button on the toolbar to display the Select Class Diagram dialog.

•	Select DEMO under Class Category, DEMO Schema Coverage under Class Diagrams.

•	Click OK.

3.	Click the [image]  button on the toolbar to redisplay the Browse Class Diagram dialog.

4.	Select DEMO under Class Category and <New> under Class Diagrams, and click OK.

5.	Enter Product and click OK in the Create Diagram dialog.

Rose/Oracle8 displays a new, blank class diagram called Product.

6.	Go to the Browser and locate the Product object.

7.	Drag and drop the Product object from the Browser to your new Product class diagram.

8.	Select the Product class in the Product diagram. (You can select as many classes as you like, but for this example, just select the one.)

9.	Select Expand Selected Classes from the Query menu.

10.	In the Expand Selected Classes  dialog, do the following:

•	Notice that you can check for Clients, Suppliers, or Both (the default). Leave these settings as they are.

•	Click Relations to view the relations that Rose/Oracle8 can check.  All relations are checked by default.

11.	Leave the default Relations settings as they are and click OK to return to the Expand Selected Classes dialog.

12.	Click OK to add any classes related to the Product diagram.  In this case, you’ll see that the Sales, Item, and Price classes have been added to the diagram.

13.	Adjust the class diagram display by clicking Layout Diagram on the Tools menu.  You now have a class diagram that shows only those parts of your database schema that are related to Product.

14.	Save the model.

	1. Click the videocam to watch a demo movie. 2. Close the movie window to return to the tutorial.
Go to Lesson 3


Lesson 3:  Adding Oracle8 Objects to Your Model

Oracle8 defines a number of database-specific objects to extend your current relational database into an object-relational database. Like all objects, each Oracle8 object has a set of attributes, operations, and, optionally, relationships that define it.

Rose/Oracle8’s Mapping Wizard makes it easy for you to add objects to your database model, and then to the database itself.  You can create new objects from information that is already in your database, as well as create them from scratch.

To add objects to your model, you start up the Wizard, answer questions about the object you want to add, and let the Wizard do the rest.  For example, here’s how to add an Oracle ObjectType to your model using existing information from your database:

1.	If your model is no longer open, select Open from the File menu to open it.

2.	Display the Product diagram by doing the following:

•	Click the [image]  button on the toolbar to display the Browse Class Diagram dialog.

•	Select DEMO under Class Category and Product under Class Diagrams.

•	Click OK.

3.	Select Price and Item in the Product diagram.

4.	On the Tools menu, point to Oracle8 and then click Mapping Wizard.

5.	Select the object to add to the diagram, in this case ObjectType.

	Notice that the Price and Item tables appear in the Selected Items list.  That’s because you selected them in your diagram in Step 3.
6.	Click Next to continue.

7.	Fill in the information to tell the Mapping Wizard the name of the object you are creating and where to put it in the model:

•	Enter the Name of the ObjectType you want to add, in this case, Sales_At_Full_Price.

	Use underscores instead of spaces when you enter your information .
•	Leave the Schema set to DEMO and Logical Package set to DEMO.

	When Rose/Oracle8 reverse engineered the DEMO database (schema), it created the DEMO Schema Coverage diagram and placed in a logical package called DEMO.
•	Select Product as the Diagram to which you are adding the ObjectType. (You are adding the object to the class diagram you created in Lesson 2.)

•	Enter Tracks full price sales as the description of the ObjectType in the Documentation field.

8.	Click Next to display the Define Attributes dialog.

9.	One at a time, select each of the following table columns under Map From, and click Add to add each one to the list of attributes for your new ObjectType:

•	Quantity (from Item)

•	Actual_Price (from Item)

•	List_Price (from Price)

•	Product_ID (from Price)

	If you want to add the entire table, click on the table name (for example, Price or Item) and all of the attributes for that table will be added at once.
10.	Click Next to display the Define Operations dialog.

11.	Fill in the information to describe the Sales_At_Full_Price ObjectType’s operations:

•	Enter CompPrice as the name of the operation to add.

•	Select Normal as the operation type.

•	Select Number from the Return Type drop down list.

12.	Notice that you can also specify operation parameters.  Leave these fields blank for now.

13.	Click Add Operation.

14.	Click Next to display the Define Relations dialog.

	This page allows you to specify relations between your new object and other objects in the database. However, any Oracle8 ObjectType object can only be related to other ObjectType objects. Since in this tutorial you are adding the first ObjectType to your database, you have no other valid objects to relate it to.  Later, as you gain experience with Oracle8 objects, you will learn to specify attribute keys, operation parameters, and appropriate relations between the objects.
15.	Click Finish to add the Sales_At_Full_Price ObjectType to the Product diagram.

16.	Select Layout Diagram from the Tools menu.

17.	Go to the Browser window and do the following:

•	Expand Logical and notice that the Sales_At_Full_Price object has been added to the model.

•	Expand the Sales_At_Full_Price object and notice that its operation and attributes have been added to the model.

18.	Save the model.

	1. Click the videocam to watch a demo movie. 2. Close the movie window to return to the tutorial.
Go to Lesson 4


Lesson 4:  Updating Your Database Schema

At this point, you have used Rose/Oracle8 to:

•	Analyze your current database and create a model of its schema

•	Create a diagram of a subset of the database with which to work

•	Add an Oracle8 object to your database model

What’s next?  Well, the model is important, but it’s not your ultimate goal, of course.  What you really want is an updated database schema that includes the new Oracle8 object that you added to the model.

Rose/Oracle8 will check the syntax of your updated model and then let you choose between two methods of updating your database.  This early release version provides you with only the first method, but both methods will be available when the product is released.

Method 1.	You can use Rose/Oracle8 to generate a DDL script file and then use the Oracle SQL Worksheet to execute the script and update your database schema.

Method 2.	You can use Rose/Oracle8 to generate the SQL code that directly updates your database schema from your model.

Checking Your Model’s Syntax

Follow these steps to check the syntax of your new class diagram:

1.	If your model is no longer open, select Open from the File menu to open it.

2.	Display the Product diagram by doing the following:

•	Click the [image]  button on the toolbar to display the Browse Class Diagram dialog.

•	Select DEMO under Class Category and Product under Class Diagrams.

•	Click OK.

3.	Select Select All from the Edit menu.

	You can use Select All to check the syntax of the entire diagram, or select objects individually to check the syntax of individual objects. It’s good practice to check all of the objects on all of your model’s diagrams before updating your database schema.
4.	On the Tools menu, point to Oracle8 and then click Syntax Checker.

5.	Select Log from the Window menu to view any syntax errors.

6.	Correct the errors, if there are any.

7.	Recheck the syntax until no errors are found.

Updating the Database Schema from a DDL Script

Follow these steps to update your database schema from a DDL script:

1.	In Explorer, create a new folder called 08script in which to store your script file.

2.	If your model is no longer open, select Open from the File menu to open it.

3.	Go to the Product class diagram and select the Sales_At_Full_Price object you added.

4.	On the Tools menu, point to Oracle8 and then click Code Generation.

5.	When the Schema Generation dialog appears, expand the tree in the Select Components area of the window.
Notice that the entire model structure is shown and the Sales_At_Full_Price object that you selected in the diagram appears in boldface type.

	You can use this window to view the objects that are currently selected for schema generation and you can change those selections, if you need to.
6.	Click Browse to display the DDL Script File Selection dialog.

7.	Locate the 08script folder and enter DDL1.sql as the name of the file in which to place the generated DDL script.

8.	Click Open to return to the Schema Generation dialog.

9.	Click OK to generate the script.

10.	Click OK to acknowledge the Successful Generation message.

	The final steps in this procedure update your database schema based on the DDL script you just generated.  This procedure currently uses the Oracle8 SQL worksheet and requires an NT system, rather than a Windows 95 system.  The released version of Rose/Oracle8 will allow you to update your database directly, and therefore will not have this constraint.
11.	Open the Oracle SQL Worksheet.

12.	In the SQL Worksheet window, open the file that contains your DDL script.
Notice that a Create statement was generated for the Sales_At_Full_Price object you added to the model.

	If you need to make changes to the script before applying it to your database, you can edit the file directly in the SQL Worksheet window.
13.	Select Execute from the Worksheet menu to apply the changes to your database schema.

	1. Click the videocam to watch a demo movie. 2. Close the movie window to return to the tutorial.
Tell Me More About Rational Rose


Tell Me More About Rational Rose

The Rational Rose Product Family

Rational Rose® is a family of products that provides a complete set of visual modeling tools.  These tools enable software developers to create robust, efficient solutions to real business needs in the client/server, distributed enterprise.

Rational Rose is the professional modeling tool for business requirements analysis and design projects of any size. Rational Rose includes modeling of dynamic behaviors, such as business requirements analysis, business scenario analysis with collaboration diagrams, and detailed component design. It supports the Unified Modeling Language (UML), a standard software design notation that unifies business process modeling, object modeling, component modeling and object-relational data modeling. More information about modeling with the UML is available at www.rational.com/uml.

Rational Rose products share a common universal standard, making modeling accessible to analysts that model business processes, as well as to programmers that model applications logic and business data.

Modeling with Rational Rose

Modeling is useful at any point in the application-development process.  Rational Rose includes powerful tools for reverse engineering (making a model from existing code) and forward engineering (making code from a model). You can gain valuable insights into your current architecture and track deviations from its original design.

Rational Rose/Oracle8

Rational Rose/Oracle8 allows you to create object models from Oracle 8 relational schemas and extend them to support  Oracle 8's object capabilities. This enables you to preserve your investment in existing relational databases while taking advantage of all the benefits that object modeling and development bring to desktop and server applications. Rose/Oracle8 wizards assist in the migration from relational to object-relational by guiding you through the definition of an object-relational model. Rational Rose can model, generate, and visualize relational tables, triggers, object types, objects views, Varrays, nested tables, and other key object features in Oracle 8.