打开VMware
选择稍后安装
自定义安装
小生安装的是64位的Centos
给虚拟机设置名称和安装位置
设置虚拟机打处理器并分配内存(oracle12G我建议内存为2G以上)
网络类型选择仅主机模式
按推荐来,创建新的虚拟磁盘
磁盘大小设为40G,不要太小,会有错误。指定磁盘文件路径
选择自定义硬件,将Centos ISO镜像文件挂载上
启动虚拟机,进入Centos安装界面
跳过检测
选择英文
键盘格式为英文
选择YES,清空数据
点击Configure Network
设置System eth0,可参考自己的主机(ipconfig)
上海时间
设置root密码
将Review。。选上
删除重建
添加/boot
添加swap分区
剩余空间给根/
默认
选择自己要安装的一些包!
开发工具一类
漫长的等待
安装完,重启
按引导来
不设置用户
将Kdump去掉。设置VMnet1的网络设置下(仔细看下)
上传oracle安装包
Ip设置为静态
[[email protected] ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=a479bd38-0b09-4afb-9cb5-2932caf4a5ac
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
HWADDR=00:0C:29:F9:14:8A
IPADDR=192.168.10.88
PREFIX=24
GATEWAY=192.168.10.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
停止ipv6服务,禁止ipv6开机启动
[[email protected] ~]# service ip6tables stop
[[email protected] ~]# chkconfig ip6tables off
[[email protected] ~]# service network restart
设置主机名为oracledb
[[email protected] ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=oracledb
GATEWAY=192.168.10.1
[[email protected] ~]# vi /etc/hosts
127.0.0.1 localhost oracledb localhost4 localhost4.localdomain4
::1 localhost oracledb localhost6 localhost6.localdomain6
192.168.10.88 oracledb
[[email protected] ~]# reboot
检查依赖包
binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
ksh
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6 (x86_64)
libaio-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6 (x86_64)
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)
检查存在
[[email protected] ~]# rpm -qa binutils*
安装
挂载centos镜像
[[email protected] ~]# mount
/dev/sda3 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
/dev/sr0 on /media/CentOS_6.5_Final
[[email protected] ~]# cd /media/CentOS_6.5_Final/Packages/
[[email protected] Packages]# ls compat-lib*
compat-libcap1-1.10-1.i686.rpm compat-libgfortran-41-4.1.2-39.el6.i686.rpm compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
compat-libcap1-1.10-1.x86_64.rpm compat-libgfortran-41-4.1.2-39.el6.x86_64.rpm compat-libtermcap-2.0.8-49.el6.i686.rpm
compat-libf2c-34-3.4.6-19.el6.i686.rpm compat-libstdc++-296-2.96-144.el6.i686.rpm compat-libtermcap-2.0.8-49.el6.x86_64.rpm
compat-libf2c-34-3.4.6-19.el6.x86_64.rpm compat-libstdc++-33-3.2.3-69.el6.i686.rpm
[[email protected] Packages]# rpm -ivh compat-libcap1-1.10-1.x86_64.rpm
创建用户和组
[[email protected] ~]# groupadd oinstall
[[email protected] ~]# groupadd dba
[[email protected] ~]# useradd -g oinstall -G dba oracle
[[email protected] ~]# passwd oracle
创建目录
[[email protected] ~]# mkdir /u01/app/oracle -p
You have mail in /var/spool/mail/root
[[email protected] ~]# chown -R oracle:oinstall /u01
[[email protected] ~]# chmod -R 775 /u01
修改内核参数
[[email protected] ~]# vi /etc/sysctl.conf
# Controls the maximum shared segment size, in bytes
#kernel.shmmax = 68719476736
# Controls the maximum number of shared memory segments, in pages
#kernel.shmall = 4294967296
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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
修改系统资源限制
[[email protected] ~]# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[[email protected] ~]# vi /etc/pam.d/login
session required pam_limits.so
[[email protected] ~]# 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
关闭防火墙
[[email protected] ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[[email protected] ~]# chkconfig iptables off
关闭Selinux
[[email protected] ~]# /usr/sbin/sestatus –v
[[email protected] ~]# vi /etc/selinux/config
SELINUX=disabled
设置环境变量
[[email protected] ~]# su - oracle
[[email protected] ~]$ cd
[[email protected] ~]$ vi .bash_profile
umask 022
ORACLE_BASH=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASH/product/11.2.0/db_1
ORACLE_SID=oracledb
PATH=$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export PATH ORACLE_BASH ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH
[[email protected] ~]$ source .bash_profile
[[email protected] ~]# cp linux.x64_11gR2_database_* /home/oracle/
[[email protected] ~]# chown oracle:oinstall /home/oracle/^Cnux.x64_11gR2_database_2of2.zip
切换到图形界面安装!
[[email protected] ~]$ unzip linux.x64_11gR2_database_1of2.zip
[[email protected] ~]$ unzip linux.x64_11gR2_database_2of2.zip
[[email protected] ~]$ ls
[[email protected] ~]$ cd database/
[[email protected] database]$ ls
doc install response rpm runInstaller sshsetup stage welcome.html
[[email protected] database]$./ runInstaller
[[email protected] ~]# sh /u01/app/oraInventory/orainstRoot.sh
[[email protected] ~]# sh /u01/app/oracle/product/11.2.0/db_1/root.sh
创建监听服务(充当oracle服务器,让别的oracle客户端连接本oracle服务器)
启动数据库,和监听
1.#su - oracle 切换到oracle用户且切换到它的环境
2.$lsnrctl status 查看监听及数据库状态
3.$lsnrctl start 启动监听
4.$sqlplus / as sysdba 以DBA身份进入sqlplus
5.SQL>startup 启动db
配置本地网络服务名(充当oracle客户端,连接别的oracle服务器)
没有通过。退出
修改/u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora。将hostname修改为oracledb。
重启整个虚拟机。
重新走。启动监听,启动数据库。走到相应步骤,然后执行SQL> alter system register;
用户名system 密码 oracle
解锁scott用户,密码是tigger
数据库就此安装成功!
小生不才这数据库安装了周末两天才安装成功,期间遇到了各种的问题比如磁盘空间,Kdump空间不足,设置权限等问题,不过高兴地是终于安装成功了。接下来终于可以开始oracle的学习了!