Пример #1
0
 def cleanup(self):
     super(DB2OnlineBackup, self).cleanup()
     '''
     After a backup operation, we can delete the archived logs
     from the archived log directory but we do not want to delete
     the directory itself. Since archive logging is enabled for
     all databases, this directory is needed to store archive logs.
     '''
     service.remove_db2_dir(system.DB2_ARCHIVE_LOGS_DIR + "/*")
Пример #2
0
 def cleanup(self):
     super(DB2OnlineBackup, self).cleanup()
     '''
     After a backup operation, we can delete the archived logs
     from the archived log directory but we do not want to delete
     the directory itself. Since archive logging is enabled for
     all databases, this directory is needed to store archive logs.
     '''
     service.remove_db2_dir(system.DB2_ARCHIVE_LOGS_DIR + "/*")
Пример #3
0
 def post_restore(self):
     """
     Once the databases are restored from a backup, we have to roll
     forward the logs to the point of where the backup was taken. This
     brings the database to a state were it can used, otherwise it
     remains in a BACKUP PENDING state. After roll forwarding the logs,
     we can delete the archived logs.
     """
     self._post_restore(system.RESTORE_ONLINE_DB, system.ROLL_FORWARD_DB)
     service.remove_db2_dir(system.DB2_ARCHIVE_LOGS_DIR + '/*')
Пример #4
0
    def _post_restore(self, restore_command, rollforward_command=None):
        """
        Restore from the directory that we untarred into
        """
        out = ""
        try:
            out, err = utils.execute_with_timeout(system.GET_DB_NAMES,
                                                  shell=True)
        except exception.ProcessExecutionError:
            LOG.exception("Couldn't find any databases.")

        dbNames = out.split()
        for dbName in dbNames:
            service.run_command(restore_command % {'dbname': dbName})
            if rollforward_command:
                service.run_command(system.ROLL_FORWARD_DB %
                                    {'dbname': dbName})

        LOG.info("Cleaning out restore location: %s.", system.DB2_BACKUP_DIR)
        service.remove_db2_dir(system.DB2_BACKUP_DIR)
Пример #5
0
 def cleanup(self):
     service.remove_db2_dir(system.DB2_BACKUP_DIR)
Пример #6
0
 def cleanup(self):
     service.remove_db2_dir(system.DB2_BACKUP_DIR)