Chaine de boot Linux

Sur Redhat 7.1 (Fonctionne sur Vldtb01p)

Les  scripts lancés au démarrage sont dans le fichier /etc/rc.local Ce fichier doit être exécutable

ll /etc/rc.local
chmod +x /etc/rc.local
lrwxrwxrwx. 1 root root 13 Sep 22 16:11 /etc/rc.local -> rc.d/rc.local

Exemple :

[root@vldtb02x ~]# cat /etc/rc.local
 #!/bin/bash
 # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
 #
 # It is highly advisable to create own systemd services or udev rules
 # to run scripts during boot instead of using this file.
 #
 # In contrast to previous versions due to parallel execution during boot
 # this script will NOT be run after all other services.
 #
 # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
 # that this script will be executed during boot.
# touch /var/lock/subsys/local
echo Start Vtom Agent
 . /etc/init.d/boot_start_vtom.sh
echo Start Oracle
 . /etc/init.d/start_oracle.sh
echo Zabbix Agent
. /etc/init.d/zabbix_agent_start.sh
 echo su -l ora112 -c /exploit/scripts/start_oracle.sh> /etc/init.d/start_oracle.sh

chmod +x /etc/init.d/start_oracle.sh

Query Mysql en ligne de commande

/soft/mysql55/bin/mysql -u user -ppassword -e « show databases »;

/soft/mysql55/bin/ = chemin pour accéder au bin mysql

Pour trouver le chemin :
find / -name mysql -type f 

 

[root@pdtb7 ~]# /soft/mysql55/bin/mysql -u root -pxxxxxx -e "show databases";
+--------------------+
| Database |
+--------------------+
| information_schema |
| FT_DATAMART_TST |
| FT_DATASTAGE_TST |
| mysql |
| performance_schema |
| redsbx |
+--------------------+

RMAN : y-a-t-il eu un Hot backup ?

se connecter ora102
se positionner sur la database

[ora102@pdtb2 KTP ~]$ export ORACLE_SID=HYPPROD
[ora102@pdtb2 HYPPROD ~]$ rman target /

pour voir les backups effectués (mais là on ne sait pas si ils sont complets !)

RMAN> list backup summary;

using target database control file instead of recovery catalog

List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
29975   B  0  A DISK        27-OCT-15       1       1       YES        DATABASE LEVEL 0
29976   B  A  A DISK        27-OCT-15       1       1       YES        ARCHIVES LEVEL 0
29977   B  F  A DISK        27-OCT-15       1       1       NO         TAG20151027T072645
29978   B  A  A DISK        28-OCT-15       1       1       YES        ARCHIVES LEVEL 0
29979   B  A  A DISK        28-OCT-15       1       1       YES        ARCHIVES LEVEL 0
29980   B  A  A DISK        28-OCT-15       1       1       YES        ARCHIVES LEVEL 0
29981   B  A  A DISK        28-OCT-15       1       1       YES        ARCHIVES LEVEL 0
29982   B  A  A DISK        28-OCT-15       1       1       YES        ARCHIVES LEVEL 0
29983   B  A  A DISK        28-OCT-15       1       1       YES        ARCHIVES LEVEL 0
29984   B  A  A DISK        28-OCT-15       1       1       YES        ARCHIVES LEVEL 0
29985   B  A  A DISK        28-OCT-15       1       1       YES        ARCHIVES LEVEL 0
29991   B  A  A DISK        28-OCT-15       1       1       YES        ARCHIVES LEVEL 0
29992   B  A  A DISK        28-OCT-15       1       1       YES        ARCHIVES LEVEL 0
29995   B  0  A DISK        28-OCT-15       1       1       YES        DATABASE LEVEL 0
29996   B  A  A DISK        28-OCT-15       1       1       YES        ARCHIVES LEVEL 0
29997   B  F  A DISK        28-OCT-15       1       1       NO         TAG20151028T035123
29998   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0
29999   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0
30000   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0
30001   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0
30002   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0
30003   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0
30004   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0
30005   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0
30006   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0
30007   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0
30008   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0
30009   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0
30010   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0
30011   B  A  A DISK        29-OCT-15       1       1       YES        ARCHIVES LEVEL 0

list des derniers FULL backup complet (là tu as toutes les infos, size, date, durée, détails des fichiers…)

RMAN> LIST BACKUP OF DATABASE;

