Mysql-zrm-reporter: Difference between revisions

From wiki.zmanda.com
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:


==SYNOPSIS==
==SYNOPSIS==
mysql-zrm-reporter [--fields <name1,name2,name3 ....>]
                    [--destination <dir> ]
                    [--where  <fieldName=value>]
                    [--show  <backup-method-info | backup-status-info  |
                      backup-retention-info | backup-performance-info |
                      restore-full-info |  restore-incr-info |  replication-info> ]
                    [--help]


mysql-zrm-reporter --fields <name1,name2,name3 ....>
                    [--directory <dir> ]
                    [--key <name=value>]
                    [--help]


==DESCRIPTION==
==DESCRIPTION==


This  tool  is part  of Zmanda Recovery Manager for MySQL (MySQL ZRM). This tool can be used to display various information regarding MySQL database backups created using [[mysql-zrm]](1) tool.
This  tool  is part  of Zmanda Recovery Manager for MySQL (MySQL ZRM). This tool can be used to provide  reports  about  various MySQL database backup run parameters.


==BACKUP INFORMATION==
===BACKUP INFORMATION===


The list of information available for each backup run:
The list of information available for each backup run:


; backup-date : Date and time stamp of Backup
; backup-date : Date and time stamp of backup run.


; mysql-version : MySQL server version
; mysql-version : MySQL server version.


; backup-directory : The location of backup directory
; backup-directory : The location of backup directory.


; backup-level : Lists the backup-level of this backup. It will be 0 for a full backup and 1 for an incremental backup
; backup-level : Lists the backup-level of this backup. It will be 0 for a full backup and 1 for an incremental backup.


; raw-databases : List of databases backed up using ''mysqlhotcopy''. If raw-tables are present, this will have only one database listed.
; raw-databases : List of databases backed up using mysqlhotcopy. If ''raw-tables'' parameter is present, this will have only one database listed.


; raw-databases(snapshot): List of tables backed up. Refer to the raw-databases(snapshot) entry to find the name of the database these tables belongs to.
; raw-tables : List of tables backed up using mysqlhotcopy. Refer to the ''raw-databases''  to find the name of the database these tables belongs to.
; backup-time : Gives the time taken for the backup to complete. Format is HH:MM:SS


; backup-date-epoch : Lists the time stamp of the backup run in seconds since epoch
; raw-databases-snapshot : List of databases backed up using lvm snapshots.


; backup-size : Gives the size of backup data in megabytes.
; raw-tables-snapshot : List of tables backed up using mysqlhotcopy.  Refer to the ''raw-databases-snapshot'' to find the name of the database these tables belongs to.


; next-binlog : Gives the name of next bin log that should be used for the next incremental backup
; backup-time : Time taken for the complete backup run.  Format is HH:MM:SS


; last-backup : Gives the name of the directory containing the previous backup
; read-locks-time : Time during which the read lock is held for each backup run. Format is HH:MM:SS


; backup-status : Gives the status of the backup run. It can have 3 values. The values can be ''Backup Failed'' which indicates that there was a fatal error, ''Backup done with errors'' which indicates that there was some error during backup. Some of the databases and tables were probably backed up and ''Backup succeeded'' which indicates that the backup run was completed successfully.
; flush-logs-time : Time for flushing database pages to the disk. Format is HH:MM:SS


; raw-tables(snapshot) : List of tables backed up using LVM snapshots
; backup-size : The size of data (in megabytes) backed up in the backup run.


; raw-tables : List of tables backed up using mysqlhotcopy
; backup-status : Gives  the  status  of the backup run. It can have 3 values. The values  can be "Backup Failed" which indicates that there  was  a fatal  error,  "Backup  done  with  errors"  which indicates that there was some error during backup.  Some  of the databases and tables were probably backed up and "Backup succeeded" which indicates that the backup run was completed successfully.


; logical-databases : List of databases backed up using mysqldump(1)
; logical-databases : List of databases backed up using mysqldump(1).


