一、Linux系统安装前准备
Linux系统版本为
1.调整系统swap分区大小
root用户下
[root@localhost ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x833eb6d8.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): e
Partition number (1-4, default 1): 4
First sector (2048-125829119, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-125829119, default 125829119): +20G
Partition 4 of type Extended and of size 20 GiB is set
Command (m for help): n
Partition type:
p primary (0 primary, 1 extended, 3 free)
l logical (numbered from 5)
Select (default p): l
Adding logical partition 5
First sector (4096-41945087, default 4096): “回车”
Using default value 4096
Last sector, +sectors or +size{K,M,G} (4096-41945087, default 41945087): “回车”
Using default value 41945087
Partition 5 of type Linux and of size 20 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost ~]# partprobe
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.
[root@localhost ~]# mkswap /dev/sdb5
Setting up swapspace version 1, size = 20970492 KiB
no label, UUID=c985adf5-dbba-48e8-803b-cc34bd0c33b1
[root@localhost ~]# vim /etc/fstab
添加如下:
UUID=c985adf5-dbba-48e8-803b-cc34bd0c33b1 swap swap defaults 0 0
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 36G 6.2G 30G 18% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 140K 1.9G 1% /dev/shm
tmpfs 1.9G 8.8M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sr0 3.5G 3.5G 0 100% /media/cdrom
/dev/sda1 497M 119M 379M 24% /boot
[root@localhost ~]# free -h
total used free shared buffers cached
Mem: 3.7G 853M 2.9G 9.7M 1.4M 252M
-/+ buffers/cache: 599M 3.1G
Swap: 23G 0B 23G
2.配置yum仓库(本地磁盘镜像iso)
[root@localhost ~]mkdir /media/cdrom
[root@localhost ~]vim /etc/fstab
/dev/cdrom /media/cdrom iso9660 defaults 0 0
[root@localhost ~]mount -a
3.关闭防火墙和selinux
[root@localhost ~]# vim /etc/selinux/config
SELINUX=disabled
[root@localhost ~]# systemctl stop iptables.service
二、Oracle安装
1.下载Oracle需要的依赖包
yum -y install gcc gcc-c++ make binutils compat-libstdc++-33 glibc glbic-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel unixODBC-devel sysstat ksh unzip compat-libcap*
2.添加账号跟用户组
[root@localhost ~]# groupadd dba
[root@localhost ~]# groupadd oinstall
[root@localhost ~]# tail -5 /etc/group
sshd:x:74:
tcpdump:x:72:
yaopeidong:x:1000:
dba:x:1001:
oinstall:x:1002:
[root@localhost ~]# useradd -g dba -G oinstall oracle
[root@localhost ~]# id oracle
uid=1001(oracle) gid=1001(dba) groups=1001(dba),1002(oinstall)
[root@localhost ~]#
nging password for user oracle.
passwd: all authentication tokens updated successfully.
[root@localhost ~]# chown -R oracle:oinstall /u01
3.下载xshell 5