📄 ch05.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Teach Yourself Oracle 8 In 21 Days -- Ch 5 -- Managing the Oracle RDBMS</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF">
<CENTER>
<H1><IMG SRC="../buttonart/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR>
<FONT COLOR="#000077">Teach Yourself Oracle 8 In 21 Days</FONT></H1>
</CENTER>
<CENTER>
<P><A HREF="../ch04/ch04.htm"><IMG SRC="../buttonart/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch06/ch06.htm"><IMG
SRC="../buttonart/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"
BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../buttonart/contents.gif" WIDTH="128"
HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A>
<HR>
</CENTER>
<CENTER>
<H1><FONT COLOR="#000077"><B>- Day 5 -</B></FONT></H1>
</CENTER>
<CENTER>
<H1><FONT COLOR="#000077">Managing the Oracle RDBMS</FONT></H1>
</CENTER>
<P>Today you will look at the basics. Here you will see some of the objects that
must be set up by the DBA (including the Oracle DBA login account, the DBA roles,
and the Oracle SID) as well as some of the tasks that the DBA must perform, including
<UL>
<LI>Setting up Enterprise Manager
<P>
<LI>Using Enterprise Manager
<P>
<LI>Using Server Manager
<P>
<LI>Starting up and shutting down the Oracle instance
</UL>
<P>All these are basic functions that need to be covered before you move on to topics
such as creating a database. This day lays a foundation for many of the days to come.
It is important that you completely understand these concepts.</P>
<H2><FONT COLOR="#000077"><B>The Oracle DBA</B></FONT></H2>
<P>On Day 1, "Starting Out with Oracle," you were presented with a list
of the duties and responsibilities of the Oracle DBA. Let's refresh your memory with
some of the key duties and responsibilities:
<UL>
<LI>Installing and upgrading Oracle products
<P>
<LI>Installing and maintaining your company's applications
<P>
<LI>Creating databases, tablespaces, tables, views, and indexes to the specification
of the application developers
<P>
<LI>Creating user accounts and monitoring system security
<P>
<LI>Monitoring space used in the database and planning for future growth
<P>
<LI>Monitoring system performance and making changes as necessary to maintain the
required performance levels
<P>
<LI>Maintaining the integrity of the data in the database
<P>
<LI>Planning and implementing a sound backup and recovery strategy
<P>
<LI>All these duties are part of being an Oracle DBA.
</UL>
<H3><FONT COLOR="#000077"><B>The DBA Account</B></FONT></H3>
<P>To accomplish these tasks, the DBA must be given special privileges. These privileges
allow the DBA to run commands that other Oracle users are not allowed to perform.
These privileges are maintained within Oracle itself. As part of the installation
of the Oracle RDBMS, several accounts are created with these special privileges.
These accounts and their privileges are described here.</P>
<H3><FONT COLOR="#000077"><TT><B>INTERNAL</B></TT></FONT></H3>
<P>The <TT>INTERNAL</TT> account is provided mainly for backward compatibility with
earlier versions of Oracle, but is still used for key functions such as starting
up and shutting down the instance. The <TT>INTERNAL</TT> account appears as user
<TT>SYS</TT> if you look at the connected sessions, but the <TT>INTERNAL</TT> account
has additional key features: It can start up or shut down the instance. The <TT>INTERNAL</TT>
account is available even when a database has not been created and when no instances
are started up.</P>
<H3><FONT COLOR="#000077"><TT><B>SYS</B></TT></FONT></H3>
<P>The <TT>SYS</TT> account is automatically created whenever a database is created.
This account is used primarily to administer the data dictionary. This account is
granted the <TT>DBA</TT> role, as well as <TT>CONNECT</TT> and <TT>RESOURCE</TT>
roles.</P>
<H3><FONT COLOR="#000077"><TT><B>SYSTEM</B></TT></FONT></H3>
<P>The <TT>SYSTEM</TT> account is also automatically created whenever a database
is created. This account is used primarily to create tables and views important to
the operation of the RDBMS. This account has been granted the <TT>DBA</TT> role.</P>
<H3><FONT COLOR="#000077"><B>Administrative Users</B></FONT></H3>
<P>I recommend that you create individual user accounts and grant the <TT>DBA</TT>
role to those users who will be acting as the DBA. In this way, fewer people access
the same account, thus avoiding confusion. Also, if auditing is enabled, there is
a record of who made these system changes.
<BLOCKQUOTE>
<P>
<HR>
<FONT COLOR="#000077"><B>TIP:</B></FONT><B> </B>Avoid using the default administrative
accounts. If DBAs are authorized with the proper roles, they can perform the tasks
they need to do and maintain their individual accounts. This allows you to determine
which DBA or DBAs modified the system and who is currently active on it.
<HR>
</BLOCKQUOTE>
<H2><FONT COLOR="#000077"><B>The DBA Roles</B></FONT></H2>
<P>Several roles are available and are assigned to the DBAs. As you will see on Day
10, "Administering User Accounts," these roles are sets of privileges assigned
to a particular Oracle role. Each role can then be assigned to a user, thus giving
that user all the privileges needed for that particular task. The use of roles is
covered in detail on Day 10, but it is appropriate to go over the roles and privileges
assigned to the Oracle DBA here.</P>
<H3><FONT COLOR="#000077"><TT><B>DBA</B></TT></FONT></H3>
<P>The <TT>DBA</TT> role consists of most of the other Oracle roles and privileges.
By assigning the DBA role to a user, there is virtually no task that user cannot
do. This role should be assigned to trusted users who are active DBAs for this system.</P>
<H3><FONT COLOR="#000077"><TT><B>OSOPER</B></TT></FONT></H3>
<P>The <TT>OSOPER</TT> role is one of two special operating system roles. These roles
are assigned to special accounts that need OS authentication. It is necessary to
have OS authentication for some accounts because Oracle authentication can be done
only when the database is open. If the database is shut down, Oracle cannot validate
the user permissions.</P>
<P>The <TT>OSOPER</TT> role allows the user to perform the following operations:
<UL>
<LI><TT>STARTUP</TT> and <TT>SHUTDOWN</TT>
<P>
<LI><TT>ALTER DATABASE MOUNT</TT>
<P>
<LI><TT>ALTER DATABASE OPEN</TT>
<P>
<LI><TT>ALTER DATABASE BACKUP</TT>
<P>
<LI><TT>ALTER DATABASE RECOVER</TT>
<P>
<LI><TT>ALTER DATABASE ARCHIVE LO</TT>
</UL>
<P>After the database is up and running, other users can be authenticated through
Oracle security. These operations require a special authentication method because
the database is not available.</P>
<H3><FONT COLOR="#000077"><TT><B>OSDBA</B></TT></FONT></H3>
<P>The <TT>OSDBA</TT> role includes the permissions granted to the <TT>OSOPER</TT>
role with some additional permissions. These additional permissions include the <TT>CREATE
DATABASE</TT> command and all system privileges with the <TT>ADMIN OPTION</TT>. The
<TT>ADMIN OPTION</TT> allows the user to grant these permissions to other roles or
users. Without the <TT>ADMIN OPTION</TT>, you cannot propagate these permissions
and roles.</P>
<H3><FONT COLOR="#000077"><B>Administrator Authentication</B></FONT></H3>
<P>Authenticating the user can be done either through OS authentication using OS
accounts and groups or through the use of Oracle password files. Which of these is
right for your installation is up to you. These methods are covered in detail on
Day 10; until then, all examples are done using Oracle password files.</P>
<H2><FONT COLOR="#000077"><B>The SID</B></FONT></H2>
<P>As you learned on Day 2, "Exploring the Oracle Architecture," an Oracle
instance is an Oracle database, the Oracle processes or threads, and the memory it
uses. The instance is the logical term that refers to the components necessary to
access the data in the database.</P>
<P>Each Oracle instance is identified by a SID (system identifier), which uniquely
identifies this instance and is used by the Oracle utilities and networking components
to connect you to the correct instance.</P>
<P>A SID is up to four alphanumeric characters in length and is required in order
to connect to an Oracle instance. The SID is set by the <TT>ORACLE_SID</TT> environment
variable. From the NT command line, you can set the SID with the following syntax:</P>
<PRE><FONT COLOR="#0066FF">Set ORACLE_SID=ORCL
</FONT></PRE>
<P>The default SID value is set in the NT Registry. If you do not set the SID using
the environment variable, the Registry entry is used. The <TT>TNSNAMES.ORA</TT> file
also resolves the SID with a service name. As you will see tomorrow, when you create
a network entry using a utility such as the Oracle Network Configuration wizard,
you will be prompted for a service name that you pick, a network type and address,
and an Oracle SID. This service name is used to resolve both the network and the
SID. Even the Oracle service name includes the SID as an identifier.</P>
<P>You will be seeing more of the use of the Oracle SID in the next few days; for
now, it is enough to think of the <TT>SID</TT> as a unique identifier and a way to
connect to an Oracle instance.</P>
<H2><FONT COLOR="#000077"><B>The Oracle Enterprise Manager</B></FONT></H2>
<P>The Oracle Enterprise Manager is a new tool from Oracle that allows the DBA to
graphically administer one or more Oracle instances. By allowing many operations
to be performed graphically, the presentation of data can be simplified and more
meaningful.</P>
<P>Enterprise Manager allows the administrator to manage one or more Oracle instances
either locally or via the network. Enterprise Manager consists of two main components:
the graphical console and the intelligent agents.</P>
<P>The Enterprise Manager console is the graphical tool that allows you to graphically
administer the Oracle instances. This console communicates to the various systems
it administers via the intelligent agents that run on these systems. These intelligent
agents allow the console to communicate with the instances. The agents use the SNMP
(Simple Network Management Protocol) to take requests from the console and communicate
those requests to the Oracle system running on these systems.</P>
<P>Enterprise Manager allows the DBA to perform the following tasks from a central
location:
<UL>
<LI>Tune and administer one or more Oracle databases.
<P>
<LI>Distribute software to both clients and servers.
<P>
<LI>Monitor events from multiple instances.
<P>
<LI>Perform backup and recovery operations from a single location.
<P>
<LI>Perform standard DBA tasks such as user administration.
</UL>
<P>The Oracle Enterprise Manager is a very powerful and flexible tool that can help
in many of your daily DBA duties.
<BLOCKQUOTE>
<P>
<HR>
<FONT COLOR="#000077"><B>NOTE:</B></FONT><B> </B>In many cases I prefer to graphically
administer the Oracle system, but in some cases, I still prefer the character-based
commands that can be run via the Oracle Server Manager. Throughout this book, both
the graphical and character-based administrative methods are shown. I will point
out where I feel one tool is more appropriate than another and why, but it is your
preference that is important. You will have to decide which tool or set of tools
is right for you.
<HR>
</BLOCKQUOTE>
<P>In this section, you will learn how to configure Enterprise Manager and how to
invoke its major functions. The individual tools that comprise Enterprise Manager,
such as the Instance Manager, the Storage Manager, the Schema Manager, and so on,
are presented separately in the lesson where most appropriate.</P>
<H3><FONT COLOR="#000077"><B>Configuring Enterprise Manager</B></FONT></H3>
<P>The Oracle Enterprise Manager is installed as part of the Oracle server installation
process or can be installed as part of the administrator client installation. After
Enterprise Manager is installed, you can connect to it by using the NT toolbar and
selecting Enterprise Manager from Enterprise Manager program group.</P>
<P>If this is the first time you've invoked Enterprise Manager, you will probably
see a screen indicating that the repositories for Enterprise Manager and Software
Manager are not installed (see Figure 5.1).</P>
<P><A NAME="01"></A><A HREF="01.htm"><B>Figure 5.1.</B></A></P>
<P><I>Enterprise Manager and Software Manager repositories are not installed.</I></P>
<P>In this case, click OK and allow Enterprise Manager to create the repositories.
This operation will take some time. During this period you will see indications that
the repositories are being created, as shown in Figure 5.2.</P>
<P><A NAME="02"></A><A HREF="02.htm"><B>Figure 5.2.</B></A></P>
<P><I>The Oracle Repository Manager screen.</I></P>
<P>When the creation operation is complete, Enterprise Manager will start; you will
see the four default panes shown in Figure 5.3.</P>
<P><A NAME="03"></A><A HREF="03.htm"><B>Figure 5.3.</B></A></P>
<P><I>The Enterprise Manager.</I></P>
<P>The four panes displayed are
<UL>
<LI>The Navigator pane--This pane provides a tree-type listing of the various objects
available to Enterprise Manager. Through this list, you can launch various administrative
operations (described later today).
<P>
<LI>The Map pane--Though blank at startup, the Map pane allows you to create a geographical
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -