\documentclass[letterpaper]{article}
\nonstopmode
\bkai
\usepackage{linuxdoc-sgml}
\usepackage{qwertz}
\usepackage{url}
\usepackage[latin1]{inputenc}
\usepackage{t1enc}
\usepackage[english]{babel}
\usepackage{epsfig}
\usepackage{null}
\def\addbibtoc{
\addcontentsline{toc}{section}{\numberline{\mbox{}}\relax\bibname}
}%end-preamble
\setcounter{page}{1}
\title{Oracle Database HOWTO}
\author{×÷Õß£ºPaul Haigh, {\ttfamily paul@nailed.demon.co.uk} \\ 
ÒëÕß£ºÔø´ï¿µ, {\ttfamily a9504480@graduate.hku.hk}}
\date{1.2 °æ, Ò»¾Å¾Å°ËÄê°ËÔÂËÄÈÕ£¨·­ÒëÈÕÆÚ¡ÃÒ»¾Å¾Å°ËÄê°ËÔÂÈýÊ®Ò»ÈÕ£©}
\abstract{ÔÚ Linux ÏµÍ³ÖÐ°²×°¼°Éè¶¨ Oracle ×ÊÁÏ¿âËÅ·þÆ÷Ö®Ö¸ÄÏ¡£}


\begin{document}
\maketitle
\tableofcontents

\section{µ¼ÑÔ}


\subsection{°æ±¾ÀúÊ·}

\begin{itemize}
\item {\ttfamily 0.1 °æ - Ò»¾Å¾Å°ËÄê¶þÔÂØ¥Ò»ÈÕ - Paul Haigh - ×îÏÈµÄ°æ±¾¡£}
\item {\ttfamily 0.2 °æ - Ò»¾Å¾Å°ËÄêÈýÔÂÒ»ÈÕ - Paul Haigh - ¼ÓÉÏÁËÐ£¶ÔÕßµÄÆÀÂÛ¡£}
\item {\ttfamily 1.0 °æ - Ò»¾Å¾Å°ËÄêÈýÔÂÊ®ÈÕ - Paul Haigh - ÔÚ LDP ³ö°æ¡£}
\item {\ttfamily 1.1 °æ - Ò»¾Å¾Å°ËÄêÁùÔÂ¶þÊ®ÈÕ - Paul Haigh - ÖØÐÂÕûÀí¼°¼ÓÉÏÒÉÄÑÅÅ½â¡£}
\item {\ttfamily 1.2 °æ - Ò»¾Å¾Å°ËÄê°ËÔÂËÄÈÕ - Paul Haigh - ¼ÓÉÏ Oracle Corporation µÄÐÂÎÅ¼°É¾È¥Î´À´¸Ä½øÒ»½Ú¡£}
\end{itemize}



\subsection{Copyright}

The Oracle Database HOWTO copyright (c) 1998, Paul Haigh.

Like all Linux HOWTO documents, this may be reproduced and distributed in whole or in part, in any medium, physical or electronic, so long as this copyright notice is retained on all copies.

Commercial redistribution is allowed and encouraged; however the author would like to be notified of such distributions. You may translate this HOWTO into any language whatsoever provided that you leave this copyright statement and disclaimer intact, and that you append a notice stating who translated the document.


\subsection{Disclaimer}

While I have tried to include the most correct and up to date information available to me, I cannot guarantee that usage of information in this document does not result in loss of data or equipment. I provide NO WARRANTY about the information in the HOWTO and I cannot be made liable for any consequences resulting from using the information in this HOWTO.


\subsection{±¾ HOWTO µÄÄ¿µÄ}

ÔÚÕâ HOWTO ÖÐÎÒ»á³¢ÊÔËµÃ÷ÈçºÎ°²×°¼°¹ÜÀíÒ»¸öÔÚ Linux ÉÏÖ´ÐÐµÄ Oracle ×ÊÁÏ¿â£¬ÎÒ»áÌØ±ðËµÃ÷ Oracle ËÅ·þÆ÷µÄ°²×°£¬SQL*Net µÄÉè¶¨¼°ÓÃ»§ (client) µÄÉè¶¨¡£



ÕâÎÄ¼þ²¢²»ÊÇÒ»·ÝÓÐ¹ØÊ¹ÓÃ¼°¹ÜÀíÒ»¸ö Oracle ×ÊÁÏ¿âµÄÈëÖ¸Òý¡£Èç¹ûÄãÏëÒªÕâÀà×ÊÁÏ£¬O'Reilly ¼°ÆäËû³ö°æÉÌ¶¼ÓÐÍÆ³öÕâ·½ÃæµÄ¼Ñ×÷¡£



ÎÒÒ²²»»áËµÃ÷ÔÚ Unix ÉÏ Oracle ³ÌÊ½µÄ¿ª·¢¹ý³Ì¡£Èç¹ûÄã¶ÔÕâÓÐ¾ø¶ÔÐèÒª£¬ÎÒ½¨ÒéÄã´Ó SCO ´¦¹ºÂò SCO development system (°üÀ¨ OpenServer 5.x)¡£¾ÝÎÒËùÖª£¬Õâ¿ÉÒÔÊ®·ÖºÏÀíµÄÊ®¾Å¿éÃÀÔª´Ó {\ttfamily www.sco.com} µÃµ½¡£


\subsection{ÏµÍ³ÒªÇó}

Òª¸ú´ÓÕâÆª HOWTO µÄÄÚÈÝ£¬ÄãÐèÒªÒÔÏÂ¶«Î÷¡£
\begin{itemize}
\item {\bfseries Oracle Server CD ÖÐµÄ SCO Openserver (7.3.3.0.0 °æ)}
\begin{description}
Õâ{\bfseries ±ØÐë}ÊÇºÏ·¨µÄ°æ±¾¡£¼ÇÖø Oracle ÊÇÒ»¼äÄ²ÀûµÄ¹«Ë¾£¬Ëý»á¶ÔÆä²úÆ·ÊÕ·Ñ¡£Èç¹ûÄãÏëÒªÃâ·Ñ¶øÓÖÖ§Ô® SQL µÄ×ÊÁÏ¿â£¬ÇëÓÃ PostgresSQL »òÆäËûÀàÒÔ³ÌÊ½¡£

ÄãÒ²¿É´Ó Oracle ÍøÒ³ÖÐÏÂÔØÒ»¸ö {\ttfamily tar} µµ°¸£¬´ÓÖÐµÃµ½Ò»¸öÁùÊ®ÌìµÄÊÔÓÃÐí¿ÉÖ¤ (license) ¼°°²×° Oracle ¡£ÎÒ²¢Ã»ÓÐÇ××ÔÊÔ¹ýËü£¬ËüÊÇÎ´¾­È·ÈÏµÄ¡£



