1 The Oracle Database Administrator: Types of Oracle Users
1 The Oracle Database Administrator: Types of Oracle Users
1
The Oracle Database Administrator
This chapter describes your responsibilities as a database administrator (DBA) who administers
the Oracle database server.
Database Administrators
Security Officers
Network Administrators
Application Developers
Application Administrators
Database Users
Database Administrators
Each database requires at least one database administrator (DBA) to administer it. Because an
Oracle database system can be large and can have many users, often this is not a one person job.
In such cases, there is a group of DBAs who share responsibility.
Security Officers
In some cases, a site assigns one or more security officers to a database. A security officer
enrolls users, controls and monitors user access to the database, and maintains system security.
As a DBA, you might not be responsible for these duties if your site has a separate security
officer.
Network Administrators
Some sites have one or more network administrators. A network administrator can administer
Oracle networking products, such as Oracle Net Services.
See Also:
Application Developers
Application developers can perform some of these tasks in collaboration with DBAs.
Application Administrators
An Oracle site can assign one or more application administrators to administrate a particular
application. Each application can have its own administrator.
Database Users
Database users interact with the database through applications or utilities. A typical user's
responsibilities include the following tasks:
Note:
Evaluate how Oracle and its applications can best use the available computer resources. This
evaluation should reveal the following information:
How many disk drives are available to Oracle and its databases
How many, if any, dedicated tape drives are available to Oracle and its databases
How much memory is available to the instances of Oracle you will run (see your system's
configuration documentation)
As the database administrator, you install the Oracle database server software and any front-end
tools and database applications that access the database. In some distributed processing
installations, the database is controlled by a central computer (database server) and the database
tools and applications are executed on remote computers (clients). In this case, you must also
install the Oracle Net components necessary to connect the remote machines to the computer that
executes Oracle.
For more information on what software to install, see "Identifying Your Oracle Database
Software Release".
See Also:
It is important to plan how the logical storage structure of the database will affect system
performance and various database management operations. For example, before creating any
tablespaces for your database, you should know how many datafiles will make up the tablespace,
what type of information will be stored in each tablespace, and on which disk drives the datafiles
will be physically stored. When planning the overall logical storage of the database structure,
take into account the effects that this structure will have when the database is actually created
and running. Such considerations include how the logical storage structure database will affect
the following:
Plan the relational design of the database objects and the storage characteristics for each of these
objects. By planning the relationship between each object and its physical storage before creating
it, you can directly affect the performance of the database as a unit. Be sure to plan for the
growth of the database.
In distributed database environments, this planning stage is extremely important. The physical
location of frequently accessed data dramatically affects application performance.
During the planning stage, develop a backup strategy for the database. You can alter the logical
storage structure or design of the database to improve backup efficiency.
It is beyond the scope of this book to discuss relational and distributed database design. If you
are not familiar with such design issues, refer to accepted industry-standard documentation.
Part II, "Oracle Server Processes and Storage Structure" and Part III, "Schema Objects" provide
specific information on creating logical storage structures, objects, and integrity constraints for
your database.
When you complete the database design, you can create the database and open it for normal use.
You can create a database at installation time, using the Database Configuration Assistant, or you
can supply your own scripts for creating a database.
Either way, refer to Chapter 2, "Creating an Oracle Database", for information on creating a
database and Chapter 4, "Starting Up and Shutting Down" for guidance in starting up the
database.
After you create the database structure, carry out the backup strategy you planned for the
database. Create any additional redo log files, take the first full database backup (online or
offline), and schedule future database backups at regular intervals.
See Also:
After you back up the database structure, you can enroll the users of the database in accordance
with your Oracle license agreement, create appropriate roles for these users, and grant these
roles.
After you create and start the database, and enroll the system users, you can implement the
planned logical structure database by creating all necessary tablespaces. When you complete this,
you can create the objects for the database.
Part II, "Oracle Server Processes and Storage Structure" and Part III, "Schema Objects" contain
information which can help you create logical storage structures and objects for your database.
Now that the database is fully implemented, again back up the database. In addition to regularly
scheduled backups, you should always back up your database immediately after implementing
changes to the database structure.
Optimizing the performance of the database is one of your ongoing responsibilities as a DBA.
Additionally, Oracle provides a database resource management feature that enables you to
control the allocation of resources to various user groups.
The database resource manager is described in Chapter 27, "Using the Database Resource
Manager".
See Also:
As many as five numbers may be required to fully identify a release. The significance of these
numbers is discussed below.
To understand the release level nomenclature used by Oracle, examine the following example of
an Oracle database server labeled "Release 9.2.0.1.0."
Figure 1-1 Example of an Oracle Release Number
Note:
This is the most general identifier. It represents a major new edition (or version) of the software
that contains significant new functionality.
This digit represents a maintenance release level. Some new features may also be included.
This digit reflects the release level of the Oracle9i Application Server (Oracle9iAS).
This digit identifies a release level specific to a component. Different components can have
different numbers in this position depending upon, for example, component patch sets or interim
releases.
This digit identifies a platform specific release. Usually this is a patch set. Where different
platforms require the equivalent patch set, this digit will be the same across the effected
platforms.
Checking Your Current Release Number
To identify the release of the Oracle database server that is currently installed and to see the
release levels of other Oracle components you are using, query the data dictionary view
PRODUCT_COMPONENT_VERSION. A sample query is shown below. Other product release levels
may increment independently of the database server.
It's important to convey to Oracle the information displayed by this query when you report
problems with the software.
Optionally, you can query the V$VERSION view to see component-level information.
To perform many of the administrative duties for a database, you must be able to execute
operating system commands. Depending on the operating system that executes Oracle, you might
need an operating system account or ID to gain access to the operating system. If so, your
operating system account might require more operating system privileges or access rights than
many database users require (for example, to perform Oracle software installation). Although
you do not need the Oracle files to be stored in your account, you should have access to them.
See Also:
Your operating system specific Oracle documentation. The method of
distinguishing a database administrator's account is operating system specific.
Note:
Oracle recommends that you specify passwords for SYS and SYSTEM at
database creation time, rather that using these default passwords. This is
explained in "Protecting Your Database: Specifying Passwords for Users
SYS and SYSTEM".
If you use the default passwords, to prevent inappropriate access to the data
dictionary tables or other tampering with the database, it is important that you
change the passwords for the SYS and SYSTEM usernames immediately after
creating an Oracle database.
It is suggested that you create at least one additional administrator user, and grant that user the
DBA role, to use when performing daily administrative tasks. It is recommended that you do not
use SYS and SYSTEM for these purposes.
SYS
When any database is created, the user SYS is automatically created and granted the DBA role.
All of the base tables and views for the database's data dictionary are stored in the schema SYS.
These base tables and views are critical for the operation of Oracle. To maintain the integrity of
the data dictionary, tables in the SYS schema are manipulated only by Oracle. They should never
be modified by any user or database administrator, and no one should create any tables in the
schema of user SYS. (However, you can change the storage parameters of the data dictionary
settings if necessary.)
Ensure that most database users are never able to connect using the SYS account.
SYSTEM
When a database is created, the user SYSTEM is also automatically created and granted the DBA
role.
The SYSTEM username is used to create additional tables and views that display administrative
information, and internal tables and views used by various Oracle options and tools. Never create
in the SYSTEM schema tables of interest to individual users.
A predefined role, named DBA, is automatically created with every Oracle database. This role
contains most database system privileges. Therefore, it is very powerful and should be granted
only to fully functional database administrators.
Note:
The DBA role does not include the SYSDBA or SYSOPER system privileges.
These are special administrative privileges that allow an administrator to
perform basic database administration tasks, such as creating the database
and instance startup and shutdown. These system privileges are discussed in
"Administrative Privileges".
Administrative Privileges
Selecting an Authentication Method
Using Operating System (OS) Authentication
Using Password File Authentication
Administrative Privileges
Administrative privileges that are required for an administrator to perform basic database
operations are granted through two special system privileges, SYSDBA and SYSOPER. You must
have one of these privileges granted to you, depending upon the level of authorization you
require.
Note:
The following are the operations that are authorized by the SYSDBA and SYSOPER system
privileges:
System
Privilege Operations Authorized
SYSDBA
Perform STARTUP and SHUTDOWN operations
ALTER DATABASE: open, mount, back up, or change character set
CREATE DATABASE
System
Privilege Operations Authorized
CREATE SPFILE
This privilege allows a user to perform basic operational tasks, but without the
ability to look at user data.
The manor in which you are authorized to use these privileges depends upon the method of
authentication that you choose to use.
When you connect with SYSDBA or SYSOPER privileges, you connect with a default schema, not
with the schema that is generally associated with your username. For SYSDBA this schema is SYS;
for SYSOPER the schema is PUBLIC.
This example illustrates that a user is assigned another schema (SYS) when connecting with the
SYSDBA system privilege.
CONNECT scott/password
CREATE TABLE admin_test(name VARCHAR2(20));
This is because scott now references the SYS schema by default. The table was created in the
scott schema.
See Also:
"Using Operating System (OS) Authentication"
"Using Password File Authentication"
Note:
These methods replace the CONNECT INTERNAL syntax provided with earlier
versions of Oracle. CONNECT INTERNAL is no longer allowed.
Your choice will be influenced by whether you intend to administer your database locally on the
same machine where the database resides, or whether you intend to administer many different
databases from a single remote client. Figure 1-2 illustrates the choices you have for database
administrator authentication schemes.
If you are performing remote database administration, you should consult your Oracle Net
documentation to determine if you are using a secure connection. Most popular connection
protocols, such as TCP/IP and DECnet, are not secure.
See Also:
Oracle9i Database Concepts for additional information about user
authentication
"User Authentication"
"User Authentication Methods"
Oracle9i Net Services Administrator's Guide
To connect to Oracle as a privileged user over a local connection or a secure remote connection,
you have the following options:
You can connect and be authenticated by a password file, provided the database has a
password file and you have been granted the SYSDBA or SYSOPER system privilege.
If the server is not using a password file, or if you have not been granted SYSDBA or
SYSOPER privileges and are therefore not in the password file, you can use OS
authentication. On most operating systems, OS authentication for database administrators
involves placing the OS username of the database administrator in a special group,
generically referred to as OSDBA.
This section describes how to authenticate an administrator using the operating system.
To enable authentication of an administrative user using the operating system you must do the
following:
2. Add the user to the OSDBA or OSOPER operating system defined groups.
A user can be authenticated, enabled as an administrative user, and connected to a local database
by typing one of the following SQL*Plus commands:
CONNECT / AS SYSDBA
CONNECT / AS SYSOPER
For a remote database connection over a secure connection, the user must also specify the net
service name of the remote database:
SQL*Plus User's Guide and Reference for syntax of the CONNECT command
Two special operating system groups control database administrator connections when using OS
authentication. These groups are generically referred to as OSDBA and OSOPER. The groups
are created and assigned specific names as part of the database installation process. The specific
names vary depending upon your operating system and are listed in the following table:
Operating System Group UNIX Windows
OSDBA dba ORA_DBA
The default names assumed by the Oracle Universal Installer can be overridden. How you create
the OSDBA and OSOPER groups is operating system specific.
The following describes how membership in the OSDBA or OSOPER group affects your
connection to Oracle:
If you are a member of the OSDBA group, and specify AS SYSDBA when you connect to
the database, you are granted the SYSDBA system privilege.
If you are a member of the OSOPER group, and specify AS SYSOPER when you connect
to the database, you are granted the SYSOPER system privilege.
If you are not a member of the associated operating system group for SYSDBA or SYSOPER
system privileges, the CONNECT command fails.
See Also:
This section describes how to authenticate an administrative user using password file
authentication.
To enable authentication of an administrative user using password file authentication you must
do the following:
2. If not already created, Create the password file using the ORAPWD utility:
3. ORAPWD FILE=filename PASSWORD=password ENTRIES=max_users
4.
4. Connect to the database as user SYS (or as another user with the administrative privilege).
5. If the user does not already exist in the database, create the user. Grant the SYSDBA or
SYSOPER system privilege to the user:
6. GRANT SYSDBA to scott;
7.
This statement adds the user to the password file, thereby enabling connection AS
SYSDBA.
See Also:
"Creating and Maintaining a Password File" for instructions for creating and
maintaining a password file
Administrative users can be connected and authenticated to a local or remote database by using
the SQL*Plus CONNECT command. They must connect using their username and password and
with the AS SYSDBA or AS SYSOPER clause. For example, user scott has been granted the
SYSDBA privilege, so he can connect as follows:
However, since scott has not been granted the SYSOPER privilege, the following command will
fail:
Note:
If you are not in the OSDBA or OSOPER groups, and you are not in the
password file, then the connection will fail.
See Also:
SQL*Plus User's Guide and Reference for syntax of the CONNECT command
Using ORAPWD
Setting REMOTE_LOGIN_ PASSWORDFILE
Adding Users to a Password File
Maintaining a Password File
See Also:
Using ORAPWD
When you invoke the password file creation utility without supplying any parameters, you
receive a message indicating the proper use of the command as shown in the following sample
output:
orapwd
Usage: orapwd file=<fname> password=<password> entries=<users>
where
file - name of password file (mand),
password - password for SYS (mand),
entries - maximum number of distinct DBAs and OPERs (opt),
There are no spaces around the equal-to (=) character.
The following command creates a password file named acct.pwd that allows up to 30 privileged
users with different passwords. In this example, the file is initially created with the password
secret for users connecting as SYS.
FILE
This parameter sets the name of the password file being created. You must specify the full path
name for the file. The contents of this file are encrypted, and the file cannot be read directly. This
parameter is mandatory.
The types of filenames allowed for the password file are operating system specific. Some
operating systems require the password file to be a specific format and located in a specific
directory. Other operating systems allow the use of environment variables to specify the name
and location of the password file. See your operating system specific Oracle documentation for
the names and locations allowed on your platform.
If you are running multiple instances of Oracle using Oracle9i Real Application Clusters, the
environment variable for each instance should point to the same password file.
Caution:
It is critically important to the security of your system that you protect your
password file and the environment variables that identify the location of the
password file. Any user with access to these could potentially compromise
the security of the connection.
PASSWORD
This parameter sets the password for user SYS. If you issue the ALTER USER statement to change
the password for SYS after connecting to the database, both the password stored in the data
dictionary and the password stored in the password file are updated. This parameter is
mandatory.
ENTRIES
This parameter specifies the number of entries that you require the password file to accept. This
number corresponds to the number of distinct users allowed to connect to the database as SYSDBA
or SYSOPER. The actual number of allowable entries can be higher than the number of users
because the ORAPWD utility continues to assign password entries until an operating system block
is filled. For example, if your operating system block size is 512 bytes, it holds four password
entries. The number of password entries allocated is always multiple of four.
Entries can be reused as users are added to and removed from the password file. If you intend to
specify REMOTE_LOGON_PASSWORDFILE=EXCLUSIVE, and to allow the granting of SYSDBA and
SYSOPER privileges to users, this parameter is required.
Caution:
When you exceed the allocated number of password entries, you must create
a new password file. To avoid this necessity, allocate a number of entries that
is larger than you think you will ever need.
Value Description
NONE Setting this parameter to NONE causes Oracle to behave as if the password file does
not exist. That is, no privileged connections are allowed over non-secure
connections. NONE is the default value for this parameter.
EXCLUSIVE An EXCLUSIVE password file can be used with only one database. Only an
EXCLUSIVE file can contain the names of users other than SYS. Using an EXCLUSIVE
password file allows you to grant SYSDBA and SYSOPER system privileges to
individual users and have them connect as themselves.
SHARED A SHARED password file can be used by multiple databases. However, the only user
recognized by a SHARED password file is SYS. You cannot add users to a SHARED
password file. All users needing SYSDBA or SYSOPER system privileges must
connect using the same name, SYS, and password. This option is useful if you have
a single DBA administering multiple databases.
Suggestion:
When you grant SYSDBA or SYSOPER privileges to a user, that user's name and privilege
information are added to the password file. If the server does not have an EXCLUSIVE password
file (that is, if the initialization parameter REMOTE_LOGIN_PASSWORDFILE is NONE or SHARED) you
receive an error message if you attempt to grant these privileges.
A user's name remains in the password file only as long as that user has at least one of these two
privileges. If you revoke both of these privileges, the user is removed from the password file.
1. Follow the instructions for creating a password file as explained in "Using ORAPWD".
4. Start up the instance and create the database if necessary, or mount and open an existing
database.
5. Create users as necessary. Grant SYSDBA or SYSOPER privileges to yourself and other
users as appropriate. See "Granting and Revoking SYSDBA and SYSOPER Privileges".
Granting the SYSDBA or SYSOPER privilege to a user causes their username to be added to the
password file. This enables the user to connect to the database as SYSDBA or SYSOPER by
specifying username and password (instead of using SYS). The use of a password file does not
prevent OS authenticated users from connecting if they meet the criteria for OS authentication.
If your server is using an EXCLUSIVE password file, use the GRANT statement to grant the SYSDBA
or SYSOPER system privilege to a user, as shown in the following example:
Use the REVOKE statement to revoke the SYSDBA or SYSOPER system privilege from a user, as
shown in the following example:
Because SYSDBA and SYSOPER are the most powerful database privileges, the ADMIN OPTION is
not used. Only a user currently connected as SYSDBA (or INTERNAL) can grant or revoke another
user's SYSDBA or SYSOPER system privileges. These privileges cannot be granted to roles, because
roles are only available after database startup. Do not confuse the SYSDBA and SYSOPER database
privileges with operating system roles, which are a completely independent feature.
See Also:
Use the V$PWFILE_USERS view to see the users who have been granted SYSDBA or SYSOPER
system privileges for a database. The columns displayed by this view are as follows:
Column Description
USERNAME This column contains the name of the user that is recognized by the password file.
SYSDBA If the value of this column is TRUE, then the user can log on with SYSDBA system
Column Description
privileges.
SYSOPER If the value of this column is TRUE, then the user can log on with SYSOPER system
privileges.
Expand the number of password file users if the password file becomes full
Remove the password file
Avoid changing the state of the password file
If you receive the file full error (ORA-1996) when you try to grant SYSDBA or SYSOPER system
privileges to a user, you must create a larger password file and re-grant the privileges to the
users.
1. Note the users who have SYSDBA or SYSOPER privileges by querying the V$PWFILE_USERS
view.
4. Follow the instructions for creating a new password file using the ORAPWD utility in
"Using ORAPWD". Ensure that the ENTRIES parameter is set to a number larger than you
think you will ever need.
If you determine that you no longer require a password file to authenticate users, you can delete
the password file and reset the REMOTE_LOGIN_PASSWORDFILE initialization parameter to NONE.
After you remove this file, only those users who can be authenticated by the operating system
can perform database administration operations.
Caution:
Do not remove or modify the password file if you have a database or instance
mounted using REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE (or SHARED). If
you do, you will be unable to reconnect remotely using the password file.
Even if you replace it, you cannot use the new password file, because the
timestamps and checksums will be wrong.
The password file state is stored in the password file. When you first create a password file, its
default state is SHARED. You can change the state of the password file by setting the initialization
parameter REMOTE_LOGIN_PASSWORDFILE. When you start up an instance, Oracle retrieves the
value of this parameter from the parameter file stored on your client machine. When you mount
the database, Oracle compares the value of this parameter to the value stored in the password
file. If the values do not match, Oracle overwrites the value stored in the file.
Caution:
SQL*Loader
Export and Import
See Also:
SQL*Loader
SQL*Loader is used both by database administrators and by other users of Oracle. It loads data
from standard operating system files (such as, files in text or C data format) into Oracle database
tables.
The Export and Import utilities enable you to move existing data in Oracle format to and from
Oracle databases. For example, export files can archive database data or move data among
different Oracle databases that run on the same or different operating systems.
Copyright © 2001, 2002 Oracle Corporation. Hom Book Conte Inde Mast Feedb
All Rights Reserved. e List nts x er ack
Inde
x
Skip Headers
2
Creating an Oracle Database
This chapter discusses the process of creating an Oracle database, and contains the following
topics:
See Also:
The following topics can help prepare you for database creation.
Prepare to create the database by research and careful planning. The following are some
recommended actions:
For more
Action information...
install Oracle and create your database. For example, placing redo log
files on separate disks or striping; placing datafiles to reduce system specific
contention; and controlling density of data (number of rows to a data documentation
block).
Chapter 3, "Using
Consider using the Oracle Managed Files feature to create and
Oracle-Managed
manage the operating system files that comprise your database
Files"
storage. This feature eases their administration.
"Determining the
Select the global database name, which is the name and location of
Global Database
the database within the network structure. Create the global
Name"
database name by setting both the DB_NAME and DB_DOMAIN
initialization parameters.
"Initialization
Familiarize yourself with the initialization parameters that comprise
Parameters and
the initialization parameter file. Become familiar with the concept and
Database Creation"
operation of a server parameter file. A server parameter file allows
you to store and manage your initialization parameters persistently in
a server-side disk file. "What is a Server
Parameter File?"
Oracle9i Database
Reference
Consider what time zones your database must support. "Specifying the
Database Time Zone
Oracle uses a time zone file, located in the Oracle home File"
For more
Action information...
directory, as the source of valid time zones. If you determine that Oracle9i Database
you need to use a time zone that is not in the default time zone Globalization
file (timezone.dat), but that is present in the larger time zone Support Guide
file (timezlrg.dat), then you must set the ORA_TZFILE
environment variable to point to the larger file.
Select the standard database block size. This is specified at database "Specifying Database
creation by the DB_BLOCK_SIZE initialization parameter and cannot Block Sizes"
be changed after the database is created.
Chapter 7, "Managing
Develop a backup and recovery strategy to protect the database from
the Online Redo Log"
failure. It is important to protect the control file by multiplexing, to
choose the appropriate backup mode, and to manage the online and
archived redo logs.
Chapter 8, "Managing
Archived Redo Logs"
Chapter 6, "Managing
Control Files"
The desired Oracle software is installed. This includes setting up various environment variables
unique to your operating system and establishing the directory structure for software and
database files.
You have the operating system privileges associated with a fully operational database
administrator. You must be specially authenticated by your operating system or through a
password file, allowing you to start up and shut down an instance before the database is created
or opened. This authentication is discussed in "Database Administrator Authentication".
There is sufficient memory available to start the Oracle instance.
There is sufficient disk storage space for the planned database on the computer that executes
Oracle.
All of these are discussed in the Oracle installation guide specific to your operating system.
Additionally, the Oracle Universal Installer will guide you through your installation and provide
help in setting up environment variables, directory structure, and authorizations.
Creating information structures, including the data dictionary, that Oracle requires to access and
use the database
Creating and initializing the control files and redo log files for the database
Creating new datafiles or erasing data that existed in previous datafiles
You use the CREATE DATABASE statement to perform these operations, but other actions are
necessary before you have an operational database. A few of these actions are creating users and
temporary tablespaces, building views of the data dictionary tables, and installing Oracle built-in
packages. This is why the database creation process involves executing prepared scripts. But,
you do not necessarily have to prepare this script yourself.
You have the following options for creating your new Oracle database:
DBCA can be launched by the Oracle Universal Installer, depending upon the type of
install that you select, and provides a graphical user interface (GUI) that guides you
through the creation of a database. You can chose not to use DBCA, or you can launch it
as a standalone tool at any time in the future to create a database. See "Using the
Database Configuration Assistant".
If you already have existing scripts for creating your database, you can still create your
database manually. However, consider editing your existing script to take advantage of
new Oracle features. Oracle provides a sample database creation script and a sample
initialization parameter file with the database software files it distributes, both of which
can be edited to suit your needs. See "Manually Creating an Oracle Database".
Upgrade an existing database.
If you are already using a previous release of Oracle, database creation is required only if
you want an entirely new database. You can upgrade your existing Oracle database and
use it with the new release of the Oracle software. Database upgrades are not discussed in
this book. The Oracle9i Database Migration manual contains information about
upgrading an existing Oracle database.
dbca
Mode Description
Interactive This is the default mode if you do not specify any parameters. This mode presents a
wizard like GUI interface and provides complete DBCA functionality. Online help
is provided.
Progress This mode is typically used by other tools to create a database. For example, it is
Only used by the Oracle Universal Installer, the Enterprise Manager Configuration
Assistant, and the Oracle Internet Directory Configuration Assistant. In this mode,
only a progress bar is displayed, and it is used when creating databases and
templates.
Silent This mode has only a command-line interface where parameters are specified.
There is no other user interaction. Informational, error, and warning message are
written to a log file. You specify the template of your choice, for customization or
for the creation of a database.
DBCA can be used to create single instance databases, or it can be used to create or add
instances in an Oracle Real Application Clusters environment.
This section primarily describes the use of DBCA in interactive mode. It contains the following
topics:
You can use its wizards to guide you through a selection of options providing an easy means of
creating and tailoring your database. It allows you to provide varying levels of detail. You can
provide a minimum of input and allow Oracle to make decisions for you, eliminating the need to
spend time deciding how best to set parameters or structure the database. Optionally, it allows
you to be very specific about parameter settings and file allocations.
It builds efficient and effective databases that take advantage of Oracle's new features.
It uses Optimal Flexible Architecture (OFA), whereby database files and administrative files,
including initialization files, follow standard naming and placement practices.
DBCA enables you to create a database from predefined templates provided by Oracle or from
templates that you or others have created. A template is a description of a database. Templates
are described in more detail in "Managing DBCA Templates".
DBCA displays the templates that are available, which includes templates that Oracle ships with
the DBCA product. These templates are described in "DBCA Templates Provided by Oracle". If
you or others have created templates, those will be displayed also. You select the appropriate
template for the database that you want to create. Clicking the "Show Details..." button displays
specific information about the database defined by a template.
Including Datafiles
When you select a template, you also specify whether the database definition is to include
datafiles. This determines whether you use a seed template (includes datafiles), or a non-seed
template (does not include datafiles), to create your database.
The next page that DBCA displays enables you provide a global database name and SID.
The following is a representative list of Oracle features that you can install in your database.
Some of the listed options might already be included depending upon the database template that
you selected. Those options that are already installed are noted as such (grayed out).
Oracle Spatial
Oracle Ultra Search
Oracle Label Security
Oracle Data Mining
Oracle OLAP Services
Sample Schemas
You can also display a list of standard database features. These are features that Oracle
recommends you always install, but you have the option of excluding them. These include:
Oracle JVM
Oracle Text
Oracle interMedia
XDB Protocol
The next pages enable you to further define your database. You specify mode (dedicated server
of shared server), set initialization parameters, and specify datafile locations. Oracle can
determine specific values for you based upon your description of the database you are trying to
create. For example, Oracle can choose appropriate settings for SGA memory sizing parameters
depending upon whether you select a typical or custom database.
After you have completed the specification of the parameters that define your database you can:
If you choose to generate scripts, you can use them to create the database later without using
DBCA, or you can use them as a checklist
DBCA enables you to delete a database. When you do so, you delete the database instance and
its control file(s), redo log files, and datafiles. Any server parameter file (SPFILE) or
initialization parameter file used by the database is also deleted.
DBCA templates are XML files that contain information required to create a database. Templates
are used in DBCA to create new databases and make clones of existing databases. The
information in templates includes database options, initialization parameters, and storage
attributes (for datafiles, tablespaces, control files and redo logs).
Templates can be used just like scripts, and they can be used in silent mode. But they are more
powerful than scripts, because you have the option of cloning a database. This saves time in
database creation, because copying an already created seed database's files to the correct
locations takes less time than creating them as new.
$ORACLE_HOME/assistants/dbca/templates
They save you time. If you use a template you do not have to define the database.
By creating a template containing your database settings, you can easily create a duplicate
database without specifying parameters twice.
They are easily edited. You can quickly change database options from the template settings.
Templates are easy to share. They can be copied from one machine to another.
Types of Templates
Seed templates
Non-seed templates
Seed .dbc Yes This type of template contains both the structure and the
physical datafiles of an existing (seed) database. When you
select a seed template, database creation is faster because the
physical files and schema of the database have already been
created. Your database starts as a copy of the seed database,
rather than having to be built.
The datafiles and redo logs for the seed database are stored in
zipped format in another file with a .dfj extension. Usually
the corresponding .dfj file of a .dbc file has the same file
name, but this is not a requirement since the corresponding
.dfj file's location is stored in the .dbc file.
Non- .dbt No This type of template is used to create a new database from
seed scratch. It contains the characteristics of the database to be
created. Seed templates are more flexible than their seed
counterparts because all datafiles and redo logs are created to
your specification (not copied), and names, sizes, and other
attributes can be changed as required.
DSS (Data Users perform numerous, complex queries that process large volumes
Warehousing) of data. Response time, accuracy, and availability are key issues.
Environment Description of Environment
The "Template Management" page provides you with three options that enable you to modify
existing templates or to create your own custom templates. Your choices are:
Using an existing template, you can create a new template based on the pre-defined
template settings. You can add or change any template settings such as initialization
parameters, storage parameters, or use custom scripts.
You can create a new template that contains structural information about an existing
database, including database options, tablespaces, datafiles, and initialization parameters
specified in the source database. User defined schema and their data will not be part of
the created template. The source database can be either local or remote.
You can create a new template that has both the structural information and physical
datafiles of an existing database. Databases created using such a template are identical to
the source database. User defined schema and their data will be part of the created
template. The source database must be local.
The "Template Management" page also allows you to delete existing templates.
Silent mode does not have any user interface (other than what you initially input on the
command line) or user interaction. It outputs all messages including information, errors, and
warnings into a log file.
From the command line enter the following command to see all of the DBCA options that are
available when using silent mode:
dbca -help
The following sections contain examples that illustrate the use of silent mode.
The examples shown in these steps are to create the database mynewdb.
Note:
At this point, you may not be familiar with all of the initialization parameters
and database structures discussed in this section. These steps contain many
cross references to other parts of this book to allow you to learn about and
understand these parameters and structures.
Decide on a unique Oracle system identifier (SID) for your instance and set the ORACLE_SID
environment variable accordingly. This identifier is used to avoid confusion with other Oracle
instances that you may create later and run concurrently on your system.
The following example sets the SID for the instance and database we are about to create:
% setenv ORACLE_SID mynewdb
The value of the DB_NAME initialization parameter should match the SID setting.
You must be authenticated and granted appropriate system privileges in order to create a
database. You can use the password file or operating system authentication method. Database
administrator authentication and authorization is discussed in the following sections of this book:
The instance (System Global Area and background processes) for any Oracle database is started
using an initialization parameter file. One way of getting started on your initialization parameter
file is to edit a copy of the sample initialization parameter file that Oracle provides on the
distribution media, or the sample presented in this book.
For ease of operation, store your initialization parameter file in Oracle's default location, using
the default name. That way, when you start your database, it is not necessary to specify the
PFILE parameter because Oracle automatically looks in the default location for the initialization
parameter file.
For example, the initialization For example, the initialization parameter file for
parameter file for the mynewdb the mynewdb database is stored in the following
database is named: location:
initmynewdb.ora /vobs/oracle/dbs/initmynewdb.ora
The following is the initialization parameter file used to create the mynewdb database.
# Archive
LOG_ARCHIVE_DEST_1='LOCATION=/vobs/oracle/oradata/mynewdb/archive'
LOG_ARCHIVE_FORMAT=%t_%s.dbf
LOG_ARCHIVE_START=TRUE
# Shared Server
# Uncomment and use first DISPATCHES parameter below when your listener is
# configured for SSL
# (listener.ora and sqlnet.ora)
# DISPATCHERS = "(PROTOCOL=TCPS)(SER=MODOSE)",
# "(PROTOCOL=TCPS)(PRE=oracle.aurora.server.SGiopServer)"
DISPATCHERS="(PROTOCOL=TCP)(SER=MODOSE)",
"(PROTOCOL=TCP)(PRE=oracle.aurora.server.SGiopServer)",
(PROTOCOL=TCP)
# Miscellaneous
COMPATIBLE=9.2.0
DB_NAME=mynewdb
# Network Registration
INSTANCE_NAME=mynewdb
# Pools
JAVA_POOL_SIZE=31457280
LARGE_POOL_SIZE=1048576
SHARED_POOL_SIZE=52428800
# Resource Manager
RESOURCE_MANAGER_PLAN=SYSTEM_PLAN
# Sort, Hash Joins, Bitmap Indexes
SORT_AREA_SIZE=524288
$ SQLPLUS /nolog
CONNECT SYS/password AS SYSDBA
Start an instance without mounting a database. Typically, you do this only during database
creation or while performing maintenance on the database. Use the STARTUP command with the
NOMOUNT option. In this example, because the initialization parameter file is stored in the default
location, you are not required to specify the PFILE clause:
STARTUP NOMOUNT
At this point, there is no database. Only the SGA is created and background processes are started
in preparation for the creation of a new database.
See Also:
To create the new database, use the CREATE DATABASE statement. The following statement
creates database mynewdb:
The database is named mynewdb. Its global database name is mynewdb.us.oracle.com. See
"DB_NAME Initialization Parameter" and "DB_DOMAIN Initialization Parameter".
Three control files are created as specified by the CONTROL_FILES initialization parameter. See
"Specifying Control Files".
The password for user SYS is pz6r58 and the password for SYSTEM is y1tz5p. These two
clauses that specify the passwords for SYS and SYSTEM are not mandatory in this release of
Oracle9i. However, if you specify either clause, you must specify both clauses. For further
information about the use of these clauses, see "Protecting Your Database: Specifying
Passwords for Users SYS and SYSTEM".
The new database has three online redo log files as specified in the LOGFILE clause.
MAXLOGFILES, MAXLOGMEMBERS, and MAXLOGHISTORY define limits for the redo log. See
Chapter 7, "Managing the Online Redo Log".
MAXDATAFILES specifies the maximum number of datafiles that can be open in the database.
This number affects the initial sizing of the control file.
Note:
You can set several limits during database creation. Some of these limits are
also subject to superseding limits of the operating system and can be affected
by them. For example, if you set MAXDATAFILES, Oracle allocates enough
space in the control file to store MAXDATAFILES filenames, even if the
database has only one datafile initially. However, because the maximum
control file size is limited and operating system dependent, you might not be
able to set all CREATE DATABASE parameters at their theoretical maximums.
For more information about setting limits during database creation, see the
Oracle9i SQL Reference and your operating system specific Oracle
documentation.
MAXINSTANCES specifies that only one instance can have this database mounted and open.
The US7ASCII character set is used to store data in this database.
The AL16UTF16 character set is specified as the NATIONAL CHARACRTER SET, used to store
data in columns specifically defined as NCHAR, NCLOB, or NVARCHAR2.
The SYSTEM tablespace, consisting of the operating system file
/vobs/oracle/oradata/mynewdb/system01.dbf, is created as specified by the
DATAFILE clause. If the file already exists, it is overwritten.
The SYSTEM tablespace is a locally managed tablespace. See "Creating a Locally Managed
SYSTEM Tablespace".
The DEFAULT_TEMPORARY_TABLESPACE clause creates and names a default temporary
tablespace for this database. See "Creating a Default Temporary Tablespace".
The UNDO_TABLESPACE clause creates and names an undo tablespace to be used to store undo
records for this database if you have specified UNDO_MANAGEMENT=AUTO in the initialization
parameter file. See "Using Automatic Undo Management: Creating an Undo Tablespace".
Because the ARCHIVELOG clause is not specified in this CREATE DATABASE statement, redo log
files will not initially be archived. This is customary during database creation and an ALTER
DATABASE statement can be used later to switch to ARCHIVELOG mode. The initialization
parameters in the initialization parameter file for mynewdb relating to archiving are
LOG_ARCHIVE_DEST_1, LOG_ARCHIVE_FORMAT, and LOG_ARCHIVE_START. See Chapter 8,
"Managing Archived Redo Logs".
See Also:
To make the database functional, you need to create additional files and tablespaces for users.
The following sample script creates some additional tablespaces:
Run the scripts necessary to build views, synonyms, and PL/SQL packages:
Script Description
CATALOG.SQL Creates the views of the data dictionary tables, the dynamic performance views,
and public synonyms for many of the views. Grants PUBLIC access to the
synonyms.
CATPROC.SQL Runs all scripts required for or used with PL/SQL.
You may want to run other scripts. The scripts that you run are determined by the features and
options you choose to use or install. Many of the scripts available to you are described in the
Oracle9i Database Reference.
See your Oracle installation guide for your operating system for the location of these scripts.
If you plan to install other Oracle products to work with this database, see the installation
instructions for those products. Some products require you to create additional data dictionary
tables. Usually, command files are provided to create and load these tables into the database's
data dictionary.
See your Oracle documentation for the specific products that you plan to install for installation
and administration instructions.
Oracle recommends you create a server parameter file as a dynamic means of maintaining
initialization parameters. The server parameter file is discussed in "Managing Initialization
Parameters Using a Server Parameter File".
The following script creates a server parameter file from the text initialization parameter file and
writes it to the default location. The instance is shut down, then restarted using the server
parameter file (in the default location).
You should make a full backup of the database to ensure that you have a complete set of files
from which to recover if a media failure occurs. For information on backing up a database, see
Oracle9i Backup and Recovery Concepts.
Protecting Your Database: Specifying Passwords for Users SYS and SYSTEM
Clauses that Simplify Database Creation and Management
Creating a Locally Managed SYSTEM Tablespace
Specifying the Database Time Zone and Time Zone File
Specifying FORCE LOGGING Mode
The clauses of the CREATE DATABASE statement used for specifying the passwords for users SYS
and SYSTEM are:
If not specified, these users are assigned the default passwords change_on_install and
manager, respectively. A record is written to the alert file indicating that the default passwords
were used. To protect your database, you should change these passwords using the ALTER USER
statement after database creation.
While these clauses are optional in this Oracle release, Oracle strongly recommends that you
specify them. The default passwords are commonly known, and if you neglect to change them
later, you leave yourself vulnerable to attack by malicious users.
See Also:
In addition to using the Database Configuration Assistant for creating your database, Oracle9i
offers you other options that can simplify the creation, operation, and management of your
database. These options, and their associated CREATE DATABASE clauses, are discussed briefly in
the following sections, and in more detail in later sections of this book:
Oracle recommends that instead of using rollback segments in your database, you use an undo
tablespace. This requires the use of a different set of initialization parameters, and optionally, the
inclusion of the UNDO TABLESPACE clause in your CREATE DATABASE statement.
You must include the following initialization parameter if you want to operate your database in
automatic undo management mode:
UNDO_MANAGEMENT=AUTO
In this mode, rollback information, referred to as undo, is stored in an undo tablespace rather
than rollback segments and is managed by Oracle. If you want to create and name a specific
tablespace for the undo tablespace, you can include the UNDO TABLESPACE clause at database
creation time. If you omit this clause, and automatic undo management is specified, Oracle
creates a default undo tablespace named SYS_UNDOTBS.
See Also:
The DEFAULT TEMPORARY TABLESPACE clause of the CREATE DATABASE statement specifies that
a temporary tablespace is to be created at database creation time. This tablespace is used as the
default temporary tablespace for users who are not otherwise assigned a temporary tablespace.
Users can be explicitly assigned a default temporary tablespace in the CREATE USER statement.
But, if no temporary tablespace is specified, they default to using the SYSTEM tablespace. It is not
good practice to store temporary data in the SYSTEM tablespace. To avoid this problem, and to
avoid the need to assign every user a default temporary tablespace at CREATE USER time, you can
use the DEFAULT TEMPORARY TABLESPACE clause of CREATE DATABASE.
If you decide later to change the default temporary tablespace, or to create an initial one after
database creation, you can do so. You do this by creating a new temporary tablespace (CREATE
TEMPORARY TABLESPACE), then assign it as the temporary tablespace using the ALTER DATABASE
DEFAULT TEMPORARY TABLESPACE statement. Users will automatically be switched (or assigned)
to the new temporary default tablespace.
The new default temporary tablespace must be an existing temporary tablespace. When using a
locally managed SYSTEM tablespace, the new default temporary tablespace must also be locally
managed.
You cannot drop a default temporary tablespace, but you can assign a new default temporary
tablespace, then drop the former one. You are not allowed to change a default temporary
tablespace to a permanent tablespace, nor can you take a default temporary tablespace offline.
Users can obtain the name of the current default temporary tablespace using the
DATABASE_PROPERTIES view. The PROPERTY_NAME column contains the value
"DEFAULT_TEMP_TABLESPACE" and the PROPERTY_VALUE column contains the default temporary
tablespace name.
See Also:
You can minimize the number of clauses and parameters that you specify in your CREATE
DATABASE statement by using the Oracle Managed Files feature.
Tablespaces
Temporary tablespaces
Control files
Online redo log files
Briefly, this is how the Oracle Managed Files feature works, using the following CREATE
DATABASE statement as an example:
No DATAFILE clause is specified, therefore Oracle creates an Oracle-managed datafile for the
SYSTEM tablespace.
No LOGFILE clauses are included, therefore Oracle creates two online redo log file groups that
are Oracle managed.
No DATAFILE subclause is specified for the UNDO TABLESPACE clause, therefore Oracle creates
an Oracle-managed datafile for the undo tablespace.
No TEMPFILE subclause is specified for the DEFAULT TEMPORARY TABLESPACE clause,
therefore Oracle creates an Oracle-managed tempfile.
Additionally, if no CONTROL_FILES initialization parameter is specified in the initialization
parameter file, Oracle creates an Oracle-managed control file.
If using a server parameter file (see "Managing Initialization Parameters Using a Server
Parameter File") the initialization parameters are set accordingly and automatically.
See Also:
When you specify the EXTENT MANAGEMENT LOCAL clause in the CREATE DATABASE statement,
you cause Oracle to create a locally managed SYSTEM tablespace wherein Oracle determines
extent sizes. The COMPATIBLE initialization parameter must be set to 9.2 or higher for this
statement to be successful. If you do not specify the EXTENT MANAGEMENT LOCAL clause, the
default is to create a dictionary-managed SYSTEM tablespace.
Locally managed tablespaces provide better performance and greater ease of management over
dictionary-managed tablespaces. A locally managed SYSTEM tablespace is created AUTOALLOCATE
by default, meaning that it is system managed with extent sizes determined and controlled by
Oracle. You may notice an increase in the initial size of objects created in a locally managed
SYSTEM tablespace because of the autoallocate policy. It is not possible to create a locally
managed SYSTEM tablespace and specify UNIFORM extent size.
When you create your database with a locally managed SYSTEM tablespace, ensure the following
conditions are met:
There must be a default temporary tablespace, and that tablespace cannot be the SYSTEM
tablespace.
You must not create rollback segments in dictionary-managed tablespaces. Attempting to create
a rollback segment in a dictionary-managed tablespace will fail if the SYSTEM tablespace is
locally managed.
To meet the first condition, you can specify the DEFAULT TEMPORARY TABLESPACE clause in the
CREATE DATABASE statement, or you cannot include the clause and allow Oracle to create the
tablespace for you using a default name and in a default location.
For fulfilling the second condition, Oracle recommends that instead of using rollback segments
to manage the database's undo records, that you use automatic undo management. You can
include the UNDO TABLESPACE clause in the CREATE DATABASE statement to create a specific
undo tablespace, or if you do not include the clause, Oracle creates a locally managed undo
tablespace for you using the default name and in a default location.
Note: