Skip to content

Commit ed47f85

Browse files
authored
Create aws_data_size_check_commands.md
1 parent 3724d19 commit ed47f85

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# AWS Data Size Check Commands
2+
3+
commands to get the database sizes:
4+
```sql
5+
SELECT
6+
table_schema AS 'Database',
7+
ROUND(SUM(data_length + index_length) / 1024 / 1024 / 1024, 2) AS 'Size (GB)',
8+
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS 'Size (MB)'
9+
FROM information_schema.tables
10+
WHERE table_schema NOT IN ('information_schema', 'mysql', 'performance_schema', 'sys')
11+
GROUP BY table_schema;
12+
```
13+
14+
```bash
15+
ssh -i ~/specify/keys/specify_ssh_key [email protected] \
16+
"mysql -h specify-cloud-na-db-1.cqvncffkwz9t.us-east-1.rds.amazonaws.com -umaster -p'thing-park-why-green' -e \"SHOW DATABASES;\""
17+
```
18+
19+
```bash
20+
ssh -i ~/specify/keys/specify_ssh_key [email protected] \
21+
"mysql -h specify-cloud-na-db-1.cqvncffkwz9t.us-east-1.rds.amazonaws.com \
22+
-umaster -p'thing-park-why-green' \
23+
-e \"SELECT table_schema AS \\\"Database\\\", \
24+
ROUND(SUM(data_length + index_length)/(1024*1024*1024),2) AS \\\"Size (GB)\\\" \
25+
FROM information_schema.TABLES \
26+
GROUP BY table_schema \
27+
ORDER BY SUM(data_length + index_length) DESC;\""
28+
```
29+
30+
commands to get asset server sizes:
31+
```bash
32+
du -sh ~/attachments/*
33+
```
34+
35+
commands to get rds backup sizes:
36+
```bash
37+
aws s3 ls s3://specify-cloud-rds-backups/na-db-snapshot-04-01-25/ --recursive --summarize --human-readable
38+
39+
aws s3 ls s3://specify-cloud-rds-backups-ca/ca-db-snapshot-04-01-25/ --recursive --summarize --human-readable
40+
41+
aws s3 ls s3://specify-cloud-rds-backups-eu/eu-db-snapshot-04-01-25/ --recursive --summarize --human-readable
42+
43+
aws s3 ls s3://specify-cloud-rds-backups-il/il-db-snapshot-04-01-25/ --recursive --summarize --human-readable
44+
45+
aws s3 ls s3://specify-cloud-rds-backups-br/br-db-snapshot-04-01-25/ --recursive --summarize --human-readable
46+
```
47+
48+
command to get mysql backup sizes:
49+
```bash
50+
aws s3 ls s3://specify-cloud-rds-backups/dumps/2025_05_01/ --summarize --human-readable
51+
52+
aws s3 ls s3://specify-cloud-rds-backups-ca/dumps/2025_05_01/ --summarize --human-readable
53+
54+
aws s3 ls s3://specify-cloud-rds-backups-eu/dumps/2025_05_01/ --summarize --human-readable
55+
56+
aws s3 ls s3://specify-cloud-rds-backups-il/dumps/2025_05_01/ --summarize --human-readable
57+
58+
aws s3 ls s3://specify-cloud-rds-backups-br/dumps/2025_05_01/ --summarize --human-readable
59+
```
60+

0 commit comments

Comments
 (0)