Ubuntu 10.10上安装Oracle 11g R2记录
1.准备工作
1.1 若是server版,需安装图形界面
$ sudo apt-get install ubuntu-desktop
1.2 安装必要的库包
$ sudo apt-get install build-essential libaio1 gawk ksh libmotif3 alien libtool lsb-rpm
$sudo apt-get install libstdc++5 此步很重要,不安装的话会出现makefileexception error in invoking target 'install' of makefile ins_ctx.mk错误。原因为ubuntu10+默认使用libstdc++6作为默认版本。
1.3 创建一些命令的软连接
$ su -
# ln -sf bash /bin/sh
# ln -s /usr/bin/awk /bin/awk
# ln -s /usr/bin/rpm /bin/rpm
# ln -s /usr/bin/basename /bin/basename
# mkdir /etc/rc.d
# for i in 0 1 2 3 4 5 6 s ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
2. 创建oracle相关用户及用户组,文件夹
2.1 创建oinstall , dba用户组
$ su -
# addgroup oinstall
# addgroup dba
2.2 创建oracle用户,并指定至以上创建的用户组
--创建oracle用户
# useradd -g oinstall -g dba -d /home/oracle -s /bin/bash oracle
--设置密码
# passwd oracle
2.3 创建文件夹
-- 创建oracle用户主目录
$ su -
# mkdir /home/oracle
# chown -r oracle:dba /home/oracle
--创建oracle_base目录
# mkdir -p /u01/oracle 此步注意 /u01默认占用“/“文件系统空间。此位置可更改,例如改为 /opt/oracle
# chown -r oracle:dba /u01
3. 设置系统参数
3.1 编辑/etc/sysctl.conf文件,添加以下参数到最后。注意:修改前应先备份此文件。
$ su -
# cp /etc/sysctl.conf /etc/sysctl.conf.bak
----------------------
添加以下参数到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.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 1048576
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 9000 65535
3.2 编辑/etc/security/limits.conf , 添加以下参数到文件末尾。
注:编辑前应先备份。
-----------
oracle soft nproc 2047
oracle hard nproc 16383
oracle soft nofile 1023
oracle hard nofile 65535
3.3 修改/etc/pam.d/login文件,添加以下两行参数:
session required /lib/security/pam_limits.so
session required pam_limits.so
3.4 激活sysctl.conf中配置
$ su -
# sysctl -p
3.5 修改/etc/profile,设置环境变量
oracle_sid=orcl
oracle_base=/u01/oracle
oracle_home=/u01/oracle/product/11.0.2
nls_lang=american_america.utf8
path=$oracle_home/bin:$path
export oracle_base oracle_sid oracle_home path nls_lang
4. 准备安装文件
4.1 从官方网站下载安装文件,文件拷贝至/u01下
$ unzip linux_11gr2_database_1of2.zip
$ unzip linux_11gr2_database_2of2.zip
总大小约2.2g,以上文件为32位。
4.2 解压缩后会出现database文件夹,此为安装文件。为安装文件指定相应权限。
$ sudo chmod 755 u01/oracle/database
$ sudo chmod 755 u01/oracle/database/*.*
$ sudo chmod 755 u01/oracle/database/install/.oui
$ sudo chmod 755 u01/oracle/database/install/*.*
$ sudo chmod 755 u01/oracle/database/install/unzip
$ chown -r oracle:dba /u01/database/
5. 开始安装
5.1 安装需要图形化界面,若出现 could not initialize class sun.awt.x11.xtoolkit 异常,应执行以下命令配置。
$ su -
# xhost +127.0.0.1
或
# export display=:0.0
5.2 开始安装
$ su - oracle
$ export lang=en_us
$ cd /u01/database
$ ./runinstaller -jreloc /opt/lib/jdk1.6.0_25 -ignoresysprereqs
指定jre目录,且忽略版本检查。
----------- 结束 -----------------
备注:
1. 在安装至 “ database configuration assist “ 时,,界面是空白的,这是正常现象。 此步需花费较长时间。此步成功后会弹出 实例名,服务名等信息提示窗口。
2. 安装成功后,在oracle用户下执行sqlplus system/pwd 可成功登录,但切换为 日常用户 后会报错。 因为在 日常用户 的环境变量中未指定oracle_sid. 修改 ~/.bashrc 或 ~/.bash_profile文件,添加export oracle_sid=orcl 即可。
若出现在 日常用户 下找不到sqlplus命令,则创建软连接至/bin下。
$ sudo ln -s $oracle_home/bin/sqlplus /bin/sqlplus

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号