cd /media/VMware\ Tools/
cp VMwareTools-10.0.0-*.tar.gz ~
cd ~
tar zxf VMwareTools-10.0.0-*.tar.gz
rm VMwareTools-10.0.0-*.tar.gz
cd vmware-tools-distrib/
./vmware-intall.pl
之后一路回车即可
创建oracle用户及管理组
以root用户登录linux,执行以下命令
#groupadd dba 创建管理组
#groupadd oinstall 创建安装组
#useradd oracle -g oinstall -G dba
#passwd oracle
oracle
检查是否存在 nobody 用户:idnobody ,没有则添加: Useradd nobody
创建用于安装 oracle 的目录结构并赋权:
#mkdir /opt/oracle/
#mkdir /opt/oracle/oradata
#mkdir /opt/oracle/product
#chown -R oracle.oinstall /opt/oracle
#mkdir /opt/oraInventory
#chown -R oracle.oinstall /opt/oraInventory/
建立 oracle 环境变量:
使用上面创建的 oracle 用户登录:
#su - oracle
$vi /home/oracle/.bash_profile
在文件中添加如下:
umask 022
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
保存退出
--执行以下命令让配置马上生效或以 oracle 用户登录使设置生效
$source $HOME/.bash_profile
fs.file-max=6815744
fs.aio-max-nr= 1048576
kernel.shmall= 2097152
kernel.shmmax=2147483648
kernel.shmmni=4096
kernel.sem=25032000100128
net.ipv4.ip_local_port_range= 900065500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default= 262144
net.core.wmem_max= 1048576
修改后运行"/sbin/sysctl -p"命令使得内核改变立即生效
对oracle用户进行限制配置:
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384 //对 oracle 用户的 process 最大 16384 个
oracle soft nofile 1024
oracle hard nofile 65536 //对 oracle 用户文件数量限制是 65535 个
编辑文件:vi /etc/pam.d/login 加入以下语句(可能应该加在最后一条规则之前):
session required /lib64/security/pam_limits.so
session required pam_limits.so
解压oracle:
前面已经解压设置成共享目录,可以跳过解压,但需要移动到根目录改权限,如果没有解压直接上传到服务器的,可以执行如下命令:
#unzip linux*_1of2.zip
#unzip linux*_2of2.zip
注意解压好的目录用户oracle必须具有读写和执行的权限,可以将目录的用户和用户组设置为oracle。也可以拷贝到$ORACLE_BASE或者oracle用户的home下:
#chown -R oracle database
#chgrp -R oinstall database
reboot并以oracle登录,进入图形界面
#cd database
#./runInstaller
这里会出现内核参数配置不对,可能是前面配置内核的参数是参考安装oracle 11g的参数的问题,依赖包也缺少
(1)解决依赖包
因为这里安装Redhat6.6的时候没有注册,没有线上源,这里先说明一下如何配置本地源
1)虚拟机挂在安装Redhat6.6的镜像
2)添加本地源:
# cd /etc/yum.repos.d/
# vi rhel-source.repo
最后添加:
[rhel_local_01]
name=Red Hat Enterprise Linux $releasever - $basearch - Source33333
baseurl=file:///media/"RHEL-6.6 Server.x86_64"
gpgcheck=1
# yum clean all
导入公钥:
rpm --import /etc/pki/rpm-gpg/RPM*
3)安装依赖
[root@localhost ~]# yum install compat-libcap1 compat-libstdc++-33 libstdc++-devel gcc gcc-c++ ksh libaio-devel
依赖关系解决
============================================ ============================================
软件包 架构 版本 仓库 大小
========================================================================================
正在安装:
compat-libcap1 x86_64 1.10-1 rhel-local-01 17 k
compat-libstdc++-33 x86_64 3.2.3-69.el6 rhel-local-01 183 k
gcc x86_64 4.4.7-11.el6 rhel-local-01 10 M
gcc-c++ x86_64 4.4.7-11.el6 rhel-local-01 4.7 M
ksh x86_64 20120801-21.el6 rhel-local-01 758 k
libaio-devel x86_64 0.3.107-10.el6 rhel-local-01 13 k
libstdc++-devel x86_64 4.4.7-11.el6 rhel-local-01 1.6 M
为依赖而安装:
cloog-ppl x86_64 0.15.7-1.2.el6 rhel-local-01 93 k
cpp x86_64 4.4.7-11.el6 rhel-local-01 3.7 M
mpfr x86_64 2.4.1-6.el6 rhel-local-01 156 k
ppl x86_64 0.10.2-11.el6 rhel-local-01 1.3 M
事务概要
========================================================================================
Install 11 Package(s)
总下载量:23 M
Installed size: 56 M
确定吗?[y/N]:y
已安装:
compat-libcap1.x86_64 0:1.10-1 compat-libstdc++-33.x86_64 0:3.2.3-69.el6
gcc.x86_64 0:4.4.7-11.el6 gcc-c++.x86_64 0:4.4.7-11.el6
ksh.x86_64 0:20120801-21.el6 libaio-devel.x86_64 0:0.3.107-10.el6
libstdc++-devel.x86_64 0:4.4.7-11.el6
作为依赖被安装:
cloog-ppl.x86_64 0:0.15.7-1.2.el6 cpp.x86_64 0:4.4.7-11.el6 mpfr.x86_64 0:2.4.1-6.el6
ppl.x86_64 0:0.10.2-11.el6
[root@localhost ~]# /tmp/CVU_12.1.0.2.0_oracle/runfixup.sh
内核参数变化如下:(通过/sbin/sysctl -p命令)
修改前:
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmmni = 4096
kernel.sem = 25032000100128
error: "Invalid argument" setting key "net.ipv4.ip_local_port_range"
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
修改后:
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmmni = 4096
kernel.sem = 930699040 32000 100 128
net.ipv4.ip_local_port_range = 9000 65535
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
保存响应文件,以备以后静默安装oralce使用
之后等待即可
执行配置脚本:
[root@localhost ~]# /opt/oraInventory/orainstRoot.sh
更改权限/opt/oraInventory.
添加组的读取和写入权限。
删除全局的读取, 写入和执行权限。
更改组名/opt/oraInventory 到 oinstall.
脚本的执行已完成。
[root@localhost ~]# /opt/oracle/product/12.1.0/dbhome_1/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /opt/oracle/product/12.1.0/dbhome_1
Enter the full pathname of the local bin directory: [/usr/local/bin]: /usr/local/bin
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
命令行显示此次安装日志的位置:
.[oracle@localhost database]$
[oracle@localhost database]$ 可以在以下位置找到本次安装会话的日志:
/opt/oraInventory/logs/installActions2015-12-14_12-39-07PM.log
执行命令
$netca
进入图形化配置,直接默认下一步,到最后完成,其中你也可以修改监听器的名称,协议,端口
命令行显示
Oracle Net Services 配置:
正在配置监听程序:LISTENER
监听程序配置完成。
Oracle Net 监听程序启动:
正在运行监听程序控制:
/opt/oracle/product/12.1.0/dbhome_1/bin/lsnrctl start LISTENER
监听程序控制完成。
监听程序已成功启动。
成功完成 Oracle Net Services 配置。退出代码是0
配置oracle随机启动
(1)修改/etc/oratab文件,需要将orcl:/opt/oracle/product/12.1.0/dbhome_1:N最后的N改成Y(如果/etc/oratab文件不存在,则需要使用root用户执行$ORACLE_HOME/root.sh文件)
#cat /etc/oratab
orcl:/opt/oracle/product/12.1.0/dbhome_1:Y
(2)使用oracle的安装用户(oracle)修改$ORACLE_HOME/bin/dbstart文件,修改之前最好备份一下,使用如下命令
#cp $ORACLE_HOME/bin/dbstart $ORACLE_HOME/bin/dbstart.bak
找到
ORACLE_HOME_LISTNER=...,
修改成
ORACLE_HOME_LISTNER=/opt/oracle/product/12.1.0/dbhome_1
或者直接修改成:
ORACLE_HOME_LISTNER=$ORACLE_HOME
(3)测试运行dbshut, dbstart
1)修改dbstart和dbshut的日志文件的权限(如果这两个文件不存在,先手工touch):
root用户先创建这两个文件,不创建也可以,系统会自动创建在$ORACLE_HOME下。
#cd $ORACLE_HOME/bin
#touch startup.log
#chown oracle.oinstall startup.log
#chmod 755 startup.log
#touch shutdown.log
#chown oracle.oinstall shutdown.log
#chmod 755 shutdown.log
#ls -l startup.log shutdown.log
2)执行相应的脚本进行测试
#su - oracle
$cd $ORACLE_HOME
$dbshut (or dbstart)
3)创建oracle服务启动脚本oradb(使用root用户),创建后可以使用oradb start|stop 命令。
#touch /home/oracle/oradb
#chown oracle.oinstall /home/oracle/oradb
#chmod 775 /home/oracle/oradb
脚本内容如下:
#!/bin/sh
# description: Oracle auto start-stop script.
# chkconfig: - 20 80
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/opt/oracle/product/12.1.0/dbhome_1/
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
;;
'restart')
$0 stop
$0 start
;;
esac
把该脚本copy到/etc/init.d/目录下
#cp /home/oracle/oradb /etc/init.d/oradb
将oradb加入到系统启动列表中
#chkconfig --add /home/oracle/oradb 注:一定要在/etc/init.d/目录下执行
#chkconfig --list oradb
测试快速启动命令:
#/etc/init.d/oradb stop
#/etc/init.d/oradb start
重启linux #reboot 在linux启动的时候,会偏慢
# su - oracle
# ps -ef | grep ora
(4)测试连接数据库
用oracle用户远程登陆,然后
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.2.0 Production on Mon Dec 14 23:30:15 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> create table testUser(id integer, name char(10));
Table created.
SQL> insert into testUser values(0, 'Jack');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from testUser;
ID NAME
---------- ----------
0 Jack
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
到此,oracle安装完毕
oracle自启动脚本
安装Linux版本的oracle11g单机版.PDF
Oracle Enterprise Manager 12c 安装过程