Benutzer-Werkzeuge

Webseiten-Werkzeuge


dba:oracle_18c_se_linux

Oracle 18c Standard Edition auf Oracle Linux 7.7 installieren und per Scripts die Datenbank erstellen

12.2019

Aufgaben: Einen Oracle 18c Standard Edition unter Linux 7.7 installieren und per Script die Datenbanken erstellen

Ablauf:

  1. Software bereitstellen (Datenbank + Patch)
  2. Basis Installation eines Oracle Linux 7.7 ohne weitere Optionen
    1. Betriebsystem auf den Betrieb einer Oracle Umgebung einstellen
    2. Sicherstellen, das X-Forwarding auf die eigene Maschine funktioniert
    3. Sicherstellen das Screen auch funktioniert und eingerichtet ist
  3. Software auf dem Server entpacken und per Installer konfigurieren
  4. Oracle Umgebung optimieren
  5. Patch einspielen
  6. Listener konfiguration
  7. TFA Konfiguration
  8. AutoStart einrichten
  9. Backup einrichten

Software Bereitstellen

Linux laden von https://edelivery.oracle.com/ - Nach dem Download die Checksum prüfen!

V983339-01.iso - Oracle Linux Release 7 Update 7 for x86 (64 bit), 4.4 GB

SHA-1		3EF94628CF1025DAB5F10BBC1ED2005CA0CB0933
SHA-256		1D06CEF6A518C32C0E7ADCAD0A99A8EFBC7516066DE41118EBF49002C15EA84D

Datenbank von https://edelivery.oracle.com/ - Nach dem Download die Checksum prüfen!

V978967-01.zip Oracle Database 18.0.0.0.0, 4.3 GB

SHA-1		C261C2ABA86D923BCCC662551223D0AEA565A6ED
SHA-256		C96A4FD768787AF98272008833FE10B172691CF84E42816B138C12D4DE63AB96

Patch von Support Portal für die Oracle 18c DB laden:

  • p30133203_180000_Linux-x86-64.zip
  • p6880880_121010_Linux-x86-64.zip

Betriebsystem installieren und bereitstellen

Nach der Basis Standard Installation ohne Optionen das Netzwerk wie benötigt einrichten.

Im Anschluss das Betriebsystem für die Oracle Installation einrichten, siehe dazu ⇒ Ein Oracle Linux 7 Basis System als Grundlagen für eine Oracle Clusterware und Datenbank Installation vorbereiten.

Screen prüfen um zu verhindern, das Netzwerkfehler die Installation oder ähnlich wichtiges abbrechen, siehe dazu ⇒ Skripte mit screen in den Hintergrund schieben


Installation der DB Software

Die Oracle DB Software wird mit der Version 18c in das entsprechende Home einfach ausgepackt.

Aus diesem Oracle Home wird der Installer dann gestartet, dieser konfiguriert das Oracle Home und linkt die Oracle Libraries.

Ablauf:

Datei auspacken

# als User Oracle
mkdir -p  /opt/oracle/product/18.0.0/dbhome_1
unzip V978967-01.zip -d /opt/oracle/product/18.0.0/dbhome_1

Den Installer aus dem Home starten

cd /opt/oracle/product/18.0.0/dbhome_1
./runInstaller

Ablauf:

  1. Software only ⇒ Next
  2. Single instance database installation ⇒ Next
  3. Standard Edition 2 ⇒ Next
  4. Oracle Base „/opt/oracle“ ⇒ Next
  5. Inventory Directory „/opt/oraInventory“ ⇒ Next
  6. Privileged Operation System groups „dba“ ⇒ Next
  7. Root script execution configuration ⇒ Next
  8. Perform Prerequisite Checks, Ignor All ⇒ Next
  9. Save Response File
  10. Summary ⇒ Install
  11. Progress
  12. Execute root Scripts ⇒ Ok
  13. Finish

Oracle Umgebung optimieren

Umgebungscripte einrichten

Je nach Geschmack empfiehlt es sich ein Script unter den User oracle zu setzen, das die Umgebung einstellt und einen schnellen Zugriff auf oft benötigte Dateien ermöglicht.

Wie ⇒ Arbeitsumgebung setzen und Einrichten unter Windows und Linux

Ich verwende dazu folgendes Script .profile und folgende .bash_profile

  • Script „.profile“ nach „~/“ Home des Oracle Users kopieren
  • den Aufruf in die „.bash_profile“ eintragen bzw. „.bash_profile“ ersetzen
  • Verzeichnis ~/sql anlegen und zum Beispiel die SQL Script von Gunther SQL Scripte dorthin kopieren
  • neu anmelden bzw. mit „. .bash_profile“ Umgebung neu sourcen/einlesen
  • Setup wird automatisch durchgeführt
  • Mit „setdb“ kann nun die vorgefunden Umgebung gesetzt werden (ORACLE_SID/ORALCE_HOME/Pfade etc.)Umgebung mit eigenen Script einstellen

Oracle Patch einspielen

Nach der Software Installation gleich den aktuellen Patch für die 18c einspielen, zur Zeit ( 12.2019) den p30133203_180000_Linux-x86-64.zip.

Opatch einspielen

Als erstes OPATCH patchen:

cd $ORACLE_HOME
mv OPatch/ OPatch_ORIG
 
cd /opt/oracle/install
 
unzip p6880880_121010_Linux-x86-64.zip -d $ORACLE_HOME
 
 
cd $ORACLE_HOME/OPatch
 
./opatch version
OPatch Version: 12.2.0.1.18
 
OPatch succeeded.

Patch einspielen

cd /opt/oracle/install
unzip p30133203_180000_Linux-x86-64.zip
 
cd 30133203/30112122
 
$ORACLE_HOME/OPatch/opatch apply
 
..
 
Is the local system ready for patching? [y|n]
y
User Responded with: Y
...
Patching component oracle.rdbms, 18.0.0.0.0...
...
 
Patch 30112122 successfully applied.
 
..
 
 
cd ..
 
cd 30133603
 
$ORACLE_HOME/OPatch/opatch apply
..
Patching component oracle.javavm.server, 18.0.0.0.0...
...
 
Patch 30133603 successfully applied.

DB per Script aufsetzen

Mit Hilfe meiner Script Library unter https://github.com/gpipperr/OraPowerShell/tree/master/Ora_Bash_create_database läßt sich eine Datenbank per Script erstellen.

Die Idee hinter dem Script ist das Setup von möglichst gleichen Datenbank Umgebungen um einen hohen Standardisierungs-Grad zu erreichen.

Ablauf:

Ablauf nach Aufruf der „create_gpi_database.sh“:

 
[oracle@gpidbsrv:create_database ]$ ./create_gpi_database.sh
-- Info :: Oracle HOME found  : use as ORACLE HOME - /opt/oracle/product/18.0.0/dbhome_1
-- Info :: Oracle BASE found  : use as ORACLE BASE - /opt/oracle
   -------------------------------------------------
   Welcome to the installation of the Database v2.2
   -------------------------------------------------
   Check environment .....
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
   ............... finish
-----------------------------------
   Check on installed ASM enviroment
  please enter the Name of the database you like to install [GPIDB]:
-----------------------------------
!! Check the name resolution of the DB host
-----------------------------------
PING gpidbsrv (192.168.123.99) 56(84) bytes of data.
64 bytes from gpidbsrv (192.168.123.99): icmp_seq=1 ttl=64 time=0.023 ms
 
--- gpidbsrv ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.023/0.023/0.023/0.000 ms
-----------------------------------
!! Check the Status of the Oracle Listener
-----------------------------------
 
LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 04-DEC-2019 21:11:34
 
Copyright (c) 1991, 2019, Oracle.  All rights reserved.
 
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 18.0.0.0.0 - Production
Start Date                03-DEC-2019 09:41:43
Uptime                    1 days 11 hr. 29 min. 51 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /opt/oracle/diag/tnslsnr/gpidbsrv/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gpidbsrv)(PORT=1521)))
The listener supports no services
The command completed successfully
-----------------------------------
-----------------------------------
  please enter the Edition of the database you like to install
  EE for Enterprise or SE for Standard [SE]:
-----------------------------------
   Environment
    Database            : GPIDB
    Hostname            : gpidbsrv.intec.de
    DB Type             : Single Instance
    DB Storage          : Filesystem Storage
    DB Version          :
    DB Edition          : SE
-----------------------------------
   Define the Character Set of your database
  please enter the Charset of the database you like to install [AL32UTF8]:
