⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch05.htm

📁 Teach yourself Oracle8 in 21 day
💻 HTM
📖 第 1 页 / 共 5 页
字号:
	a new service or to modify, delete, or test an existing configuration. If you are
	adding a new service, type the service name and click Next (see Figure 5.26).
</DL>

<P><A NAME="26"></A><A HREF="26.htm"><B>Figure 5.26.</B></A></P>
<P><I>Choose to modify, delete, or test a configuration.</I></P>

<DL>
	<DD><B>2. </B>You will be prompted for the network protocol for this service, as
	shown in Figure 5.27. Highlight the protocol that you want and click Next.
	<P><B>3.</B> The next screen, shown in Figure 5.28, prompts you for the hostname
	(if you chose TCP/IP protocol). Enter the hostname of the system. You can change
	the port number if you want, but that is not recommended.</P>
	<P><B>4. </B>The next screen, shown in Figure 5.29, prompts you for the SID of the
	instance being configured. If the instance name is correct, click Next.
</DL>

<P><A NAME="27"></A><A HREF="27.htm"><B>Figure 5.27.</B></A></P>
<P><I>The Oracle Service Name wizard allows you to choose a network protocol to use
for this service.</I></P>
<P><A NAME="28"></A><A HREF="28.htm"><B>Figure 5.28.</B></A></P>
<P><I>The Oracle Service Name wizard allows you to change the hostname and port number.</I></P>
<P><A NAME="29\"></A><A HREF="29.htm"><B>Figure 5.29.</B></A></P>
<P><I>The Oracle Service Name wizard allows you to specify the SID.</I></P>

<DL>
	<DD><B>5. </B>In the screen shown in Figure 5.30, you can test the newly created
	service. Although you can skip this step, I don't recommend it. Just click the Test
	Service button.
</DL>

<P><A NAME="30"></A><A HREF="30.htm"><B>Figure 5.30.</B></A></P>
<P><I>The Oracle Service Name wizard lets you decide whether you want to test the
connection.</I></P>

<DL>
	<DD><B>6. </B>Test the connection in the Connection Test screen. If the test is successful,
	you will be duly informed (see Figure 5.31).
</DL>

<P><A NAME="31"></A><A HREF="31.htm"><B>Figure 5.31.</B></A></P>
<P><I>The Connection Test screen allows you to test the connection before saving
it.</I></P>

<DL>
	<DD><B>7.</B> After you finish testing the service, return to the previous screen
	and click Next to see the final screen of the wizard (see Figure 5.32). If everything
	was successful, click the Finish button to save the configuration.
</DL>

<P><A NAME="32"></A><A HREF="32.htm"><B>Figure 5.32.</B></A></P>
<P><I>Finishing with the Oracle Service Name wizard.</I></P>
<P>After you click Finish, the application will exit. Your new network configuration
is ready to use. You can also manage the network through the Oracle Net8 Assistant.</P>
<H2><FONT COLOR="#000077"><B>Modifying the State of the System</B></FONT></H2>
<P>During the normal operation of the RDBMS, it is often necessary to modify the
state of the instance. These operations actually modify the state of the instance
or cause events to occur in the Oracle instance.</P>
<P>Modifying the instance can be done only using the <TT>ALTER SYSTEM</TT> command.
There is currently no way to run these commands via a graphical utility.</P>
<H3><FONT COLOR="#000077"><B>Modifying the System using the <TT>ALTER SYSTEM Command</TT></B></FONT></H3>
<P>Using the <TT>ALTER SYSTEM</TT> command, you can alter the state of the system
or cause some event to occur in the Oracle instance.</P>
<H4><FONT COLOR="#000077"><B>The Syntax for <TT>ALTER SYSTEM</TT></B></FONT></H4>
<P>The <TT>ALTER SYSTEM</TT> command is run with the following syntax:</P>
<P><B>SYNTAX:</B></P>
<PRE><FONT COLOR="#0066FF">ALTER SYSTEM
[ENABLE RESTRICTED SESSION]
[DISABLE RESTRICTED SESSION]
[FLUSH SHARED_POOL]
[CHECPOINT [GLOBAL or LOCAL]]
[CHECK DATAFILES [GLOBAL or LOCAL]]
[SWITCH LOGFILE]
[ENABLE DISTRIBUTED RECOVERY]
[DISABLE DISTRIBUTED RECOVERY]
[ARCHIVE LOG archive_log_clause]
[KILL SESSION `SID, serial_no']
[SET ??]
</FONT></PRE>
<P>where the options that can be used by the set parameter are</P>
<PRE><FONT COLOR="#0066FF">SET
[RESOURCE_LIMIT = TRUE or FALSE]
[GLOBAL_NAMES = TRUE or FALSE]
[SCAN_INSTANCES = number]
[CACHE_INSTANCES = number]
[MTS_SERVERS = number]
[MTS_DISPATCHERS = `protocol' , `number']
[LICENSE_MAX_SESSIONS = number]
[LICENSE_SESSIONS_WARNING = number]
[LICENSE_MAX_USERS = number]
[REMOTE_DEPENDENCIES_MODE = TIMESTAMP]
or  [REMOTE_DEPENDENCIES_MODE = SIGNATURE]
</FONT></PRE>
<P>The parameters used to alter the system are defined as follows:

