Error when creating DB with a Filestream - sql-server

I'm executing the following sql on a windows 7 os with sql server 2012 express.
CREATE DATABASE Archive
ON
PRIMARY (
NAME = Arch1,
FILENAME = 'c:\data\archdat1.mdf'),
FILEGROUP FileStreamGroup1 CONTAINS FILESTREAM
(
NAME = Arch3,
FILENAME = 'c:\data\filestream1')
LOG ON ( NAME = Archlog1,
FILENAME = 'c:\data\archlog1.ldf')
GO
I receive this error:
Msg 5120, Level 16, State 106, Line 1
Unable to open the physical file "c:\data\filestream1". Operating system error 259: "259(No more data is available.)".
This is what I've done before I got here:
Enabled the service to allow filestream from "sql server configuration manager".
Enabled the instance to allow a filestream.
Gave full control on the 'c:\data\' folder to the "NT Service\MSSQL$SQLEXPRESS2012" account running the sql server service
I'm at a complete loss at this point and any help would be much appreciated.
UPDATE 1
I'm installing sql server express on a new windows 7 install to see if this fixes anything.
UPDATE 2
Tried running the same sql on a windows xp box with sql server 2008 installed and received this error:
Unable to open the physical file "c:\data\filestream1". Operating system error -2147024891: "0x80070005(Access is denied.)".
UPDATE 3
Install on a clean windows 7 machine gives me the exact same error:
Msg 5120, Level 16, State 106, Line 1
Unable to open the physical file "c:\data\filestream1". Operating system error 259: "259(No more data is available.)".
UPDATE 4
I was able to get this to work on the windows xp box by changing the "Log on as" to Local System.
UPDATE 5
I tried doing the same thing (changing the "Log on as" to Local System) on the windows 7 box and am still getting the same error.

I solved this. Turns out it was our internal disk encryption software causing this error. Disabling the software was not enough. It had to be completely removed.

Related

Error when trying to load database into backup server

Im trying to load a database dump into my Sybase backup server.
Running sybase ASE-16_0 on both my primary and backup machine.
Import is done in isql cli via
load database DB from ./dumps/data_dump
Error message is the following:
Backup Server session id is: 22. Use this value when executing the
'sp_volchanged' system stored procedure after fulfilling any volume change
request from the Backup Server.
Backup Server: 4.141.2.40: [11] The 'open' call failed for database/archive
device while working on stripe device
'/opt/dumps/data_dump' with error number
13 (Permission denied). Refer to your operating system documentation for further
details.
Also found this SAP Knowledge Base article, but it's hidden behind a paywall:
https://userapps.support.sap.com/sap/support/knowledge/en/3140989
Setting up a new Server fixed the issue for me. Im still working on a possible answer for this problem.

Polybase doesn't create external file format

I get the good old
Incorrect syntax near 'EXTERNAL'.
error. I am exactly doing what this answer describes. But SQL Server returns the aforementioned error when I come to this code-chunk:
CREATE EXTERNAL FILE FORMAT csvformat
WITH (
FORMAT_TYPE = DELIMITEDTEXT,
FORMAT_OPTIONS (FIELD_TERMINATOR =',')
);
GO
What am I doing wrong?
What I tried
Java runtime environment is installed (Java 8 Update 201)
PolyBase is installed with "PolyBase Query Service for External Data"
I enabled PolyBase with EXEC sp_configure 'hadoop connectivity', 4;. I also set that option to 1 and 7 - I still get that error
Using EXEC sp_configure, I also set 'polybase enabled' to 1
I checked SELECT SERVERPROPERTY ('IsPolybaseInstalled') AS IsPolybaseInstalled; - it returns 1
My TCP is enabled
My PolyBase is running:
Setup: SQL Server 2019 on a Virtual Machine (Azure), no Azure SQL Server or Azure DWH.
Perhaps too simple answer, but can you restart entire virtual server and try it again?
Update: Reboot of the server/service after installation of Polybase is not stated in the documentation, also not requested by the installer, however plenty of messages on user boards tell that it is required to make Polybase work.

T-SQL Backup/Restore to/from URL does not work on SQL Server 2017 Web Edition on Ubuntu Linux 16.04 LTS

