Posts

How to check Database size in Linux

We can check all the sizes of databases through execute a simple query in mysql server

Step 1: Login with mysql server

Login to mysql server by putting the mysql server credentials

# mysql -u username -p
Enter Password: 

Step 2: Execute the Query

Execute the mysql query in mysql server.

mysql> SELECT table_schema "Data Base Name",
    -> sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB",
    -> sum( data_free )/ 1024 / 1024 "Free Space in MB"
    -> FROM information_schema.TABLES
    -> GROUP BY table_schema ;

 +---------------------------------+----------------------+------------------+
 | Data Base Name | Data Base Size in MB | Free Space in MB |
 +---------------------------------+----------------------+------------------+ 
 | about_demo_conf | 0.11203384 | 0.02596664 |
 | appstore | 0.02434349 | 0.00234127 |
 | cacti | 0.95234585 | 0.00552368 |
 | growingfeet | 0.10937500 | 11765.00000000 |
 | information_schema | 0.00781250 | 0.00000000 |
 | lotus_to_mysql | 0.47713852 | 0.00000000 |
 | moderapp_log | 0.00230408 | 0.00000000 |
 | moedeogeventmessen | 0.13060379 | 0.00000000 |
 | mysql | 0.66061878 | 0.00000000 |
 | vsftpd | 0.00310898 | 0.00000000 |
 | what2do | 0.03068542 | 0.00035095 | 
+---------------------------------+----------------------+------------------+

Disk Management: How to configure RAID

RAID is a Redundant Array of Inexpensive disks, also known as Redundant Array of Independent drives.
RAID is used to increase the logical capacity of storage devices used, improve read/write performance and ensure redundancy in case of a hard disk failure. All these needs can be addressed by other means, usually more expensive than the RAID configuration of several hard disks. The adjective Inexpensive used in the name is not without a reason.

RAID 0
Stripping
RAID 1
Mirroring
RAID 5
Strip Set with priority bit
Min. Max Disk 2-32 2-2 3-32
Failure Support 0 1 1
Size-Loss 0% 50% N-1