Oracle Linux8 安装Oracle 19c
Oracle 19C 安装
其他LINUX 安装ORACLE 与此类似,这里以 Oracle Linux8 为例。
1.软件下载
Oracle Database
Oracle Database 19c Download for Linux x86-64https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html#license-lightboxXMING(我这里是虚拟机 没有使用XMING)--用于本地WINDOWS 链接ORACLE Linux server
https://xming.en.softonic.com/?ex=CORE-1074.0https://xming.en.softonic.com/?ex=CORE-1074.0
2.硬件检查
RAM 例子中用的是4GB
-
At least 1 GB RAM for Oracle Database installations. 2 GB RAM recommended.(建议2GB 内存以上)
DISPLAY(现在能显示的电脑都能支持,可以略过)
At least 1024 x 768 display resolution, which Oracle Universal Installer requires
3.系统配置需求
1)临时目录 最少1GB的/tmp空间,这里配置2-4G
At least 1 GB of space in the /tmp
directory(最少1GB的/tmp空间,这里配置2-4G)
2) Swap 内存小于等于2GB 时为1.5*RAM 大小,内存在2GB-16GB之间,设置为与RAM相等,内存大于16GB时,SWAP 设置为16GB
Swap space allocation relative to RAM (Oracle Database) | Between 1 GB and 2 GB: 1.5 times the size of the RAM |
3) 硬盘需求 只装软件大概在10GB左右,Oracle建议100GB+,一般这里在上产环境上不用担心,肯定有足够的空间给你用,例子中用了100GB
For Linux x86-64:
At least 6.5 GB for an Oracle Grid Infrastructure for a standalone server installation.
At least 7.2 GB for Oracle Database Enterprise Edition.
At least 7.2 GB for Oracle Database Standard Edition 2.
Note:
Oracle recommends that you allocate approximately 100 GB to allow additional space for applying any future patches on top of the existing Oracle home. For specific patch-related disk space requirements, please refer to your patch documentation.
4. Linux安装,Storage configuration 那里务必选择CUSTOM 不然不符合数据库操作系统的要求
5.安装数据库
1).登录到数据库server,运行命令 dnf install oracle-database-preinstall-19c,会自动创建ORACLE 用户和修改系统参数。
[root@localhost ~]# dnf install oracle-database-preinstall-19c
Oracle Linux 8 BaseOS Latest (x86_64) 2.0 MB/s | 47 MB 00:23
Oracle Linux 8 Application Stream (x86_64) 3.1 MB/s | 37 MB 00:11
Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64) 3.0 MB/s | 50 MB 00:16
Last metadata expiration check: 0:00:07 ago on Mon 04 Jul 2022 03:17:43 AM EDT.
Dependencies resolved.
==========================================================================================================================================================================
Package Architecture Version Repository Size
==========================================================================================================================================================================
Installing:
oracle-database-preinstall-19c x86_64 1.0-2.el8 ol8_appstream 31 k
Installing dependencies:
glibc-devel x86_64 2.28-151.0.1.el8 ol8_baseos_latest 1.0 M
ksh x86_64 20120801-254.0.1.el8 ol8_appstream 927 k
libaio-devel x86_64 0.3.112-1.el8 ol8_baseos_latest 19 k
libnsl x86_64 2.28-151.0.1.el8 ol8_baseos_latest 102 k
libstdc++-devel x86_64 8.4.1-1.0.1.el8 ol8_appstream 2.1 M
libxcrypt-devel x86_64 4.1.1-4.el8 ol8_baseos_latest 25 k
lm_sensors-libs x86_64 3.4.0-23.20180522git70f7e08.el8 ol8_baseos_latest 59 k
make x86_64 1:4.2.1-11.el8 ol8_baseos_latest 498 k
sysstat x86_64 11.7.3-7.el8 ol8_appstream 425 k
Transaction Summary
==========================================================================================================================================================================
Install 10 Packages
Total download size: 5.1 M
Installed size: 19 M
Is this ok [y/N]: y
Downloading Packages:
(1/10): libaio-devel-0.3.112-1.el8.x86_64.rpm 16 kB/s | 19 kB 00:01
(2/10): libxcrypt-devel-4.1.1-4.el8.x86_64.rpm 70 kB/s | 25 kB 00:00
(3/10): libnsl-2.28-151.0.1.el8.x86_64.rpm 57 kB/s | 102 kB 00:01
(4/10): lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64.rpm 110 kB/s | 59 kB 00:00
(5/10): make-4.2.1-11.el8.x86_64.rpm 379 kB/s | 498 kB 00:01
(6/10): glibc-devel-2.28-151.0.1.el8.x86_64.rpm 325 kB/s | 1.0 MB 00:03
(7/10): oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm 110 kB/s | 31 kB 00:00
(8/10): ksh-20120801-254.0.1.el8.x86_64.rpm 517 kB/s | 927 kB 00:01
(9/10): sysstat-11.7.3-7.el8.x86_64.rpm 575 kB/s | 425 kB 00:00
(10/10): libstdc++-devel-8.4.1-1.0.1.el8.x86_64.rpm 1.5 MB/s | 2.1 MB 00:01
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.1 MB/s | 5.1 MB 00:04
warning: /var/cache/dnf/ol8_baseos_latest-e4c6155830ad002c/packages/glibc-devel-2.28-151.0.1.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ad986da3: NOKEY
Oracle Linux 8 BaseOS Latest (x86_64) 3.0 MB/s | 3.1 kB 00:00
Importing GPG key 0xAD986DA3:
Userid : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
Fingerprint: 76FD 3DB1 3AB6 7410 B89D B10E 8256 2EA9 AD98 6DA3
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libxcrypt-devel-4.1.1-4.el8.x86_64 1/10
Installing : glibc-devel-2.28-151.0.1.el8.x86_64 2/10
Running scriptlet: glibc-devel-2.28-151.0.1.el8.x86_64 2/10
Installing : libstdc++-devel-8.4.1-1.0.1.el8.x86_64 3/10
Installing : ksh-20120801-254.0.1.el8.x86_64 4/10
Running scriptlet: ksh-20120801-254.0.1.el8.x86_64 4/10
Installing : make-1:4.2.1-11.el8.x86_64 5/10
Running scriptlet: make-1:4.2.1-11.el8.x86_64 5/10
Installing : lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 6/10
Running scriptlet: lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 6/10
/sbin/ldconfig: /etc/ld.so.conf.d/kernel-5.4.17-2102.201.3.el8uek.x86_64.conf:6: hwcap directive ignored
Installing : sysstat-11.7.3-7.el8.x86_64 7/10
Running scriptlet: sysstat-11.7.3-7.el8.x86_64 7/10
Installing : libnsl-2.28-151.0.1.el8.x86_64 8/10
Installing : libaio-devel-0.3.112-1.el8.x86_64 9/10
Running scriptlet: oracle-database-preinstall-19c-1.0-2.el8.x86_64 10/10
Installing : oracle-database-preinstall-19c-1.0-2.el8.x86_64 10/10
Running scriptlet: oracle-database-preinstall-19c-1.0-2.el8.x86_64 10/10
/sbin/ldconfig: /etc/ld.so.conf.d/kernel-5.4.17-2102.201.3.el8uek.x86_64.conf:6: hwcap directive ignored
Verifying : glibc-devel-2.28-151.0.1.el8.x86_64 1/10
Verifying : libaio-devel-0.3.112-1.el8.x86_64 2/10
Verifying : libnsl-2.28-151.0.1.el8.x86_64 3/10
Verifying : libxcrypt-devel-4.1.1-4.el8.x86_64 4/10
Verifying : lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 5/10
Verifying : make-1:4.2.1-11.el8.x86_64 6/10
Verifying : ksh-20120801-254.0.1.el8.x86_64 7/10
Verifying : libstdc++-devel-8.4.1-1.0.1.el8.x86_64 8/10
Verifying : oracle-database-preinstall-19c-1.0-2.el8.x86_64 9/10
Verifying : sysstat-11.7.3-7.el8.x86_64 10/10
Installed:
glibc-devel-2.28-151.0.1.el8.x86_64 ksh-20120801-254.0.1.el8.x86_64 libaio-devel-0.3.112-1.el8.x86_64
libnsl-2.28-151.0.1.el8.x86_64 libstdc++-devel-8.4.1-1.0.1.el8.x86_64 libxcrypt-devel-4.1.1-4.el8.x86_64
lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 make-1:4.2.1-11.el8.x86_64 oracle-database-preinstall-19c-1.0-2.el8.x86_64
sysstat-11.7.3-7.el8.x86_64
Complete!
[root@localhost ~]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54330(racdba),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba)
[root@localhost ~]#
2).查看自动configuration的文件具体做了哪些操作,可以直接拿这些参数配置到新的非ORACLE Linux的系统 cat /var/log/oracle-database-preinstall-19c/results/orakernel.log
root@localhost results]# cat /var/log/oracle-database-preinstall-19c/results/orakernel.log
Adding group oinstall with gid 54321
Adding group dba with gid 54322
Adding group oper with gid 54323
Adding group backupdba with gid 54324
Adding group dgdba with gid 54325
Adding group kmdba with gid 54326
Adding group racdba with gid 54330
Adding user oracle with user id 54321, initial login group oinstall, supplementary groups oinstall,dba,oper,backupdba,dgdba,kmdba,racdba and home directory /home/oracle
Changing ownership of /home/oracle to oracle:oinstall
Please set password for user - oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54330(racdba),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba)
User creation passed
Saving a copy of the initial sysctl.conf
Verifying kernel parameters as per Oracle recommendations...
Trying to remove instances of - setting for fs.file-max is
Adding fs.file-max = 6815744
Trying to remove instances of - setting for kernel.sem is
Adding kernel.sem = 250 32000 100 128
Trying to remove instances of - setting for kernel.shmmni is
Adding kernel.shmmni = 4096
Trying to remove instances of - setting for kernel.shmall is
Adding kernel.shmall = 1073741824
Trying to remove instances of - setting for kernel.shmmax is
Adding kernel.shmmax = 4398046511104
Trying to remove instances of - setting for kernel.panic_on_oops is
Adding kernel.panic_on_oops = 1
Trying to remove instances of - setting for net.core.rmem_default is
Adding net.core.rmem_default = 262144
Trying to remove instances of - setting for net.core.rmem_max is
Adding net.core.rmem_max = 4194304
Trying to remove instances of - setting for net.core.wmem_default is
Adding net.core.wmem_default = 262144
Trying to remove instances of - setting for net.core.wmem_max is
Adding net.core.wmem_max = 1048576
Trying to remove instances of - setting for net.ipv4.conf.all.rp_filter is
Adding net.ipv4.conf.all.rp_filter = 2
Trying to remove instances of - setting for net.ipv4.conf.default.rp_filter is
Adding net.ipv4.conf.default.rp_filter = 2
Trying to remove instances of - setting for fs.aio-max-nr is
Adding fs.aio-max-nr = 1048576
Trying to remove instances of - setting for net.ipv4.ip_local_port_range is
Adding net.ipv4.ip_local_port_range = 9000 65500
Setting kernel parameters as per oracle recommendations...
Altered file /etc/sysctl.conf
Saved a copy of the current file in /etc/sysctl.d/99-oracle-database-preinstall-19c-sysctl.conf
Check /etc/sysctl.d for backups
Verification & setting of kernel parameters passed
Setting user limits using /etc/security/limits.d/oracle-database-preinstall-19c.conf
Verifying oracle user OS limits as per Oracle recommendations...
Adding oracle soft nofile 1024
Adding oracle hard nofile 65536
Adding oracle soft nproc 16384
Adding oracle hard nproc 16384
Adding oracle soft stack 10240
Adding oracle hard stack 32768
Adding oracle hard memlock 134217728
Adding oracle soft memlock 134217728
Adding oracle soft data unlimited
Adding oracle hard data unlimited
Setting oracle user OS limits as per Oracle recommendations...
Altered file /etc/security/limits.d/oracle-database-preinstall-19c.conf
Original file backed up at /var/log/oracle-database-preinstall-19c/backup/Jul-04-2022-03-18-43
Verification & setting of user limits passed
Saving a copy of /etc/default/grub file in /etc/default/grub-initial.orabackup
Saving a copy of /etc/default/grub in /var/log/oracle-database-preinstall-19c/backup/Jul-04-2022-03-18-43...
Verifying kernel boot parameters as per Oracle recommendations...
old boot params: "crashkernel=auto resume=/dev/mapper/ol-swap rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet"
new boot params: "crashkernel=auto resume=/dev/mapper/ol-swap rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet numa=off"
Setting boot params - Checking for blscfg
GRUB_ENABLE_BLSCFG=true
options $kernelopts
options $kernelopts $tuned_params
options $kernelopts $tuned_params
old boot params: "crashkernel=auto resume=/dev/mapper/ol-swap rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet numa=off"
new boot params: "crashkernel=auto resume=/dev/mapper/ol-swap rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet numa=off transparent_hugepage=never"
Setting boot params - Checking for blscfg
GRUB_ENABLE_BLSCFG=true
options $kernelopts
options $kernelopts $tuned_params
options $kernelopts $tuned_params
Setting kernel boot parameters as per Oracle recommendations...
G_DIR=/boot/grub2
Checking for blscfg
GRUB_ENABLE_BLSCFG=true
Saved Entry = dccf1f1269b049bda9fdc0820728e8d6-5.4.17-2102.201.3.el8uek.x86_64
Running grub2-mkconfig
Generating grub configuration file ...
File descriptor 199 (/run/lock/subsys/oracle-preinstall.lock) leaked on vgs invocation. Parent PID 12875: /usr/sbin/grub2-probe
File descriptor 199 (/run/lock/subsys/oracle-preinstall.lock) leaked on vgs invocation. Parent PID 12875: /usr/sbin/grub2-probe
File descriptor 199 (/run/lock/subsys/oracle-preinstall.lock) leaked on vgs invocation. Parent PID 13049: /usr/sbin/grub2-probe
File descriptor 199 (/run/lock/subsys/oracle-preinstall.lock) leaked on vgs invocation. Parent PID 13049: /usr/sbin/grub2-probe
done
Restore default
Boot parameters will be effected on next reboot
Altered file /etc/default/grub
Copy of the changed file is in - /etc/default/grub-oracle-database-preinstall-19c.orabackup
Copy of the original file is in - /var/log/oracle-database-preinstall-19c/backup/Jul-04-2022-03-18-43
Verification & setting of boot parameters passed
Trying to add NOZEROCONF parameter...
Taking a backup of existing file to /etc/sysconfig/network.orabackup
Successfully added parameter NOZEROCONF to /etc/sysconfig/network
Setting /etc/sysconfig/network parameters passed
Disabling Transparent Hugepages.
Refer Oracle Note:1557478.1
Disabling defrag.
Refer Oracle Note:1557478.1
Taking a backup of old config files under /var/log/oracle-database-preinstall-19c/backup/Jul-04-2022-03-18-43
3)安装Oracle软件
用root用户登录,执行如下命令
[root@localhost ~]# mkdir -p /u01
[root@localhost ~]# chown -R oracle:oinstall /u01
[root@localhost ~]# 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.
启动 WINSCP ,使用oracle account连接到LINUX server ,把下载好的Oracle软件上传到/u01目录下,上传完成后如下
[oracle@localhost u01]$ pwd
/u01
[oracle@localhost u01]$ ls
LINUX.X64_193000_db_home.zip
[oracle@localhost u01]$
正式安装Oracle 软件
[oracle@localhost u01]$ mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
[oracle@localhost u01]$ ls
app LINUX.X64_193000_db_home.zip
[oracle@localhost u01]$ mv LINUX.X64_193000_db_home.zip /u01/app/oracle/product/19.3.0/dbhome_1
[oracle@localhost u01]$ export ORACLE_BASE=/u01/app
[oracle@localhost u01]$ export ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1
[oracle@localhost u01]$ cd /u01/app/oracle/product/19.3.0/dbhome_1
[oracle@localhost dbhome_1]$ ls
LINUX.X64_193000_db_home.zip
[oracle@localhost dbhome_1]$ unzip LINUX.X64_193000_db_home.zip
[root@localhost ~]# export DISPLAY="localhost:0.0"
[root@localhost ~]# xhost +
xhost: unable to open display "localhost:0.0"
当我执行如上命令的时候,发现无论用root用户还是oracle用户都是报错的,我登录虚拟机图形界面的用户是gavin,你的也可能是其他的。这是因为 我们登录机器图形界面的时候使用的是Gavin,我从命令行里执行的su - oracle 所以是不支持的,直接在图形界面点击logout,然后用Oracle账号密码登录
oracle账号登录后执行安装命令
[oracle@localhost u01]$ xhost +
access control disabled, client can connect from any host
[oracle@localhost u01]$ cd /u01/app/oracle/product/19.3.0/dbhome_1
[oracle@localhost dbhome_1]$ ./runInstaller
遇到如下错误
修改Oracle 系统参数 CV_ASSUME_DISTID 与19c 兼容的版本(建议大家用oracle LINUX 7 安装19C)
[oracle@localhost dbhome_1]$ export CV_ASSUME_DISTID=OEL7.8
[oracle@localhost dbhome_1]$ ./runInstaller
Oracle数据库安装成功,修改 bash_profile 环境变量
[oracle@localhost ~]$ cd ~
[oracle@localhost ~]$ ls -al
total 36
drwx------. 17 oracle oinstall 4096 Jul 4 17:37 .
drwxr-xr-x. 4 root root 33 Jul 4 15:18 ..
-rw-------. 1 oracle oinstall 879 Jul 4 16:32 .bash_history
-rw-r--r--. 1 oracle oinstall 18 Apr 7 2021 .bash_logout
-rw-r--r--. 1 oracle oinstall 281 Jul 4 17:37 .bash_profile
-rw-r--r--. 1 oracle oinstall 376 Apr 7 2021 .bashrc
drwx------. 10 oracle oinstall 238 Jul 4 16:34 .cache
drwx------. 11 oracle oinstall 215 Jul 4 16:41 .config
drwxr-xr-x. 2 oracle oinstall 6 Jul 4 16:34 Desktop
drwxr-xr-x. 2 oracle oinstall 6 Jul 4 16:34 Documents
drwxr-xr-x. 2 oracle oinstall 6 Jul 4 16:34 Downloads
-rw-------. 1 oracle oinstall 16 Jul 4 16:33 .esd_auth
-rw-------. 1 oracle oinstall 314 Jul 4 16:34 .ICEauthority
drwxr-xr-x. 3 oracle oinstall 19 Jul 4 15:52 .java
-rw-r--r--. 1 oracle oinstall 172 Apr 30 2020 .kshrc
drwx------. 3 oracle oinstall 19 Jul 4 16:34 .local
drwxr-xr-x. 4 oracle oinstall 39 Jul 4 2022 .mozilla
drwxr-xr-x. 2 oracle oinstall 6 Jul 4 16:34 Music
drwxr-xr-x. 2 oracle oinstall 6 Jul 4 16:34 Pictures
drwxr-----. 3 oracle oinstall 19 Jul 4 16:34 .pki
drwxr-xr-x. 2 oracle oinstall 6 Jul 4 16:34 Public
drwx------. 2 oracle oinstall 6 Jul 4 17:20 .ssh
drwxr-xr-x. 2 oracle oinstall 6 Jul 4 16:34 Templates
drwxr-xr-x. 2 oracle oinstall 6 Jul 4 16:34 Videos
-rw-------. 1 oracle oinstall 1711 Jul 4 17:37 .viminfo
[oracle@localhost ~]$ vi .bash_profile
ORACLE_BASE=/u01/app
export ORACLE_BASE
ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1/
export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin
[oracle@localhost ~]$ source .bash_profile
4)创建数据库
使用oracle 用户登录图形界面,运行DBCA 创建数据库
[oracle@localhost ~]$ dbca
更多推荐
所有评论(0)