C# Class Smithers.Worker.Jobs.PrePurchasing.AzureStorageService

Afficher le fichier Open project: ucdavis/Smithers

Méthodes publiques

Méthode Description
AzureStorageService ( string serverName, string sqlUsername, string sqlPassword, string storageAccountName, string storageKey, string storageContainer, string storageUrl = null, int cleanupThreshold = -4 ) : System

Backup ( string database, List tables, string &filename ) : string

Execute the srcDatabase backup

BackupDataSync ( string database, string &filename ) : string

Backup a srcDatabase that has datasync enabled

BlobCleanup ( ) : IEnumerable

Cleans up the container, deleting old backupss

Code based on example: https://www.windowsazure.com/en-us/develop/net/how-to-guides/blob-storage/

GetStatus ( string requestId ) : string

Get status of srcDatabase backup job

Private Methods

Méthode Description
CleanupTmp ( string tmpDatabase, string masterDbConnectionString ) : void

Remove the temporary srcDatabase

CreateCopy ( string srcDatabase, string tmpDatabase, string masterDbConnectionString ) : void

makes a copy of the srcDatabase

DisableTriggers ( string tmpDbConnectionString ) : void

Disables ALL database triggers period.

Disabling these allows the srcDatabase to be restored without errors. Once restored, ALL database triggers can be re-enabled without incident by issuing the command from an AZURE query window: ENABLE TRIGGER ALL ON DATABASE

RemoveDataSync ( string tmpDbConnectionString ) : void

Removes all the necessary tables/sprocs/triggers that are related to DataSync

Removing these allows the srcDatabase to be restored and minimizes a little of the spaced needed for backups. The triggers are the only necessary part, as they prevent restoration from blob storage.

Method Details

AzureStorageService() public méthode

public AzureStorageService ( string serverName, string sqlUsername, string sqlPassword, string storageAccountName, string storageKey, string storageContainer, string storageUrl = null, int cleanupThreshold = -4 ) : System
serverName string
sqlUsername string
sqlPassword string
storageAccountName string
storageKey string
storageContainer string
storageUrl string Overrides using the standard domain of blob.core.windows.net, based on storage account name
cleanupThreshold int # of days to before clearing out old backups
Résultat System

Backup() public méthode

Execute the srcDatabase backup
public Backup ( string database, List tables, string &filename ) : string
database string Name of srcDatabase to backup
tables List List of tables for selective backup, null if backup entire srcDatabase
filename string Generated filename for blob storage
Résultat string

BackupDataSync() public méthode

Backup a srcDatabase that has datasync enabled
public BackupDataSync ( string database, string &filename ) : string
database string
filename string
Résultat string

BlobCleanup() public méthode

Cleans up the container, deleting old backupss
Code based on example: https://www.windowsazure.com/en-us/develop/net/how-to-guides/blob-storage/
public BlobCleanup ( ) : IEnumerable
Résultat IEnumerable

GetStatus() public méthode

Get status of srcDatabase backup job
public GetStatus ( string requestId ) : string
requestId string
Résultat string