Exemplo n.º 1
0
 public void RestoreAllViaServer()
 {
     using (ServerClientSession session = new ServerClientSession(systemDir, null, 2000, false)) // don't use optimistic locking for restore
     {
         session.BeginUpdate();
         DatabaseLocation backupLocation = new DatabaseLocation(Dns.GetHostName(), backupDir, backupLocationStartDbNum, UInt32.MaxValue, session,
                                                                PageInfo.compressionKind.None, PageInfo.encryptionKind.noEncryption, true, session.DatabaseLocations.Default());
         session.RestoreFrom(backupLocation, DateTime.Now);
         session.Commit(false);
     }
 }
Exemplo n.º 2
0
        public void RestoreToBackupServer()
        {
            using (ServerClientSession session = new ServerClientSession(s_systemDir, systemHost))
            {
                session.ClearServerCache(); // normally don't use this function but use it here to simulate a server going down and restarting
            }

            using (ServerClientSession session = new ServerClientSession(s_systemDir, backupHost, 1000, true, inMemoryOnly))
            {
                session.BeginUpdate();
                DatabaseLocation backupLocation = new DatabaseLocation(backupHost, backupDir, backupLocationStartDbNum, UInt32.MaxValue, session,
                                                                       PageInfo.compressionKind.LZ4, PageInfo.encryptionKind.noEncryption, true, session.DatabaseLocations.Default());
                session.RestoreFrom(backupLocation, DateTime.MaxValue);
                session.Commit(false, true);
            }
        }
Exemplo n.º 3
0
 public void RestoreAllViaServer()
 {
   using (ServerClientSession session = new ServerClientSession(systemDir, null, 2000, false)) // don't use optimistic locking for restore
   {
     session.BeginUpdate();
     DatabaseLocation backupLocation = new DatabaseLocation(Dns.GetHostName(), backupDir, backupLocationStartDbNum, UInt32.MaxValue, session,
       PageInfo.compressionKind.None, PageInfo.encryptionKind.noEncryption, true, session.DatabaseLocations.Default());
     session.RestoreFrom(backupLocation, DateTime.UtcNow);
     session.Commit(false, true);
   }
 }
Exemplo n.º 4
0
    public void RestoreToBackupServer()
    {
      using (ServerClientSession session = new ServerClientSession(s_systemDir, systemHost))
      {
        session.ClearServerCache(); // normally don't use this function but use it here to simulate a server going down and restarting
      }

      using (ServerClientSession session = new ServerClientSession(s_systemDir, backupHost, 1000, true, inMemoryOnly))
      {
        session.BeginUpdate();
        DatabaseLocation backupLocation = new DatabaseLocation(backupHost, backupDir, backupLocationStartDbNum, UInt32.MaxValue, session,
          PageInfo.compressionKind.LZ4, PageInfo.encryptionKind.noEncryption, true, session.DatabaseLocations.Default());
        session.RestoreFrom(backupLocation, DateTime.MaxValue);
        session.Commit(false, true);
      }
    }