Re: onload/onunload all tables EXCEPT ones specified
Posted in 2003
U can write some small script like this, u have to make a file with list
of tables not to be included
( notincludelist.txt in the example)
---------------------------
#/bin/ksh
isql dbname<<!
unload to list.out select tabname from systables where tabid> 99;!
sed "s/|$//" list.out |while read rec
do
grep -wq ${rec} notincludelist.txt
if [ $? -ne 0 ]
then
onunload -t /dev/rmt0 -b 16 -s 4000000 -d myspace mydb:${rec}
fi
done
-----------------------------
Rgds
Preetinder
Steve N. wrote:
>Hi all,
>
>We have a database that contains 700 tables which we backup and
>restore monthly using onunload and onload commands. That database
>contains one table which is rather large (a LOB table) which is NOT
>required for monthly reporting in the restored area.
>
>I know that you can use onunload and specify tables to be backed up,
>but is there a way to specify tables that are NOT to be backed up? For
>example, this will only backup the mydb:images table:
>
> onunload -t /dev/rmt0 -b 16 -s 4000000 -d myspace mydb:images>
>But if I wanted all tables except mydb:images is there a "not"
>feature? Example:
>
> onunload -t /dev/rmt0 -b 16 -s 4000000 -d myspace !mydb:images>
>Maybe wishful thinking so I don't have to list 699 tables so I don't
>back up the one I don't want...
>
>Thx
>
>Steve
>
>
>
sending to informix-list