10.20下午,接到任务,说是要在客户的Linux系统上安装Oracle 11G数据库搭建一个测试环境。
赶紧联系客户现场,远程过去。
cat /etc/issue
发现是Oracle Enterprise Linux 6.0。
接着,想通过yum安装Oracle的依赖包。
cd /etc/y/etc/yum.repos.d
wget http://public-yum.oracle.com/public-yum-ol6.repo
发现虚拟机无法解析域名。将域名改成IP,也不可行。下载不了repo
检查网卡配置以及/etc/resolv.conf, 最后折腾了半天, 在/ect/resolv.conf中增加了一个nameserver 8.8.8.8
最终,可以成功的wget以及 oracle-rdbms-server-11gR2-preinstall
但是这个与oracle 12c原装不同,预安装完成后并没有创建相关的用户组与oracle用户。
创建用户组:groupadd oinstall
groupadd dba
groupadd oper
创建用户: useradd -g oinstall -G dba,oper oracle
随后修改oracle用户密码: passwd oracle
随后增加必要的参数:
修改内核参数文件:/etc/sysctl.conf
添加如下内容:
编辑系统资源限制配置文件 vi /etc/security/limits.conf,在该文件下添加如下行:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
编辑文件 vi /etc/pam.d/login,添加如下行
session required pam_limits.so
编辑 vi /etc/profile 文件,添加如下行
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
编辑文件 vi /home/oracle/.bash_profile,添加如下行:
ORACLE_BASE=/opt/oracle; #安装目录
ORACLE_HOME=$ORACLE_BASE/11g;
ORACLE_SID=orcl; #实例名
LD_LIBRARY_PATH=$ORACLE_HOME/lib;
PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin;
export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH;
保存退出后执行如下命令使以上设置立即生效:
source /home/oracle/.bash_profile
因为数据库安装文件是放在光盘里的,而且是挂载在另外一个用户下的,没权限去访问光盘文件,
没法子,只好把光盘里的文件通过root用户拷贝到/home/oracle/install下,拷贝完成后通过
修改安装文件的owner
chown -R oracle:oinstall *
修改安装文件的权限
chmod -R 755 *
通过图形界面启动安装程序:
./runInstaller
这里碰到了问题, 安装程序启动到了一半,崩溃了。
出现了类似错误:
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0x00000036d1614d70, pid=4234, tid=140183010223888
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_17-b03 mixed mode)
# Problematic frame:
# C [ld-linux-x86-64.so.2+0x14d70]
#
# An error report file with more information is saved as hs_err_pid4234.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
不知所以然,只好谷歌:
关键字:
因为参数
不过这些参数的意义,应该弄明白
赶紧联系客户现场,远程过去。
cat /etc/issue
发现是Oracle Enterprise Linux 6.0。
接着,想通过yum安装Oracle的依赖包。
cd /etc/y/etc/yum.repos.d
wget http://public-yum.oracle.com/public-yum-ol6.repo
发现虚拟机无法解析域名。将域名改成IP,也不可行。下载不了repo
检查网卡配置以及/etc/resolv.conf, 最后折腾了半天, 在/ect/resolv.conf中增加了一个nameserver 8.8.8.8
最终,可以成功的wget以及 oracle-rdbms-server-11gR2-preinstall
但是这个与oracle 12c原装不同,预安装完成后并没有创建相关的用户组与oracle用户。
创建用户组:groupadd oinstall
groupadd dba
groupadd oper
创建用户: useradd -g oinstall -G dba,oper oracle
随后修改oracle用户密码: passwd oracle
随后增加必要的参数:
修改内核参数文件:/etc/sysctl.conf
添加如下内容:
fs.file-max = 6815744
fs.aio_max_nr=1048576
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
在安装的时候漏掉了
kernel.shmmax = 2147483648导致预检查以及创建数据库的时候出错了。
编辑系统资源限制配置文件 vi /etc/security/limits.conf,在该文件下添加如下行:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
编辑文件 vi /etc/pam.d/login,添加如下行
session required pam_limits.so
编辑 vi /etc/profile 文件,添加如下行
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
编辑文件 vi /home/oracle/.bash_profile,添加如下行:
ORACLE_BASE=/opt/oracle; #安装目录
ORACLE_HOME=$ORACLE_BASE/11g;
ORACLE_SID=orcl; #实例名
LD_LIBRARY_PATH=$ORACLE_HOME/lib;
PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin;
export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH;
保存退出后执行如下命令使以上设置立即生效:
source /home/oracle/.bash_profile
因为数据库安装文件是放在光盘里的,而且是挂载在另外一个用户下的,没权限去访问光盘文件,
没法子,只好把光盘里的文件通过root用户拷贝到/home/oracle/install下,拷贝完成后通过
修改安装文件的owner
chown -R oracle:oinstall *
修改安装文件的权限
chmod -R 755 *
通过图形界面启动安装程序:
./runInstaller
这里碰到了问题, 安装程序启动到了一半,崩溃了。
出现了类似错误:
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0x00000036d1614d70, pid=4234, tid=140183010223888
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_17-b03 mixed mode)
# Problematic frame:
# C [ld-linux-x86-64.so.2+0x14d70]
#
# An error report file with more information is saved as hs_err_pid4234.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
不知所以然,只好谷歌:
关键字:
an unexpected error has been detected by hotspot virtual machine sigseg
最后答案:
To fixed this error, execute this command on shell before launching the oracle runInstaller
export LD_BIND_NOW=1
设置个环境变量:
LD_BIND_NOW=1
此处需要科学上网:
http://www.mr2t.com/oracle-database-11gr2-runinstaller-an-unexpected-error-ld-linux-x86-64-so-20x14d70
接着启动安装程序,一路下一步。
最后答案:
To fixed this error, execute this command on shell before launching the oracle runInstaller
export LD_BIND_NOW=1
设置个环境变量:
LD_BIND_NOW=1
此处需要科学上网:
http://www.mr2t.com/oracle-database-11gr2-runinstaller-an-unexpected-error-ld-linux-x86-64-so-20x14d70
因为参数
kernel.shmmax没有设置引起的数据库创建的错误,可以通过再添加这个参数,重新创建数据库的方式去解决。
这个并不影响数据库软件的安装。
不过这些参数的意义,应该弄明白
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8520577/viewspace-1815313/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8520577/viewspace-1815313/