some daily operational tasks:
|
1 2 3 4 5 |
sudo apt upgrade if [ -f /var/run/reboot-required ]; then echo 'Reboot required'; fi sudo tail -n 80 /var/log/apache2/futas.net_error.log |

Just another Select of Ms SQL DBA site
some daily operational tasks:
|
1 2 3 4 5 |
sudo apt upgrade if [ -f /var/run/reboot-required ]; then echo 'Reboot required'; fi sudo tail -n 80 /var/log/apache2/futas.net_error.log |
Database sizes and number of tables:
|
1 2 3 4 5 6 7 8 |
SELECT table_schema AS 'Database', ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS 'Size (MB)', COUNT(*) AS 'Number of Tables' FROM information_schema.tables WHERE table_schema NOT IN ('information_schema', 'performance_schema', 'sys', 'mysql') GROUP BY table_schema ORDER BY SUM(data_length + index_length) DESC; |
Database total size:
|
1 2 3 4 5 6 7 8 9 10 |
SELECT table_schema AS 'Database', ROUND(SUM(data_length) / 1024 / 1024, 2) AS 'Data_Size_MB', ROUND(SUM(index_length) / 1024 / 1024, 2) AS 'Index_Size_MB', ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS 'Total_Size_MB', ROUND(SUM(data_length) / SUM(data_length + index_length) * 100, 2) AS 'Data_Percentage' FROM information_schema.tables WHERE table_schema NOT IN ('information_schema', 'performance_schema', 'sys', 'mysql') GROUP BY table_schema ORDER BY Total_Size_MB DESC; |
Recent Database Activity
|
1 2 3 4 5 6 7 8 9 10 |
SELECT OBJECT_SCHEMA AS 'Database', COUNT_READ AS 'Reads', COUNT_WRITE AS 'Writes', COUNT_FETCH AS 'Fetches', COUNT_STAR AS 'Total_Operations' FROM performance_schema.table_io_waits_summary_by_table WHERE OBJECT_SCHEMA IS NOT NULL ORDER BY COUNT_STAR DESC LIMIT 10; |