I tried, without success, to run a T-SQL script to Backup to URL and another one to Restore to URL on SQL Server 2017 Web Edition, which is running on Ubuntu 16.04 LTS. The credential was successfully created.
Here's an example of the T-SQL for Backup that I'm trying to run:
DECLARE #name varchar(100)
DECLARE #fileURL varchar(100)
SET #name = 'test-db'
SET #fileURL = 'https://mystorageaccountname.blob.core.windows.net/databases/test-db.BAK'
BACKUP DATABASE #name
TO URL = #fileURL
WITH CREDENTIAL = 'mycredential'
,COMPRESSION
,STATS = 5;
Here's the error that I'm getting on MSSQL Management Studio:
Msg 3292, Level 16, State 6, Line 5
A failure occurred while attempting to execute Backup or Restore with a URL device specified. Consult the operating system error log for details.
Msg 3013, Level 16, State 1, Line 5
BACKUP DATABASE is terminating abnormally.
Here's the error that I'm getting on /var/log/syslog:
#015VDI: "C:\binn\BackupToUrl.exe" "b" "p" "680074007400700073003A002F002F0073007700650065007400640061007400610062006100730065006200610063006B007500700073002E0062006C006F0062002E0063006F00720065002E00770069006E0064006F00770073002E006E00650074002F006400610074006100620061007300650073002F0068006300640061006D006F00620069006C0065002E00420041004B00" "73007700650065007400640061007400610062006100730065006200610063006B00750070007300" "01000000D08C9DDF0115D1118C7A00C04FC297EB010000008AB2169DF1DE3A45B5514DCCD09182C3000000001200000061007A007500720065006B006500790000001066000000010000200000008ECF1319A21E667E0E32E83135C57DFCAF4E3DFF2AABDA00E3E2D814B5C88D2E000000000E8000000002000020000000E9E64579DF38EA0E66886B8D454C4F4256A682A124E70D86EC0DA087112ECA0450000000F92ED8FD343DADDE9518C412CA5EAB188316B24A6A0B407CCEA9AE142A9DBC282085ABF133BFDF017A3AFA9CEB4C5039433D15FA47A64A1339F2D030ED3383C58F81A2C3634FA945B6B819F113AB22DF40000000E9CDF76A290F18299BBE99C273FCA31E4622334C645EBFE8C5AA9C4F68C1A323A2F0EED33B8F6E8D5922B5B78DE1F6DB456864A290689C98A3631EA3F62505D3" "NOFORMAT" "4D005300530051004C00530045005200560045005200" "" "DB" "68006300640061006D006F00620069006C006500" "NOTRACE"
#015BackupToUrl: couldn't load process Error Code: 80070002
#0152018-03-14 12:35:25.30 Backup Error: 3041, Severity: 16, State: 1.
#0152018-03-14 12:35:25.30 Backup BACKUP failed to complete the command BACKUP DATABASE hcdamobile. Check the backup application log for detailed messages.
Have you guys had this problem before? Do I need to install any additional package to be able to run Backup to URL on Linux?

I am trying to backup a database and am getting MSG 3013

I have tried to backup in Microsoft SSMS with the GUI backup task, and it fails after a few seconds, so then I tried running this command:
BACKUP DATABASE databasename TO DISK = 'd:\databasename_full.Bak' WITH FORMAT, MEDIANAME = 'd_datbasenamebackup', NAME = 'Full Backup of databasename';
And get a very generic error of the following
Msg 3013, Level 16, State 1, Line 1 BACKUP DATABASE is terminating abnormally.
I am wondering if anyone has come across this error before. Everything I have read is saying there is a media fault, which I know isn't the case.
There is a Microsoft support page for this Error Message 3013.
It is apparently caused when a filemark in your backup device could not be read. Resolution steps below:
To allow SQL Server to perform new backups to the backup device, you
must manually delete or erase the device by using the following
command:
BACKUP DATABASE mydatabase TO DISK='C:\MyDatabase.bak' with FORMAT

Create Database Snapshot for remote database on local machine

I am having a subtle problem in creating Database snapshot. I am connected to a remote database. I want to create a snapshot on my local machine. Is it possible or allowed?
I am typing the query below
> CREATE DATABASE SampleSnapshot ON ( NAME = 'Sample', FILENAME =
> 'C:\SampleFile' ) AS SNAPSHOT OF Sample; GO
and getting the exception
Msg 262, Level 14, State 1, Line 1
CREATE DATABASE permission denied in database 'master'.
I am having following questions:
When i specify the path in query the snapshot will be created on local machine or server machine? If local machine then how to create the snapshot on server machine itself.
No. Generally Client/Server means you send instructions to the server. Which execute on the server. Which means that your C:\ is relative TO THE SERVER, not your client machine.

Resources