📄 在redhat6_0上安装oracle8i(全攻略) ╃web-apache服务器技术╃ 有风信息港 - powered by phpwind_net.htm
字号:
</SPAN> <BR>修改ORACLE_SID匹配我想要的SID: <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">][sKB<Iq6Z
</SPAN> <BR>ORACLE_SID=8idb </P><BR>
<P><SPAN style="FONT-SIZE: 0pt; COLOR: #ffffff">Sc0Fgub<5)
</SPAN> <BR>我搜索所有$ORACLE_HOME/dbs的出现并且用$ORACLE_BASE/oradata/8idb替代了它们。因为我在同一个目录下存储他们。另外,遵循你的OFA地点,因此你可以最终为每个数据文件获得不同的挂载点。当然,
绝对确保你指定的路径存在(没有错别字!)或数据文件将不被创建,并且特别地你必须使再次运行脚本的一部分创建数据文件或借助svrmgrl创建他们。
<SPAN style="FONT-SIZE: 0pt; COLOR: #ffffff">AVav*P#s|A
</SPAN> <BR>现在运行第二个脚本SIDcrdb2.sh(8idbcrdb2.sh)。只要你正确指定了所有的路径,并且你正确地指定了你的ORACLE_SID,你应该没有任何问题。
<SPAN style="FONT-SIZE: 0pt; COLOR: #ffffff">F^wB*/1
</SPAN> <BR>现在,你可能想要增加更多的重做日志文件,否则你将在警告日志文件中得到类似于以下的消息: <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">aEqy]R5*
</SPAN> <BR>Thread 1 cannot allocate new log, sequence 79 <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">=BYc)x?s{
</SPAN> <BR>Checkpoint not complete </P><BR>
<P>为此我运行了svrmgrl,以internal连接了并再创建了2个重做日志组,如下显示: </P><BR>
<P>SQL> alter database <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">f2UNI </SPAN> <BR>2
add logfile group 3
("/home/oracle/app/oracle/oradata/8idb/redo03.log") size 4096K <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">(FCId&&
</SPAN> <BR>3 / </P><BR>
<P>Statement Processed. </P><BR>
<P>SQL> alter database <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">wn! + } </SPAN> <BR>2
add logfile group 4
("/home/oracle/app/oracle/oradata/8idb/redo04.log") size 4096k <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">)}UeW$qQ </SPAN> <BR>3 /
</P><BR>
<P>Statement Processed. </P><BR>
<P>你可能想要通过在括号内增加另一个文件名,并且每个重做日志文件的文件名由一个逗号分开,且每个重做日志文件的文件名包围在他们自己的引号内,可让每个日志文件组有超过一个的成员。
</P><BR>
<P>编辑第3个脚本SIDcrdb3.sh(8idbcrdb3.sh)。我在这里做的所有改变是值ORACLE_SID。 <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">JO!(rwxO
</SPAN> <BR>运行第3个脚本。应该没有问题。 <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">-`rG0bk
</SPAN> <BR>在继续安装Oracle的一些或所有选件前,你可能想要检查系SYSTEM表空间最大范围。通过sqlplus以system/manager登录并且做:
<SPAN style="FONT-SIZE: 0pt; COLOR: #ffffff">[((yM*e
</SPAN> <BR>SQL> set linesize 1000 <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">|:8fU# .
</SPAN> <BR>SQL> SELECT tablespace_name "TABLESPACE", <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">Xb|`U4b </SPAN> <BR>2
initial_extent "INITIAL_EXT", <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">0 * [U% </SPAN> <BR>3
next_extent "NEXT_EXT", <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">LImz?X!1 </SPAN> <BR>4
min_extents "MIN_EXT", <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">9A:W.3.M(p </SPAN> <BR>5
max_extents "MAX_EXT", <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">f/t 6gHV </SPAN> <BR>6
pct_increase <SPAN style="FONT-SIZE: 0pt; COLOR: #ffffff">]M@LUc^?
</SPAN> <BR>7 FROM sys.dba_tablespaces <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">M *m'N{4 </SPAN> <BR>8
/ </P><BR>
<P>TABLESPACE INITIAL_EXT NEXT_EXT MIN_EXT MAX_EXT PCT_INCREASE
<SPAN style="FONT-SIZE: 0pt; COLOR: #ffffff">:YOJ!
</SPAN> <BR>------------------------------ -----------
---------- ---------- ---------- ------------ <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">!Dp_X}t0
</SPAN> <BR>SYSTEM 10240 10240 1 121 50 <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">u2UH*4pS
</SPAN> <BR>OEM_REPOSITORY 131072 131072 1 2147483645 0 <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">_mHg;
</SPAN> <BR>RBS 131072 131072 2 2147483645 0 <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">QeWDyMB
</SPAN> <BR>TEMP 262144 262144 1 2147483645 0 <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">;z98nn21
</SPAN> <BR>USERS 51200 51200 1 2147483645 0 <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">Q$wd9Qoy
</SPAN> <BR>INDX 51200 51200 1 2147483645 0 </P><BR>
<P>6 rows selected. </P><BR>
<P>SYSTEM表空间的缺省MAXEXTENTS是121,它确实不够,特别是当我们增加Oracle选件时。如果我们不增加它,我们将得到类似于“unable
to extend ... in tablespace SYSTEM”的错误消息。因此我做了: </P><BR>
<P>SQL> alter tablespace system <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">ZbWkkDl P </SPAN> <BR>2
default storage <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">{25`FXPS </SPAN> <BR>3
(pctincrease 0 maxextents unlimited) <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">]7_=6YRu| </SPAN> <BR>4
/ </P><BR>
<P>Tablespace altered. </P><BR>
<P>现在再运行上面的查询。这次,SYSTEM表空间的MAX_EXT应该是一个大数字。 </P><BR>
<P>退出sqlplus并且返回到shell。现在选择你的数据库想要哪个Oracle选件。如果Oracle选件要求执行超过一个的脚本,保证你以在$ORACLE_HOME/rdbms/install/create/
README文件中说明的正确的顺序执行这些脚本。 <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff"> W yX>: 8
</SPAN> <BR>确定改变每个脚本中的ORACLE_SID值。如果你加入InterMedia选件,保证你在drsys.sh脚本中为DRSYS数据文件指定了正确且有效的一条路径。
</P><BR>
<P>最后,
编辑你的initSID.ora文件并删除和rollback_segments入口的注释,以便在你关闭并且重启数据库时,将使用创建的退回片段。
<SPAN style="FONT-SIZE: 0pt; COLOR: #ffffff">-:HO&0y!8_
</SPAN> <BR>记住,我们这里创建的数据库使用8idb作为ORACLE_SID,并且在后文中引用的数据库假定为ORACLE_SIDO为ORCL。
</P><BR>
<P>4. 数据库创建的后期过程 <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">Jg]D+zu
</SPAN> <BR>4.1自动化数据库启动和关闭 <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">qVkz$l;~&
</SPAN> <BR>自动化数据库的启动和关闭是简单的。即使你不想要数据库自动地启动,你应该总是自动化数据库的关闭以防止破坏你的数据库。有关的步骤是:
</P><BR>
<P>su成为root。 <SPAN style="FONT-SIZE: 0pt; COLOR: #ffffff">Jr:W JS+
</SPAN> <BR>用一行ORACLE_SID:ORACLE_HOME:{Y|N}形式修改/etc/oratab,用来自你的环境变量的值代替ORACLE_SID和
ORACLE_HOME。该行类似这样: <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">}qri;w
</SPAN> <BR>ORCL:/home/oracle/app/oracle/product/8.1.5:Y
</P><BR>
<P><SPAN style="FONT-SIZE: 0pt; COLOR: #ffffff">#dAauUEi
</SPAN> <BR>在行末尾的Y将表明你是否想要数据库自动地启动和关闭。 </P><BR>
<P>在/etc/rc.d/init.d里创建一个脚本,起名为oracle8i,并把下面的代码放进去,它是在"Oracle8i
Linux Installation
Guide"提供的脚本基础上的一个修改版本。注意在该指南中的脚本由一个bug,阻止它关掉Oracle8i数据库。这在下面解释。
<SPAN style="FONT-SIZE: 0pt; COLOR: #ffffff">Yy^8gF-;s
</SPAN> <BR>#!/bin/sh <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">xZlc{\3_ </SPAN> <BR>#
Set ORA_HOME to be equivalent to the ORACLE_HOME <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">,Gj Uo6; </SPAN> <BR>#
from which you wish to execute dbstart and <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">._4W# 9w </SPAN> <BR>#
dbshut <SPAN style="FONT-SIZE: 0pt; COLOR: #ffffff">nu_\- (8#
</SPAN> <BR># set ORA_OWNER to the user id of the owner of the
<SPAN style="FONT-SIZE: 0pt; COLOR: #ffffff">PHM!PW[_
</SPAN> <BR># Oracle database in ORA_HOME </P><BR>
<P>ORA_HOME=/home/oracle/app/oracle/product/8.1.5 <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">rI5Jn]
</SPAN> <BR>ORA_OWNER=oracle </P><BR>
<P>case "$1" in <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">4SL#8>x9
</SPAN> <BR>"start") </P><BR>
<P><SPAN style="FONT-SIZE: 0pt; COLOR: #ffffff">p[I:UTty
</SPAN> <BR># Start the Oracle databases: <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">5n"8O_;F </SPAN> <BR>#
The following command assumes that the oracle login will not prompt
the </P><BR>
<P># user for any values <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">DgCsL h
</SPAN> <BR>echo -n "Starting Oracle8i: " <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">wX3=hy i
</SPAN> <BR>su - $ORA_OWNER -c $ORA_HOME/bin/dbstart <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">dM"*K u u
</SPAN> <BR>touch /var/lock/subsys/oracle8i <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">/' ^"-s
</SPAN> <BR>echo <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">z1b\
</SPAN> <BR>;; </P><BR>
<P>"stop") </P><BR>
<P># Stop the Oracle databases: <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">e}VKzv:8 </SPAN> <BR>#
The following command assumes that the oracle login will not prompt
the </P><BR>
<P># user for any values <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">~* nO Rt0Z
</SPAN> <BR>echo -n "Shutting down Oracle8i: " <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">jd_~{ </SPAN> <BR>su
- $ORA_OWNER -c $ORA_HOME/bin/dbshut <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">-W 5nkr </SPAN> <BR>rm
-f /var/lock/subsys/oracle8i <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">v|Y.` t2j
</SPAN> <BR>echo <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">>H==s= 1;
</SPAN> <BR>;; </P><BR>
<P>"restart") </P><BR>
<P># Restart the Oracle databases: <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">M4> IL2+l
</SPAN> <BR>echo -n "Retarting Oracle8i: " <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">{ - IL0u
</SPAN> <BR>$0 stop <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">k[wT00({
</SPAN> <BR>$0 start <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">nqU M[S
</SPAN> <BR>echo <SPAN
style="FONT-SIZE: 0pt; COLOR: #ffffff">3cgx"Q&8
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -