Select the Schema Manager from the Oracle Enterprise Manager program group. Start Schema Manager by selecting the program from the Oracle Enterprise Manager group.
Login in as user SCOTT with password TIGER and then click the OK button.
The Schema Manager gives you a graphical view of all the database objects. To see a listing of indexes, click the plus sign to the left of the Indexes heading in the list box on the left.
The Indexes listing contains all the schemas that the user SCOTT has access to. Click the plus sign to the left of the SCOTT schema to show the Indexes in that schema.
To see the details of the DEPT_PRIMARY_KEY index, click the index name in the left list box.
To create a new index, right click the SCOTT schema name.
Select the Create menu choice.
The Create Index form will prompt you for an index name. Enter A_UNIQUE_INDEX in the Name box.
By default, the Create Index form starts with the first table in the schema in alphabetical order. This is the A_TABLE that you created in an earlier module, and is the one you want to use.
The index also will contain the one column in the table, COLUMN1. To specify this column as part of the index, click the box to the left of the column name in the column list box.
Once you select a column, it is given an order in the index; in this case, 1.
You have to indicate that this is a unique index by selecting the Unique check box near the bottom of the Create Index form.
The final step in creating the index is to click the Create push button at the bottom of the page.
When you return to the Schema Manager, you can see that the A_UNIQUE_INDEX entry is now in the list of indexes. This is the end of the simulation.
Although you can use the SchemaManager API directly, Oracle recommends that you create a TableCreator class and use its API (which, in turn, uses the SchemaManager). The TableCreator class owns one or more TableDefinition classes (one for each database table) and the TableDefinition class owns one or more FieldDefinition classes (one for each field).
The TableDefinition class lets you specify a database table schema in a generic format. At run time, TopLink uses the session associated with your TopLink project to determine the specific database type, and uses the generic schema to create the
appropriate tables and fields for that database.