Translation

The oldest posts, are written in Italian. If you are interested and you want read the post in English, please use Google Translator. You can find it on the right side. If the translation is wrong, please email me: I'll try to translate for you.
Visualizzazione post con etichetta unix. Mostra tutti i post
Visualizzazione post con etichetta unix. Mostra tutti i post

mercoledì, febbraio 26, 2014

Changing the gpfs inodes online

What I learned today....

I was installing the IBM Datastage and the inod on the GPFS filesystem (FS) was used at 85% with 20% of free space.

By defaul, GPFS FS is created with few inode. So, during the installation, I increased their value.

  • I first checked the actual value using this command
mmdf /dev/sbIIS -F

  • Then I modified their vaules with
mmchfs /dev/sbIIS -F 300000

Unfortunately, I lost the output of the command I ran, so i can write only the link where I found the commands:

http://unix.ittoolbox.com/groups/technical-functional/ibm-aix-l/how-to-increase-the-inodes-size-of-the-specific-filesystems-in-aix-3419245

martedì, agosto 23, 2011

Unix profile: showlist

Al fine di personalizzare l'utente oracle, all'interno del "profile", definiamo la funzione showlist

typeset -fx showlist
showlist(){
ps -ef -o %a|grep -i tnslsnr |grep -v grep|awk '{print $2}'|sort
}

Questo è un esempio di output

$> showlist
listener_mydb01t
listener_mydb02t
listener_mydb03t

Lo scopo di questa funzione è di mostrare tutti i listener che girano sulla macchina

Unix profile: setsid

Al fine di personalizzare l'utente oracle, all'interno del "profile", definiamo la funzione setsid

typeset -fx setsid
setsid()
{
_sidName=$(echo $1 |sed -e "s/\(^.*\)\(.\)/\1/")
_sidType=$(echo $1 |sed -e "s/\(^.*\)\(.\)/\2/")
_sidUpperName=$(echo ${_sidName} |tr '[:lower:]' '[:upper:]')
_sidLowerType=$(echo ${_sidType} |tr '[:upper:]' '[:lower:]')

echo ${_sidUpperName}${_sidLowerType}
}

Questo è un esempio di output

$> setsid VasMsrt
VASMSRt

Lo scopo di questa funzione è di rendere ORACLE_SID nel seguente formato:

ORACLE_SID ::= <logical_name><type>

dove


<logical_name>
è una stringa che identifica l'applicazione

<type>
può assumere 3 valori:

  • t -> test
  • d -> develop
  • p -> production

lunedì, giugno 20, 2011

Single quotes and double quote

Che differenza c'è tra gli apici singoli e quelli doppi in bash?

Semplicemente, nel primo caso la shell non interpreta le variabili, cosa che invece fa nel secondo. In altri termini, nel secondo caso, la shell sostituisce la variabile con il suo valore.

=========
Apici singoli
=========
[my-lap]$ var1=pippo
[my-lap]$ var2='$var1 & pluto'
[my-lap]$ echo $var2
$var1 & pluto

=========
Apici doppi
=========
[my-lap]$ var1=pippo
[my-lap]$ var3="$var1 & pluto"
[my-lap]$ echo $var3
pippo & pluto

lunedì, giugno 13, 2011

puser

Quali processo stanno utilizzando la porta del listener? Linux permette di rispondere a questa domanda utilizzando il comando fuser con l'opzione "-n". Il programma che segue è scritto in perl ed è necessario avere i privilegi di accesso a tutte le sottodirectory di /proc. Per utilizzarlo basta lanciare “puser” seguito dal numero della porta da controllare. Ad esempio:

#andrea> puser 1531
1531: 2506 18359

#!/usr/bin/perl
die "Usage: puser \n" if @ARGV[0] == 0;

$ENV{'PORT'} = @ARGV[0];
$shell_in = <<'IN'; echo "" > /tmp/checkPortTestPerl;

for PROC in /proc/*; do
  echo $PROC >> /tmp/checkPortTestPerl 2> /dev/null
  pfiles -F $PROC | grep port |grep $PORT >> /tmp/checkPortTestPerl 2> /dev/null

done 2> /dev/null

IN

$shell_out = `$shell_in`;
open(FH, "< /tmp/checkPortTestPerl") or die "can't open /tmp/checkPortTestPerl: $!";

$i=0;
$lineprep=;

for ($count=0; $row=; $count++) {
  if ($row =~ m/@ARGV[0]/){
    $lineprep =~ m#^/[a-z]+/([0-9]+)$#;
    $process[$i]=$1;

    $i++;
  }
  $lineprep=$row;
}

print "@ARGV[0]: @process\n";
unlink "/tmp/checkPortTestPerl";