Got it

How do I query the service tablespace usage on ServiceCenter?

Created: Jan 10, 2020 01:59:17Latest reply: Aug 20, 2021 11:37:16 670 2 0 0 0
  Rewarded HiCoins: 0 (problem resolved)

Hello, everyone!

I want to query the service tablespace usage on ServiceCenter, So can you tell me how to do it?

Thanks

Featured Answers

Recommended answer

olive.zhao
Admin Created Jan 10, 2020 02:14:04

Hello, dear!

Have a nice day!

You can query the service tablespace usage on ServiceCenter by performing the following steps:

Step 1 Use PuTTY and the floating IP address of ServiceCenter to log in to the ServiceCenter node as user galaxmanager.
           Default password of user galaxmanager: Huawei@CLOUD8
Step 2 Run the following command to enter the engineering mode:
           gotoEngineerMode
           Default password: Huawei@CLOUD8!
           Run the following command to disable logout on timeout:
          TMOUT=0
Step 3 Run the following command to switch to user dbadmin:
           su dbadmin
Step 4 Run the following command to access the database:
           gsql -W Manager@123
Step 5 Run the following commands to query the service tablespace usage:
           SELECT nspname || '.' || relname AS "relation",
           pg_size_pretty(pg_total_relation_size(C.oid)) AS "size"
           FROM pg_class C
           LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
           WHERE nspname NOT IN ('PG_CATALOG','PG_TOAST','INFORMATION_SCHEMA')
           ORDER BY pg_total_relation_size(C.oid) DESC;
The following figure shows an example of the query result.

tablespace

Any further questions, let us know!

View more
  • x
  • convention:

All Answers

Hello, dear!

Have a nice day!

You can query the service tablespace usage on ServiceCenter by performing the following steps:

Step 1 Use PuTTY and the floating IP address of ServiceCenter to log in to the ServiceCenter node as user galaxmanager.
           Default password of user galaxmanager: Huawei@CLOUD8
Step 2 Run the following command to enter the engineering mode:
           gotoEngineerMode
           Default password: Huawei@CLOUD8!
           Run the following command to disable logout on timeout:
          TMOUT=0
Step 3 Run the following command to switch to user dbadmin:
           su dbadmin
Step 4 Run the following command to access the database:
           gsql -W Manager@123
Step 5 Run the following commands to query the service tablespace usage:
           SELECT nspname || '.' || relname AS "relation",
           pg_size_pretty(pg_total_relation_size(C.oid)) AS "size"
           FROM pg_class C
           LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
           WHERE nspname NOT IN ('PG_CATALOG','PG_TOAST','INFORMATION_SCHEMA')
           ORDER BY pg_total_relation_size(C.oid) DESC;
The following figure shows an example of the query result.

tablespace

Any further questions, let us know!

View more
  • x
  • convention:

Good answer my friend
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.