; logical-tables : List of  tables  belonging  to "logical-databases" backed up using mysqldump(1)
; logical-tables : List of  tables  belonging  to ''logical-databases'' backed up using mysqldump(1.     


; replication : List of names of the replication files backedup namely master.info and relay-log.info
; replication : List of names of the replication files backed up namely master.info and relay-log.info


; read-locks-time : Time during which the read lock is held for each backup run. Format is HH:MM:SS
; slave-load-files : Names of SQL_LOAD* files that were backed up.


; flush-logs-time : Time for flushing database pages to the disk. Format is HH:MM:SS
; incremental : Names of the binary log files backed up.


; slave-load-files : Names of SQL_LOAD* files that were backed up
; backup-set : Lists the backup-set this backup belongs to.


; incremental : List of names of the bin log files backedup.
; comment : Comment about the backup  added  by  the administrator in the [[mysql-zrm.conf]](5) file.


; backup-set : Lists the backup-set this backup belongs to
; retention-policy : Backup data retention policy. Backup image will be retained for the  time  specified as  parameter.  Time value can  be  in Days/Weeks/Months/Years.  For example: if  the value is "10D" means the backup  image  will  be  retained 10 days from the backup-date. 365 days  in  a  year  and 30 days in a month are assumed.


; comment : Lists the comment that was given to the mysql-zrm utility
==OPTIONS==


; retention-policy : Data retention-policy value, Data will be retained for the time specified as parameter. Time value can be in Days/Weeks/Months. For e.g. if retention-policy=10M indicates that the backup should be retained for 300 days.  retention-policy 10H indicates that the backup should be retained for 10 hours. If no suffix is specified, the amount specified is assumed to be number of days the backup should be retained.
; --destination <dir> : Specify the backup root directory. This  parameter is  optional and default value is ''/var/lib/mysql-zrm''


==OPTIONS==
; --fields <name1,name2,name3...> : Specify list of  backup parameters to display.  List of valid              field names are described  in [[#BACKUP  INFORMATION|BACKUP INFORMATION]] section.  This              field  is  optional.  If  specific fields are not specified in the command line, backup-set, backup-date, backup-directory, backup-level, backup-status are displayed.


; --directory <dir> :  Specify the backup root directory, default value is /var/lib/mysql-zrm
; --where <fieldName=value> : The  tool will display the MySQL backup parameters where the              field name matches value. This field is optional.


; --fields <name1,name2,name3...> :  Specify list of  backup  parameters  to  display. List of valid field names are described in BACKUP INFORMATION section.
; --show <backup-method-info | backup-status-info |  backup-retention-info | backup-performance-info  | restore-full-info  | restore-incr-info | replication-info > : This option displays predefined reports based on the option. The list of reports that are available are:


; --where <name=value> : The tool will display the MySQL ZRM backup parameters where the key matches value.
backup-status-info : backup-set,backup-date,backup-level,backup-status, backup comment
backup-method-info : backup-set,raw-databases,raw-databases,logical-databases 
backup-retention-info : backup-set,  backup-date, backup-level,backup-size,retention-policy
backup-performance-info : backup-set, backup-date, backup-level, backup-size, backup-time, read-locks-time, flush-logs-time
restore-full-info : backup-set, backup-date, backup-level,backup-directory
restore-incr-info :  backup-set,  backup-date,  incremental 
replication-info  : backup-set, backup-date, replication,slave-load-files


; --help : Display help message and exit.
; --help : Display help message and exit.


==EXAMPLES==
==EXAMPLES==
     
Following command displays backup date, location of  backups, backup set name: 
mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup \
                    --fields backup-date,backup-directory,backup-set


Following command displays backup date, location of backups, backup set name:         
Following command displays size  of  backup,  backup set name, and date of backup:
mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup \
                    --fields backup-date,backup-set,backup-size


  # mysql-zrm-reporter --directory /var/lib/mysql-zrm/backup \
Following command displays  size  of  backup, backup set name, and date of backup for "config1" backup  set: 
  --fields backup-date,backup-directory,backup-set
  mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup \
                    --fields backup-date,backup-set,backup-size \
                    --where backup-set=config1


Following command displays size of backup, backup set name, and date of backup:
Following command displays backup  status report for "config1" backup set:         
mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup \
                    --show backup-status-info \
                    --where backup-set=config1


# mysql-zrm-reporter --directory /var/lib/mysql-zrm/backup \
  --fields backup-date,backup-set,backup-size
Following command searches all  index files for "config1" backup-set name  and  displays size  of backup, backup set name and date of backup
     
# mysql-zrm-reporter --directory /var/lib/mysql-zrm/backup --fields backup-date,backup-set,backup-size \
  --where backup-set=config1


==FILES==
==FILES==
; /var/lib/mysql-zrm : Directory under which all backup data is stored.
; /var/lib/mysql-zrm : Directory under which all backup data is stored.


; /etc/mysql-zrm/<backup set name>/mysql-zrm.conf : Configuration file read by mysql-zrm tool.
; /etc/mysql-zrm/mysql-zrm-reporter.conf : Configuration file read by mysql-zrm-reporter tool.


==RETURN VALUES==
==RETURN VALUES==
 
On success, zero is returned. On error,non-zero value is returned.
On success, zero is returned. On error, non-zero value is returned.


==SEE ALSO==
==SEE ALSO==


[[mysql-zrm]](1), [[mysql-zrm-scheduler]](1), mysql(1)
[[mysql-zrm]](1), [[mysql-zrm-scheduler]](1), mysql(1), Zmanda Recovery Manager for MySQL (http://mysqlbackup.zmanda.com/)


==AUTHOR==
==AUTHOR==
Zmanda Inc. (http://www.zmanda.com)
Zmanda Inc. (http://www.zmanda.com)

Revision as of 19:53, 14 September 2006

NAME

mysql-zrm-reporter - MySQL backup reporting tool.

SYNOPSIS

mysql-zrm-reporter [--fields <name1,name2,name3 ....>]
                   [--destination <dir> ]
                   [--where  <fieldName=value>]
                   [--show   <backup-method-info | backup-status-info  |
                     backup-retention-info | backup-performance-info |
                     restore-full-info |  restore-incr-info |  replication-info> ]
                   [--help]


DESCRIPTION

This tool is part of Zmanda Recovery Manager for MySQL (MySQL ZRM). This tool can be used to provide reports about various MySQL database backup run parameters.

BACKUP INFORMATION

The list of information available for each backup run:

backup-date
Date and time stamp of backup run.
mysql-version
MySQL server version.
backup-directory
The location of backup directory.
backup-level
Lists the backup-level of this backup. It will be 0 for a full backup and 1 for an incremental backup.
raw-databases
List of databases backed up using mysqlhotcopy. If raw-tables parameter is present, this will have only one database listed.
raw-tables
List of tables backed up using mysqlhotcopy. Refer to the raw-databases to find the name of the database these tables belongs to.
raw-databases-snapshot
List of databases backed up using lvm snapshots.
raw-tables-snapshot
List of tables backed up using mysqlhotcopy. Refer to the raw-databases-snapshot to find the name of the database these tables belongs to.
backup-time
Time taken for the complete backup run. Format is HH:MM:SS
read-locks-time
Time during which the read lock is held for each backup run. Format is HH:MM:SS
flush-logs-time
Time for flushing database pages to the disk. Format is HH:MM:SS
backup-size
The size of data (in megabytes) backed up in the backup run.
backup-status
Gives the status of the backup run. It can have 3 values. The values can be "Backup Failed" which indicates that there was a fatal error, "Backup done with errors" which indicates that there was some error during backup. Some of the databases and tables were probably backed up and "Backup succeeded" which indicates that the backup run was completed successfully.
logical-databases
List of databases backed up using mysqldump(1).
logical-tables
List of tables belonging to logical-databases backed up using mysqldump(1.
replication
List of names of the replication files backed up namely master.info and relay-log.info
slave-load-files
Names of SQL_LOAD* files that were backed up.
incremental
Names of the binary log files backed up.
backup-set
Lists the backup-set this backup belongs to.
comment
Comment about the backup added by the administrator in the mysql-zrm.conf(5) file.
retention-policy
Backup data retention policy. Backup image will be retained for the time specified as parameter. Time value can be in Days/Weeks/Months/Years. For example: if the value is "10D" means the backup image will be retained 10 days from the backup-date. 365 days in a year and 30 days in a month are assumed.

OPTIONS

--destination <dir>
Specify the backup root directory. This parameter is optional and default value is /var/lib/mysql-zrm
--fields <name1,name2,name3...>
Specify list of backup parameters to display. List of valid field names are described in BACKUP INFORMATION section. This field is optional. If specific fields are not specified in the command line, backup-set, backup-date, backup-directory, backup-level, backup-status are displayed.
--where <fieldName=value>
The tool will display the MySQL backup parameters where the field name matches value. This field is optional.
--show <backup-method-info | backup-status-info | backup-retention-info | backup-performance-info | restore-full-info | restore-incr-info | replication-info >
This option displays predefined reports based on the option. The list of reports that are available are:
backup-status-info : backup-set,backup-date,backup-level,backup-status, backup comment 
backup-method-info : backup-set,raw-databases,raw-databases,logical-databases   
backup-retention-info : backup-set,  backup-date, backup-level,backup-size,retention-policy
backup-performance-info : backup-set, backup-date, backup-level, backup-size, backup-time, read-locks-time, flush-logs-time 
restore-full-info : backup-set, backup-date, backup-level,backup-directory 
restore-incr-info :  backup-set,  backup-date,  incremental  
replication-info  : backup-set, backup-date, replication,slave-load-files
--help
Display help message and exit.

EXAMPLES

Following command displays backup date, location of backups, backup set name:

mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup \
                   --fields backup-date,backup-directory,backup-set

Following command displays size of backup, backup set name, and date of backup:

mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup \
                   --fields backup-date,backup-set,backup-size

Following command displays size of backup, backup set name, and date of backup for "config1" backup set:

mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup \
                   --fields backup-date,backup-set,backup-size \
                   --where backup-set=config1

Following command displays backup status report for "config1" backup set:

mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup \
                   --show backup-status-info \
                   --where backup-set=config1


FILES

/var/lib/mysql-zrm
Directory under which all backup data is stored.
/etc/mysql-zrm/mysql-zrm-reporter.conf
Configuration file read by mysql-zrm-reporter tool.

RETURN VALUES

On success, zero is returned. On error,non-zero value is returned.

SEE ALSO

mysql-zrm(1), mysql-zrm-scheduler(1), mysql(1), Zmanda Recovery Manager for MySQL (http://mysqlbackup.zmanda.com/)

AUTHOR

Zmanda Inc. (http://www.zmanda.com)