I don't understand why there is an access violation at this point. If vFileToRead, err = os.OpenFile(vFilenameToRead, os.O_RDONLY, 0666) err != nil ' WITH REPLACE Time.Sleep(time.Second * 3) // Wait for C++ to create named pipe My client used the option and their database size was huge and seeding is supposed to work faster than a backup and restore method. In the latest version of SSMS, we can also see the option of seeding as below. is a valid backup file created by the application (as I previosuly said, I restored the database from SQL Server Management Studio from it) vReadFromFileFinished := make(chan bool) If you have not heard earlier, one of the new features in AlwaysOn which was introduced in SQL Server 2016 was automatic seeding. Reads a local file and writes into created C++ named pipe. Just to test that restore using named pipes is working. As far as It is one DB it is OK, everything goes smoothly. I have already looked at the sample called 'snapshot'. Printf(" Read Error: client disconnected.\n") Snapshot backup of multiple databases using VDI API Hi I am trying to Backup my SQL server using the VDI (Virtual Device Interface) APIs I have the capability of creating and mounting snapshot. Printf(" %d bytes read.\n", dwTransferredBytes) Printf(" %d bytes to read.\n", cmd->size) įSuccess = ReadFile(hPipe, cmd->buffer, cmd->size, &dwTransferredBytes, NULL) Printf(" GetCommand executed successfully\n") If (ConnectNamedPipe(hPipe, NULL) != FALSE) // wait for someone to connect to the pipe Printf(" Named pipe %s created successfully\n", fname) PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, I am already using read/write mode both named pipe client and serverĬreates pipe server and waits for client to start read from. I can restore the database using the generated backup file from application using SQL Server Management StudioĮDIT 2: It is not the same case described in. If I read directly from backup file I can restore the database, it only crashes when a named pipe is involved.ĮDIT 1: Yes, I am sure the backup is working. This just for testing purposes, I will integrate with other writers in the future. The named pipe client is just a Go reader/writer that reads from a disk file and writes to the pipe. CONTINUATION: - The api was waiting and the timeout interval had elapsed.
I created a named pipe server from C++ and I read data from the pipe to SQL Server using VDI virtual device from C++ too. INF - Created VDI object for SQL Server instanceHowever when I try to execute a restore it never finishes and SQL Server aborts with a 38 error (EOF). The application has been created using Go and C++.
#SQL SERVER VDI API WINDOWS#
This posting is provided "AS IS" with no warranties, and confers no rights.I developed an application to backup/restore Microsoft SQL Server databases from Windows using VDI and named pipes to transfer data. If not, then as Uri pointed out perform SQL database backups separately. You should be testing your backup/restore options using your third party tool and verify if that satifies your requirements. Native SQL database backups or any other non-volume based snapshot backups do not use SQL VSS Writer.Īny third party backup application which performs backups needs to follow the guidelines which Microsoft has published under the article: SQL Server Developer > VDI and Differential backup Hi, Is it possible to perform a restore of a differential backup done with VDI API Im not sure the way differential backup works, if it uses transactional logs or not. This is incorrect! Only applications which perform snapshot backups of volumes which contain SQL database files for creating the exclusion list and coordinating the backup through the VDI interface calls provided in the SQLVDI.DLL shipped with SQL installations. Its good that the 3rd party tool is using backups via VSS since SQL native backups also use VSS WriterĪbhay Chaudhary OCP 9i, MCTS/MCITP (SQL Server 2005, 2008, 2005 BI) /