记录我第一次在Linux上安装oracle10g遇到的错误:
要使用时,
su oracle
lnsrctl start
sqlplus
/ as sysdba
startup
退出时:
sqlplus
shutdown immediate
exit
cpio.gz解压错误
下载Oracle压缩包(cpio.gz格式)到windows,再ftp到Linux,在用gunzip解压文件时报错:invalid compressed data--format violated
原因是用windows自带的ftp时,默认以ASCII方式传送文件,而windows和linux文件中换行格式不同,导致这个错误。
ftp时用bin方式传送即可。
cpio文件时 控制台没反应
用 free -m 发现内存500M swap为0,需要增大(Oracle10g要求最少512m,1g)
>su root
#创建用于交换分区的文件,大小1G:
>dd if=/dev/zero of=/dev/swap bs=1k count=1024000
#设置Linux交换分区文件:
>mkswap /dev/swap
#立即启用交换分区文件:,执行后free -m 可看到swap
>swapon /dev/swap
#使开机时自启用,则需修改文件/etc/fstab中的swap行:
/dev/swap swap swap defaults 0 0
操作系统版本不支持
运行./runInstaller时,提示 Checking operating system version: must be redhat-2.1,redhat-3....
#查看当前版本 为RedHat 9
>rpm -q redhat-release
#对RedHat 9,可以通过修改/etc/redhat-release的方式,骗过校验
su - root
cp /etc/redhat-release /etc/redhat-release_bak
cat > /etc/redhat-release << EOF
Red Hat Enterprise Linux AS release 3 (Taroon)
EOF
#安装后,记得改回来
运行./runInstaller时,提示 Can't connect to X11.......
su - root
init 3
init 5
#以Oracle身份登陆再运行./runInstaller
安装界面乱码。
执行./runInstaller前,先
>LANG=C
>./runInstaller
安装前预检警告
在检查时,Checking Kernel Parameters有个Warning:semopm为32太小了(要求100)
For Oracle10g, the following kernel parameters have to be set to values greater than or equal to the recommended values which can be changed in the proc filesystem:
shmmax = 2147483648 (To verify, execute: cat /proc/sys/kernel/shmmax)
shmmni = 4096 (To verify, execute: cat /proc/sys/kernel/shmmni)
shmall = 2097152 (To verify, execute: cat /proc/sys/kernel/shmall) (for 10g R1)
shmmin = 1 (To verify, execute: ipcs -lm |grep "min seg size")
shmseg = 10 (It's hardcoded in the kernel - the default is much higher)
semmsl = 250 (To verify, execute: cat /proc/sys/kernel/sem | awk '{print $1}')
semmns = 32000 (To verify, execute: cat /proc/sys/kernel/sem | awk '{print $2}')
semopm = 100 (To verify, execute: cat /proc/sys/kernel/sem | awk '{print $3}')
semmni = 128 (To verify, execute: cat /proc/sys/kernel/sem | awk '{print $4}')
file-max = 65536 (To verify, execute: cat /proc/sys/fs/file-max)
ip_local_port_range = 1024 65000 (To verify, execute: cat /proc/sys/net/ipv4/ip_local_port_range)
NOTE: Do not change the value of any kernel parameter on a system where it is already higher than listed as minimum requirement.
用sqlplus连接DB时,提示没有设置ORACLE_HOME
安装完毕后,sqlplus老是连不上 在.bash_profile中添加
ORACLE_BASE=....
export ORACLE_BASE
ORACLE_HOME=....
export ORACLE_HOME
ORACLE_SID=...
export ORACLE_SID
需要注意:1)"="两边不能有空格;2)这样写不对,不能写到一行中。 ORACLE_BASE=....; export ORACLE_BASE
另外,在PATH后面追加:oracle/bin