• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Get size of database?

LEGEND ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

Hello, all,

I know that CF has CFDBINFO, but it doesn't return the information I am looking for.

The hosting service that I am using for a personal project (hostek.com) puts a limit of 250M on their databases; but you can have an unlimited number of databases.

I would like to check the size of a database before uploading files to it.  Basically, if the database is at or near the 250M limit, I want to export some data to an archive table, then finish the upload into the original table.

Is this possible in CF??

V/r,

^_^

Views

678

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

If you are on SQL server you can run a system stored proc of  "sp_helpdb" to get size.

HTH,

--Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

I should have mentioned that it's a MySQL db.  You can't see it, but I'm facepalming myself for not having included that important bit of information in my original post.  (Hangs head in shame.)

Thankfully, I'm too shallow to be depressed for too long. 

Heheheh.. it's a MySQL, I forget which version (I'm not at home, right now).  But I do have a Windows 7 VM that has the MySQL WorkBench GUI, if that helps.

V/r,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

For MySQL:

SELECT table_schema  "DB Name",
  Round
(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM  information_schema.tables
GROUP  BY table_schema;

hth,

--Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

LATEST

That is awesome!  I'll give that a shot when I get home.

Thanks, Dave Ferguson​!

V/r,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation