1、oracle下载地址
自行官网找吧!
若使用Oracle11g推荐安装11.2.0.4版本;
若使用Oracle12c推荐安装12.2.0.1版本或12.2.0.3;
若使用Oracle19c自行去研究吧;
Oracle 12.1.0.2数据库版本在进行流式批量更新操作LOB数据存在BUG,已收录于Oracle Bug 19703301
ORA-22275 “invalid lob locator specified” if fix for bug 14044260 present
https://support.oracle.com/knowledge/Oracle%20Database%20Products/2015052_1.html
本文的版本是12.2.0.1的版本,此版本没有上述版本bug问题。
2、解压缩
[root@shigj oracle12c]# unzip linuxx64_12201_database.zip
3、创建安装需要的组和用户
[root@shigj oracle12c]# groupadd oinstall
[root@shigj oracle12c]# groupadd dba
[root@shigj oracle12c]# groupadd oper
[root@shigj oracle12c]# useradd -g oinstall -G dba -s /bin/bash oracle
[root@shigj oracle12c]# gpasswd -a oracle dba
Adding user oracle to group dba
[root@shigj oracle12c]# gpasswd -a oracle oper
Adding user oracle to group oper
[root@shigj oracle12c]# gpasswd -a oracle oinstall
Adding user oracle to group oinstall
4、创建数据库安装目录
[root@shigj oracle12c]# mkdir -p /app/oracle/product/12c/dbhome_1
[root@shigj oracle12c]# mkdir -p /app/oraInventory
5、修改安装目录属主、初始化oracle用户密码
[root@shigj oracle12c]# chown -R oracle:oinstall /app
[root@shigj oracle12c]# 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.
6、修改Oracle用户环境变量
[oracle@shigj ~]$ vim .bash_profile
export ORACLE_BASE=/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12c/dbhome_1
export ORACLE_SID=oadb
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
[oracle@shigj ~]$ source .bash_profile
7、修改主机文件
[root@shigj ~]# echo '127.0.0.1 oadb' >> /etc/hosts
[root@oadb ~]# hostnamectl set-hostname oadb
[root@oadb ~]# hostnamectl
Static hostname: oadb
Icon name: computer-vm
Chassis: vm
Machine ID: 20220322150908035081894917625632
Boot ID: a11c286fa7b4417ebbeea3d0c5418794
Virtualization: kvm
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1160.59.1.el7.x86_64
Architecture: x86-64
[root@shigj ~]# chown -R oracle:oinstall /oracle19c/
8、开始安装
报错
[oracle@oadb oracle12c]$ ./runInstaller
ERROR: Unable to verify the graphical display setup. This application requires X display. Make sure that xdpyinfo exist under PATH variable.
/oracle19c/perl/bin/perl: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory
[oracle@oadb oracle19c]$ startx
xauth: file /home/oracle/.serverauth.42206 does not exist
xauth: file /home/oracle/.Xauthority does not exist
xauth: file /home/oracle/.Xauthority does not exist
/usr/libexec/Xorg.wrap: Only console users are allowed to run the X server
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
Couldn't get a file descriptor referring to the console
在root用户下执行xorg*的安装
[root@oadb ~]# yum -y install xorg*
其他另类报错
[oracle@oadb oracle12c]$ cd /tmp/OraInstall2022-04-16_01-53-48PM
- An internal error occurred within cluster verification framework The command executed was "/tmp/CVU_12.2.0.1.0_oracle//exectask.sh -getver". The output from the command was "/tmp/CVU_12.2.0.1.0_oracle/exectask: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory"
解决办法
Redhat/Fedora/CentOS下执行即可:
[root@oadb /]# yum -y install libaio
安装所需的包,CentOS7通过yum源都能直接安装
Package: compat-libcap1-1.10
Package: compat-libstdc+±33-3.2.3 (x86_64)
Package: libstdc+±devel-4.8.2 (x86_64)
Package: gcc-c+±4.8.2
Package: ksh
Package: libaio-0.3.109 (x86_64)
Package: libaio-devel-0.3.109 (x86_64)
通过root执行以下提示的脚本
[root@oadb oraInventory]# ls
ContentsXML logs oraInst.loc orainstRoot.sh oui
[root@oadb oraInventory]# ./orainstRoot.sh
Changing permissions of /app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /app/oraInventory to oinstall.
The execution of the script is complete.
[root@oadb oraInventory]# cd /app/oracle/product/19c/dbhome_1/
出现路径选择时,按回车键选择默认路径
[root@oadb dbhome_1]# ./root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /app/oracle/product/19c/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.
脚本运行完毕后,返回弹窗处,点击“OK”,完成Oracle数据库软件安装
9、数据库监听配置
以oracle用户身份登录,执行命令“netca”
[oracle@oadb ~]$ dbca
此处重点选择:如果你对12c之后引入容器数据库了解的很多,此处正常勾选;如果对容器数据还不明白,建议不要勾选,以免给自己徒增烦恼。