Конечно, можно использовать dbms_sql, dbms_job...
А можно и так:
#!/bin/sh # # analyze all tables #
sqlfile=/tmp/analyze.sql logfile=/tmp/analyze.log
echo @connect dbo/passwd@ > $sqlfile
$oracle_home/bin/svrmgrl <> $sqlfile connect dbo/passwd select table, table_name from all_tables where owner = dbo; eof
echo exit >> $sqlfile cat $sqlfile > $logfile
cat $sqlfile $oracle_home/bin/svrmgrl >> $logfile
cat $logfile /usr/bin/mailx -s analyze tables tlk@nbd.kis.ru
rm $sqlfile rm $logfile
|