这几天在SUSE 10下安装oracle 11g遇到了很多问题,在网上也搜索不到很有用的文档,搞的人很烦躁,经过这些天和同事的一起努力,终于把安装过程中遇到的问题基本都给解决了。总结于苏州:
linux-aps:~ # id oracle
id: oracle: No such user
linux-aps:~ # /usr/sbin/groupadd oinstall
groupadd: Group `oinstall' already exists.
linux-aps:~ # /usr/sbin/groupadd dba
groupadd: Group `dba' already exists.
linux-aps:~ # id oracle
id: oracle: No such user
SUSE 10在安装后如果存在oracle,但不能切换到oracle用户下,应先删除oracle用户,再重新建立:
userdel oracle
在切换到oracle用户下之前应先查看/home目录下有没有oracle用户文件夹,如没有应先建立:
mkdir -p /home/oracle
chown -R oracle:oinstall /home/oracle
chmod -R 775 /home/oracle
linux-aps:~ # /usr/sbin/useradd -g oinstall -G dba oracle
linux-aps:~ # id oracle
uid=1000(oracle) gid=103(oinstall) groups=103(oinstall),104(dba)
linux-aps:~ # passwd oracle
Changing password for oracle.
New Password:
Bad password: too simple
Reenter New Password:
Password changed.
linux-aps:~ # su - oracle
oracle@linux-aps:~> su -
口令:
linux-aps:~ # id nobody
uid=65534(nobody) gid=65533(nobody) groups=65533(nobody),65534(nogroup)
linux-aps:~ #
linux-aps:~ # uname -r --检查suse linux 内核版本
2.6.16.60-0.21-default
linux-aps:~ # rpm -q gcc make binutils openmotif --检查gcc make binutils openmotif这些软件是否存在及其版本号
gcc-4.1.2_20070115-0.21
make-3.80-202.2
binutils-2.16.91.0.5-23.31
package openmotif is not installed
linux-aps:~ #
linux-aps:~ # mkdir -p /opt/oracle
linux-aps:~ # chown -R oracle:oinstall /opt/oracle
linux-aps:~ # chmod -R 775 /opt/oracle/
linux-aps:~ # su - oracle
oracle@linux-aps:~ # vi .profile
umask 022
Oracle_BASE=/opt/oracle
Oracle_HOME=$Oracle_BASE/10.2/db_1
Oracle_SID=TBSTICKET
PATH=$Oracle_HOME/bin:$PATH
export Oracle_BASE Oracle_HOME Oracle_SID PATH --这段红色代码可以不写入.profile文件
oracle@linux-aps:~> . ./.profile
oracle@linux-aps:~> DISPLAY=192.168.60.51:0.0 --写入本机IP
oracle@linux-aps:~> export DISPLAY
oracle@linux-aps:~> echo $DISPLAY
192.168.60.51:0.0
oracle@linux-aps:~> Oracle_BASE=/opt/oracle
oracle@linux-aps:~> Oracle_HOME=$Oracle_BASE/10.2/db_1
oracle@linux-aps:~> Oracle_SID=TBSTICKET --创建DB实例名
oracle@linux-aps:~> export Oracle_BASE Oracle_SID
注:以上部分为oracle安装前的配置工作
把解压后的oracle 11g安装文件放入/opt/oracle文件夹下
oracle@linux-aps:/> cd /opt/oracle
linux-yx:/opt/oracle # ls -lh
total 36K
drwxr-x--- 3 oracle oinstall 4.0K Jan 27 17:25 admin
drwxr-xr-x 5 oracle oinstall 4.0K Jan 27 17:31 cfgtoollogs
drwxrwxr-x 11 oracle oinstall 4.0K Jan 27 17:25 diag
drwxr-x--- 3 oracle oinstall 4.0K Jan 27 17:26 flash_recovery_area
drwxrwxr-x 5 oracle oinstall 4.0K Jan 27 05:14 linux_11gR1_database_1013
-rw------- 1 root root 522 Jan 27 18:34 new file
drwxrwx--- 5 oracle oinstall 4.0K Jan 27 17:24 oraInventory
drwxr-x--- 3 oracle oinstall 4.0K Jan 27 17:25 oradata
drwxr-xr-x 3 oracle oinstall 4.0K Jan 27 05:36 product
linux-yx:/opt/oracle # cd linux_11gR1_database_1013/
linux-yx:/opt/oracle/linux_11gR1_database_1013 # ls -lh
total 28K
-rwxrwxr-x 1 oracle oinstall 124 Oct 6 2008 README
drwxrwxr-x 11 oracle oinstall 4.0K Jan 27 05:07 doc
drwxrwxr-x 5 oracle oinstall 4.0K Jan 27 05:07 install
-rwxrwxr-x 1 oracle oinstall 2.9K Sep 26 2008 runInstaller
drwxrwxr-x 14 oracle oinstall 4.0K Jan 27 05:14 stage
-rwxrwxr-x 1 oracle oinstall 4.8K Sep 26 2008 welcome.html
linux-yx:/opt/oracle/linux_11gR1_database_1013 #
oracle 11g安装文件放入/opt/oracle后,退出SUSE系统,重新使用oracle用户登录;
再次为/opt/oracle赋权:
chown -R oracle:oinstall /opt/oracle
chmod -R 775 /opt/oracle/
oracle@linux-aps:/> locale --查看字符集
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=
oracle@linux-aps:/> export LC_CTYPE=en_US.UTF-8 --添加系统字符集
linux-ora01:~ # lsb_release -a
LSB Version: core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64:desktop-3.1-amd64:desktop-3.1-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.1-amd64:graphics-3.1-noarch
Distributor ID: SUSE LINUX
Description: SUSE Linux Enterprise Server 10 (x86_64)
Release: 10
Codename: n/a
linux-ora01:~ # uname -a
Linux linux-ora01 2.6.16.60-0.54.5-smp #1 SMP Fri Sep 4 01:28:03 UTC 2009 x86_64 x86_64 x86_64 GNU/Linux
linux-ora01:~ # env | grep ORA --查看环境变量信息
ORA_CRS_HOME=/opt/oracle/product/10gR2/crs
ORA_ASM_HOME=/opt/oracle/product/10gR2/asm
ORACLE_SID=orcl
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/product/10.2/db_1