Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 mySQL: Get MySQL Database Size Jump to:  
Category: >> mySQL >> Get MySQL Database Size Bookmark and Share

<< lastnext >>

Snippet Name: Get MySQL Database Size

Description: Useful shell commands for determining overall DB size.

Comment: (none)

Language: MYSQL
Highlight Mode: MYSQL
Last Modified: March 01st, 2009

mysql -uroot -D db_development -e 
"show table status\G"| egrep "(Index|Data)_length" | 
awk 'BEGIN { rsum = 0 } { rsum += $2 } END { print rsum }'
 
-- another way:
 
echo "SELECT TABLE STATUS" | mysql-dbrc //DATABASE// | 
awk '{sum=sum+$7+$9;} 
END {print sum/1024/1024 "M"}'
 


Free
Oracle Magazine
Subscriptions
and Oracle White Papers


SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 59 users online    © 2009 psoug.org

PSOUG LOGIN
Username: 
Password: 
Forgot your password?