当前位置:网站首页>CentOS 7.9 installing Oracle 21C Adventures

CentOS 7.9 installing Oracle 21C Adventures

2022-07-07 05:20:00 bisal(Chen Liu)

and 19c Installation related historical articles ,

Not Oracle Linux Next Oracle 19c CDB Database installation

Oracle 19c Of examples Silent installation

Not Oracle Linux Lower installation Oracle 19c

Oracle 19c And RPM install

Because there is a scene , Need to use Oracle 21c In the environment of , I plan to install one on the virtual machine . Read the installation file download on the official website , At present, three platforms are provided (Linux x86-64、HP-UX ia64 and Windows x64) Medium of ,

https://www.oracle.com/database/technologies/oracle-database-software-downloads.html

becf3ea82c16d74b28a230838aab3e7f.png

Linux platform , The official website provides rpm and home Two ways to install , This and 19c It's the same , Therefore, the installation process , It should be the same ,

b653d407a7fc0dcecc83c244016ce98b.png

We choose rpm install ,19c Of rpm install CDB He Fei CDB All tested , As shown below ,

Not Oracle Linux Next Oracle 19c CDB Database installation

Oracle 19c And RPM install

reference 19c Installation process , Try installing 21c.

1. install preinstall

rpm Prelude to installation , By installing preinstall To prepare the environment , The following is for Oracle Linux 7 and Oracle Linux 8 Of preinstall Package download address ,

https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-21c-1.0-1.el7.x86_64.rpm

https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm

43f4b76c2c58e750dc2b077fbb64ebe8.png

Although what is said here is aimed at Oracle Linux, But the actual environment I installed this time is CentOS 7.9,Linux The same applies to the kernel .

preinstall In fact, it installs some dependent packages needed in the installation process , In the previous version, we prepared by hand , from 19c Start , Integrated into preinstall in , Convenient for automatic installation , Reduce the difficulty of installation , If some auxiliary packages are missing during installation , You have to install it yourself ,

[[email protected] software]# rpm -ivh oracle-database-preinstall-21c-1.0-1.el7.x86_64.rpm
warning: oracle-database-preinstall-21c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
        ksh is needed by oracle-database-preinstall-21c-1.0-1.el7.x86_64
        nfs-utils is needed by oracle-database-preinstall-21c-1.0-1.el7.x86_64
        policycoreutils-python is needed by oracle-database-preinstall-21c-1.0-1.el7.x86_64
        smartmontools is needed by oracle-database-preinstall-21c-1.0-1.el7.x86_64
        sysstat is needed by oracle-database-preinstall-21c-1.0-1.el7.x86_64
        xorg-x11-utils is needed by oracle-database-preinstall-21c-1.0-1.el7.x86_64
        xorg-x11-xauth is needed by oracle-database-preinstall-21c-1.0-1.el7.x86_64

Install these missing dependent packages , Re execution ,

[[email protected] software]# rpm -ivh oracle-database-preinstall-21c-1.0-1.el7.x86_64.rpm
warning: oracle-database-preinstall-21c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]
        package oracle-database-preinstall-21c-1.0-1.el7.x86_64 is already installed

2. install 21c Database software

CentOS 7.9 use oracle-database-ee-21c-1.0-1.ol7.x86_64.rpm To install .rpm install Oracle The default path is /opt/oracle, Before installation, you need to confirm that the permission of this path is oracle Usable , If it is root, When performing the installation , It will prompt the error ,

[[email protected] software]# 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
Preparing...                          ################################# [100%]


[SEVERE] The install cannot proceed because ORACLE_BASE directory (/opt/oracle)
is not owned by "oracle" user. You must change the ownership of ORACLE_BASE
directory to "oracle" user and retry the installation.


error: %pre(oracle-database-ee-19c-1.0-1.x86_64) scriptlet failed, exit status 1
error: oracle-database-ee-19c-1.0-1.x86_64: install failed

At this time, change the permission ,

chown -R oracle:oinstall /opt/oracle

Re execution , It will be installed normally ,

[[email protected] software]# rpm -ivh oracle-database-ee-21c-1.0-1.ol7.x86_64.rpm
warning: oracle-database-ee-21c-1.0-1.ol7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:oracle-database-ee-21c-1.0-1     ################################# [100%]
[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-21c configure

I hit a pit here , Under normal circumstances , Install the software ,/opt/oracle At least these folders should be included in , If it wasn't for these , There is probably a problem , Pay attention to whether there are errors in the console log ,

cd /opt/oracle
drwxr-x---  3 oracle oinstall 4096 Jul  1 23:50 cfgtoollogs
drwxr-x---  2 oracle oinstall 4096 Jul  1 23:50 dbs
drwxrwxr-x 23 oracle oinstall 4096 Jul  1 23:50 diag
drwxr-x---  3 oracle oinstall 4096 Jul  1 23:50 homes
drwxrwx---  4 oracle oinstall 4096 Jul  1 23:50 oraInventory
drwxr-xr-x  3 oracle oinstall 4096 Jul  1 23:46 product

in addition , Maybe because of my path permission problem , Prompt me that many file permissions are wrong ,

[[email protected] init.d]# /etc/init.d/oracledb_BISALCDB_21c configure
Configuring Oracle Database BISALCDB.
[FATAL] [DBT-10011] Incorrect ownership/permissions detected for the file (/opt/oracle/product/21c/dbhome_1/bin/oradism).
   CAUSE: Following nodes does not have required file ownership/permissions: Node :vm-20-15-centos
PRVG-11960 : Set user ID bit is not set for file "/opt/oracle/product/21c/dbhome_1/bin/oradism" on node "vm-20-15-centos".
PRVG-2031 : Owner of file "/opt/oracle/product/21c/dbhome_1/bin/oradism" did not match the expected value on node "vm-20-15-centos". [Expected = "root(0)" ; Found = "oracle(54321)"]


   ACTION: Run the Oracle Home root script as the "root" user to fix the permissions.
[FATAL] [DBT-05509] Failed to connect to the specified database (BISALCDB).
   CAUSE: OS Authentication might be disabled for this database (BISALCDB).
   ACTION: Specify a valid sysdba user name and password to connect to the database.


Database configuration failed.

for example $ORACLE_HOME/bin The file in should be a linked file ,

[[email protected] bin]# ll oradism
-rwsr-x--- 1 root oinstall 1867552 Jul 28  2021 oradism

But in the environment I installed, this file is a file ,

[[email protected] bin]# ll oradism
-rwxr-x--- 1 root oinstall 1867552 Jul 28  2021 oradism

And at that point it goes through chown When adjusting folders , There may still be a problem , Be sure to execute configure It was adjusted before /opt/oracle Authority .

3. install 21c database

and 19c identical ,21c Can be configured by oracledb_$ORACLE_SID_21c This file is used to install the database ,

P.S. If you change the original oracledb_ORCLCDB_21c The name is

oracledb_BISALCDB_21c,

be /etc/sysconfig Of oracledb_ORCLCDB-21c.conf To be changed to

oracledb_BISALCDB-21c.conf,

[[email protected] init.d]# ./oracledb_BISALCDB_21c configure
Configuring Oracle Database BISALCDB.
Prepare for db operation
8% complete
Copying database files
31% complete
100% complete
[FATAL]


Parsing command line arguments:
    Parameter "silent" = true
    Parameter "local" = true
    Parameter "inscomp" = server
    Parameter "insprtcl" = TCP
    Parameter "orahome" = /opt/oracle/product/21c/dbhome_1
    Parameter "instype" = custom
    Parameter "listener" = LISTENER
    Parameter "lisport" = 1521
    Parameter "cfg" = local
    Parameter "responsefile" = /opt/oracle/product/21c/dbhome_1/network/install/netca_typ.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
LISTENER:No valid IP Address returned for the host VM-20-15-centos.
Profile configuration complete.
Check the trace file for details: /opt/oracle/cfgtoollogs/netca/trace_OraDBHome21cEE-22070212AM1239.log
Oracle Net Services configuration failed.  The exit code is 1
8% complete
0% complete
Look at the log file "/opt/oracle/cfgtoollogs/dbca/BISALCDB/BISALCDB.log" for further details.


Database configuration failed.

There is a mistake here , Look at the tips , It's about configuration Listener when , Cannot find a valid corresponding host name IP Address , from netca journal , You can reconfirm ,

[main] [ 2022-07-02 00:12:40.913 CST ] [ConfigureListener.isPortFree:1330]  InetAddress.getByName(127.0.0.1): /127.0.0.1
[main] [ 2022-07-02 00:12:40.913 CST ] [ConfigureListener.isPortFree:1332]  Local host IP address: VM-20-15-centos/127.0.0.1
[main] [ 2022-07-02 00:12:40.913 CST ] [ConfigureListener.isPortFree:1334]  Local host name: VM-20-15-centos
[main] [ 2022-07-02 00:12:40.913 CST ] [ConfigureListener.isPortFree:1345]  Address VM-20-15-centos
[main] [ 2022-07-02 00:12:40.913 CST ] [ConfigureListener.isPortFree:1345]  Address VM-20-15-centos
[main] [ 2022-07-02 00:12:40.913 CST ] [ConfigureListener.isPortFree:1407]  No IP address returned for host. VM-20-15-centos
[main] [ 2022-07-02 00:12:40.913 CST ] [SilentConfigure.silentConfigureListener:398]  oracle.net.ca.IllegalEndpointException: No valid IP Address returned for the host VM-20-15-centos.

In this case , Need configuration /etc/hosts, Add host name and current intranet IP The relationship between ,

vi /etc/hosts
x.x.x.x      VM-20-15-centos

reinstall , It can be executed normally ,

[[email protected] init.d]# ./oracledb_BISALCDB_21c configure
Configuring Oracle Database BISALCDB.
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/BISALCDB.
Database Information:
Global Database Name:BISALCDB
System Identifier(SID):BISALCDB
Look at the log file "/opt/oracle/cfgtoollogs/dbca/BISALCDB/BISALCDB0.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.

4. Connect to database

Database installation complete , You can log in , because 21c No support for non CDB, therefore sqlplus / as sysdba Login is CDB, We configured a PDB, Can pass alter session set container perhaps tns Log in to this PDB,

ecf774a3e6f057e2ec62245481e7fdbe.png

There is another pit here , I am here $ORACLE_HOME/network/admin Of tnsnames.ora Configuration of the ,

BISALPDB = (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = VM-20-15-centos)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = BISALPDB1)
    )
  )

