测试博客测试博客测试博客

oracle21C在RHEL单节点图形化安装

21C在RHEL单节点图形化安装

原创                                        Oracle                                            作者:raysuen                                        时间:2021-08-31 20:27:49                                        306                                        0                                                                                                

注意:

        https的内容为官方文档对于当前项的参考,嫌麻烦可以不用看官方文档,只为参考使用。


##21c的系统要求,正常是需要RHEL8.2或以后的系统版本

https空格:空格//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/operating-system-checklist-for-oracle-database-installation-on-linux.html#GUID-E5C0A90E-7750-45D9-A8BC-C7319ED934F0

##rpm包的要求,参考rhel8和oracle linux7的需求

https冒号//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/operating-system-requirements-for-x86-64-linux-platforms.html#GUID-3F647617-7FF5-4EE4-BBA8-9A5E3EEC888F
https冒号//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/supported-red-hat-enterprise-linux-8-distributions-for-x86-64.html#GUID-B1487167-84F8-4F8D-AC31-A4E8F592374B
https冒号//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/supported-oracle-linux-7-distributions-for-x86-64.html#GUID-3E82890D-2552-4924-B458-70FFF02315F7
https冒号//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/installing-odbc-drivers-for-linux-x86-64.html#GUID-494A764B-22A6-4DB4-AB45-AE4B467650D2

#linux 7

yum -y install unzip bc binutils elfutils-libelf glibc glibc-devel ksh libaio libXrender libX11 libXau libXi libXtst libgcc libstdc++ libxcb make policycoreutils policycoreutils-python smartmontools sysstat unixODBC

#linux 8

yum -y install unzip bc binutils compat-openssl10 elfutils-libelf glibc glibc-devel ksh libaio libXrender libX11 libXau libXi libXtst libgcc libnsl libstdc++ libxcb libibverbs make smartmontools sysstat unixODBC


##关闭防火墙

systemctl stop firewalld
systemctl disable firewalld
    Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
    Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
getenforce
    Permissive
egrep -v "^#|^$" /etc/selinux/config
    SELINUX=disabled
    SELINUXTYPE=targeted


##配置hostname

https冒号//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/confirming-host-name-resolution.html#GUID-B12E885F-CF2E-498A-A878-117082F237CC
ip add | grep enp0s3 | grep inet | awk '{print $2}' awk -F"/" '{printf $1" "}{cmd="hostname";system(cmd)}' >> /etc/hosts


##创建用户和组

https冒号//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/creating-operating-system-privileges-groups.html#GUID-164A7218-166D-4B58-9A86-88149E8FCB83
https冒号//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/creating-operating-system-oracle-installation-user-accounts.html#GUID-4DA71FFA-AB5B-49AA-B21D-92C952C8A3FC
/usr/sbin/groupadd -g 54321 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper
/usr/sbin/groupadd -g 54324 backupdba
/usr/sbin/groupadd -g 54325 dgdba
/usr/sbin/groupadd -g 54326 kmdba
/usr/sbin/groupadd -g 54330 racdba
/usr/sbin/useradd -u 54320 -g oinstall -G oper,dba,backupdba,dgdba,kmdba,racdba oracle


##为oracle配置oracle home等环境变量

https冒号//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/file-path-directory-changes-read-only-oracle-home.html#GUID-695D5458-A4AF-4F2A-AE4B-FB1062CF6014
https冒号//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/understanding-read-only-oracle-homes.html#GUID-AE1973D7-0325-4AD8-9FC9-D7BA3C3C3F37
vi ~/.bash_profile
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/21.0.0/dbhome_1
ORACLE_BASE_HOME=/u01/app/oracle/homes/OraDB21Home1
ORACLE_SID=orcl
export ORACLE_BASE ORACLE_HOME ORACLE_BASE_HOME ORACLE_SID
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin:/usr/bin:/sbin
#注意:
        21C以后network/admin, network/trace, and network/log等信息放在ORACLE_BASE_HOME目录下
        21C以后参数文件和密码文件等信息在ORACLE_BASE_CONFIG/dbs下,ORACLE_BASE_CONFIG约同ORACLE_BASE


##设置用户资源限制

https冒号//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/checking-resource-limits-for-oracle-software-installation-users.html#GUID-293874BD-8069-470F-BEBF-A77C06618D5A
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  32768
oracle soft memlock 3145728
oracle hard memlock 3145728


##创建安装目录

https冒号//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/running-oracle-universal-installer-to-install-oracle-database.html#GUID-DD4800E9-C651-4B08-A6AC-E5ECCC6512B9
mkdir -p /u01/app/oracle/product/21.0.0/dbhome_1
mkdir -p /u01/app/oraInventory
chown -R oracle:oinstall /u01/app/oracle
chown -R oracle:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app


##配置内核参数

https冒号//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/changing-kernel-parameter-values.html#GUID-FB0CC366-61C9-4AA2-9BE7-233EB6810A31
vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 18446744073692774399
kernel.shmmax = 18446744073692774399
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


##设置UDP和TCP网络参数

https冒号//docs.oracle.com/en/database/oracle/oracle-database/21/ladbi/setting-udp-and-tcp-kernel-parameters-manually.html#GUID-F94545C8-7695-4866-89B0-F32651CD3658
cat /proc/sys/net/ipv4/ip_local_port_range
32768 61000
echo 9000 65500 > /proc/sys/net/ipv4/ip_local_port_range
/etc/rc.d/init.d/network restart


##修改时钟源

[root@ray113 ~]# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
kvm-clock tsc acpi_pm 
[root@ray113 ~]# cat /sys/devices/system/clocksource/clocksource0/current_clocksource
kvm-clock
[root@ray113 ~]# echo tsc > /sys/devices/system/clocksource/clocksource0/current_clocksource
[root@ray113 ~]# cat /sys/devices/system/clocksource/clocksource0/current_clocksource
tsc


##安装

unzip LINUX.X64_213000_db_home.zip -d /u01/app/oracle/product/21.0.0/dbhome_1/
./runInstaller

[root@ray113 ~]# /u01/app/oraInventory/orainstRoot.sh 
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@ray113 ~]# /u01/app/oracle/
cfgtoollogs/ dbs/         diag/        homes/       product/     
[root@ray113 ~]# /u01/app/oracle/product/21.0.0/dbhome_1/root.sh
Performing root user operation.
The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/21.0.0/dbhome_1
Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.



##创建实例
[oracle@ray113 dbhome_1]$ /u01/app/oracle/product/21.0.0/dbhome_1/bin/dbca 


从21c开始必须为容器数据库









来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28572479/viewspace-2789755/,如需转载,请注明出处,否则将追究法律责任。


未经允许不得转载:测试博客 » oracle21C在RHEL单节点图形化安装