List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
29975   Incr 0  17.57G     DISK        03:14:27     27-OCT-15
        BP Key: 29975   Status: AVAILABLE  Compressed: YES  Tag: DATABASE LEVEL 0
        Piece Name: /data/backups/20151027_HYPPROD_90qknrkl_1_1
  List of Datafiles in backup set 29975
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1    0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/system01.dbf
  2    0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/undotbs01.dbf
  3    0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/sysaux01.dbf
  4    0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/data_hfm01.dbf
  5    0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/data_hss01.dbf
  6    0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/data_hbi01.dbf
  7    0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/idx_hss01.dbf
  8    0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/idx_hbi01.dbf
  9    0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/idx_hfm01.dbf
  10   0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/data_hfm02.dbf
  11   0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/data_hfm03.dbf
  12   0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/data_hfm04.dbf
  13   0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/data_hfm05.dbf
  14   0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/data_hfm06.dbf
  15   0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/idx_hfm02.dbf
  16   0  Incr 644379976  27-OCT-15 /data/oracle/HYPPROD/idx_hfm03.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
29995   Incr 0  17.58G     DISK        03:26:55     28-OCT-15
        BP Key: 29995   Status: AVAILABLE  Compressed: YES  Tag: DATABASE LEVEL 0
        Piece Name: /data/backups/20151028_HYPPROD_9kqkq2ll_1_1
  List of Datafiles in backup set 29995
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1    0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/system01.dbf
  2    0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/undotbs01.dbf
  3    0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/sysaux01.dbf
  4    0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/data_hfm01.dbf
  5    0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/data_hss01.dbf
  6    0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/data_hbi01.dbf
  7    0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/idx_hss01.dbf
  8    0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/idx_hbi01.dbf
  9    0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/idx_hfm01.dbf
  10   0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/data_hfm02.dbf
  11   0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/data_hfm03.dbf
  12   0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/data_hfm04.dbf
  13   0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/data_hfm05.dbf
  14   0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/data_hfm06.dbf
  15   0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/idx_hfm02.dbf
  16   0  Incr 644705605  28-OCT-15 /data/oracle/HYPPROD/idx_hfm03.dbf

conclusion factuelle

Pas de backup complet en date du 29/10

Télédiffusion

Utiliser la télédiffusion.

1) Créer un lot
2)  Lancer la génération de ce lot pour télédiffusion
3) Intégrer le lot (lancer la télédiffusion)
3a) Lancer la simulation
3b) Lancer l’Intégration

1) Créer un lot

teledif1

En haut

– Créer ou dupliquer un lot

Dans la partie gauche
– Faire glisser un ENV
– Éventuellement supprimer de la sélection le(s) objet(s)  non concerné(s). (Clic droit sur l’objet, Traitement, Application)
– Appliquer les règles

Dans la partie Droite
-Créer une transformation (s’applique à un objet (nom du script, machine ..) ou un Alias (Remplacement d’une chaîne de caractère par une autre)
– Faire glisser la règle sur la partie gauche de l’écran

ENREGISTRER le lot.

2)  Lancer la génération de ce lot pour télédiffusion

teledif2

Sur l’onglet Génération
– Sélectionner le lot à traiter
– Clic sur Générer (en haut à droite)
– Cocher le lot à traiter
– Clic sur le bouton Transférer,

teledif3

– Clic sur le bouton Transférer

3) Intégrer le lot (lancer la télédiffusion)

