在VMware安装Centos再安装Oracle数据库(个人学习使用)

时间:2023-03-08 23:29:52
在VMware安装Centos再安装Oracle数据库(个人学习使用)

打开VMware

在VMware安装Centos再安装Oracle数据库(个人学习使用)

选择稍后安装

在VMware安装Centos再安装Oracle数据库(个人学习使用)

自定义安装

在VMware安装Centos再安装Oracle数据库(个人学习使用)

小生安装的是64位的Centos

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

给虚拟机设置名称和安装位置

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

设置虚拟机打处理器并分配内存(oracle12G我建议内存为2G以上)

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

网络类型选择仅主机模式

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

按推荐来,创建新的虚拟磁盘

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

磁盘大小设为40G,不要太小,会有错误。指定磁盘文件路径

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

选择自定义硬件,将Centos ISO镜像文件挂载上

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

启动虚拟机,进入Centos安装界面

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

跳过检测

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

选择英文

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

键盘格式为英文

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

选择YES,清空数据

在VMware安装Centos再安装Oracle数据库(个人学习使用)

点击Configure Network

在VMware安装Centos再安装Oracle数据库(个人学习使用)

设置System eth0,可参考自己的主机(ipconfig)

在VMware安装Centos再安装Oracle数据库(个人学习使用)

上海时间

在VMware安装Centos再安装Oracle数据库(个人学习使用)

设置root密码

在VMware安装Centos再安装Oracle数据库(个人学习使用)

将Review。。选上

在VMware安装Centos再安装Oracle数据库(个人学习使用)

删除重建

在VMware安装Centos再安装Oracle数据库(个人学习使用)

添加/boot

在VMware安装Centos再安装Oracle数据库(个人学习使用)

添加swap分区

在VMware安装Centos再安装Oracle数据库(个人学习使用)

剩余空间给根/

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

默认

在VMware安装Centos再安装Oracle数据库(个人学习使用)

选择自己要安装的一些包!

在VMware安装Centos再安装Oracle数据库(个人学习使用)

开发工具一类

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

漫长的等待

在VMware安装Centos再安装Oracle数据库(个人学习使用)

安装完,重启

在VMware安装Centos再安装Oracle数据库(个人学习使用)

按引导来

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

不设置用户

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

将Kdump去掉。设置VMnet1的网络设置下(仔细看下)

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

上传oracle安装包

在VMware安装Centos再安装Oracle数据库(个人学习使用)

Ip设置为静态

[root@localhost ~]# 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开机启动

[root@localhost ~]# service ip6tables stop

[root@localhost ~]# chkconfig ip6tables off

[root@localhost ~]# service network restart

设置主机名为oracledb

[root@localhost ~]# vi /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=oracledb

GATEWAY=192.168.10.1

[root@localhost ~]# vi /etc/hosts

127.0.0.1 localhost oracledb localhost4 localhost4.localdomain4

::1 localhost oracledb localhost6 localhost6.localdomain6

192.168.10.88 oracledb

[root@localhost ~]# 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)

检查存在

[root@oracledb ~]# rpm -qa binutils*

安装

挂载centos镜像

[root@oracledb ~]# 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

[root@oracledb ~]# cd /media/CentOS_6.5_Final/Packages/

[root@oracledb 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

[root@oracledb Packages]# rpm -ivh compat-libcap1-1.10-1.x86_64.rpm

创建用户和组

[root@oracledb ~]# groupadd oinstall

[root@oracledb ~]# groupadd dba

[root@oracledb ~]# useradd -g oinstall -G dba oracle

[root@oracledb ~]# passwd oracle

创建目录

[root@oracledb ~]# mkdir /u01/app/oracle -p

You have mail in /var/spool/mail/root

[root@oracledb ~]# chown -R oracle:oinstall /u01

[root@oracledb ~]# chmod -R 775 /u01

修改内核参数

[root@oracledb ~]# 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

生效命令  sysctl -p

修改系统资源限制

[root@oracledb ~]# vi /etc/security/limits.conf

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

[root@oracledb ~]# vi /etc/pam.d/login

session required pam_limits.so

[root@oracledb ~]# 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

关闭防火墙

[root@oracledb ~]# service iptables stop

iptables: Setting chains to policy ACCEPT: filter [ OK ]

iptables: Flushing firewall rules: [ OK ]

iptables: Unloading modules: [ OK ]

[root@oracledb ~]# chkconfig iptables off

关闭Selinux

[root@oracledb ~]# /usr/sbin/sestatus –v

[root@oracledb ~]# vi /etc/selinux/config

SELINUX=disabled

设置环境变量

[root@oracledb ~]# su - oracle

[oracle@oracledb ~]$ cd

[oracle@oracledb ~]$ vi .bash_profile

umask 022

ORACLE_BASE=/u01/app/oracle

ORACLE_HOME=$ORACLE_BASE/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_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH

[oracle@oracledb ~]$ source .bash_profile

[root@oracledb ~]# cp linux.x64_11gR2_database_* /home/oracle/

[root@oracledb ~]# chown oracle:oinstall /home/oracle/^Cnux.x64_11gR2_database_2of2.zip

切换到图形界面安装!

[oracle@oracledb ~]$ unzip linux.x64_11gR2_database_1of2.zip

[oracle@oracledb ~]$ unzip linux.x64_11gR2_database_2of2.zip

[oracle@oracledb ~]$ ls

[oracle@oracledb ~]$ cd database/

[oracle@oracledb database]$ ls

doc install response rpm runInstaller sshsetup stage welcome.html

[oracle@oracledb database]$./ runInstaller

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

在VMware安装Centos再安装Oracle数据库(个人学习使用)

[root@oracledb ~]# sh /u01/app/oraInventory/orainstRoot.sh

[root@oracledb ~]# sh /u01/app/oracle/product/11.2.0/db_1/root.sh

在VMware安装Centos再安装Oracle数据库(个人学习使用)

在VMware安装Centos再安装Oracle数据库(个人学习使用)

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

创建监听服务(充当oracle服务器,让别的oracle客户端连接本oracle服务器)

在VMware安装Centos再安装Oracle数据库(个人学习使用)

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

启动数据库,和监听

1.#su - oracle              切换到oracle用户且切换到它的环境

2.$lsnrctl status           查看监听及数据库状态

3.$lsnrctl start            启动监听

4.$sqlplus / as sysdba       以DBA身份进入sqlplus

5.SQL>startup                启动db

配置本地网络服务名(充当oracle客户端,连接别的oracle服务器)

在VMware安装Centos再安装Oracle数据库(个人学习使用)

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

没有通过。退出

修改/u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora。将hostname修改为oracledb。

重启整个虚拟机。

重新走。启动监听,启动数据库。走到相应步骤,然后执行SQL> alter system register;

在VMware安装Centos再安装Oracle数据库(个人学习使用)

在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)在VMware安装Centos再安装Oracle数据库(个人学习使用)

用户名system 密码 oracle

解锁scott用户,密码是tigger

在VMware安装Centos再安装Oracle数据库(个人学习使用)

数据库就此安装成功!

小生不才这数据库安装了周末两天才安装成功,期间遇到了各种的问题比如磁盘空间,Kdump空间不足,设置权限等问题,不过高兴地是终于安装成功了。接下来终于可以开始oracle的学习了!