Got it

Collecting OMS GaussDB Space Usage

Latest reply: Dec 2, 2021 05:02:10 355 2 2 0 0


Hi, everyone!

Today I’m going to introduce you Collecting OMS GaussDB Space Usage.


1. Log in to the active OMS node as user ommdba.

cd /opt/huawei/Bigdata/tmp


2. Save the following SQL statement to the check_database_size.sql file:

SELECT table_name,
pg_size_pretty(table_size) AS table_size,
pg_size_pretty(indexes_size) AS indexes_size,
pg_size_pretty(total_size) AS total_size
FROM (
SELECT table_name, pg_table_size(table_name) AS table_size, pg_indexes_size(table_name) AS indexes_size,
pg_total_relation_size(table_name) AS total_size
FROM (
SELECT ('"' || table_schema || '"."' || table_name || '"') AS table_name
FROM information_schema.tables
) AS all_tables
ORDER BY total_size DESC
) AS pretty_sizes;


3. Run the following command on the OMS node as user ommdba:

gsql -p 20015 -d OMM -U ommdba -W XXXXXXX -t -f /opt/huawei/Bigdata/tmp/check_database_size.sql > /opt/huawei/Bigdata/tmp/log_check_database_size.log &


4. Analyze the /opt/huawei/Bigdata/tmp/log_check_database_size.log file to check the space usage.


Hope you can learn from it,thank you!


  • x
  • convention:

DragonVN
Created Mar 29, 2021 13:54:21

Good sharing
View more
  • x
  • convention:

smileymind
Created Dec 2, 2021 05:02:10

Collecting OMS GaussDB Space Usage-4433937-1
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.