本文档描述了在CentOS Linux release 7.5.1804 (Core)上安装Oracle19C 数据库服务器版的安装过程。
节点 |
|
主机型号 |
|
操作系统版本 |
CentOS Linux release 7.5.1804 (Core) |
oracle软件版本 |
19.2.0.0.0 |
oracle实例名 |
Oradb |
Public IP |
192.168.106.128 |
127.0.0.1 localhost
192.168.106.128 oradb
root用户执行:
groupadd -g 5001 dba
groupadd -g 5002 asmdba
groupadd -g 5003 backupdba
groupadd -g 5004 dgdba
groupadd -g 5005 kmdba
groupadd -g 5006 racdba
groupadd -g 5007 oper
groupadd -g 5008 oinstall
/usr/sbin/useradd -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper oracle
mkdir -p /u01/app/oracle/{oraInventory,product/19.2.0/db}
chown -R oracle:oinstall /u01
chmod -R 775 /u01
passwd oracle
/etc/security/limits.conf中增加如下几行
oracle soft nproc 8192
oracle hard nproc 16384
oracle soft nofile 8192
oracle hard nofile 65536
修改#GSSAPIAuthentication yes
GSSAPIAuthentication no
修改#UseDNS yes
UseDNS no
# systemctl get-default
#cat /etc/inittab
#systemctl set-default graphical.target //由命令行模式更改为图形界面模式
#systemctl set-default multi-user.target //由图形界面模式更改为命令行模式
[root@oradb ~]# systemctl status firewalld.service
[root@oradb ~]# systemctl stop firewalld.service
[root@oradb ~]# systemctl disable firewalld.service
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
# sysctl –p
mkdir -p /media/cdrom
mount /dev/sr0 /media/cdrom
cat > /etc/yum.repos.d/dvd.repo < [dvd] name=install dvd baseurl=file:///media/cdrom enabled=1 gpgcheck=0 END yum install tigervnc-server tigervnc vnc vnc-server yum -y install compat-libcap1-1.10-7.el7.x86_64.rpm yum -y install libstdc++-devel-4.8.5-28.el7.x86_64.rpm yum -y install gcc-c++-4.8.5-28.el7.x86_64.rpm yum -y install ksh-20120801-137.el7.x86_64.rpm yum -y install glibc-devel-2.17-222.el7.x86_64.rpm yum -y install libaio-devel-0.3.109-13.el7.x86_64.rpm yum -y install compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm 需要下载 #vi /etc/profile # for oracle setting 在文档内加入以下内容 if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi oracle用户: $ cd $ vi .bash_profile 加入: export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/19.2.0/db export ORACLE_SID=oradb export ORACLE_TERM=xterm export ORACLE_OWNER=oracle export TNS_ADMIN=$ORACLE_HOME/network/admin export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK" export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:/lib:/usr/lib:/usr/local/lib export LIBPATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:/lib:/usr/lib:/usr/local/lib export PATH=$PATH:/sbin:/usr/lbin:/usr/sbin:$JAVA_HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/lib:$HOME/bin:$ORACLE_HOME/OPatch:. umask 022 注意:修改完.bash_profile配置文件之后,oracle用户需要重新SSH登录,所设定的环境变量才会真正生效。 以oracle用户身份通过FTP方式上传安装包至Linux主机目录:cd $ORACLE_HOME (即oracle用户的home主目录下) cd $ORACLE_HOME /u01/app/oracle/product/19.2.0/db V981623-01.zip Xshell为Xmanager工具套件中所包含的xstart客户端,推荐使用此工具。 或也可以通过ilo界面,直接通过oracle用户登录,在图形界面上安装。 cd $ORACLE_HOME /u01/app/oracle/product/19.2.0/db unzip V981623-01.zip 切换至database子目录下,运行./runInstaller (oracle身份),即可出现图形化的安装界面。 注意:以oracle用户登录执行 安装准备工作完毕之后,我们即可看到oracle图形化的安装界面(如下图所示)。 这里只选择安装软件,实例在软件安装好后再安装。 root执行2个脚本 密码均为oracle Yes继续 连接测试,创建表空间,创建用户,创建表,查询测试 SQL> select * from product_component_version; PRODUCT VERSION VERSION_FULL STATUS -------------------------------------------------- -------------------- -------------------- -------------------- Oracle Database 19c Enterprise Edition 19.0.0.0.0 19.2.0.0.0 Production col name format a20 col open_mode format a20 SQL> select con_id,name,open_mode from v$pdbs; CON_ID NAME OPEN_MODE ---------- ---------------- ---------- 2 PDB$SEED READ ONLY 3 ORAPDB19 READ WRITE --SQL> alter pluggable database ORAPDB19 open; SQL> alter session set container=ORAPDB19; Session altered. SQL> create tablespace HUORAN datafile '/u01/app/oracle/oradata/ORADB/orapdb19/huoran.dbf' size 10M; Tablespace created. SQL> create user huoran identified by huoran default tablespace HUORAN; User created. SQL> grant connect,dba,resource to huoran; Grant succeeded. 另外开终端连接刚创建好的用户或者配置tns连接 [oracle@oradb ~]$ sqlplus huoran/[email protected]:1521/orapdb19 SQL*Plus: Release 19.0.0.0.0 - Production on Thu Apr 18 20:21:30 2019 Version 19.2.0.0.0 Copyright (c) 1982, 2018, Oracle. All rights reserved. Last Successful login time: Thu Apr 18 2019 19:59:59 +08:00 Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.2.0.0.0 SQL> SQL> col NAME format a20 SQL> select con_id,name,open_mode from v$pdbs; CON_ID NAME OPEN_MODE ---------- ---------------- ---------- 3 ORAPDB19 READ WRITE SQL> create table test(id int primary key,name varchar2(16)); Table created. SQL> insert into test values(1,'huoran'); 1 row created. SQL> commit; Commit complete. SQL> select * from test; ID NAME ---------- ---------------- 1 huoran SQL> select db_unique_name from v$database; DB_UNIQUE_NAME ------------------------------ Oradb