ubuntu-14.04.1-server-amd64安装Oracle_linux.x64_11gR2_database
1参考《Ubuntu系统安装.mm》《安装和配置ubuntu系统.doc》文档安装系统,并配置网络连接;2更新系统(联网情况下可选,需测试离线安装)
●工具和用户:Xshell、root
●1)使用root用户登录;
●2)执行更新系统命令:
○>>apt-get update
○>>apt-get dist-upgrade
■PS:须确认安装,选择Y
3安装Ubuntu桌面应用程序
●工具和用户:Xshell、root
●1)安装桌面程序命令:
○>>apt-get install xubuntu-desktop
■PS:须确认安装,选择Y
4安装Oracle所需的依赖包
●工具和用户:Xshell、root
●1)下载依赖包列表的命令:
○>>apt-get install automake autotools-dev binutils bzip2 elfutils expat gawk gcc gcc-multilib g++-multilib ia32-libs ksh less lesstif2 lesstif2-dev lib32z1 libaio1 libaio-dev libc6-dev
libc6-dev-i386 libc6-i386 libelf-dev libltdl-dev libmotif4 libodbcinstq4-1 libodbcinstq4-1:i386
libpth-dev libpthread-stubs0 libpthread-stubs0-dev libstdc++5 lsb-cxx make openssh-server pdksh
rlwrap rpm sysstat unixodbc unixodbc-dev unzip x11-utils zlibc
●2)逐个安装依赖包列表
○apt-get install automake
■PS:更新
○apt-get install autotools-dev
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install binutils
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install bzip2
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install elfutils
■PS:更新
○apt-get install expat
■PS:更新
○apt-get install gawk
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install gcc
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install gcc-multilib
■PS:更新
○apt-get install g++-multilib
■PS:更新
○apt-get install ia32-libs
■PS:报错,提示见样例,安装替换文件
●报错样例:
Reading Done
Building dependency tree
Reading Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
lib32z1 lib32ncurses5 lib32bz2-1.0
○apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
■PS:更新
○apt-get install ksh
■PS:更新
○apt-get install less
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install lesstif2
■PS:报错,提示【Unable to locate package lesstif2】
■PS:跳过
○apt-get install lesstif2-dev
■PS:报错,提示见样例,安装替换文件
●报错样例:
root@VYSer13:~# apt-get install lesstif2-dev
Reading Done
Building dependency tree
Reading Done
Package lesstif2-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
■PS:替换
●Replaces:
lesstif-dev
lesstifg-dbg
lesstifg-dev
libmotif-dev
○apt-get install libmotif4
■PS:更新
○apt-get install lib32z1
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install libaio1
■PS:更新
○apt-get install libaio-dev
■PS:更新
○apt-get install libc6-dev
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install libc6-dev-i386
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install libc6-i386
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install libelf-dev
■PS:更新
○apt-get install libltdl-dev
■PS:更新
○apt-get install libodbcinstq4-1 libodbcinstq4-1:i386
■PS:更新
○apt-get install libpth-dev
■PS:更新
○apt-get install libpthread-stubs0
■PS:报错,提示【Unable to locate package libpthread-stubs0】○apt-get install libpthread-stubs0-dev
■PS:更新
○apt-get install libstdc++5
■PS:更新
○apt-get install lsb-cxx
■PS:更新
○apt-get install make
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install openssh-server
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install pdksh
■PS:更新
○apt-get install rlwrap
■PS:更新
○apt-get install rpm
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install sysstat
■PS:更新
○apt-get install unixodbc
■PS:更新
○apt-get install unixodbc-dev
■PS:更新
○apt-get install unzip
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install x11-utils
■PS:已存在【0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded】○apt-get install zlibc
■PS:更新
5创建用户(此步不能省略,不能使用root用户安装)
●工具和用户:Xshell、root
●参考命令
○>>groupadd oinstall
○>>groupadd dba
○>>useradd -g oinstall -G dba -d /opt/oracle -s /bin/bash oracle
○>>passwd oracle
■oracle/oracle
●使用root用户修改oracle用户密码
○>>passwd oracle
■oracle/oracle
6检查并更新系统变量
●工具和用户:Xshell、root
●1)检查并记录系统变量
○/sbin/sysctl -a | grep sem
■root@VYSer13:~# /sbin/sysctl -a | grep sem
kernel.sem = 250 32000 32 128
kernel.sem_next_id = -1
○/sbin/sysctl -a | grep shm
■root@VYSer13:~# /sbin/sysctl -a | grep shm
kernel.shm_next_id = -1
kernel.shm_rmid_forced = 0
kernel.shmall = 2097152
kernel.shmmax = 33554432
kernel.shmmni = 4096
vm.hugetlb_shm_group = 0
○/sbin/sysctl -a | grep file-max
■root@VYSer13:~# /sbin/sysctl -a | grep file-max
fs.file-max = 200672
○/sbin/sysctl -a | grep aio-max
■root@VYSer13:~# /sbin/sysctl -a | grep aio-max
fs.aio-max-nr = 65536
○/sbin/sysctl -a | grep ip_local_port_range
■root@VYSer13:~# /sbin/sysctl -a | grep ip_local_port_range
net.ipv4.ip_local_port_range = 32768 61000
○/sbin/sysctl -a | grep rmem_default
■root@VYSer13:~# /sbin/sysctl -a | grep rmem_default
○/sbin/sysctl -a | grep rmem_max
■root@VYSer13:~# /sbin/sysctl -a | grep rmem_max
○/sbin/sysctl -a | grep wmem_default
■root@VYSer13:~# /sbin/sysctl -a | grep wmem_default
○/sbin/sysctl -a | grep wmem_max
■root@VYSer13:~# /sbin/sysctl -a | grep wmem_max
●2)然后根据上面命令中得到的参数值在【/f】中增加对应数据,比如:
○>>vim /f
○fs.aio-max-nr = 65536
fs.file-max = 200672
kernel.shmall = 2097152
kernel.shmmax = 33554432
kernel.shmmni = 4096
kernel.sem = 250 32000 32 128
net.ipv4.ip_local_port_range = 32768 61000
●3)运行一下命令更新内容参数:
○>>sysctl -p
7添加对当前用户的内核限制
●工具和用户:Xshell、root
●1)在【/etc/f】文件中增加以下数据(***为当前用户名,以oracle为例)
○>>vim /etc/f
○oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
8添加系统资源限制参数
●工具和用户:Xshell、root
●1)在【/etc/pam.d/login】文件中,增加以下行(有了就不用增加了)
○>>vim /etc/pam.d/login
○增加行【session required pam_limits.so】
●2)在【/etc/pam.d/su】文件中,增加以下行
○>>vim /etc/pam.d/su
○增加行或取消注释【session required pam_limits.so】
9创建用于安装Oracle的文件夹并设置其所有权(家目录设置)
●工具和用户:Xshell、root
●1)创建Oracle安装目录文件夹
○>>mkdir -p /opt/oracle
○>>mkdir -p /opt/oraInventory
●2)使用root用户,对手动创建用户,需要设置其所有权(家目录):
○>>chown -R oracle:oinstall /opt/oracle
○>>chown -R oracle:oinstall /opt/oraInventory
○PS:如果跳过了第四步,那就将所有权设置命令中的用户oracle和组oinstall改为自己当前用户和组(通常二者是一样的),当然这时也可以不执行这两个chown命令,本来目录创建者就
是所有者了。另外,需要root权限执行这些命令(sudo,下同)
10安装JDK环境
●工具和用户:Xshell、root
●1)下载JDK6版本【jdk-6u45-linux-x64.bin】(考虑到兼容性问题,安装6)
●2)创建【/usr/lib/jdk】目录
○>>mkdir -p /usr/lib/jdk/
●3)将JDK6放到【/usr/lib/jdk】目录下,可使用工具Xftp或WinSCP
●4)为JDK6安装包,赋予可执行权限
○>>cd /usr/lib/jdk
○>>chmod 777 jdk-6u45-linux-x64.bin
●5)解压出【jdk1.6.0_45】文件夹
○>>./jdk-6u45-linux-x64.bin
●6)设置Java环境
○ a. 打开配置文件
■>>vim /etc/profile
○ b. 在文件最后添加设置Java环境变量信息
■#JDK set java environment
JA V A_HOME=/usr/lib/jdk/jdk1.6.0_45
JRE_HOME=${JA V A_HOME}/jre
export ANDROID_JA V A_HOME=$JA V A_HOME
export CLASSPA TH=.:${JA V A_HOME}/lib:$JRE_HOME/lib:$CLASSPATHxshell下载
export JA V A_PATH=${JA V A_HOME}/bin:${JRE_HOME}/bin
export JA V A_HOME;
export JRE_HOME;
export CLASSPATH;
HOME_BIN=~/bin/
export PA TH=${PATH}:${JA V A_PATH}:${HOME_BIN};
○ c. 重启计算机,用命令测试JDK的版本
■>>reboot
■>>java -version
●PS:配置成功,提示
○root@VYSer13:~# java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
11为Oracle配置环境变量
●工具和用户:Xshell、root
●1)进入到主文件夹下的.bashrc配置文件中;
○>>cd
○>>ll
●2)在【.bashrc】配置文件中加入如下内容:
○#Oracle
#这个写刚刚创建的文件夹
export ORACLE_BASE=/opt/oracle/
#这个后面可以随便填写
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
#数据库的sid
export ORACLE_SID=orcl
export ORACLE_UNQNAME=orcl
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论