\end{description}

\item {\bfseries Ò»Ì¨ Linux ËÅ·þÆ÷}

\begin{description}
Èç¹ûÃ»ÓÐµÄ»°£¬Äã¾Í²»»áÔÄ¶ÁÕâÎÄ¼þÁË£¬ÊÇÂð£¿



\end{description}

\item {\bfseries 2.0.30+ µÄºËÐÄ}

\begin{description}
ÎÒ²»±£Ö¤ÕâÐ©Ö¸Ê¾¶ÔÈÎºÎÆäËûºËÐÄÀ´Ëµ×¼È·¡££¨ÎÒ¶Ô 2.0.30 Ò²²»×÷³ö±£Ö¤¡­¡­£©



\end{description}

\item {\bfseries iBCS}

\begin{description}
°²×°¼°Ê¹ÓÃÄãËùÓÃµÄÆ½Ì¨µÄ×îÐÂ°æ±¾·Ç³£ÖØÒª¡££¨ÎÒÕýÔÚÊ¹ÓÃ Redhat Linux µÄ iBCS-2.0-10.i386.rpm¡££©



\end{description}

\item {\bfseries ´óÁ¿´Åµú¿Õ¼ä}

\begin{description}
600 Mb ÒÔÉÏÊÇ¸öºÏÀíµÄÊý×Ö¡£Ê¹ÓÃ¸üÉÙµÄ¿Õ¼äÒ²¿ÉÒÔ£¬µ«ÄãÐèÒª×÷³öÒ»Ð©ÎþÉü£¬ÎÒ´Ó²»ÕâÑù¿ªÊ¼¡£²»¹ý£¬ÎÒ»á³¢ÊÔÖ¸³öÔÚÄÄÀï¿ÉÌÚ³ö¿Õ¼ä¡£



\end{description}

\item {\bfseries 32Mb ÒÔÉÏ¼ÇÒäÌå}

\begin{description}
ÎÒÖªµÀÕâÌýÆðÀ´ºÜ¶à£¬ÌØ±ðÊÇÒÔ Linux À´Ëµ, µ«Çë¼ÇÖø Oracle ÊÇ¸ö¸´ÔÓµÄÈí¼þ¡£ÔÚ SCO£¬Äã²»»á¾õµÃÓÐÎÊÌâ£¡



ÎÒ²»ÊÇËµ Oracle ²»ÄÜÔÚ½ÏÉÙ¼ÇÒäÌåµÄÇéÐÎÏÂ¹¤×÷£¬²»¹ýÕâÑù»áÉÙ¹ý Oracle µÄ½¨Òé£¬ÎÒÒ²²»ÔÞ³ÉÕâÑù×ö¡£



\end{description}

\item {\bfseries Oracle µÄÐí¿ÉÖ¤ (License)}

\begin{description}
ÎÒÖªµÀÎÒÒÑÌá³ö¹ý£¬µ«ÎÒÏë´ó¼ÒÖªµÀÕâÊÇÖØÒªµÄ¡£Ã»ÓÐÐí¿ÉÖ¤¶øÊ¹ÓÃ Oracle µÄÈí¼þÊÇÎ¥·¨µÄ¡£



\end{description}

\end{itemize}







\subsection{Oracle Corporation µÄÐÂÏûÏ¢}

Oracle Çü·þì¶À´×Ô Linux ÉçÈºµÄÑ¹Á¦¡£Oracle Corporation ÒÑ¾­¾ö¶¨ÏòÔÚ Linux Æ½Ì¨µÄ Oracle 8 Ìá¹©{\bfseries ¹Ù·½}Ö§Ô®¡£¾Ý Oracle ÍøÖ·Ëµ£¬Õâ½«»áÔÚÒ»¾Å¾Å°ËÄêÊ®¶þÔÂÍÆ³ö¡£



¸üºÃµÄÏûÏ¢ÊÇ Oracle »á°Ñ {\ttfamily Oracle Ó¦ÓÃÈí¼þ}ÒÆÖ²µ½ Linux Æ½Ì¨¡£¸ù¾Ý Oracle µÄÍøÒ³£¬ÕâÓ¦¸Ã»áÔÚÒ»¾Å¾Å¾ÅÄêÉÏ°ëÄêÍÆ³ö¡£

