Gather stats for only lastAnalyzed apps Tables (appunti grezzi)


#!/bin/sh
cd /home/oracle/script/
. /home/oracle/.env11g
/home/oracle/app/product/11.2.0/bin/sqlplus -s /nolog < TRUE);’ from dba_all_tables where OWNER not like ‘%SYS%’ AND OWNER not like ‘SCOTT’ and OWNER not like ‘XXXX’ AND LAST_ANALYZED is not null AND last_analyzed > (sysdate-NUMdays) order by last_analyzed;
spool off
EOF
#lavora lo spool sql in modo da togliere intestazione della query
/bin/sed /OWNER/d statLast.sql > statLast2.sql
/bin/sed /—–/d statLast2.sql > statLast3.sql
#esegue lo script dinamico creato per le stats specifiche + uno spool per eventuali
/home/oracle/app/product/11.2.0/bin/sqlplus -s /nolog <

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.