Normally speaking ,sqlplus user/[email protected] You can log in , But it's always suggested that ,

73c7c8b50dbabe526f6bb28e46dfb37d.png

ORA-12514 My mistake is TNS Configuration error , But I looked at the document , There's really nothing wrong . After many attempts , Even if I delete $ORACLE_HOME/network/admin/

tnsnames.ora The content of , Can be implemented tnsping BISALCDB, This is strange .

" When things go out of whack, they will ", Compared several configuration files 、 Monitoring configuration and other information , Find a doubtful point ,lsnrctl status Medium Listener Parameter File The path is /opt/oracle/homes/, Not at all /opt/oracle/product/...,

47a7d931c9f6627f8e93eed84527b3e7.png

Let's take a look at /opt/oracle/homs/ Of tnsnames The configuration file , Indeed, only the above tests exist BISALCDB, No wonder it was deleted /opt/oracle/product Of tnsnames.ora Content , No entry into force , It turned out that the wrong document , But why is the listening parameter file here , It's not very elegant , It's probably the first time to install , There are some problems with the configuration , A parameter adopts the default ,

[[email protected] admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /opt/oracle/homes/OraDBHome21cEE/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.


LISTENER_BISALCDB =
  (ADDRESS = (PROTOCOL = TCP)(HOST = VM-20-15-centos)(PORT = 1521))


BISALCDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = VM-20-15-centos)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = BISALCDB)
    )
  )

In order to solve this , I deleted /opt/oracle/homes Wrong path tnsnames.ora、listener.ora, Restart monitoring , Will be looking for $ORACLE_HOME/network/admin Of tnsnames.ora,

4e297f180d076ad473cc45ab1b498147.png

If a friend knows how to change it more accurately Listener Parameter File The way of value , Please advise .

You can use TNS Log in normally to PDB,

7e897544c722f93e48ad4939ae0ceb83.png

21c The overall use and operation of , and 19c The difference is not too big , Aspects of new features , You also need to test to understand .

Recently updated articles :

Linux Of 10 Great danger orders

You know, Oracle Is there an upper limit on the size of the data file ?

Oracle and JSON The combination of

How to " grace " avoid MySQL Login tips

Xiaobai studies MySQL - Incremental Statistics SQL The needs of - Scheme of windowed function

Recent hot articles :

" Red Alert " Game open source code brings us a shock

Article classification and indexing :

official account 1000 Article classification and index

原网站

版权声明
本文为[bisal(Chen Liu)]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207062242498815.html