- 论坛徽章:
- 0
|
我的安装手记,希望能给大家有所帮助!
正确安装Red Hat 2.1 Advanced Server后,具体请看相应的文档资料
解压缩安装文件
cpio –idmv < /mnt/cdrom/lnx_920_disk1.cpio.gz
cpio –idmv < /mnt/cdrom/lnx_920_disk2.cpio.gz
cpio –idmv < /mnt/cdrom/lnx_920_disk2.cpio.gz
JDK的安装
在/usr/local下运行
#j2sdk-1_3_1_04-linux-i586.bin
#ln –s jdk1.3.1_04 java
创建用户帐号
As root:
groupadd dba
groupadd oinstall
useradd -g oinstall -G dba oracle
passwd oracle
设置Oracle用户的环境变量(非常重要!!!)
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
# Oracle Environment
#export ORACLE_BASE=/opt/oracle
export ORACLE_BASE=/usr/local/oracle
#export ORACLE_HOME=/opt/oracle/product/9.2.0
export ORACLE_HOME=/usr/local/oracle/product/9.2.0
export ORACLE_SID=test
export ORACLE_TERM=xterm
#export TNS_ADMIN= Set if sqlnet.ora, tnsnames.ora, etc. are not in $ORACLE_HOME/network/admin
#export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_LANG=AMERICAN;
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
# Set shell search paths
export PATH=$PATH ORACLE_HOME/bin HOME/bin
# CLASSPATH:
CLASSPATH=$ORACLE_HOME/JRE ORACLE_HOME/jlib ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH ORACLE_HOME/network/jlib
#PATH=$PATH HOME/bin
#export PATH
unset USERNAME
(export给了两组参数,请你做相应的修改!)
安装Oracle
以oracle用户登录系统,运行
$./runInstaller
系统将弹出安装画面,点击Next,继续安装就是了。选择安装路径,直接下一步。接下来会出现让你添安装组名-oinstall,然后以root用户执行orainstRoot.sh
在Link时需要以root用户执行/home/oracle/product/9.2.0/root.sh
有可能的错误信息:
Step 1: E.g. allow "oracleserver" to display X information to your desktop PC "yourdesktop":
yourdesktop:user$ xhost +oracleserver
Step 2: From the console of your Oracle server "oracleserver " you are logged into, execute the following command as user " oracle ":
oracleserver racle$ export DISPLAY=yourdesktop:0.0
Step 3a: From your burned CD Disk 1, execute runInstaller (do not cd to /mnt/cdrom !):
As root:
oracleserver:root# mount /mnt/cdrom
As oracle:
# Before starting runInstaller, try maybe to execute e.g. 'xterm' to see if your X setup is really working!
oracleserver racle$ /mnt/cdrom/runInstaller
Step 3b: Or wherever you unpacked your downloaded files:
oracleserver racle$ Disk1/runInstaller
启动、关闭9i的数据库
sqlplus:
svrmgrl is not supported any more. You can now do everything with sqlplus.
E.g., to startup the database, execute the following commands:
&nbsp;dba$ sqlplus /nolog
&nbsp;SQL>; connect / as sysdba
&nbsp;SQL>; startup
The slash connects you to the schema owned by SYS.&nbsp; So in this example we are saying that we want to connect to the schema owned by SYS with the privilege SYSDBA. SYSDBA gives you the following privileges:
&nbsp;sysoper privileges WITH ADMIN OPTION
&nbsp;create database
&nbsp;recover database until
$ORACLE_HOME/bin/dbstart and $ORACLE_HOME/bin/dbshut :
You can also use $ORACLE_HOME/bin/dbstart to startup the database, and $ORACLE_HOME/bin/dbshut to shutdown the database. You can place $ORACLE_HOME/bin/dbstart into the /etc/rc.d/rc.local boot script to automatically bring up the database at system boot time. To get $ORACLE_HOME/bin/dbstart and $ORACLE_HOME/bin/dbshut working, you need to change the third field for your Oracle SID in /etc/oratab from "N" to "Y".
E.g. for the Oracle SID "test" I changed the line in /etc/oratab from
test:/opt/oracle/product/9.2.0:N
to read
test:/opt/oracle/product/9.2.0:Y
For 9.2.0, I also had to copy the init file for my SID "test" from /opt/oracle/admin/test/pfile to $ORACLE_HOME/dbs to get dbstart and dbshut working:
cp /opt/oracle/admin/test/pfile/inittest.ora.642002224936 $ORACLE_HOME/dbs/inittest.ora
But first check if your init file already exists in $ORACLE_HOME/dbs.
我遇到的安装问题
ORA-03113: end-of-file on communication channel
I saw this when running the "Database Configuration Assistant" and "sqlplus". When the "Database Configuration Assistant" gave me this error during Oracle 9i (9.2.0) installation on Red Hat 2.1 AS, I simply removed the shared memory segments owned by the Oracle user and I restarted the "Database Configuration Assistant". I'm not sure if this is the right way but it always worked for me. Here is what I did to get the "Database Configuration Assistant" running again:
I executed the ipcs command to get the address of the shared memory segments that have been allocated by Oracle:
# ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 0 root 600 196608 2
0x00000001 32769 root 600 655360 2
0x00000000 458755 oracle 660 4194304 0
0x00000000 491524 oracle 660 33554432 0
0x00000000 524293 oracle 660 33554432 0
0x00000000 557062 oracle 660 33554432 0
0x00000000 589831 oracle 660 33554432 0
0x00000000 622600 oracle 660 33554432 0
0x00000000 655369 oracle 660 33554432 0
0x00000000 688138 oracle 660 33554432 0
0x3ecee0b0 720907 oracle 660 4194304 0
------ Semaphore Arrays --------
key semid owner perms nsems status
------ Message Queues --------
key msqid owner perms used-bytes messages
#
Then I removed all shared memory segments that were owned by the Oracle user during the installation with the following command:
# ipcrm shm 458755 491524 524293 557062 589831 622600 655369 688138 720907
After that I restarted the "Database Configuration Assistant". Once the installation was done I immediately restarted the DB as well.
Caveat: I'm not sure if this procedure can cause any other problems if it's done during the installation.
But if you get this problem in connection with sqlplus, then simply make sure that the database is down and exit sqlplus. After that, follow the procedure above by removing all shared memory segments that belong to the Oracle user. To my knowledge, this should not cause any problems.
参考资料
http://www.puschitz.com/OracleOnLinux.shtml |
|