revoke.sh 와 grant.sh 두개의 파일 (ksh shell script)
revoke.sh
==============================
if [ $# -ne 2 ]
then
echo "USAGE: $0 database명 user명"
exit 1
fi
Database=$1
dbaccess $Database - <<!
output to "tablist" without headings
select tabname from systables where tabid > 100 and tabtype !='V';
!
for TABNAME in `cat tablist`
do
dbaccess $Database - <<!
revoke all on $TABNAME from $3;
grant select on $TABNAME to $3;
!
done
rm tablist
grant.sh
=======================
if [ $# -ne 2 ]
then
echo "USAGE: $0 database명 user명 "
exit 1
fi
Database=$1
dbaccess $Database - <<!
output to "tablist" without headings
select tabname from systables
where tabid > 100 and tabtype != 'V';
!
for TABNAME in `cat tablist`
do
echo
echo Doing.. $Database:$TABNAME
dbaccess $Database - <<!
grant insert on $TABNAME to $2;
grant update on $TABNAME to $2;
grant delete on $TABNAME to $2;
grant select on $TABNAME to $2;
!
done
rm tablist
|