RavenDB Restore Stuck - ravendb

We are trying to restore Ravendb from the backup file. We are using Raven studio. The restore process copied index files from the backup to the new location but it's stuck at the below step:
Esent Restore: Restore Begin
Esent Restore: 18 1001
I couldn't see any other logs or exceptions.
The backup size is around 123 GB.
How do I fix this stuck process?

After lots of investigation, I found the issue.
Seems the IIS application pool was configured to recycle itself every 20 min. So, after 20 mins, RavenDB was used to kill the restore process.
I found the issue by monitoring the Resouce Monitor -> CPU -> Process Manager tab. You should able to see the Raven process doing loads of write operations during restore and should able to monitor when service gets stopped.

Related

Restore duplicati configuration from backup

I lost my system drive a day ago and with it all my duplicati settings/jobs (not the backups - they are ok)
Restoring works fine but I'd like to restore/recreate my jobs from an existing backup and continue backing up to that location
Is there a way to do that (couldn't find it in the web interface nor online documentation)
I created the job with the same settings (default settings and same AES password) and tried to start a backup, duplicati complained about a missing database and suggeted a db repair.
After the db repair run everything was back to normal.

Jira backup files being automatically created every 3 hours

On my Jira server v7.5.2 (CentOS 7), in /data/atlassian/jira/export, there is a bunch of zipfiles created every 3 hours, each around 200 Mb in size:
...
2018-Aug-14-0000.zip
2018-Aug-14-0300.zip
2018-Aug-14-0600.zip
2018-Aug-14-0900.zip
2018-Aug-14-1200.zip
2018-Aug-14-1500.zip
...
Apparently they're automated backups. However, there is neither any Scheduled Job nor any cron job with such a timing.
What could be creating these files? Is there any other Jira job scheduling or setting that I should check?
Look for Admin, System, Services. There is a Backup Service running there. You can edit or delete it there

RavenDB periodic backup bundle + web admin does not persist changes

I'm using the latest stable version (3.0.3660) on a VM on Windows Azure and would like to enable period backup. Have tried to enable both local backup and backup to Azure but the GUI doesn't seem to persist the changes. Modal dialog says "Saving..." but nothing more.
Is there a log for this so that I can troubleshoot what doesn't work?
/Erik
I tried it too and the database is non-responsive for several minutes (a co-worker was waiting for tens of minutes). But after waiting a while it actually does something. I configured the Azure backup and that went wrong because it couldn't upload a blob of that large a size. The error was logged and can be found in the studio > status > logs.
Running the server standalone (instead of running as a service) doesn't give any additional feedback either.
Managed it to work by setting "Raven/AnonymousAccess" to Admin and then save the changes, not sure why. Connected with API key that should have full access.

Restore Database from URL (Azure storage) fails without further details

On a Windows Azure VM running Windows 2008 R2 and SQL 2012 Enterprise SP1 CU5, I'm trying to restore a backup stored in Azure as a page blob with the new functionality RESTORE DATABASE FROM URL.
So far I've done it several times with backups up to 60GB in size (uncompressed) and it works like a charm.
However, there is a particular backup 32GB in size that I can't restore. It fails with the following error message:
Msg 3013, Level 16, State 1, Line 2
RESTORE DATABASE is terminating abnormally.
No further information is provided as to why it fails. If I download the same backup from to the local hard drive I can restore it without problem. I tried executing
dbcc traceon(3004,3605,-1)
to get more info and I can see that the DB is restored successfully, then it zeroes in the log file and after that completes is when it fails.
There isn't any error message in the SQL logs, neither in Windows Event log.
There is plenty of free space on that hard drive.
VM and storage are in the same datacenter and I've followed all best practices in building the environment.
EDIT> I noticed the following lines in Event viewer AFTER the database is restored and BEFORE it starts restoring the LOG file (in other words, while the log file is being zeroed)
SQLVDI: Loc=CVDS::Close. Desc=Open devices!. ErrorCode=(0). Process=2900. Thread=1104. Client. Instance=MSSQLSERVER. VD=Global\https://url/stuff/xx.bak_SQLVDIMemoryName_0.
SQLVDI: Loc=SignalAbort. Desc=Client initiates abort. ErrorCode=(0). Process=2900. Thread=1104. Client. Instance=MSSQLSERVER. VD=Global\https://url/stuff/xx.bak_SQLVDIMemoryName_0.
SQLVDI: Loc=TriggerAbort. Desc=invoked. ErrorCode=(0). Process=1508. Thread=2008. Server. Instance=MSSQLSERVER. VD=Global\https://url/stuff/xx.bak_SQLVDIMemoryName_0.
Is it possible that the connection to Azure storage times out before the zeroing finishes and thus the RESTORE fails? If so, how do I change this timeout?
You may wish to try enabling instant file initialization (it solved the problem for me). To do this you need to grant the SQL service account the 'Perform volume maintenance tasks' permission in security policy.
For instructions, see:http://blogs.msdn.com/b/sql_pfe_blog/archive/2009/12/23/how-and-why-to-enable-instant-file-initialization.aspx
With thanks to this 'question' for providing the answer:https://stackoverflow.com/questions/20692592/restoring-large-database-backups-from-azure-blob-storage-to-sql-server-2012-in-a
For anyone having this issue i found a different workaround.
Rather than creating the backup Log file to store on Azure blob storage, i changed that part of the script generated before execution to store it to local disk.
I'm unsure as to why the log file is not successfully being created when SQL attempts to write it to the blob storage.
Here is a segment of the script in questiona fter my amendmants :-
USE [master]
BACKUP LOG [RealTime] TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQL14\MSSQL\Backup\YourDb_LogBackup_2015-07-07_09-04-17.bak'
WITH NOFORMAT, NOINIT, NAME = N'YourDb_LogBackup_2015-07-07_09-04-17', NOSKIP, NOREWIND, NOUNLOAD, NORECOVERY , STATS = 5
Leave the rest of the script generated to RESTORE the database as is.

SQL Server 2005 Restore Hanging

I have a database showing up in SQL Enterprise Manager as "(Restoring...)"
If i do SP_WHO there is no restore process.
The disk and CPU activity on the server is very low
I think it is not restoring at all.
How can I get rid of this?
I've tried renaming the underlying MDF file, but even when I do "NET STOP MSSQLSERVER" it tells me the file is open.
I've tried using PROCEXP to find what process has the file open, but even the latest PROCEXP can't seem to do that on Windows Server 2003 R2 x64. The lower pane view is blank.
In the SQL Server log it says "the database is marked RESTORING and is in a state that does not allow recovery to be run"
Sql Server has two backup types:
Full backup, contains the entire database
Transaction log backup, contains only the changes since the last full backup
When restoring, Sql Server asks you if you want to restore additional logs after the full backup. If you choose this option, called WITH NORECOVERY, the database will be left in Restoring state. It will be waiting for more transaction logs to be restored.
You can force it out of Restoring mode with:
RESTORE DATABASE <DATABASE_NAME> WITH RECOVERY
If this command gives an error, detach the database, remove the MDF files, and start the restore from scratch. If it keeps failing, your backup file might be corrupted.
Here's a screenshot of the restore options, with the default selected. The second option will leave the database in Restoring state.
Image of the restore options http://img193.imageshack.us/img193/8366/captureu.png
P.S.1. Are you running the 64 bit version of process explorer? Verify that you see procexp64.exe in the task manager.
P.S.2. This is more like a question for serverfault.
WITH RECOVERY option is used by default when RESTORE DATABASE/RESTORE LOG commands is executed. If you're stuck in "restoring" process you can bring back a database to online state by executing:
RESTORE DATABASE YourDB WITH RECOVERY
GO
You can look for more options and some third party tools on this SO post https://stackoverflow.com/a/21192066/2808398
If you are trying to get rid of the lock on the file I would recommend getting Unlocker http://www.emptyloop.com/unlocker/
It'll give you an option to unlock the file, or kill the process that has locked the file. Run this on the mdf and ldf files.
Another option is to try to Detach the files from Enterprise Manager or Sql Management Studio and then reattach the db. You can try this before running unlocker to see if sql server will just release the mdf and ldf files.
CAUTION: If you kill the process you might lose data or the data might get corrupted so use this only if you are trying to get rid of it and you have a good and tested backup.