<UL>
	<LI><TT>ENABLE RESTRICTED SESSION</TT> --Sets the mode of the instance so that only
	users with the <TT>RESTRICTED SESSION</TT> permission can log on.
	<P>
	<LI><TT>DISABLE RESTRICTED SESSION</TT> --Disables the restricted session, allowing
	all users to log on.
</UL>



<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>TIP:</B></FONT><B> </B>This can be very useful for temporarily
	restricting new users from logging onto the system if you think there might be some
	sort of problem or a load issue. By restricting the sessions, you are not causing
	problems to current users; you are simply preventing new users from logging on. You
	can reverse this without shutting down the instance. 
<HR>


</BLOCKQUOTE>


<UL>
	<LI><TT>FLUSH SHARED_POOL</TT> --Clears all data from the shared pool.
	<P>
	<LI><TT>CHECKPOINT [GLOBA</TT> or <TT>LOCAL]</TT>--Initiates a checkpoint. In a parallel-server
	environment, <TT>CHECKPOINT LOCAL</TT> checks only its own log group, whereas <TT>CHECKPOINT
	GLOBAL</TT> checks all log groups.
</UL>



<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>TIP:</B></FONT><B> </B>If you anticipate that the system
	might need to be shut down or you feel you might be in danger of losing power, you
	can checkpoint the system, thus shortening any recovery time you might need in the
	event of a failure. 
<HR>


</BLOCKQUOTE>


<UL>
	<LI><TT>CHECK DATAFILES</TT>--Verifies that your instance can access all online datafiles.
	In the parallel-server environment, the <TT>GLOBAL</TT> qualifier additionally verifies
	that all instances can access all online datafiles. The <TT>LOCAL</TT> qualifier
	specifies only your instance.
	<P>
	<LI><TT>SWITCH LOGFILE</TT>--Initiates a log switch; a log switch automatically triggers
	a checkpoint.
	<P>
	<LI><TT>ENABLE DISTRIBUTED RECOVERY</TT> --Enables distributed recovery in a single-process
	environment.
	<P>
	<LI><TT>DISABLE DISTRIBUTED RECOVERY</TT> --Disables distributed recovery.
	<P>
	<LI><TT>ARCHIVE LOG</TT>archive_log_clause--The <TT>ARCHIVE LOG</TT> clause is described
	in detail in Days 16, &quot;Understanding Effective Backup Techniques,&quot; and
	17, &quot;Recovering the Database,&quot; which cover backup and recovery.
	<P>
	<LI><TT>KILL SESSION </TT>SID<TT>, </TT>serial_no<TT>'</TT>--Kills a session. Values
	of both SID and serial_no must be provided. These are obtained from the <TT>V$SESSION</TT>
	view.
</UL>



<BLOCKQUOTE>
	<P>
<HR>
<FONT COLOR="#000077"><B>TIP:</B></FONT><B> </B>This can be useful for stuck or nonresponding
	sessions. This can also be done through the Instance Manager. 
<HR>


</BLOCKQUOTE>


<UL>
	<LI><TT>SET </TT>??--The <TT>SET</TT> parameter is used to set a number of Oracle
	parameter values. These values as shown in the <TT>ALTER SYSTEM</TT> syntax are described
	in detail in the Oracle documentation.
</UL>

