虚拟机必须能连网,可以使用yum命令
yum install libstdc* libstdc++* libstdc++-devel make* pdksh* sysstat* xscreensaver*
libaio* libaio-devel* glibc-devel* glibc-headers* openmotif compat-gcc-32* compat-gcc*
binutils* compat-db* compat-libstdc* control-center* gcc-c++* glibc-common* libgcc-*
libgomp* libXp* unix-ODBC* unix-ODBC-devel* -y
首先安装虚拟机>1G内存,且防火墙禁用状态,selinux禁用状态。
检查cpu
grep "model name" /proc/cpuinfo
检查处理器
cat /proc/cpuinfo | grep "processor" | wc -l
检查进程
grep "physical id" | sort | uniq | wc -l
检查内存
grep MemTotal /proc/meminfo
检查Swap内存
grep SwapTotal /proc/meminfo
检查实际内存的使用情况
free -g
检查磁盘使用情况
df -h
检测操作系统版本
uname -m
uname -r
more /etc/redhat-release
uname -a
lsb_release -id
groupadd dba
groupadd oinstall
useradd -g oinstall -G dba oracle
id oracle
passwd oracle
创建安装目录,并授予权限
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
vi /etc/sysconfig/selinux
SELINUX=disabled
需要重启系统
查看基本参数
getconf PAGESIZE
sysctl -a | grep sem
sysctl -a | grep shm
sysctl -a | grep file-max
sysctl -a | grep ip_local_port_range
备份文件
cp /etc/sysctl.conf /etc/sysctl.conf.bak
添加或修改参数
vi /etc/sysctl.conf
kernel.shmmax = 68719476736
kernel.shmall = 6029312
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 9000 65500
fs.file-max = 6815744
fs.aio-max-nr = 1048576
执行使之生效
sysctl -p
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
oracle hard stack 10240
vi /etc/pam.d/login文件中添加
session required /lib/security/pam_limits.so
session required pam_limits.so
vi /etc/profile
if [ $USER = "oracle" ]; then
ulimit -u 16384
ulimit -n 65536
fi
首先切换到oracle账户 ,编辑修改主目录下 .bash_profile
修改vi .bash_profile,注意ORACLE_SID设置为实例名
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
mkdir -p /u01/app/oralnventory
chown -R oracle:oinstall /u01/app/oralnventory
chmod -R 775 /u01/app/oralnventory
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
切换到oracle用户下,当执行runInstaller出现图像界面乱码时执行以下命令
执行
export LANG=en_US
./orainstRoot.sh
./root.sh
netca
出现“Oracle Net Configuration”配置界面,选择“监听程序配置”
弹出 DBCA 的欢迎界面
{ORACLE_DATE}/oradata
ORA-00845: MEMORY_TARGET not supported on this system
[oracle@wyf ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 03-APR-2017 12:13:49
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/wyf/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=wyf)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=wyf)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 03-APR-2017 12:13:50
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/wyf/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=wyf)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@wyf ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 3 12:14:20 2017
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 830930944 bytes
Fixed Size 2217912 bytes
Variable Size 503318600 bytes
Database Buffers 322961408 bytes
Redo Buffers 2433024 bytes
????????
????????
vi /etc/fstab
tmpfs /dev/shm tmpfs defaults,size=1G 0 0
lsof |grep shm
mount /dev/shm
df -h|grep shm
设置完后重新启动监听服务,数据库服务
[root@wyf ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 36G 13G 22G 37% /
tmpfs 1.0G 76K 1.0G 1% /dev/shm
/dev/sda1 190M 40M 140M 23% /boot
/dev/sr0 3.7G 3.7G 0 100% /media/CentOS_6.7_Final