Hi!

Here at SUSE we were working at Dobby replacement and we would like to
know what could be missing from the things that we already achieved.

We thought to make it exact Python clone and extend with PostgreSQL
support, but then we realized that we can make it even better,
deprecating cold backups and related things to that.


Done:
=====
1. Works with Oracle DB and PostgreSQL.

2. No DBI drivers at all, no dependencies like that. It is just a
wrapper for SQL*Plus, RMAN and psql utilities.

3. No configuration at all, except it reads main rhn.conf
what DB is configured at the very moment. The rest it detects
from Oracle DB-related or PostgreSQL-related files separately.

4. Automatically changes set of commands available. For example,
it allows restart only listeners in Oracle, but no such feature
for PostgreSQL.

5. Hot backups for Oracle and PostgreSQL. No longer need to stop
entire system just to snapshot the db.

6. Never executes external processes with '...> /dev/null &;" printing
"Done" no matter what, but actually waits for the actual result
and tells you everything in details.

7. Oracle is put to autoextend mode, reporting free space. The "extend
tablespace" feature is just dropped.

8. No need of "su - oracle" (or "su - postgres") any longer. :-)
Just make sure your user has sudo rights.

9. Renamed to "mgr-db". This will also deprecate customer scripts for
previous "db-control". Commands are incompatible.


To do:
======
1. (Critical) Automatically dealing with archivelog for Oracle DB, so
it won't blow away the entire disk space.

2. (Later) Add XML output, so the utility might be also "crontabbed"
and integrated into a Spacewalk directly, with no more CLI intervention.


Code & Documentation:
=====================
Soon on our GitHub. Hopefully, next week.


CLIshots:
=========

Overview:

$ sudo ./mgr-db
SUSE Manager Database Control. Version 1.0
Copyright (c) by SUSE Linux Products GmbH

Available commands on Postgresql database:
        backup-hot      Perform host database backup.
        backup-status   Show backup status.
        db-start        Start the SUSE Manager Database.
        db-status       Show database status.
        db-stop         Stop the SUSE Manager Database.
        space-overview  Show database space report.
        space-reclaim   Free disk space from unused object
                        in tables and indexes.
        space-tables    Show space report for each table.
        system-check    Common backend healthcheck.


Config check:

$ sudo ./mgr-db system-check
INFO: Database needs to be restarted.
INFO: Wrote new client auth configuration.
Backup as /var/lib/pgsql/data/pg_hba.2012-05-02-15-13-39.conf
Stopping core...        done
Starting core...        done
Database is online
System check finished


Space Overview:

$ sudo ./mgr-db space-overview

Tablespace  | Size (Mb) | Avail (Mb) | Use %
------------+-----------+------------+------
template1   | 6         | 91645      | 0.006
template0   | 6         | 91645      | 0.006
postgres    | 5         | 91646      | 0.005
susemanager | 37        | 91613      | 0.041


Backup options:

$ sudo ./mgr-db backup-hot help
SUSE Manager Database Control. Version 1.0
Copyright (c) by SUSE Linux Products GmbH

Command:
        backup-hot

Description:
        Perform host database backup.

Parameters:
        --enable        Enable or disable hot backups.
                        Values: on | off | purge
        --destination   Destination directory of the backup.


Adding "help" to each command will print you what it is
and what are other params available.


P.S. Written in Python.


--
Bo Maryniuk

SUSE LINUX Products GmbH, HRB 16746 (AG Nürnberg)
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer

I had a dream... and there were 1's and 0's
everywhere, and I think I saw a 2!

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to