²Î¿¼×ÊÁÏ£º
\begin{itemize}
\item {\ttfamily \onlynameurl{http://www.oracle.com/html/linux.html}}
\item {\ttfamily \onlynameurl{http://www.news.com/News/Item/0,4,24436,00.html}}
\item {\ttfamily \onlynameurl{http://www.zdnet.com/pcweek/news/0720/20morac.html}}
\end{itemize}





\section{°²×° Oracle Èí¼þ}


\subsection{ËÅ·þÆ÷µÄ×¼±¸¹¤·ò}


\subsubsection{½¨Á¢ Oracle ÓÃ»§}

Èç´ó¼ÒËùÁÏ£¬ÎÒÃÇÐèÒªÒ»¸öÓÃ»§À´±£´æ Oracle µÄ×ÊÁÏ¿â¡£ÒòÎªÎÒÃÇ²»ÏëÖØÐÂÁ´½á Oracle ºËÐÄ£¨ÈÝááÔÙÌ¸£©£¬ÎÒÃÇÒª½ÓÊÜ Oracle ÄÚ¶¨µÄÊ¹ÓÃÕß¼°Èº×éÃû³Æ£¬¼´Ê¹ÓÃÕßÎª ORACLE£¬¶øÈº×éÎª DBA¡£

\begin{enumerate}
\item ÒÔ root µÄÉí·ÖÇ©Èë


\item ½¨Á¢Ê¹ÓÃÕß oracle ¼°Èº×é dba¡£
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ groupadd dba 
$ useradd  oracle
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}
\item È·±£Ê¹ÓÃÕß oracle ÓÐ³õÊ¼Ä¿Â¼ (home directory)
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ mkdir /home/oracle
$ mkdir /home/oracle/7.3.3.0.0 (Oracle µÄ°æ±¾)
$ chown -R oracle.dba /home/oracle
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}
\end{enumerate}





\subsection{´Ó¹âµú°²×°}

²»ÐÒµØ£¬SCO ¹âµúµÄ Oracle °²×°³ÌÊ½²»ÄÜÔË×÷¡£Ê¹ÓÃÕß»áÓöµ½Ò»Á¬´®²»Í¬µÄÎÊÌâ£¬´Ó core dump µ½µ±»ú¡£ËùÒÔÎÒÃÇÒª×Ô¼º´Ó¹âµú°Ñµµ°¸³­µ½Ó²µú¼°½âÑ¹£º

£¨È·±£¹âµúÒÑ¹Ò (mount) µ½ÏµÍ³ÉÏ£©¡£
\begin{enumerate}
\item ÒÔ Oracle µÄÉí·ÝÇ©Èë
\item µ½ {\ttfamily /home/oracle/7.3.3.0.0} Ä¿Â¼¡£
\item ´Ó¹âµú³­³ö°ÑËùÓÐ°²×°µµ°¸
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ cp -a /mnt/cdrom/* .
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}
\item ½âÑ¹¹âµúÉÏµÄËùÓÐ Oracle µµ°¸¡£
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ find . -name *_ -exec ~/7.3.3.0.0/orainst/oiuncomp {} \;
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}
\end{enumerate}





\subsection{°²×°ááµÄ¹¤×÷}


\subsubsection{Root µÄ¹¤×÷}

°ÑÒÔÏÂÊýÐÐ¼Óµ½ {\ttfamily /etc/profile} »ò¼Óµ½Ã¿Ò»¸ö»áÊ¹ÓÃ Oracle µÄÓÃ¼ÒµÄ {\ttfamily .profile} ÖÐ¡£
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# Oracle ×¨ÓÃ
ORACLE_HOME=/home/oracle/7.3.3.0.0
ORACLE_SID=orcl
ORACLE_TERM=vt100
export ORACLE_HOME ORACLE_SID ORACLE_TERM

# Îª Oracle ÐÞ¸ÄÂ·¾¶
PATH="$PATH:$ORACLE_HOME/bin"
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}




ÎÒÃÇÒ²ÐèÒªÐÞ¸Ä Oracle ulimit ÌáÉý¹¤¾ßµÄÓµÓÐÈË¼°Ðí¿É (permissions)¡£
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ chown root.root $ORACLE_HOME/bin/osh
$ chmod u+s $ORACLE_HOME/bin/osh
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}





\subsubsection{Oracle µÄ¹¤¼þ}

ÐÞ¸Ä Oracle µµ°¸µÄÐí¿ÉÀ´È·±£²Ù×÷ÕýÈ·¡£
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ chmod +x $ORACLE_HOME/bin/*
$ chmod u+s $ORACLE_HOME/bin/oracle
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}




Oracle µÄ¹¤¾ßÒªÇó°ÑÑ¶Ï¢·ÅÔÚ {\ttfamily \$ORACLE\_HOME/tool\_name/mesg} Ä¿Â¼¡£ËùÒÔÎÒÃÇÒª°Ñ¼° {\ttfamily msg\_ship} Ä¿Â¼ÏÂµÄ{\ttfamily msg} µµ°¸ÒÆµ½ {\ttfamily mesg} Ä¿Â¼ÏÂ¡£
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ mv $ORACLE_HOME/plsql/mesg/mesg_ship/* $ORACLE_HOME/plsql/mesg/.
$ mv $ORACLE_HOME/rdbms/mesg/mesg_ship/* $ORACLE_HOME/rdbms/mesg/.
$ mv $ORACLE_HOME/svrmgr/mesg/mesg_ship/* $ORACLE_HOME/svrmgr/mesg/.
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}

Èç¹ûÃ»ÓÐÒÔÏÂÄ¿Â¼£¬Òª½¨Á¢ËüÃÇ£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ mkdir $ORACLE_HOME/rdbms/log
$ mkdir $ORACLE_HOME/rdbms/audit
$ mkdir $ORACLE_HOME/network/log
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}



\subsubsection{¿ÉÒÆ³ýµÄ¶«Î÷}

ÒÔÏÂÄ¿Â¼¿ÉÒÔ°²È«µØÒÆ³ý£º
\begin{itemize}
\item {\ttfamily \$ORACLE\_HOME/guicommon2/}
\item {\ttfamily \$ORACLE\_HOME/ctx/}
\item {\ttfamily \$ORACLE\_HOME/md/}
\item {\ttfamily \$ORACLE\_HOME/mlx/}
\item {\ttfamily \$ORACLE\_HOME/precomp/}
\item {\ttfamily \$ORACLE\_HOME/slax/}
\end{itemize}



\section{½¨Á¢Ò»¸ö×ÊÁÏ¿â}

Oracle ËÅ·þÆ÷ÏÖÒÑ°²×°ÁË£¬ÎÒÃÇÐèÒª½¨Á¢Ò»¸ö×ÊÁÏ¿âÀ´²âÊÔËü¡£

{\ttfamily Èç¹ûÄãÊ¹ÓÃ Oracle 7.2.x »òÖ®Ç°°æ±¾£¬ÇëÔÄ¶ÁÏÂÃæµÄÒÉÄÑÅÅ½â²¿·Ö¡£}


\subsection{½¨Á¢³õÊ¼µµ (Initialisation File)}

°Ñ {\ttfamily \$ORACLE\_HOME/dbs/init.ora} ³­µ½ {\ttfamily \$ORACLE\_HOME/dbs/initorcl.ora}:
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ cd $ORACLE_HOME/dbs
$ cp init.ora initorcl.ora
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}

¼ÓÉÏÒÔÏÂÊýÐÐ£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
db_name = orcl
COMPATIBLE=7.3.3.0.0
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}







\subsection{½¨Á¢×ÊÁÏ¿â°²×°ÃüÁî¸å}

ÔÚ {\ttfamily \$ORACLE\_HOME/dbs} Ä¿Â¼ÏÂ½¨Á¢Ò»¸öÃûÎª makedb.sql µÄÃüÁî¸åµµ£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
connect internal
startup nomount
set echo on
spool makedb.log
create database orcl
        maxinstances 1
        maxlogfiles  8
        datafile '$ORACLE_HOME/dbs/orcl_syst_01.dbf' size 40M reuse
        logfile
                '$ORACLE_HOME/dbs/orcl_redo_01.dbf' size 1M reuse,
                '$ORACLE_HOME/dbs/orcl_redo_02.dbf' size 1M reuse,
                '$ORACLE_HOME/dbs/orcl_redo_03.dbf' size 1M reuse;
@$ORACLE_HOME/rdbms/admin/catalog.sql
create tablespace rollback
        datafile '$ORACLE_HOME/dbs/orcl_roll_01.dbf' size 8.5M reuse;
create tablespace temp
        datafile '$ORACLE_HOME/dbs/orcl_temp_01.dbf' size 5M reuse 
        temporary;
create tablespace users
        datafile '$ORACLE_HOME/dbs/orcl_user_01.dbf' size 10M reuse;
create rollback segment r1 tablespace rollback
        storage ( optimal 5M );
alter rollback segment r1 online;
connect system/manager
@$ORACLE_HOME/rdbms/admin/catdbsyn.sql
connect internal
@$ORACLE_HOME/rdbms/admin/catproc.sql
connect system/manager
@$ORACLE_HOME/sqlplus/admin/pupbld.sql
spool off
exit
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}





\subsection{Ö´ÐÐ×ÊÁÏ¿âµÄ°²×°°²Áî¸å}

¿ªÊ¼ {\ttfamily svrmgrl} ¼°Ö´ÐÐÃüÁî¸å¡Ã
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ cd $ORACLE_HOME/dbs
$ svrmgrl

Oracle Server Manager Release 2.3.3.0.0 - Production

Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.

Oracle7 Server Release 7.3.3.0.0 - Production Release
PL/SQL Release 2.3.3.0.0 - Production

SVRMGR> connect internal
Connected.
SVRMGR> startup nomount
ORACLE instance started.
Total System Global Area       4313312 bytes
Fixed Size                       41876 bytes
Variable Size                  4140364 bytes
Database Buffers                122880 bytes
Redo Buffers                      8192 bytes
SVRMGR> @makedb
<loads of messages>
SVRMGR> exit
Server Manager complete.
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}



\subsection{Æô¶¯×ÊÁÏ¿â}

¿ªÊ¼Ê±£¬ÎÒÃÇÒªÇ×ÊÖÆô¶¯×ÊÁÏ¿â£¨ÎÒÃÇÉÔáá»á°ÑÕâ¹¤¼þ×Ô¶¯»¯£©¡£ÒªÆô¶¯ Oracle µÄ×ÊÁÏ¿â£¬ÎÒÃÇÒªÀ´ÄÚ²¿Á¬½Ó (connected internally) ÁËµÄÇé¿öÏÂÖ´ÐÐ {\ttfamily startup} Ö¸Áî£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ svrmgrl

Oracle Server Manager Release 2.3.3.0.0 - Production

Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.

Oracle7 Server Release 7.3.3.0.0 - Production Release
PL/SQL Release 2.3.3.0.0 - Production

SVRMGR> connect internal
Connected.
SVRMGR> startup
ORACLE instance started.
Total System Global Area       4313316 bytes
Fixed Size                       41876 bytes
Variable Size                  4140368 bytes
Database Buffers                122880 bytes
Redo Buffers                      8192 bytes
Database mounted.
Database opened.
SVRMGR> exit
Server Manager complete.
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}



\subsection{Í£Ö¹×ÊÁÏ¿â}

ÏÈÖ¼ÉùÃ÷£¬ÔÚÎ´¹Ø±ÕÒ»¸ö Oracle ×ÊÁÏ¿âµÄÇé¿öÏÂÖØÐÂÆô¶¯ Linux ºÜÓÐ¿ÉÄÜ»áÊ¹×ÊÁÏ¿âËð»Ù¡£

Òò´Ë£¬ÔÚÎÒÃÇÖ´ÐÐ Linux µÄ {\ttfamily shutdown} Ö¸ÁîÇ°×îºÃÏÈ¹Ø±Õ×ÊÁÏ¿â£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ svrmgrl

Oracle Server Manager Release 2.3.3.0.0 - Production

Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.

Oracle7 Server Release 7.3.3.0.0 - Production Release
PL/SQL Release 2.3.3.0.0 - Production

SVRMGR> connect internal
Connected.
SVRMGR> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SVRMGR> exit
Server Manager complete.
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}



\subsection{½¨Á¢ÄÚ¶¨ÓÃ»§ (Default User)}

ÔÚ½¨Á¢×ÊÁÏ¿âÊ±£¬»á×Ô¶¯²úÉúÁ½¸öÌØ±ðµÄÓÃ»§£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
Username                Password

SYSTEM                  MANAGER
SYS                     change_on_install
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}




ÕâÐ©ÓÃ»§Í¨³£ÊÇÓÃÀ´±£´æ±ê×¼µÄ×ÊÁÏ×Öµä (data dictionary) ×ÊÁÏÔÚ×ÊÁÏ¿âÖÐ¡£¾¡¿ì°ÑÃÜÂëÐÞ¸ÄÊÇÒ»¸öºÃÖ÷Òâ¡£

¿ÉÒÔÕâÑù×ö£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
sqlplus system/manager

SQL*Plus: Release 3.3.3.0.0 - Production on Sat Feb 21 12:43:33 1998

Copyright (c) Oracle Corporation 1979, 1996.  All rights reserved.


Connected to:
Oracle7 Server Release 7.3.3.0.0 - Production Release

SQL> alter user system identified by <newpassword>;

User altered.

SQL> alter user sys identified by <newpassword>;

User altered.

SQL> exit;
Disconnected from Oracle7 Server Release 7.3.3.0.0 - Production Release
PL/SQL Release 2.3.3.0.0 - Production
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}




ÓÃ»§ {\ttfamily system/manager} ¾ÍÈç UNIX ÖÐµÄ {\ttfamily root}£¬Òò´ËÎÒÃÇÒª½¨Á¢ÁíÒ»¸öÈ¨Á¦½ÏÉÙµÄÓÃ»§ÒÔ·ÀËðÊ§¡££¨¼ÇÖøÒªÏÈ¿ªÆô×ÊÁÏ¿â²Å½¨Á¢ÓÃ»§¡££©

Á¬½Óµ½ SQL*Plus ¼°½¨Á¢ÓÃ»§£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ sqlplus system/manager

SQL*Plus: Release 3.3.3.0.0 - Production on Sat Feb 21 12:43:33 1998

Copyright (c) Oracle Corporation 1979, 1996.  All rights reserved.


Connected to:
Oracle7 Server Release 7.3.3.0.0 - Production Release
PL/SQL Release 2.3.3.0.0 - Production

SQL> create user <user> identified by <psw> 
  2  default tablespace users 
  3  temporary tablespace temp;

User created.

SQL> grant connect, resource to <user>

Grant succeeded.

SQL> exit
Disconnected from Oracle7 Server Release 7.3.3.0.0 - Production Release
PL/SQL Release 2.3.3.0.0 - Production
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}


ÏµÍ³ÖÐÒÑÓÐÒ»¸öÐÂÓÃ»§£¬Äã¿ÉÒÔÓÃËûÀ´ÊÔÓÃÐÂÏµÍ³¡£ÒªÇ©Èë Oracle ×ÊÁÏ¿â£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ sqlplus <user>/<password>
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}


Èç¹ûÕâÔÚÃ»ÓÐ´íÎóÑ¶Ï¢µÄÇé¿öÏÂÍê³É£¬ÄãÒÑÓÐÒ»¸öÔË×÷ÖÐµÄ Oracle ×ÊÁÏ¿â¡£Èç¹ûÄãÖ»»á´ÓÕâ²¿µçÄÔÁ¬½Óµ½Õâ×ÊÁÏ¿â£¬¶ø²»»á´ÓÆäËûµØ·½£¬Äã¿ÉÐÝÏ¢ÁË£¡

²»¹ý£¬Èç¹ûÄãÏñ´ó²¿·ÖÈË°ãÏëÉè¶¨ÍøÂçÈí¼þÊ¹Äã¿ÉÒÔ´ÓÆäËûµçÄÔÁ¬½Ó£¬Çë¼ÌÐø¶ÁÏÂÈ¥¡£


\section{ÔÚËÅ·þÆ÷ÉÏÉè¶¨ SQL*Net}

ËùÓÐÕâÐ©µµ°¸¶¼»áÓÃì¶Éè¶¨ Oracle µÄÍøÂçÈí¼þ£¨SQL*Net£¬ºÍ Oracle8 µÄ Net8 ²î²»¶à£©¡£ÕâÐ©µµ°¸Ó¦¸Ã¶¼½¨Á¢ÔÚËÅ·þÆ÷ÖÐµÄ
{\ttfamily \$ORACLE\_HOME/network/admin} Ä¿Â¼¡£


\subsection{{\ttfamily tnsnames.ora}}

{\ttfamily TNSNAMES.ORA} µµÉè¶¨ËùÓÐÕâµçÄÔÌá¹©µÄ·þÎñ¡£ÏÖÔÚÎÒÃÇÃèÊöËùÓÐ¹ÒÉÏÁËËÅ·þÆ÷µÄ×ÊÁÏ¿â¡£¶ÔËÅ·þÆ÷ÉÏËùÓÐ×ÊÁÏ¿âÄãÒª¼ÓÉÏÀàËÆÒÔÏÂµÄÒ»¶Î£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
orcl.world =
  (DESCRIPTION =
    (ADDRESS_LIST =
        (ADDRESS =
          (COMMUNITY = tcp.world)
          (PROTOCOL = TCP)
          (Host = <INSERT HOST NAME OF SERVER HERE> )
          (Port = 1521)
        )
        (ADDRESS =
          (COMMUNITY = tcp.world)
          (PROTOCOL = TCP)
          (Host = <INSERT HOST NAME OF SERVER HERE> )
          (Port = 1526)
        )
    )
   (CONNECT_DATA = (SID = ORCL)
    )
  )
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}



\subsection{{\ttfamily listener.ora}}

{\ttfamily listener.ora} µµÃèÊöËùÓÐÆäËûµçÄÔ¿ÉµÃµ½µÄ·þÎñ¼°ËÅ·þÆ÷µÄ¼àÌý³ÌÊ½
(listener) ËùÐèµÄËùÓÐÉè¶¨¡£

ËüÓÐÒ»¶Î°üÀ¨¼àÌý³ÌÊ½Ãû³Æ¡¢¼àÌý³ÌÊ½µØÖ·¡¢¼àÌý³ÌÊ½Ìá¹©·þÎñµÄ×ÊÁÏ¿â¼°²ÎÊýÉè¶¨ (listener name, listener address, databases served by the listener and configuration parameters)¡£

ÕâÀïÓÐÒ»¸öÀý×Ó£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# ¼àÌý³ÌÊ½Ãû³Æ¼°ËùÊÕÌýµÄµØÖ·
LISTENER =
        ( ADDRESS_LIST =
                (ADDRESS =
                        (PROTOCOL=tcp)
                        (HOST=<INSERT HOST>)
                        (PORT=1521)
                        (COMMUNITY=UK_SUP_TCPIP)
                )
                (ADDRESS =
                        (PROTOCOL=ipc)
                        (KEY=700)
                        (COMMUNITY=UK_SUP_TCPIP)
                )
        )

# ÁÐ³ö¼àÌý³ÌÊ½Ìá¹©µÄ·þÎñ
SID_LIST_LISTENER=
        (SID_LIST=
                (SID_DESC=
                        (SID_NAME=orcl)
                        (ORACLE_HOME=/home/oracle/7.3.3.0.0)
                )
        )

# ¿ªÊ¼²ÎÊýÉè¶¨
TRACE_LEVEL_LISTENER=OFF
TRACE_FILE_LISTENER = "listener"
LOG_FILE_LISTENER = "listener"
CONNECT_TIMEOUT_LISTENER = 10
STOP_LISTENER = YES
DBA_GROUP = dba
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}



\subsection{{\ttfamily sqlnet.ora}}

{\ttfamily sqlnet.ora} µµ°üÀ¨¶ÔÍøÂçÉÏÒ»¸öÌØ¶¨½Úµã (node) µÄÉè¶¨¡£ÕâÐ©×ÊÁÏºÍ×ÊÁÏ¿âµÄÊýÄ¿¼°¼àÌý³ÌÊ½µÄÊýÄ¿ÎÞ¹Ø¡£Õâ¸öµµ°¸ÖÐ×îÖØÒªµÄ¶«Î÷ÊÇ {\ttfamily Dead Connection Timeout} ±äÊýµÄÉè¶¨¡£

Dead connection timeout ¼ì²éÃ¿Ò»¸ö½Óµ½¸Ã×ÊÁÏ¿âµÄÐÐ³Ì¼°È·±£ÓÃ»§¶ËÈÔÓÐ·´Ó¦¡£Èç¹ûÄÇÓÃ»§£¨ÀàÐÍ²»¾Ð£©²¢ÎÞ·´Ó¦£¬¶ÔÓ¦µÄ Oracle ËÅ·þÆ÷Ó°×ÓÐÐ³Ì (shadow process) ±ã»á±»É±¡£

Èç¹ûÄãÓÐºÜ¶àÓÃ»§´æÈ¡ÄÇ×ÊÁÏ¿â£¬Õâµã·Ç³£ÓÐÓÃ¡£ÓÈÆäÊÇµ±ÄãÈÔÔÚ³ÌÊ½¿ª·¢½×¶Î£¬ÓÃ»§¶àÊý²»ÄÜÕýÈ·µØ½á¡õµÄÊ±ºò¡£

ÒÔÏÂÊÇÎÒµÄ {\ttfamily sqlnet.ora} µµ£¬¹©¸÷¶ÁÕß²Î¿¼£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
TRACE_LEVEL_CLIENT = OFF
sqlnet.expire_time = 30         # Á½´Î¼ì²é¿Í»§Ïà²îµÄÃëÊý
names.default_domain = world
name.default_zone = world
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}





\subsection{¿ªÊ¼¼°½á¡õ¼àÌý³ÌÊ½}

ÏÖÔÚÓÐ¹Ø¼àÌý³ÌÊ½¼° SQL*Net µÄÉè¶¨ÒÑ¾­Íê³É£¬ÎÒÃÇ¿ÉÒÔÊÔÓÃÍøÂçÈí¼þÀ´²µµ½×ÊÁÏ¿â¡££¨Ö®Ç°ÎÒÃÇÖ»ÊÇÖ±½ÓÁ¬½Óµ½×ÊÁÏ¿â£¬ÏÖÔÚÔòÊÇÔÚÄ£ÄâÊ¹ÓÃÔ¶³Ì (remote) ÓÃ»§¡££©

Ê¹ÓÃÒÔÉÏµÄÉè¶¨À´Æô¶¯¼àÌý³ÌÊ½£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ lsnrctl

LSNRCTL for SCO System V/386: Version 2.3.3.0.0 - Production on 23-FEB-98 20:38:25

Copyright (c) Oracle Corporation 1994.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> start
Starting /home/oracle/7.3.3.0.0/bin/tnslsnr: please wait...

TNSLSNR for SCO System V/386: Version 2.3.3.0.0 - Production
System parameter file is /home/oracle/7.3.3.0.0/network/admin/listener.ora
Log messages written to /home/oracle/7.3.3.0.0/network/log/listener.log
Listening on: (ADDRESS=(PROTOCOL=tcp)(DEV=6)(HOST=192.168.1.1)(PORT=1521))
Listening on: (ADDRESS=(PROTOCOL=ipc)(DEV=10)(KEY=700))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=magic.com)(PORT=1521)(COMMUNITY=UK_SUP_TCPIP))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for SCO System V/386: Version 2.3.3.0.0 - Production
Start Date                23-FEB-98 20:38:50
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  OFF
SNMP                      ON
Listener Parameter File   /home/oracle/7.3.3.0.0/network/admin/listener.ora
Listener Log File         /home/oracle/7.3.3.0.0/network/log/listener.log
Services Summary...
  orcl          has 1 service handler(s)
The command completed successfully
LSNRCTL> exit
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}


ÒªÍ£Ö¹¼àÌý³ÌÊ½£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ lsnrctl

LSNRCTL for SCO System V/386: Version 2.3.3.0.0 - Production on 23-FEB-98 20:43:20

Copyright (c) Oracle Corporation 1994.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> stop
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=magic.com)(PORT=1521)(COMMUNITY=UK_SUP_TCPIP))
The command completed successfully
LSNRCTL> exit
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}


Èç¹ûÄãµÄ DNS ²¢²»´«»ØÖ¸¶¨µÄÖ÷»úµÄ IP µØÖ·£¬Æô¶¯¼°½á¡õ¼àÌý³ÌÊ½»á»¨Ò»µãÊ±¼ä£¨ÒÀ¾Ý DNS 2-3 µÄÓâÊ±±äÊý (timeout variable)£¬´óÖÂÔÚ 2-3 ·ÖÖÓÖ®¼ä£©¡£Èç¹ûÕæµÄ·¢ÉúÕâÇé¿ö£¬ÇëÄÍÐÄµÈ´ý£¬²»±Øµ£ÐÄ¡£






\section{ÓÃ»§µÄÉè¶¨}


\subsection{ÊÓ´°ÓÃ»§}

ÔÚ PC ÉÏÊ¹ÓÃ½ÏÐÂ°æ±¾µÄ Oracle Client Software Éè¶¨ SQL*Net Ê®·Ö¼òµ¥¡£×î¼Ñ£¨Ò²×î·½±ã£©µÃµ½Ò»¸öÔË×÷ÍêÈ«Õý³£µÄÓÃ»§ÊÇÊ¹ÓÃ Oracle Ìá¹©µÄ  {\ttfamily SQL*Net Easy Configuration} ¹¤¾ß¡£

Õâ¹¤¾ßÓÐÒ»¸ö¾«Áé (wizard) µÄ½éÃæ£¬¿É´øÁìÄãÉè¶¨ {\ttfamily tnsnames.ora} ¼° {\ttfamily sqlnet.ora} Á½¸öµµ°¸¡£

Ñ¡Ôñ "Add Database Alias" ¼°ÔÚ±»ÎÊ¼°Ê±´òÈë´úºÅÃû³Æ¡£Õâ´úºÅÊÇÄãÓÃÒÔÖ¸¶¨×ÊÁÏ¿âµÄÃû³Æ£¬ÕâÓ¦¸ÃºÍ×ÊÁÏ¿âÃû³ÆÏàÍ¬£¨ÕâÀïÊÇ orcl)¡£

ÔÚÍ¨Ñ¶Ð­¶¨ (protocol) ÖÐÑ¡Ôñ TCP/IP£¬ÔÚ±»ÎÊ¼°Ê±»Ø´ðÖ÷»úÃû³Æ (machine hosting the database) ¼°×ÊÁÏ¿âÃû³Æ (instance name)¡£

¾ÍÊÇÕâÑùÁË¡£

²»¹ý£¬¼´Ê¹ÄãÃ»ÓÐ {\ttfamily SQL*Net Easy Configuration} ¹¤¾ßÒ²²»ÓÃµ£ÐÄ¡£ÄãÖ»ÐèÔÚ {\ttfamily \$ORACLE\_HOME/network/admin} Ä¿Â¼ÖÐ½¨Á¢ºÍÔÚËÅ·þÆ÷ÖÐÒ»Ä£Ò»ÑùµÄ {\ttfamily tnsnames.ora} ºÍ {\ttfamily sqlnet.ora} µµ¡£ÕâÑù»áÊ¹ÄãµÃµ½ÏàÍ¬µÄ±ðÃû£¨ÕâÊÇÒ»¸öºÃÖ÷Òâ£©¡£


\subsection{Unix ÓÃ»§}

UNIX ÓÃ»§ºÍÊÓ´°ÓÃ»§·Ö±ð²»´ó¡£Èç¹ûÄãÓÐ Oracle µÄ {\ttfamily Network Manager}£¬×ö·¨ºÍÒÔÉÏ²î²»¶à¡£Ã»ÓÐµÄ»°£¬ÔÙËµÒ»´Î£¬Ö»ÐèÊ¹ÓÃºÍËÅ·þÆ÷ {\ttfamily \$ORACLE\_HOME/network/admin} Ä¿Â¼ÖÐÏàÍ¬µÄÉè¶¨µµ¡£


\section{×Ô¶¯Æô¶¯¼°Í£Ö¹}


\subsection{{\ttfamily dbstart} ¼° {\ttfamily dbstop}}

Oracle ×ÊÁÏ¿âµÄ×Ô¶¯Æô¶¯¼°Í£Ö¹¿É¼® Oracle Ìá¹©µÄ {\ttfamily dbstart} ¼° {\ttfamily dbshut} µµ´ï³É (ÔÚ 7.3.3.0.0 ÖÐ£©¡£ÕâÐ©µµ°¸ÓÖË£ÒÀ¿¿ {\ttfamily /etc/oratab} ´æÔÚ²ÅÄÜÊ¹ÓÃ£¨ËäÈ»¸ü¸Ä {\ttfamily dbshut} ºÍ {\ttfamily dbstart} µµ¿ÉÊ¹½â³ýÕâÏÞÖÆ¡££©

{\ttfamily /etc/oratab} µµ¸ñÊ½ÈçÏÂ£º
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
SID:ORACLE_HOME:AUTO
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}


ÀýÈç
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
orcl:/home/oracle/7.3.3.0.0:Y
leaveup:/home/oracle/7.3.2.1.0:N
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}



\subsection{{\ttfamily init.d} ¼° {\ttfamily rc.d}}

ÒªÔÚ¿ª»ú¹Ø»úÊ±×Ô¶¯Æô¶¯ºÍ½á¡õ×ÊÁÏ¿âµÄ»°£¬ÄãÐèÒªÐÞ¸Ä Linux µÄÆô¶¯ÃüÁî¸å¡£Õâ²¢²»À§ÄÑ£¬²»¹ý£¬ÎÒÐèÒªÖ¸³öÕâÐ©¸Ä¶¯ÒòÓ¦²»Í¬µÄ Linux ·¢ÐÐ°æ±¾£¨slackware, debian, redhat µÈ£©¶øÓÐËù²»Í¬¡£ÎÒÕâÐ©Àý×ÓÊÊÓÃì¶ Redhat  5.0¡£ÒªÎªÄãËùÓÃµÄ Linux ×÷³öÐÞ¸Ä£¬ÇëÏÈ²Î¿¼ÄãÊÖÍ·ÉÏµÄ Linux ÎÄ¼þ¡££¨ËäÈ»ÕâÊµ¼ÊÉÏÓ¦¸ÃÊÊÓÃì¶ËùÓÐ Sys V UNIX¡££©

Ê×ÏÈ£¬ÎÒÃÇÒª½¨Á¢»áÖ´ÐÐ {\ttfamily /etc/rc.d/init.d} Ä¿Â¼ÖÐ {\ttfamily dbshut} ¼° {\ttfamily dbstart} µÄÃüÁî¸å¡£°ÑÒÔÏÂµµ°¸ÃüÃûÎª {\ttfamily /etc/rc.d/init.d/oracle}:
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
#!/bin/sh
#
# /etc/rc.d/init.d/oracle
# ½âËµ¡ÃÆô¶¯¼°Í£Ö¹ Oracle ×ÊÁÏ¿âºÍ¼àÌý³ÌÊ½
# ¼ì²éÈçºÎÖ´ÐÐÃüÁî¸å
case "$1" in
  start)
        echo -n "Starting Oracle Databases: "
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Starting Oracle Databases as part of system up." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        su - oracle -c dbstart >> /var/log/oracle
        echo "Done."
        echo -n "Starting Oracle Listeners: "
        su - oracle -c "lsnrctl start" >> /var/log/oracle
        echo "Done."
        echo ""
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Finished." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        touch /var/lock/subsys/oracle
        ;;
  stop)
        echo -n "Shutting Down Oracle Listeners: "
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Shutting Down Oracle Databases as part of system down." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        su - oracle -c "lsnrctl stop" >> /var/log/oracle
        echo "Done."
        rm -f /var/lock/subsys/oracle
        echo -n "Shutting Down Oracle Databases: "
        su - oracle -c dbshut >> /var/log/oracle
        echo "Done."
        echo ""
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Finished." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        ;;
  restart)
        echo -n "Restarting Oracle Databases: "
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Restarting Oracle Databases as part of system up." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        su - oracle -c dbstop >> /var/log/oracle
        su - oracle -c dbstart >> /var/log/oracle
        echo "Done."
        echo -n "Restarting Oracle Listeners: "
        su - oracle -c "lsnrctl stop" >> /var/log/oracle
        su - oracle -c "lsnrctl start" >> /var/log/oracle
        echo "Done."
        echo ""
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Finished." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        touch /var/lock/subsys/oracle
        ;;
  *)
        echo "Usage: oracle {start|stop|restart}"
        exit 1
esac
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}


²»ÒªÁßØÄì¶¼ì²éÕâ¸öµµ°¸µ½µ×ÓÐÃ»ÓÐÕæµÄÕýÈ·µØÆô¶¯ºÍÍ£Ö¹ÏµÍ³ÖÐµÄ×ÊÁÏ¿â¡£Çë¼ì²é¼ÇÂ¼µµ(log file)£¬¿´¿´ÓÐÃ»ÓÐ´íÎóÑ¶Ï¢¡£

ÅªÍ×ÕâÃüÁî¸åáá£¬ÎÒÃÇÒªÔÚÕýÈ·µÄÖ´ÐÐµÈ¼¶Ä¿Â¼ (runlevel directories)  {\ttfamily /etc/rc.d/rcX.d} ÖÐ½¨Á¢¼°É¾³ý·ûºÅÁ¬½á (symbolic links)¡£

ÒÔÏÂÖ¸ÁîÈ·±£ÔÚÖ´ÐÐµÈ¼¶ 2, 3 ¼° 4 ÏÂ»á½Ð³ö×ÊÁÏ¿â¡Ã
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ ln -s ../init.d/oracle /etc/rc.d/rc2.d/S99oracle
$ ln -s ../init.d/oracle /etc/rc.d/rc3.d/S99oracle
$ ln -s ../init.d/oracle /etc/rc.d/rc4.d/S99oracle
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}


ÒªÔÚÖØÐÂÆô¶¯Ê±Í£Ö¹×ÊÁÏ¿â£¬ÎÒÃÇÐèÒªÒÔÏÂÁ¬½á¡Ã
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ ln -s ../init.d/oracle /etc/rc.d/rc0.d/K01oracle          # Í£Ö¹
$ ln -s ../init.d/oracle /etc/rc.d/rc6.d/K01oracle          # ÖØÐÂÆô¶¯
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}



\section{ÆäËûÊÂÒË}


\subsection{Intelligent Agent}

Èç¹ûÄãÐèÒª {\ttfamily Oracle Intelligent Agent}£¬ÎÒ·¢ÏÖÄã²»ÐèÐÞ¸ÄÈÎºÎÉè¶¨±ãÄÜÖ´ÐÐËü¡£ÒªÆô¶¯ IA µÄ»°¡Ã
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ lsnrctl dbsnmp_start
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}


ÒªÍ£Ö¹ IA¡Ã
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
$ lsnrctl dbsnmp_stop
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}


²»»á³öÏÖÈÎºÎÑ¶Ï¢ËµÃ÷Æô¶¯»òÍ£Ö¹ intelligent agent ÊÇ·ñ³É¹¦¡£²»¹ý£¬ÔÚÓÃ»§¶ËËüÓÐ¶Ô Enterprise Manager ×÷³ö»ØÓ¦£¬ËùÒÔÎÒ¼ÙÉèËüÔË×÷Õý³£¡£




\section{ÒÉÄÑÅÅ½â}

ÕâÀïÓÐÒ»Ð©¹ØÒÉÄÑÅÅ½âµÄÌáÊ¾¡£


\subsection{ÎÒ²»ÄÜÔÚ Oracle 7.2.x ÖÐ½¨Á¢×ÊÁÏ¿â¡£}

Oracle 7.2.x ²úÆ·´íÎóµØ¼ÙÉèÄãÏëÉè¶¨Æ½ÐÐËÅ·þÆ÷ (parallel server)¡£ÄÚÖÃµÄ {\ttfamily init.ora} µµÖÐÓÐÒÔÏÂÒ»¾ä¡Ã
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# define parallel server (multi-instance) parameters
ifile = ora_system:initps.ora
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}

Òª½â¾öÕâÎÊÌâÖ»Ðè°ÑËü±äÎª×¢½â¡Ã
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
# define parallel server (multi-instance) parameters
#ifile = ora_system:initps.ora
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}



\subsection{7.3.4.x µÄ {\ttfamily svrmgrl} ²úÉú segmentation fault¡£}

ÓÐ²»ÉÙÈË±¨¸æ¹ýÕâÎÊÌâ¸øÎÒ¡£Gerald Weber {\ttfamily gerald\_weber@master.co.at} ½â¾öÁËËü¡Ã 
\begin{tscreen}
\par
\addvspace{\medskipamount}
\nopagebreak\hrule
\begin{verbatim}
Hi Paul,

Ê×ÏÈ·Ç³£¸ÐÐ»ÄãµÄ°ïÖú£¬²»¹ý£¬ÄãËùÏëµ½µÄÎÊÌâÈ«¶¼ºÍÎÒËùÓöµ½µÄÎÞ¹Ø¡£
ÎÊÌâ³öÔÚì¶ iBCS Ä£ÄâÆ÷¡£
ËÆºõ Oracle Ö´ÐÐÁËÒ»¸öÄ¿Ç°°æ±¾µÄ iBCS ²¢²»Ö§Ô®µÄÏµÍ³Éè¶¨ºô½Ð (sysconf-calls)¡£
Çë¿´ÒÔÏÂµÄ trace¡Ã

<7>[22]615 sysconf(34)
<7>iBCS2 unsupported sysconf call 34
<7>[22]615 sysconf error return linux=-22 -> ibcs=22 <Invalid argument>
<7>[24]615 sysconf(34)
<7>iBCS2 unsupported sysconf call 34
<7>[24]615 sysconf error return linux=-22 -> ibcs=22 <Invalid argument>

½â¾ö·½·¨¡ÃÐÞÕý iBCS Ô´³ÌÊ½Âë¡£Ê¹ÓÃÒÔÏÂµÄÐÞÕýµµ¡Ã


--- sysconf.c   Sun Apr 19 19:19:15 1998
+++ sysconf.c.ori       Sun Apr 19 19:28:45 1998
@@ -60,7 +60,6 @@
 #define _SC_JOB_CONTROL        5
 #define _SC_SAVED_IDS  6
 #define _SC_VERSION    7
-#define _SC_HACK_FOR_ORACLE 34

 #define _SC_PAGESIZE   11

@@ -97,11 +96,6 @@
                case _SC_SAVED_IDS: {
                        return (1);
                }
-
-               case _SC_HACK_FOR_ORACLE: {
-                 return (1);
-               }
-

                case _SC_PAGESIZE: {
                  return PAGE_SIZE;
\end{verbatim} 
\nopagebreak\hrule 
\addvspace{\medskipamount}
\end{tscreen}



\section{ÈÙÓþ}

ÕâÎÄ¼þ¸ù¾Ý Bob Withers, {\ttfamily bwit@pobox.com} µÄÒ»ÆªÎÄ¼þÐ´³É¡£ÆäËû×ÊÁÏÊÇÀ´×Ô Georg Rehreld, {\ttfamily rehfeld@wmd.de} ºÍ David Mansfield,  {\ttfamily david@claremont.com} ËùÐ´µÄÎÄ¼þ¡£

ÆäËûµÄÐ£¶Ô¹¤×÷ÓÉ Bob Withers, Mark Watling, {\ttfamily mwatling@mjw-ltd.demon.co.uk}, Peter Sodhi, {\ttfamily petersodhi@unn.unisys.com} and Greg Hankins, {\ttfamily greg.hankins@cc.gatech.edu} Íê³É¡£

ÎÒÒª¶àÐ»ËùÓÐ²ÎÓëÕâÆªÎÄ¼þµÄÈËµÄÖ§³Ö¼°Ëù×÷³öµÄÑÐ¾¿¡£ÌØ±ðÒª¶àÐ» Bob Withers ºÍ Mark Watling µÄ¸½¼ÓÒâ¼û¼°×÷³öµÄ°ïÃ¦¡£

\end{document}
