Thứ Tư, 23 tháng 3, 2016

[ORACLE-DB] Modify spfile setting in case unable to startup instance when parameter in spfile is wrong

$sqlplus / as sysdba
sql> create pfile='pfile.ora' from spfile='spfileORCL.ora';
Modify wrong parameter in pfile.ora and start your instance using this new configuration:
sql> startup pfile='pfile.ora';
You can then save your settings back to an spfile with the following command:
sql> create spfile='spfileORCL.ora' from pfile='pfile.ora';
And shutdown/start your database as usual:
sql> shutdown immediate;
sql> startup;

Thứ Ba, 8 tháng 3, 2016

[IBM AIX] - Create many users follow [PCIDSS - User Policy] in a script



#!/bin/bash
x() {
LIST=
SET_A=
for i in "$@"
do
        if [ "$i" = "admin=true" ]
        then
                SET_A="-a"
                continue
        elif [ "$i" = "admin=false" ]
        then
                continue
        fi
        LIST="$LIST \"$i\""
done
eval mkuser $SET_A $LIST
}
for tpbuser in u_xxx u_yyy u_zzz
do
x admin='false' pgrp='staff' rlogin='true' loginretries='5' pwdwarntime='7' histsize='4' histexpire='0' maxage='13' minage='4' minlen='7' minalpha='1' minother='1' maxrepeats='5' mindiff='1' $tpbuser;
echo $tpbuser:Callme#1234 | chpasswd;
pwdadm -c $tpbuser;
done;