Page 517
Figure 19.2.
Creating a new role
with Security Manager.
Figure 19.3.
Granting the CONNECT
and RESOURCE roles to
the new role.
Page 518
Figure 19.4.
Creating the new
database user.
Figure 19.5. Page 519
Granting the
Department_
Administrator role
to the new user.
In addition to providing a quota on the use of storage in a tablespace, Oracle also provides other system-level quotas that can be established for a user. These quotas include the following:
The mechanism that you use for specifying these quotas is the profile. For example, you might want to create a profile for a casual user that limits his or her connect time to two hours or less. In addition, you might also want to limit a casual user's idle time to 10 minutes. On top of that, you might also fear that a casual userparticularly, one who has access to an ad hoc query toolcould inadvertently construct queries that produce a Cartesian product of several tables. By setting a fairly high limit on LOGICAL_READS_PER_CALL, you can prevent the user's query from consuming memory and CPU time needed by other users.
To enforce the resource limits specified in a user's profile, the DBA must perform either one of the following tasks:
One of the goals of this lesson is to address performance issues related to an Oracle database. The material in this lesson is an introduction to some of the issues you may encounter during the database development process. Here are some general suggestions.
Page 520
DO DON'T |
DO buy as many disks and as much memory as you can afford. |
Keep these guidelines in mind as you read about the performance characteristics that occur in an Oracle client/server environment.
A synonym is another name for a table. Actually, the term table synonym is more accurate. Synonyms come in two flavors: private and public. A private synonym is visible only to the Oracle user who created it. A public synonym is visible to all Oracle users. Any Oracle user who has been granted the RESOURCE role can create a private synonym. On the other hand, only an Oracle user who has been granted the DBA roleor the Create Public Synonym system privilegecan create a public synonym.
NEW TERM
A synonym is another name for a table or view. A synonym that is visible only to its owner is referred to as a private synonym. A synonym that is visible to all Oracle users is referred to as a public synonym.
In one way, a synonym is similar to a view: both objects enable a table to be referenced by a different name. However, a synonym doesn't enable you to restrict columns or rename them.
A synonym provides an additional name for referencing a table. For example, you may not be able to rename a table because existing applications reference the current table name. However, a synonym that provides a more intuitive and meaningful name might be ideal for use in an ad hoc query tool.
You should see how you can manage synonyms with the Personal Oracle Navigator or with Schema Manager. However, there is an advantage to using an SQL script for creating and dropping synonyms.
Page 521
Therefore, take a look at the syntax for creating a synonym:
CREATE [PUBLIC] SYNONYM synonym-name FOR owner.object-name;
The variables are defined as follows:
synonym-name is the synonym name and is subject to Oracle database object-naming
requirements.
owner is the name of the Oracle account that owns the referenced table or view.
object-name is the name of the table or view referenced by the synonym.
You might want to create a synonym to reference a table whose name is inappropriate or difficult to remember. In this example, the synonym p_artifact is used to point to the table parthaginian_artifacts, which belongs to the same Oracle user.
SQL> create synonym p_artifact for parthaginian_artifacts; Synonym created.
A private synonym also can point to a table owned by another Oracle user. Suppose Oracle user RJOHNSON has created the Project table and wants to enable Oracle user KCHOW to read the Project table. First, RJOHNSON grants the select privilege on the Project table to KCHOW. However, each time KCHOW wants to look at the table, she has to remember to qualify the table name with RJOHNSONthe table owner. Consequently, she creates a private synonym that enables her to reference the table by the Project name alone, as shown in Listing 19.1.
Listing 19.1. Using a private synonym.
SQL> select Project_Number 2 from Project; from Project * ERROR at line 2: ORA-00942: table or view does not exist SQL> create synonym Project for RJOHNSON.Project; Synonym created. SQL> select Project_Number 2 from Project; PROJECT_NUMBER -------------- 1201 2143 4310