rac-status.sh for oracle cluster

Source: An Unknown DBA blog English: Allow me to introduce one of the scripts that has consistently impressed me over the last 3 years. This script has proven its worth in a wide range of environments, from 2 to 10 node clusters. It excels in providing a clear overview of ASM components per host, enabling … Mehr rac-status.sh for oracle cluster

Workaround for timeouts on oracle tablespace nrpe check

If you have timeouts on your nrpe check to check oracle tablespace I show you a workaround. My problem was checking tbs on Oracle Cloud Control mashine. There is an CDB/PDB installed for Oracle Cloud Control 13c R2. NRPE check need more than 1 min to collect the results. But nagios timeout we couldn’t change … Mehr Workaround for timeouts on oracle tablespace nrpe check

Change from nonrolling to rolling Update on Oracle RAC

Before as grid-user $ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME … Patch level status of Cluster nodes : Patching Level Nodes ————– —– 810652142 Node1,Node3,Node2 ——————————————————————————– OPatch succeeded.   Patching as root – user mistake: $GRID_HOME/OPatch/opatchauto apply -nonrolling /mnt/oracle/software/12c/grid_12_1_0_2/25434003_COMBO_GI_APRIL2017_12102170418 -oh /usr/local/grid/12.1.0.2 (from old wrong template) CRS-2883: Resource ‚ora.crsd‘ failed during Clusterware stack start. CRS-4406: Oracle High Availability … Mehr Change from nonrolling to rolling Update on Oracle RAC

#DOAG2016 am Abend davor

Hier nun meine Unterlagen zum Vortrag: Vortrag als Powerpoint:     Wechsel von Oracle Cloud Control 12c zu 13c Vortrag als PDF:                    Wechsel von Oracle Cloud Control 12c zu 13c Handout als Word:              Handout Wechsel von Oracle Cloud Control 12c zu 13c Handout als Textfile:         Handout-txt Wechsel von Oracle Cloud Control 12c zu 13c   Folgende … Mehr #DOAG2016 am Abend davor

SSH Access for named credentials EM13c

  To use secure access between Oracle Cloud Control 13c and database server I establish SSH-Keys for oracle user. User:ora121 (ORACLE_HOME=/usr/local/oracle/product/12.1.0.2) /usr/local/oracle/product/12.1.0.2/oui/prov/resources/scripts ./sshUserSetup.sh -setup -user ora121 -hosts „CBA_HOST0.dresden.de CBA_HOST1.dresden.de CBA_HOST2.dresden.de„ Host0: Host1: Host2: create testfile 1 create testfile 2 copy ssh-keys to localhost with scp create named credentials test and save Now check all nodes! … Mehr SSH Access for named credentials EM13c

OMSPatcher failed with error code 252

Command: [cloud13@CBAMyHost OMSPatcher]$  /usr/local/oracle/middleware/EM131/OMSPatcher/omspatcher apply /home/cloud13/Patches/23697785 -analyze -invPtrLoc /usr/local/oracle/middleware/EM131/oraInst.loc  OMSPatcher.OMS_DISABLE_HOST_CHECK=true (OMS is installed on virtual host configuration.) Running apply prerequisite checks for sub-patch(es) „23592208 23592093 23592074 23592229“ and Oracle Home „/usr/local/oracle/middleware/EM131″… Sub-patch(es) „23592208 23592093 23592074 23592229“ are successfully analyzed for Oracle Home „/usr/local/oracle/middleware/EM131“ Running rollback prerequisite checks for patch(es) „22589347 22823156 22823175“ and Oracle Home … Mehr OMSPatcher failed with error code 252

Check oraarch

Vor Kurzem bat mich ein Kollege, der gerade ein EHP 7 Update machte, während der Mittagspause auf einem Rechner das Verzeichnis oraarch zu überwachen um zu verhindern, dass das Verzeichnis voll läuft und die Datenbank stehen bleibt. Für NON-SAP System schaue ich auch gern im Exportverzeichnis nach so wie in diesem Beispiel: watch -n20 „du … Mehr Check oraarch

Nagios NRPE checks on Oracle Database Host fails locally

Problem: On nagios host : No response from remote host … (Oracle database host) There are not enough resources to check with NRPE on Oracle database host with OL7.2 . Solution: [root@CBAHOST]# touch /etc/systemd/system/nrpe.service [root@CBAHOST]# chmod 644 /etc/systemd/system/nrpe.service [root@CBAHOST]# vi /etc/systemd/system/nrpe.service .include /usr/lib/systemd/system/nrpe.service [Service] CPUShares=1500 [root@CBAHOST]# systemctl daemon-reload [root@CBAHOST]# systemctl restart nrpe.service check result: [root@CBAHOST]# … Mehr Nagios NRPE checks on Oracle Database Host fails locally

Kernelparameter für Oracle Cloud Control 13c

vi /etc/sysctl.conf #mem parameter anpassen #semaphoren anpassen #https://docs.oracle.com/cd/E63000_01/EMBSC/E63676-01.pdf kernel.shmmax = 4294967295 kernel.shmall = 4294967295 kernel.sem = 10000 2560000 100 256 fs.file-max = 6815744 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 4194304 net.core.wmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_max = 1048576 fs.aio-max-nr = 3145728 # Keepalive net.ipv4.tcp_keepalive_time=300 net.ipv4.tcp_keepalive_intvl = 5 net.ipv4.tcp_keepalive_probes = 10 vi /etc/security/limits.conf root soft … Mehr Kernelparameter für Oracle Cloud Control 13c

RAC und Multitenant

„….Zudem entstehen Probleme bei der Verfügbarkeit: Sobald Kunden statische Parameter ändern oder die Soft- beziehungs- weise Hardware warten oder patchen möchten, können die vielen auf einer CDB konsolidierten PDBs die Planung einer Ausfallzeit erschweren, weil die verschiedenen Anwendungen unterschiedliche Wartungs- fenster benötigen.(…) Kurz gesagt, die Multitenant-Imple- mentierung auf eigenständigen Instanzen löst das Silo-Paradigma nicht auf; … Mehr RAC und Multitenant

Oracle DB ab 11.2.0.3 hat einen In-Memory-Advisor

„Lizenzierung: Der In-Memory-Advisor ist Bestandteil des Oracle-Tuning-Packs und verwendet Informationen aus dem Diagnostics Pack. Somit sind Lizenzen für beide Packs sowie für die Oracle Database Enterprise Edition erforderlich.“ siehe: Mit Rat und Tat: Der Database-In-Memory-Advisor Ileana Someșan, ORACLE Deutschland B.V. & Co. KG DOAG SOUG Nr 3 2015, S.14 Weitere Links zu diesem Thema: Klicke, … Mehr Oracle DB ab 11.2.0.3 hat einen In-Memory-Advisor

Oracle SAP Profile

SQL> select * from dba_profiles where PROFILE=’DEFAULT‘ and RESOURCE_TYPE=’PASSWORD‘; PROFILE     RESOURCE_NAME              RESOURCE     LIMIT —————————————– ———– DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD 10 DEFAULT PASSWORD_LIFE_TIME PASSWORD 180 DEFAULT PASSWORD_REUSE_TIME PASSWORD UNLIMITED DEFAULT PASSWORD_REUSE_MAX PASSWORD UNLIMITED DEFAULT PASSWORD_VERIFY_FUNCTION PASSWORD NULL DEFAULT PASSWORD_LOCK_TIME PASSWORD 1 DEFAULT PASSWORD_GRACE_TIME PASSWORD 7   SQL>select … Mehr Oracle SAP Profile

seizure of a tablespace

SELECT NVL(b.tablespace_name, NVL(a.tablespace_name,’UNKNOWN‘)) „Tablespace“, ROUND( kbytes_alloc, 2) „Allocated MB“, ROUND( kbytes_alloc-NVL(kbytes_free,0), 2) „Used MB“, ROUND( NVL(kbytes_free,0), 2) „Free MB“, ROUND( ((kbytes_alloc-NVL(kbytes_free,0))/kbytes_alloc), 2) „Used“, data_files „Data Files“ FROM (SELECT SUM(bytes)/1024/1024 Kbytes_free, MAX(bytes) /1024/1024 largest, tablespace_name FROM sys.dba_free_space GROUP BY tablespace_name ) a, (SELECT SUM(bytes)/1024/1024 Kbytes_alloc, tablespace_name, COUNT(*) data_files FROM sys.dba_data_files GROUP BY tablespace_name )b WHERE a.tablespace_name … Mehr seizure of a tablespace