<H2><FONT COLOR="#000077"><B>Summary</B></FONT></H2>
<P>This lesson covers quite a bit of material that introduces the Oracle administrative
duties and tools. The day begins by looking at the various duties of the DBA. It
later presents the various default accounts used by the DBA to connect to the Oracle
instance and how they are used.</P>
<P>A major part of this chapter looks at the tools of the trade. I am really happy
with the work Oracle has done to create Enterprise Manager and the applications that
go with it. Along with Enterprise Manager are tools such as Instance Manager, Storage
Manager, Schema Manager, Security Manager, and Backup Manager. You will see these
in more detail later on in this book.</P>
<P>You saw how to invoke Enterprise Manager and how to configure the different panes,
as well as how to use the Discover New Services wizard to determine the services
available for administration by Enterprise Manager.</P>
<P>For those of you running on the Windows NT platform, this chapter demonstrates
how to create the Oracle bootstrap instance. Because Oracle is a service under NT,
it needs this bootstrap instance to allow you to connect, and to start up and shut
down the Oracle instance.</P>
<P>You also learned how to use the various network tools to configure the <TT>TOPOLOGY.ORA</TT>
and <TT>TNSNAMES.ORA</TT> files, as well as how to configure the <TT>LISTENER.ORA</TT>
file. These are the key components to the Oracle networking system.</P>
<P>Finally, you learned how to alter the instance. This is not typically done, but
is occasionally necessary to initiate a checkpoint by hand or to manually archive
a redo log file. In any case, it is good to know how to perform these operations
when necessary.</P>
<H2><FONT COLOR="#000077"><B>What's Next?</B></FONT></H2>
<P>Tomorrow you will learn how to create an Oracle database. This is the first of
two days that take you through the process of creating redo log files, control files,
and datafiles, and building the initial database. In the second of these days, you
will learn how to build on that initial starter database and add your own tablespaces
and datafiles. After you finish Days 6 and 7, &quot;Administering Tablespaces,&quot;
you will be able to create your own database.</P>
<H2><FONT COLOR="#000077"><B>Q&amp;A</B></FONT></H2>

<DL>
	<DD><B>Q What is the primary duty of the DBA?</B>
	<P><B>A</B> The primary duty of the DBA is to protect the database and provide continuous
	(if required) access to that data for the user community.</P>
	<P><B>Q Should all DBAs use the </B>SYS<B> account?</B></P>
	<P><B>A</B> A lot of installations have their DBAs use the <TT>SYS</TT> account,
	but I think it is better to provide all the DBAs with accounts that have the proper
	level of permissions. User permissions are discussed on Day 10.</P>
	<P><B>Q Is it better to use the graphical tools or Server Manager?</B></P>
	<P><B>A</B> Both tools have their place. The Enterprise Manger tools are absolutely
	great. I really like using them, but there are times when I just can't get the job
	done without using Server Manager.</P>
	<P><B>Q Why does an instance need to be created before the database can be created?</B></P>
	<P><B>A</B> This is unique to Windows NT. The Windows NT system uses services to
	run the Oracle instance. The bootstrap instance must be created so Instance Manager
	or Server Manager can connect to it to start up the full instance.
</DL>

<H2><FONT COLOR="#000077"><B>Workshop</B></FONT></H2>
<P>The workshop provides quiz questions to help you solidify your understanding of
the material covered and exercises to provide you with experience in using what you've
learned. Find the answers to quiz questions in Appendix A, &quot;Answers.&quot;</P>
<H3><FONT COLOR="#000077"><B>Quiz</B></FONT></H3>

<DL>
	<DD><B>1. </B>What two accounts are created by default when a database is created?
	<P><B>2.</B> What are some duties of the DBA?</P>
	<P><B>3.</B> How can you protect the system against data loss?</P>
	<P><B>4. </B>What two OS roles are created by default when a database is created?</P>
	<P><B>5. </B>What is the bootstrap instance?</P>
	<P><B>6. </B>What is the <TT>TNSNAMES.ORA</TT> file for?</P>
	<P><B>7.</B> How do you administer the <TT>TNSNAMES.ORA</TT> file?</P>
	<P><B>8. </B>What tool is used to modify the state of the system (that is, cause
	a checkpoint to occur, and so on)?
</DL>

<H3><FONT COLOR="#000077"><B>Exercises</B></FONT></H3>

<DL>
	<DD><B>1. </B>Create a new Oracle instance using the NT Instance Manager.
	<P><B>2.</B> Create a new Oracle instance using the <TT>ORADIM80</TT> command.</P>
	<P><B>3. </B>Add this instance to the <TT>TNSNAMES.ORA</TT> file using the Oracle
	Network Configuration wizard.</P>
	<P><B>4. </B>Add this insta

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -