Get the App
SLTechnology News&Howtos  ›  Database  › 

Monitor or count the storage capacity and backup of multiple databases

Shulou Source: shulou.com Published: 2022-06-01 05:11:07 10月03日 Update

In order to reduce the workload of monitoring or multiple sets of database storage capacity or backup checks at the same level, consider using a dedicated monitoring server,

By configuring some configuration tables that need to be obtained, and then solidifying the storage capacity or backup of multiple sets of libraries in the form of sh scripts or storage procedures

A simple collection process is formed, which greatly simplifies the repetitive and complicated database management work.

Configuration method:

1. Monitoring servers;

2. Configuration table of dblink from monitoring server to each monitored server (suxing.conf11g_dblink_tab or suxing.CONF_BACKUPCHECK_DBLINK_TAB)

----Because the functions of the two configuration tables are different, two configuration tables are separated;

3, dedicated to monitoring users;

4. Script or storage process (as follows: multiple server capacity statistics scripts and multiple server backup check result collection scripts);

5. A table for storing collected data (suxing.space or suxing.db_backup_check_alltab).

#####Multiple server capacity statistics scripts:

declare

v_sql varchar2(4000);

begin

for rec in (select * from suxing.conf11g_dblink_tab) loop

v_sql :='insert into suxing.space_gather11G_tab

select * from (

with

I as (select instance_name from v$instance@'||rec.db_link||'),

A as (select round(sum(bytes)/1024/1024/1024,2) aa from dba_data_files@'||rec.db_link||'),

B as (select round(sum(bytes)/1024/1024/1024,2) bb from dba_free_space@'||rec.db_link||'),

C as (select round(sum(BYTES / 1024 / 1024 / 1024), 2) cc

from v$datafile@'||rec.db_link||' a, v$tablespace@'||rec.db_link||' b

where a.TS# = b.TS#

and a.CREATION_TIME

Tags: Server service script monitoring configuration backup capacity storage multiple data check multiple sets database statistics two situation result process work tedious Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Huawei Apple macOS Xiaomi