Page 43
Every database connection is established on behalf of a database user. The terms table owner, Oracle user, and Oracle account are used interchangeably. A table owner is the database user that owns a table. A table owner is always an Oracle user, but an Oracle user may or may not own any tables of his or her own. An example should help explain this concept.
Let's look at the sample database. An Oracle account named FLUGLE owns all the tables for the college information system. Sally Jensen is the biology department administrator and has an Oracle account named JENSENS. However, even though Sally Jensen has access to all the tables owned by the FLUGLE account, she owns no tables of her own.
Every table that exists in an Oracle database must have an owner. A sensible approach is to create an owner that corresponds to the organization rather than to any individual in the organization. If you think about it, an organization's datainformation that members of the organization create, modify, and usedoesn't belong to any one person. Also, given the dynamics of organizations, people come and go, but the organization remains.
In the sample application, instead of making an individual the owner of the Oracle tables, you are going to create a new user named FLUGLE and have that Oracle account own all of the tables in the application.
Before you create a new Oracle user, you'll have to know how to connect to an Oracle database. Most Oracle tools provide a dialog window for establishing a connection to an Oracle database. The dialog window prompts you for three items:
If you're using Personal Oracle, you don't have to enter a database name. If you're trying to connect to an Oracle database on a server, you'll generally have to specify the database name.
As a first step in setting up the sample database, you will create an Oracle user, FLUGLE, which will own all of the database objects in the application database. This section looks at two different ways to accomplish this. If you're using Personal Oracle for Windows 95, you'll see how to use the Navigator to create the new user. If you're using an Oracle servereither Workgroup Server or Universal Serveryou'll see how the same task can be performed using Security Manager, a component of Oracle Enterprise Manager.
Page 44
First, invoke the Navigator from the Personal Oracle for Windows 95 program group.
To see the existing users in the local database, just double-click the User folder. A list of
the existing users is displayed on the right side of the main window. To create the
FLUGLE user, select the User folder and right-click New. The Navigator displays a window, prompting
you for the username, the password, and the password confirmation. (See Figure 3.2.)
Figure 3.2.
Creating the FLUGLE
user with the
Navigator.
Click OK. The FLUGLE user is displayed in the list of existing users in the Local Database. (See Figure 3.3.)
Figure 3.3.
The FLUGLE user is
displayed in the list of
users in the
Local
Database.
You'll want to assign an existing database role to the FLUGLE userRESOURCE. This role enables the FLUGLE Oracle account to create new tables and other database objects. To assign this role, select the FLUGLE user and right-click Properties. A window with two tab folders will appear; select the Role/Privilege tab. Select the Roles radio button. Select the role named RESOURCE and click <. The role will be assigned to FLUGLE. (See Figure 3.4.)
Page 45
Figure 3.4.
Granting the
RESOURCE role to
the FLUGLE user.
As an alternative to the Personal Oracle Navigator, this section leads you through the steps of creating a user with Security Manager, a component of Oracle Enterprise Manager. To initially use Security Manager, you need to connect to the Oracle database using an account with DBA privileges. For this purpose, use the SYSTEM account to initially connect to the Oracle database.
Figure 3.5.
Connecting to the
Oracle Server with
Security Manager.
NOTE |
This example specifies the service or database as FCIS. You can create this database alias by using the SQL*Net Easy Configuration utility, as described in Day 1, "Exploring the World of Relational Databases." If you are using an Oracle server, please ask your DBA for the node and instance names that you should use when creating a new database alias with the SQL*Net Easy Configuration utility. |
Page 46
Figure 3.6.
Adding the FLUGLE
user with Security
Manager.
Before you actually create the FLUGLE user, you'll grant the RESOURCE role to the FLUGLE user so that the user can create tables and other database objects.