Check UNDO Size

 per sqlplus oder grafisch im Oracle Cloud Control   SELECT d.undo_size/(1024*1024) „ACTUAL UNDO SIZE [MByte]“, SUBSTR(e.value,1,25) „UNDO RETENTION [Sec]“, ROUND((d.undo_size / (to_number(f.value) * g.undo_block_per_sec))) „OPTIMAL UNDO RETENTION [Sec]“ FROM ( SELECT SUM(a.bytes) undo_size FROM v$datafile a, v$tablespace b, dba_tablespaces c WHERE c.contents = ‚UNDO‘ AND c.STATUS = ‚ONLINE‘ AND b.name = c.tablespace_name AND a.ts# = … Mehr Check UNDO Size

Zombies

How can I kill zombies in short time? top – 15:22:58 up 44 days,  1:19,  4 users,  load average: 0.73, 0.65, 0.61 Tasks: 2230 total,   1 running, 1242 sleeping,   0 stopped, 987 zombie Cpu(s): 14.6%us,  0.6%sy,  0.0%ni, 84.7%id,  0.0%wa,  0.0%hi,  0.1%si,  0.0%st Mem:     32113M total,    31691M used,      422M free,      737M buffers Swap:    20479M total,     3864M … Mehr Zombies

SAPDATA vergrößern, Platte anhängen, df tunen

cbavCBA0:/ # df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/rootvg-root 5.0G 3.2G 1.6G 67% / udev 7.8G 240K 7.8G 1% /dev tmpfs 27G 0 27G 0% /dev/shm /dev/sda1 1003M 49M 904M 6% /boot /dev/mapper/rootvg-home 3.0G 86M 2.9G 3% /home /dev/mapper/rootvg-opt 3.0G 183M 2.8G 7% /opt /dev/mapper/rootvg-tmp 5.0G 316M 4.6G 7% /tmp /dev/mapper/rootvg-usr 6.9G … Mehr SAPDATA vergrößern, Platte anhängen, df tunen

mehrere Dateien unter Linux zippen und entpacken

Nach längerer Zeit hier mal ein Befehl den man immer mal wieder braucht wenn es schnell gehen soll. find -iname ‚*.MK2‘ -print|xargs zip -9 zusammenfassung_MK2.zip es werden demnach sämtliche Dateien mit der Dateiendung *.MK2 gesucht und anschließend mit der höchsten Komprimierung  -9 in das Zip-File zusammenfassung_MK2.zip aufgenommen. find -iname ‚*.MK2‘ -print|xargs zip -9 zusammenfassung_MK2.zip adding: SAPL-700COINEHRBASIS.MK2 … Mehr mehrere Dateien unter Linux zippen und entpacken

Netzwerkverschlüsselung unter Oracle 11.2.0.4

Diese Idee las ich in der DOAG Zeitschrift (01-2014, von Heinz-Wilhelm Fabry) und so hab ich das bei mir mal ausprobiert. Das Ziel ist die Änderungen nur auf dem Server umzusetzen So sah meine SQLNET.ORA vorher aus: Aktivierung des Tracelevels: cbavsrd0:orasrd 86> cat sqlnet.ora ##################################################### # Filename……: sqlnet.ora                        # # Created…….: created by Christoph Bauermeister … Mehr Netzwerkverschlüsselung unter Oracle 11.2.0.4

Password Policy Oracle 11.2.0.4

1. Prüfung der Passwortversion SQL> Select PROFILE, RESOURCE_NAME, LIMIT FROM DBA_PROFILES WHERE RESOURCE_NAME = ‚PASSWORD_VERIFY_FUNCTION‘; PROFILE               RESOURCE_NAME                                          LIMIT —————————— ——————————– —————————————- DEFAULT             … Mehr Password Policy Oracle 11.2.0.4

Skript zum Archivieren von Logs oder sonstigen Dateien

Ziel Dateien aus mehreren Monaten/ Jahren mit mehreren pro Tag sollen seperat abgespeichert werden. In diesem Skript erstelle ich vorher eine MD5-Checksumme und anschließend werden die Dateien tageweise gezippt. Anschließend werden die Dateien in ein Monatsarchiv verschoben. Nachdem die Zip-Files mit den Nachweisen der MD5-Checksumme zusammen abgelegt wurden werden die noch vorhandenen alten Dateien und … Mehr Skript zum Archivieren von Logs oder sonstigen Dateien

Starten und Stoppen Oracle Cloud Control 12c

cd /oracle/OEM/product/12.1.0/mwhome_1/oms/bin   Starten: ./emctl start oms   oracle@ftp0:/oracle/OEM/product/12.1.0/mwhome_1/oms/bin> ./emctl start oms Oracle Enterprise Manager Cloud Control 12c Release 4 Copyright (c) 1996, 2014 Oracle Corporation. All rights reserved. Starting Oracle Management Server… Starting WebTier… WebTier Successfully Started Oracle Management Server Successfully Started Oracle Management Server is Up Starting BI Publisher Server … BI Publisher … Mehr Starten und Stoppen Oracle Cloud Control 12c

Oracle überprüfen welche Tablespaces komprimiert sind

set linesize 400 col TABLESPACE_NAME for a30 col STATUS for a10 col DEF_TAB_COMPRESSION for a10 col COMPRESS_FOR for a13 SELECT TABLESPACE_NAME,STATUS,DEF_TAB_COMPRESSION,COMPRESS_FOR FROM DBA_TABLESPACES;   Ergebnis: TABLESPACE_NAME               STATUS          DEF_TAB_CO           COMPRESS_FOR —————————— ———- ———- ————- ———- ———– PSAPSR3       … Mehr Oracle überprüfen welche Tablespaces komprimiert sind

/etc/fstab und /etc/hosts als root nur readonly

Ab dem Linuxkernel 3.* (ab SLES 11 SP2 oder neuer) kann es vorkommen, das das root FS / als readonly gemountet wird. An und für sich ist das nicht problematisch, da wir mit Masse auf externen FS arbeiten. Allerdings eine Bearbeitung der /etc/fstab oder anderer Dateien im root FS ist dann nicht möglich. Auch ein … Mehr /etc/fstab und /etc/hosts als root nur readonly

Überprüfung Corosync

corosync-cfgtool -s Printing ring status. Local node ID 1084814118 RING ID 0 id = 192.168.243.38 status = ring 0 active with no faults RING ID 1 id = 213.23.125.32 status = ring 1 active with no faults corosync-objctl runtime.totem.pg.mrp.srp.members corosync-objctl runtime.totem.pg.mrp.srp.members runtime.totem.pg.mrp.srp.1084814118.ip=r(0) ip(192.168.243.38) r(1) ip(213.23.125.32) runtime.totem.pg.mrp.srp.1084814118.join_count=1 runtime.totem.pg.mrp.srp.1084814118.status=joined runtime.totem.pg.mrp.srp.1084814117.ip=r(0) ip(192.168.243.37) r(1) ip(213.23.125.31) runtime.totem.pg.mrp.srp.1084814117.join_count=1 runtime.totem.pg.mrp.srp.1084814117.status=joined Stresstest Corosync … Mehr Überprüfung Corosync

Apache2 and MySQL in CPUSet „USER“

Requirements Install in yast cpuset, libcpuset1 and contingent packages . Configure System with 32 CPU. I will give 6 CPU for system and other for userprocesses (webserver, database). hostcba:~ # cset shield -c 6-31 cset: –> activating shielding: cset:moving 179 tasks from root into system cpuset… [==================================================]% cset: „system“ cpuset of CPUSPEC(0-5) with 179 tasks … Mehr Apache2 and MySQL in CPUSet „USER“

Logrotate für alert.log und listener.log

Anmelden als ora<SID> und in das home wechseln. hostcba:oracb2 61> pwd /oracle/cb2 mkdir conf && cd conf vi alert.conf In die Datei folgende Zeilen nach Anpassung an die eigenen Bedürfnisse einfügen. /oracle/cb2/saptrace/diag/rdbms/cb2/cb2/trace/*.log { daily missingok rotate 7 compress mail oracb2@localhost } /oracle/cb2/saptrace/diag/tnslsnr/hostcba/listener/trace/*.log { daily missingok rotate 7 compress mail oracb2@localhost } Testen usr/sbin/logrotate -f -s … Mehr Logrotate für alert.log und listener.log

Datapump mit dem Oracle Cloud Control 12c

Nur als SYSTEM! Nach der Anmeldung als SYSTEM:       Auf der Konsole:   srd0:orasrd > df -h /oracle/SRD/sapdata2 Filesystem                        Size  Used Avail Use% Mounted on /dev/mapper/vgdata00-SRDsapdata2   99G   15G   80G  16% /oracle/SRD/sapdata2 srd0:orasrd 104>   SQL> Create Or Replace Directory Data_Pump_Dir As ‚/oracle/SRD/sapdata2/log‘; Directory created. SQL> SQL> select * from dba_directories where directory_name = … Mehr Datapump mit dem Oracle Cloud Control 12c

Datapump auf der Konsole

Durchführung als User: SYSTEM   srd0:orasrd > expdp system/mein_password full=y DIRECTORY=DATA_PUMP_DIR  DUMPFILE=export_datapump_srd_03102015.dmp logfile=export_datapump_srd_03102015.log COMPRESSION=all Export: Release 11.2.0.4.0 – Production on Sat Oct 3 23:53:43 2015 Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production With the Partitioning, OLAP, Data Mining and … Mehr Datapump auf der Konsole

Backup Controlfile to Tracefile

SQL> alter database backup controlfile to trace; Database altered. SQL> hostcba:orap02 65> pwd /oracle/P02/saptrace/diag/rdbms/p02/P02/trace hostcba:orap02 66> Grund für das Speichern der Vorlage des Controlfiles in ein Tracefile Die einfachste Möglichkeit, die Grundlage für den Datenbankaufbau für ein „einfaches“ und einen cross-Restore bereitzustellen. Hierbei empfehle ich die Sicherung in das Tracefile mindestens 1 Mal pro Tag. … Mehr Backup Controlfile to Tracefile

Oracle-Redologs

Vorbereitungen hostcba:orap01 52> sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Wed Aug 13 09:41:15 2014 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> Verfügbarkeit der Datenbank set linesize 400 … Mehr Oracle-Redologs

ORAPWD – Der Authorisierte Zugriff über SQLPlus

Um per SQLPlus oder JDBC sich remote an der Datenbank anmelden zu können, wurde seit der Version 9i dem User bzw. der Verbindung die Rechte des Superusers (connect as SYSDBA) zugewiesen. Besitzt die Verbindung nicht diese Berechtigung, wird die Verbindung mit dem Oraclefehler ORA-0103 auf Grund „insufficient privileges“ abgelehnt. Der Grund für dieses Vorgehen lag darin … Mehr ORAPWD – Der Authorisierte Zugriff über SQLPlus

Oracle Net8 listener.ora, sqlnet.ora, tnsnames.ora für Oracle 11.2.

#listener.ora  LISTENER =     (ADDRESS_LIST =          (ADDRESS =             (PROTOCOL = IPC)             (KEY = CBA)          )         (ADDRESS =            (PROTOCOL = IPC)            (KEY = … Mehr Oracle Net8 listener.ora, sqlnet.ora, tnsnames.ora für Oracle 11.2.

Neueröffnung meines Blogs – und so begann es …

Nach langer Überlegungszeit habe ich mich heute am 27.09.2015 dazu durchgerungen, meinen Blog auf die nächste Stufe anzuheben und aus dem Thema Oracle und SAP + Datenbanken für SAP und Linux den Weg wieder zu dem primären Zielen Oracle und Linux zu lenken. Mein erster Blog database4sap.com startete am 25.07.2014 und wurde nun durch meinen … Mehr Neueröffnung meines Blogs – und so begann es …