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 Enviroment. Mostra tutti i post
Visualizzazione post con etichetta Enviroment. Mostra tutti i post

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