安装
-
下载
从 Oracle官方下载地址 需要的版本,本次安装是在Linux上使用yum安装,因此下载的是RPM。另外,需要说明的是,Oracle加了锁的下载需要登录用户才能安装,而用户是可以免费注册的,这里不做过多说明。
-
安装
# 创建oracle用户组
[root@QingYun oracle19]# groupadd oracle
# 创建oracle用户
[root@QingYun oracle19]# useradd -g oracle -G oracle oracle
# rpm安装oracle
[root@QingYun oracle19]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm
使用上述rpm,不出意外的话,应该会报错如下:
[root@QingYun oracle19]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm
warning: oracle-database-ee-19c-1.0-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
oracle-database-preinstall-19c is needed by oracle-database-ee-19c-1.0-1.x86_64
意思是:oracle-database-ee-19c-1.0-1.x86_64.rpm
依赖的oracle-database-preinstall-19c
没有安装。
解决这个错误,需要从 Oracle官网yum源 下载rpm依赖包oracle-database-preinstall-19c
安装即可。
[root@QingYun oracle19]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
warning: oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
bind-utils is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
compat-libcap1 is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
compat-libstdc++-33 is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
ksh is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
libaio-devel is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
nfs-utils is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
psmisc is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
smartmontools is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
xorg-x11-utils is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
xorg-x11-xauth is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
可以看到,安装oracle-database-preinstall-19c
时也有很多依赖的包,依次进行安装即可。
这里也罗列了我之前下载安装的一些列依赖rpm,有点多,耐心安装即可:
[root@QingYun oracle19]# ls
bind-libs-9.9.4-74.el7_6.2.x86_64.rpm
bind-license-9.9.4-74.el7_6.2.noarch.rpm
bind-utils-9.9.4-74.el7_6.2.x86_64.rpm
compat-libcap1-1.10-7.el7.x86_64.rpm
compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
GeoIP-1.5.0-14.el7.x86_64.rpm
geoipupdate-2.5.0-1.el7.x86_64.rpm
glibc-2.17-322.0.1.el7_9.x86_64.rpm
glibc-common-2.17-322.0.1.el7_9.x86_64.rpm
ksh-20120801-144.0.1.el7_9.x86_64.rpm
libaio-devel-0.3.109-13.el7.x86_64.rpm
libdmx-1.1.3-3.el7.x86_64.rpm
libXmu-1.1.2-2.el7.x86_64.rpm
libXt-1.1.5-3.el7.x86_64.rpm
libXtst-1.2.3-1.el7.x86_64.rpm
libXv-1.0.11-1.el7.x86_64.rpm
libXxf86dga-1.1.4-2.1.el7.x86_64.rpm
libXxf86misc-1.0.3-7.1.el7.x86_64.rpm
mailx-12.5-19.el7.x86_64.rpm
nfs-utils-1.3.0-0.68.0.1.el7.x86_64.rpm
oracle-database-ee-19c-1.0-1.x86_64.rpm
oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
psmisc-22.20-17.el7.x86_64.rpm
quota-4.01-19.el7.x86_64.rpm
rpcbind-0.2.0-49.el7.x86_64.rpm
smartmontools-7.0-2.el7.x86_64.rpm
xorg-x11-utils-7.5-23.el7.x86_64.rpm
xorg-x11-xauth-1.0.9-1.el7.x86_64.rpm
问题
1. su oracle 报错
2.乱码
安装好之后,使用sqlplus登录之后,可以看到SQL界面的显示都是???
,这个实际上是中文显示乱码
解决这个问题,直接修改数据库字符集为英文
SQL> conn /as sysdba;
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter system enable restricted session;
SQL> alter system set job_queue_processes=0;
SQL> alter system set aq_tm_processes=0;
SQL> alter database open;
# 设置成中文
SQL> alter database character set internal_use ZHS16GBK;
# 设置成英文
SQL> alter database character set internal_use AL32UTF8;
SQL> alter system set nls_language = 'AMERICAN' scope = spfile;
SQL> alter system set nls_territory = 'AMERICA' scope = spfile;
SQL> shutdown immediate;
SQL> startup;