– Cocher le lot à traiter
– Lancer la Simulation
teledif4
– Lancer l(Intégration

teledif5

 

Envoi de mail suite erreur job Vtom.

Windows

set retcode=%ERRORLEVEL%

echo ------------------ Fin Talend -----------------------
echo retcode : %retcode%

if %retcode%==0 goto :FIN

:ERREUR
L:
copy /Y %TOM_LOG_PATH_E% %TOM_LOG_PATH_E%.txt 2>nul
copy /Y %TOM_LOG_PATH_O% %TOM_LOG_PATH_O%.txt 2>nul

echo envoi de mail suite erreur job
%ABM_BIN%/tmail -c %ABM_BIN%/tmail.ini -to %w_dest% -cc %w_cc% -sub "VTOM : ERROR : %TOM_ENVIRONMENT% / %TOM_APPLICATION% / %TOM_JOB% job failed" -msg "ERROR : Job %TOM_JOB% Code retour (%retcode%) en erreur " -att %TOM_LOG_PATH_E%.txt;%TOM_LOG_PATH_O%.txt

:FIN
exit /B %retcode%

====================================================

Linux

err_sh=$?

echo "Valeur err_sh : "$err_sh

echo ""
dt_fin=`date +"%A %d/%m/%Y - %H:%M:%S"`
echo $dt_fin
echo ""

if [ $err_sh -eq 0 ] ; then
echo Job completed : OK
else
${ABM_BIN}/tmail -c ${ABM_BIN}/tmail.ini -to ${1} -cc ${2} -sub "ERROR :$TOM_JOB - ERROR" -msg "
******************* VTOM MESSAGE ERROR ***********************

The scheduler Vtom has completed with error.

Error code : $err_sh

Please verify log file joint.

Best Regards.

******************* END OF VTOM MESSAGE ERROR***********************" -att $TOM_LOG.o\;$TOM_LOG.e
fi
exit $err_sh

logrotate

Exemple de logrotate pour le fichier listener.log oracle

exemple :
root@wctsrv0060:~# ll /etc/cron.daily/
root@wctsrv0060:~# cat /etc/cron.daily/logrotate

[root@pdtb9 ~]# ll /usr/sbin/logrotate
-rwxr-xr-x. 1 root root 59712 Apr 28 2012 /usr/sbin/logrotate
[root@pdtb9 ~]# ll /var/lib/logrotate/logrotate.status
ls: cannot access /var/lib/logrotate/logrotate.status: No such file or directory
[root@pdtb9 ~]# cat /etc/logrotate.d/listener
/soft/oracle/diag/tnslsnr/pdtb9/listener/trace/*.log {
copytruncate
daily
rotate 10
size 1M
compress
delaycompress
missingok
}
[root@pdtb9 ~]# ll /soft/oracle/diag/tnslsnr/pdtb9/listener/trace/*
-rw-r—–. 1 ora112 oinstall 35155055 Feb 24 13:45 /soft/oracle/diag/tnslsnr/pdtb9/listener/trace/listener.log
-rw-r—–. 1 ora112 oinstall 933973 Feb 23 15:04 /soft/oracle/diag/tnslsnr/pdtb9/listener/trace/listener.log.1
-rw-r—–. 1 ora112 oinstall 1596247 Feb 23 15:04 /soft/oracle/diag/tnslsnr/pdtb9/listener/trace/listener.log.2.gz
[root@pdtb9 ~]# cat /etc/cron.daily/logrotate
#!/bin/sh

#/usr/sbin/logrotate /etc/logrotate.conf >/dev/null 2>&1
/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate « ALERT exited abnormally with [$EXITVALUE] »
fi
exit 0
[root@pdtb9 ~]#

RMAN archivlog / noarchivlog

Rman

archive log mode

[oracle@wctsrv0058 ~]$ . oraenv
ORACLE_SID = [TSH1] ? BRIDGE
[oracle@wctsrv0058 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Tue Jul 2 13:12:04 2019

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Release 10.2.0.4.0 - 64bit Production

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u01/app/oracle/product/10.2.0/db_1/dbs/arch
Oldest online log sequence     68
Current log sequence           70
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  285212672 bytes
Fixed Size                  2083368 bytes
Variable Size             188745176 bytes
Database Buffers           88080384 bytes
Redo Buffers                6303744 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/product/10.2.0/db_1/dbs/arch
Oldest online log sequence     68
Next log sequence to archive   70
Current log sequence           70
SQL>
alter database noarchivelog;
alter database open; 
archive log list;
alter system switch logfile;

Configuration ControlFile

$ rman

connect target / ;
show all;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/data/backups/hot/%T_%d_%F';
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/data/backups/hot/%T_%d_%U';

ou

connect target / ;
show all;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backups/%d/hot/%T_%d_%F';
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backups/%d/hot/%T_%d_%U';

rman backup

manual
crosscheck backup;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt expired archivelog all;
delete noprompt obsolete;

backup incremental level 0 tag 'database level 0' database plus archivelog tag 'archives level 0';
delete noprompt obsolete;

report need backup;
list backup summary;
script

Cold

 ./stop_database.sh BIPRD
 ./backup_cold_BIPRD.sh
 ./start_database.sh BIPRD

Hot

 sauve_hot.sh BIPRD

ftp absyss.com

ftp.absyss.com

 

Connected to ftp.absyss.com.
220 Bienvenue sur le serveur FTP ABSYSS.

ftp ftp.absyss.com
Name (ftp.absyss.com:root): faiveley
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd incoming
250 Directory successfully changed.
ftp> pwd
257 « /faiveley/incoming »
ftp> passive
Passive mode on.
ftp> ls
227 Entering Passive Mode (212,157,114,230,73,45).
150 Here comes the directory listing.
drwxr-xr-x 2 1351 50 4096 Feb 28 2014 Pb_du_27-01-2012
drwxr-xr-x 8 1351 50 4096 Sep 10 07:07 bases
-rw-r–r– 1 1351 50 19133 Sep 09 07:11 serveurs.log
drwxr-xr-x 2 1351 50 4096 Sep 09 13:51 traces_30-01-2012
226 Directory send OK.
ftp> put Vtbackup_20150910_123028.tar.gz
local: Vtbackup_20150910_123028.tar.gz remote: Vtbackup_20150910_123028.tar.gz
227 Entering Passive Mode (212,157,114,230,52,121).
150 Ok to send data.
226 File receive OK.
18456249 bytes sent in 25.84 secs (697.5 kB/s)

Add tablespace

Add tablespace oracle

add_tablespace

La limite physique gérée par Oracle est de 32Go.
Quand on arrive à cette limite il faut en créer nouveau.

 

----------------------------------------------
 Recherche des erreurs dans les log
----------------------------------------------

File : /soft/oracle/diag/diag/rdbms/zabprd/ZABPRD/trace/alert_ZABPRD.log
month : Sep
year : 2015
day : 13
error : ORA-
nom de lignes dans le fichier log :  14775247
Erreur trouvée en ligne :  14774733
Sun Sep 13 00:01:30 2015
Starting background process VKRM
Sun Sep 13 00:01:30 2015
VKRM started with pid=28, OS id=20244 
Sun Sep 13 00:01:44 2015
ORA-1652: unable to extend temp segment by 128 in tablespace                 IDX 
ORA-1652: unable to extend temp segment by 128 in tablespace                 IDX 
Sun Sep 13 00:01:45 2015
Starting ORACLE instance (restrict)
Sun Sep 13 00:01:45 2015
Thread 1 advanced to log sequence 24884 (LGWR switch)
  Current log# 2 seq# 24884 mem# 0: /data3/oracle/ZABPRD/redo02a.rdo

robocopy_transfert_horolog.bat

set source=%1
set cible=%2
set mode=%3
set d_log=%4

echo %source%
echo %cible%
echo %mode%

for /F « tokens=1-4 delims=/ » %%a in (‘echo %date:~4,10%’) do set w_date=%%c%%a%%b
for /F « tokens=1-4 delims=: » %%a in (‘echo %time:~0,8%’) do set w_time=%%a%%b%%c

set horo=%w_date%_%w_time%
set f_log=%d_log%\%w_date%_%w_time%_%TOM_JOB%.log
echo robocopy %source% %cible% /%mode% /w:10 /r:2 /LOG+:%f_log%
robocopy %source% %cible% /%mode% /w:10 /r:2 /LOG+:%f_log%
set err=%errorlevel%

type %f_log%

exit /B %err%

Vwjes01 et Vwjes02

Mise en place deux nouvelles machines :

Vwcco07p:  chargée d’exécuter les jobs de déplacement de fichiers et autres travaux hors Talend

Vwcco08p:  chargée d’exécuter les jobs Talend

Ces deux machines doivent permettre d’assurer un PRA de ces deux fonctionnalités principales.
Elles doivent donc être rigoureusement identique.
En configurer une et créer l’autre par copie.

Configuration requise :

Windows 2008 R2

Agent Vtom
Robocopy
Java Run Time (pour les Jobs Talend)

Fonction serveur de « logs » ? (à voir)

Dans Vtom

vwjes_Robocopy => Vwcco07p
vwjes_Talend => Vwcco08p

 

 En place.

FAQ – application

Mettre en place une FAQ pour chaque application afin de regrouper les solutions aux problèmes récurrents et les tickets associés.

https://easytracking.faiveleytransport.com/projects/cco/wiki/End-User_Application

FAQ template
h1. FAQ template

{{>TOC}}

h2. Issue title n°1

h3. Issue

h3. Solution

h3. Associated tickets

h2. Issue title n°2

h3. Issue

h3. Solution

h3. Associated tickets