du -sk to identify space usage unix

Find out what directories are using up disk space in unix with this command: du -sk * | sort -n I often put it into a function so I can call it quickly: g () { du -sk * | sort -n } df -h (df -k on old machines) shows the filesystem disk utilisation.

Read More du -sk to identify space usage unix
April 8, 2010

Materialized Views with dbms_metadata.get_ddl

See the SQL create definition of a materialized view by running this SQL: set long 200000 pages 0 lines 131 doc off column txt format a121 word_wrapped spool recreate_sql select dbms_metadata.get_ddl(‘MATERIALIZED_VIEW’,’my_mv_name’,’my_owner’) txt from dual; spool off set pages 9999 Look especially for the refresh option, e.g.: REFRESH FORCE ON DEMAND NEXT null There are three […]

Read More Materialized Views with dbms_metadata.get_ddl
April 7, 2010

One Comment

dbms_stats export import optimizer statistics

Examples of syntax to export/import dbms_stats: exec dbms_stats.create_stat_table ( ownname => user , stattab => ‘temp_stats’ ) ; exec dbms_stats.export_table_stats ( ownname => user , stattab => ‘temp_stats’ , tabname => ‘mytable’ , statid => ‘Taken_7Apr2010’ ) ; exec dbms_stats.import_table_stats ( ownname => user , stattab => ‘temp_stats’ , tabname => ‘mytable’ , statid => […]

Read More dbms_stats export import optimizer statistics
April 7, 2010