-----------------------------------
   Define the storage locations for the datafiles of your database
   Set the Redo Log Destination 1 location
 +please enter the location for the Redo Log Destination 1 of the Database
   [/opt/oracle/oradata/redo1]:
   /opt/oracle/oradata/redo1 exists
   Set the Redo Log Destination 2 location
 +please enter the location for the Redo Log Destination 2 of the Database
   [/opt/oracle/oradata/redo2]:
   /opt/oracle/oradata/redo2 exists
   Set the System Tablespace location
 +please enter the location for the System Tablespace of the Database
   [/opt/oracle/oradata/GPIDB/system01.dbf]:
   /opt/oracle/oradata/GPIDB/system01.dbf exists
   Set the SYSAUX Tablespace location
 +please enter the location for the SYSAUX Tablespace of the Database
   [/opt/oracle/oradata/GPIDB/sysaux01.dbf]:
   /opt/oracle/oradata/GPIDB/sysaux01.dbf exists
   Set the AUDITLOG Tablespace location
 +please enter the location for the AUDITLOG Tablespace of the Database
   [/opt/oracle/oradata/GPIDB/auditlog01.dbf]:
   /opt/oracle/oradata/GPIDB/auditlog01.dbf exists
   Set the TEMP Tablespace location
 +please enter the location for the TEMP Tablespace of the Database
   [/opt/oracle/oradata/GPIDB/temp01.dbf]:
   /opt/oracle/oradata/GPIDB/temp01.dbf exists
   Set the UNDO 1 Tablespace location
 +please enter the location for the UNDO 1 Tablespace of the Database
   [/opt/oracle/oradata/GPIDB/undo01.dbf]:
   /opt/oracle/oradata/GPIDB/undo01.dbf exists
   Set the USER Tablespace location
 +please enter the location for the USER Tablespace of the Database
   [/opt/oracle/oradata/GPIDB/user01.dbf]:
   /opt/oracle/oradata/GPIDB/user01.dbf exists
   Set the Flash Recovery location
 +please enter the location for the Flash Recovery of the Database
   [/opt/oracle/flash_recovery_area]:
   Location /opt/oracle/flash_recovery_area not exists, will be generated
-----------------------------------
   Use as ORACLE_HOME for the DB Install the path from default.conf :: /opt/oracle/product/18.0.0/dbhome_1
   Use as ORACLE BASE for the DB Install the path from default.conf :: /opt/oracle
   Use this Oracle Home and Oracle Base?   [NO]:YES
-----------------------------------
-----------------------------------
   Instance : GPIDB
-----------------------------------
   Oracle System User Passwords
-----------------------------------
User : SYS   [oracle]:
User : SYSTEM   [oracle]:
User : SYSMAN   [oracle]:
User : DBSNMP   [oracle]:
-----------------------------------
-----------------------------------
   Create the nessesary directories
-----------------------------------
   Start the installation of the database with the following parameter:
    Oracle Home           : /opt/oracle/product/18.0.0/dbhome_1
    Oracle DB Name        : GPIDB
    Oracle DB Edition     : SE
-----------------------------------
    Oracle Rac            : No RAC Enviroment
-----------------------------------
    Main Character Set    : AL32UTF8
-----------------------------------
    Compatible Parameter  : 18.0.0.0
    Blocksize  Parameter  : 8192
-----------------------------------
    System Tablespace     : /opt/oracle/oradata/GPIDB/system01.dbf
    Sysaux Tablespace     : /opt/oracle/oradata/GPIDB/sysaux01.dbf
    Auditlog Tablespace   : /opt/oracle/oradata/GPIDB/auditlog01.dbf
    Temp Tablespace       : /opt/oracle/oradata/GPIDB/temp01.dbf
    Undo Tablespace       : /opt/oracle/oradata/GPIDB/undo01.dbf
    Redolog destination 1 : /opt/oracle/oradata/redo1/GPIDB
    Redolog destination 2 : /opt/oracle/oradata/redo2/GPIDB
    FLASH Recovery Area   : /opt/oracle/flash_recovery_area
    Diagnostic Destination: /opt/oracle
-----------------------------------
   Do you want to start the DB creation?   [NO]: YES

Parallel in einer zweiten Session den Aufbau der DB überwachen mit „adrci> show alert -tail -f“:

[oracle@gpidbsrv:~ ]$ setdb
-----------------------------------
    Current ORACLE SID  :
-----------------------------------
   Possible New Environments:
    1 ---> -          Home:  t/18.0.0/dbhome_1
   Selection   [1]:
-----------------------------------
    New ORACLE SID set  : -
    New ORACLE HOME set : {/opt/oracle/product/18.0.0/dbhome_1}
-----------------------------------
[oracle@gpidbsrv:~ ]$ adrci
 
ADRCI: Release 18.0.0.0.0 - Production on Wed Dec 4 21:18:13 2019
 
Copyright (c) 1982, 2018, Oracle and/or its affiliates.  All rights reserved.
 
ADR base = "/opt/oracle"
adrci> show homes
ADR Homes:
diag/rdbms/intec/INTEC
diag/tnslsnr/gpidbsrv/listener
adrci> set home diag/rdbms/gpi/GPI
adrci> show alert -tail -f

Auto Start

Oracle Trace File Analyzer (TFA)

Mehr zum Thema siehe unter Oracle 12c / 18c - Die RAC Umgebung mit Oracle Trace File Analyzer (TFA) überprüfen - 19 Autonomous Health Framework (AHF)

Mit der DB Software ist auch eine Basis Version von TAF mit geliefert worden.

Anmelden als root:

 
/opt/oracle/tfa/bin/tfactl status
 
WARNING - TFA Software is older than 180 days. Please consider upgrading TFA to the latest version.
 
.----------------------------------------------------------------------------------------------------.
| Host         | Status of TFA | PID  | Port  | Version    | Build ID             | Inventory Status |
+--------------+---------------+------+-------+------------+----------------------+------------------+
| gpidbsrv | RUNNING       | 2051 | 10861 | 18.1.0.0.0 | 18100020171203222424 | COMPLETE         |
'--------------+---------------+------+-------+------------+----------------------+------------------'

D.h als erstes muss das mal auf den neusten Stand gebracht werden.

Download von „TFA & ORAchk/EXAchk 19.3.2 for Linux“ über die DOK ID ⇒ Autonomous Health Framework (AHF) - Including TFA and ORAchk/EXAChk (Doc ID 2550798.1)

Als root installieren, dazu auspacken und mit „ahf_setup“ installieren.

Als User Root:

yum install -y perl-Digest-MD5
 
 
unzip AHF-LINUX_v19.3.2.zip
 
 
./ahf_setup
 
..
Installed TFA Version : 181000 Build ID : 20171203222424
 
Default AHF Location : /opt/oracle/tfa
 
Do you want to change AHF Location (/opt/oracle/tfa) ? Y|[N] : Y
 
Please Enter new AHF Location : /opt/tfa
 
AHF Location : /opt/tfa/oracle.ahf
 
AHF Data Directory stores diagnostic collections and metadata.
AHF Data Directory requires at least 5GB (Recommended 10GB) of free space.
 
Choose Data Directory from below options :
 
1. /opt/tfa/oracle.ahf [Free Space : 25801 MB]
2. Enter a different Location
 
Choose Option [1 - 2] : 1
..
 
Do you want to add AHF Notification Email IDs ? [Y]|N : Y
 
Enter Email IDs separated by space : mymonitor@logger.cn
....
.--------------------------------------------------------------.
|                 Summary of AHF Configuration                 |
+-----------------+--------------------------------------------+
| Parameter       | Value                                      |
+-----------------+--------------------------------------------+
| AHF Location    | /opt/tfa/oracle.ahf                        |
| TFA Location    | /opt/tfa/oracle.ahf/tfa                    |
| Orachk Location | /opt/tfa/oracle.ahf/orachk                 |
| Data Directory  | /opt/tfa/oracle.ahf/data                   |
| Repository      | /opt/tfa/oracle.ahf/data/repository        |
| Diag Directory  | /opt/tfa/oracle.ahf/data/gpisrvl/diag |
'-----------------+--------------------------------------------'
 
AHF binaries are available in /opt/tfa/oracle.ahf/bin
 
AHF is successfully installed

Problem - [ERROR] : AHF-00014: AHF Location /opt/oracle/tfa is not owned by root in directory hierarchy

Anscheinend kann AHF nur z.b, unter /opt/tfa installiert werden, in ORACLE_BASE mag er nicht …

Umgebung ob alles gut installiert ist überprüfen mit:

# als user root!
 
cd /opt/tfa/oracle.ahf/tfa/bin/
 
./tfactl orachk
 
/opt/tfa/oracle.ahf

Quellen

Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information
dba/oracle_18c_se_linux.txt · Zuletzt geändert: 2020/09/14 12:44 von gpipperr