最近學習開源,發現不止MySQL,很多開源的產品都有個特點:安裝簡單。
而回過頭來看傳統的Oracle確實是太重了,在這個用戶產品快速更新迭代的時代下,如果數據庫這類基礎產品的安裝部署都需花費很長時間顯然是有些跟不上節奏的。
不過Oracle其實也沒有固步自封,較新版本中也推出了很多簡化的特性,比如在19c中已經引入了rpm的安裝方式。最近在給同事准備一套19c單實例的測試環境時,就嘗試了下這個rpm的安裝方式,整體來說還是很方便的。
環境:OEL 7.6
核心命令就三條:
--1.安裝依賴包
[root@db19 ~]# yum install oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
--2.安裝數據庫軟件
[root@db19 ~]# yum install oracle-database-ee-19c-1.0-1.x86_64.rpm
--3.配置數據庫實例
[root@db19 ~]# /etc/init.d/oracledb_ORCLCDB-19c configure
記錄下實際安裝的過程:
1.OEL7.6中沒有preinstall-19c,只有18c,認為基本一樣,就先安裝了18c
[root@db19 ~]# yum install oracle-database-preinstall-19c
Loaded plugins: ulninfo
No package oracle-database-preinstall-19c available.
Error: Nothing to do
[root@db19 ~]# yum install oracle-database-preinstall-*
Loaded plugins: ulninfo
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-preinstall-18c.x86_64 0:1.0-1.el7 will be installed
--> Processing Dependency: xorg-x11-xauth for package: oracle-database-preinstall-18c-1.0-1.el7.x86_64
...省略...
Complete!
2.安裝oracle-database-ee-19c報錯有依賴oracle-database-preinstall-19c
[root@db19 ~]# yum install oracle-database-ee-19c-1.0-1.x86_64.rpm
Loaded plugins: ulninfo
Examining oracle-database-ee-19c-1.0-1.x86_64.rpm: oracle-database-ee-19c-1.0-1.x86_64
Marking oracle-database-ee-19c-1.0-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-ee-19c.x86_64 0:1.0-1 will be installed
--> Processing Dependency: oracle-database-preinstall-19c for package: oracle-database-ee-19c-1.0-1.x86_64
--> Finished Dependency Resolution
Error: Package: oracle-database-ee-19c-1.0-1.x86_64 (/oracle-database-ee-19c-1.0-1.x86_64)
Requires: oracle-database-preinstall-19c
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[root@db19 ~]#
3.下載oracle-database-preinstall-19c並安裝:
[root@db19 ~]# 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
Preparing... ################################# [100%]
Updating / installing...
1:oracle-database-preinstall-19c-1.################################# [100%]
4.再次嘗試安裝oracle-database-ee-19c成功,需要6.9G空間
[root@db19 ~]# yum install oracle-database-ee-19c-1.0-1.x86_64.rpm
Loaded plugins: ulninfo
Examining oracle-database-ee-19c-1.0-1.x86_64.rpm: oracle-database-ee-19c-1.0-1.x86_64
Marking oracle-database-ee-19c-1.0-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-ee-19c.x86_64 0:1.0-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==================================================================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================================================================
Installing:
oracle-database-ee-19c x86_64 1.0-1 /oracle-database-ee-19c-1.0-1.x86_64 6.9 G
Transaction Summary
==================================================================================================================================================================================
Install 1 Package
Total size: 6.9 G
Installed size: 6.9 G
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : oracle-database-ee-19c-1.0-1.x86_64 1/1
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure a sample Oracle Database you can execute the following service configuration script as root: /etc/init.d/oracledb_ORCLCDB-19c configure
Verifying : oracle-database-ee-19c-1.0-1.x86_64 1/1
Installed:
oracle-database-ee-19c.x86_64 0:1.0-1
Complete!
5.安裝配置數據庫
[root@db19 ~]# /etc/init.d/oracledb_ORCLCDB-19c configure
Configuring Oracle Database ORCLCDB.
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
/opt/oracle/cfgtoollogs/dbca/ORCLCDB.
Database Information:
Global Database Name:ORCLCDB
System Identifier(SID):ORCLCDB
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.
Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database using 'sqlplus / as sysdba' as the oracle user.
[root@db19 ~]#
6.檢查環境可正常登陸
[oracle@db19 ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jul 6 23:46:06 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB1 READ WRITE NO
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8
SQL> alter session set container=ORCLPDB1;
Session altered.
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8