Linux测试环境配置_for_oracle(单实例)

1.创建目录

使用lvm管理的u01目录:
输出省略了其他不相关的磁盘信息。

[root@oel7101 ~]# lsblk 
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdb           8:16   0   30G  0 disk
[root@oel7101 ~]# pvcreate /dev/sdb 
  Physical volume "/dev/sdb" successfully created.
[root@oel7101 ~]# vgcreate oraclevg /dev/sdb 
  Volume group "oraclevg" successfully created
[root@oel7101 ~]# lvcreate -L +30G -n oraclelv oraclevg
  Volume group "oraclevg" has insufficient free space (7679 extents): 7680 required.
[root@oel7101 ~]# lvcreate -L +29G -n oraclelv oraclevg
  Logical volume "oraclelv" created.
[root@oel7101 ~]# lsblk 
NAME                MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdb                   8:16   0   30G  0 disk 
└─oraclevg-oraclelv 253:2    0   29G  0 lvm  
[root@oel7101 ~]# mkfs.xfs /dev/mapper/oraclevg-oraclelv 
meta-data=/dev/mapper/oraclevg-oraclelv isize=256    agcount=4, agsize=1900544 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0, sparse=0
data     =                       bsize=4096   blocks=7602176, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=3712, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@oel7101 ~]# blkid 
/dev/mapper/oraclevg-oraclelv: UUID="bc8c5537-2d14-42f0-aeb6-86e7ec8281d6" TYPE="xfs" 
[root@oel7101 ~]# vi /etc/fstab 
UUID="bc8c5537-2d14-42f0-aeb6-86e7ec8281d6" /u01 xfs    defaults        0 0
[root@oel7101 ~]# mkdir /u01
[root@oel7101 ~]# mount -a
[root@oel7101 ~]# df -h
Filesystem                     Size  Used Avail Use% Mounted on
/dev/mapper/oraclevg-oraclelv   29G   33M   29G   1% /u01

2.创建组和用户

参考18c官方文档,选取了单实例安装所需要的信息。
使用普通文件系统,不使用ASM。

Database Installation Guide 18c for Linux
E83745-03
November 2018

[root@oel7101 ~]# /usr/sbin/groupadd -g 54321 oinstall
[root@oel7101 ~]# /usr/sbin/groupadd -g 54321 oinstall
[root@oel7101 ~]# /usr/sbin/groupadd -g 54322 dba
[root@oel7101 ~]# groupadd -g 54323 oper
[root@oel7101 ~]# /usr/sbin/groupadd -g 54324 backupdba
[root@oel7101 ~]# /usr/sbin/groupadd -g 54325 dgdba
[root@oel7101 ~]# /usr/sbin/useradd -u 54321 -g oinstall -G dba,backupdba,dgdba,oper oracle
[root@oel7101 ~]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54322(dba),54323(oper),54324(backupdba),54325(dgdba),54321(oinstall)
[root@oel7101 ~]# passwd oracle
Changing password for user oracle.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.

配置u01目录权限

[root@oel7101 ~]# mkdir -p /u01/oracle/product/db18c
[root@oel7101 ~]# chown oracle:oinstall -R /u01/
[root@oel7101 ~]# chmod 775 -R /u01

环境变量配置
18c的安装文档里只设置了umask,取消了其他环境变量的设置,还强调要取消这3个环境变量,以及PATH中的路径。若/tmp目录小于1GB,则还要设置TMP和TMPDIR指定其他临时目录。

[oracle@oel7101 ~]$ echo $SHELL
/bin/bash
[oracle@oel7101 ~]$ vi .bash_profile 
umask 022
[oracle@oel7101 ~]$ unset ORACLE_SID
[oracle@oel7101 ~]$ unset ORACLE_HOME
[oracle@oel7101 ~]$ unset ORACLE_BASE
[oracle@oel7101 ~]$ . .bash_profile 
[oracle@oel7101 ~]$ umask 
0022
[oracle@oel7101 ~]$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/oracle/.local/bin:/home/oracle/bin:/home/oracle/.local/bin:/home/oracle/bin
[oracle@oel7101 ~]$ export DISPLAY=192.168.150.1:0.0

3.修改系统参数

这部分参考了官方文档和原有的安装文档
修改系统resource limit,用户重新登录后生效

[root@oel7101 ~]# vi /etc/security/limits.conf
oracle           soft    nproc   16384
oracle           hard    nproc   16384
oracle           soft    nofile  65536
oracle           hard    nofile  65536
oracle           hard    stack   10240
oracle           soft    stack   10240

修改内核参数

[root@oel7101 ~]# cd /etc/sysctl.d/
[root@oel7101 sysctl.d]# ll
total 0
lrwxrwxrwx. 1 root root 14 Mar  7 15:50 99-sysctl.conf -> ../sysctl.conf
[root@oel7101 sysctl.d]# vi 99-sysctl.conf 
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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
[root@oel7101 sysctl.d]# sysctl -p

安装缺少的系统rpm包

以下安装包是在安装时检查出来缺少的包,这里可以提前安装下

[root@oel7101 sysctl.d]# yum -y install compat-libcap1 libstdc++-devel sysstat ksh glibc-devel libaio-devel nfs-utils smartmontools net-tools 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值