I just created an instance of SQL Server Express in Amazon RDS since I want to perform a test but I need to add a sample database "AdventureWorksLT2012_Data" that is in extension .mdf.
I got to connect to the database without problems through MSSMS but when I try to attach the BD that I have locally I can not do it
And I tried to investigate in the AWS documentation the way to attach this type of files to the instance of my BD but I can not calculate any reference.
Thanks for your response.
I managed to add the .mdf file to the RDS cloud but when I tried to add it to the database instance using the following command:
exec msdb.dbo.rds_restore_database
#restore_db_name='AdventureWorksLT',
#s3_arn_to_restore_from='arn:aws:s3:::sqlserverp/Andveruteworks.mdf';
I got the following error
[2017-11-22 20:40:22.247] The media family on device '0FEAAE12-E9A1-4D84-8AEF-39AD0FFB496A' is incorrectly formed. SQL Server cannot process this media family. [2017-11-22 20:40:22.250] RESTORE FILELIST is terminating abnormally. [2017-11-22 20:40:22.267] Aborted the task because of a task failure or a concurrent RESTORE_DB request. [2017-11-22 20:40:22.373] Invalid attempt to read when no data is present.
The only thing that I want to do was to use a backup of the database (.bak) which I uploaded to the S3 AWS service and later guiding me on the following documentation
enter link description here
and using the following stored procedures I managed to attach the BD to the instance of my sql server
exec msdb.dbo.rds_restore_database
#restore_db_name='AdventureWorksLT',
#s3_arn_to_restore_from='arn:aws:s3:::sqlserverp/AdventureWorks2012-FullDatabaseBackup.bak';
exec msdb.dbo.rds_task_status
Related
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.
I am new to using using stored procedure and Azure storage account. I am exploring the following guide at:
https://www.sqlshack.com/how-to-connect-and-perform-a-sql-server-database-restore-from-azure-blob-storage/
and have created a credential in my database 'Security' > 'Credential' folder in SSMS.
Query that I ran in SSMS:
--using the url and the key
CREATE CREDENTIAL [Credential_BLOB]
WITH IDENTITY= 'https://<account>.blob.core.windows.net/',
SECRET = '<storage account key -> which I enter my Access Key 1>';
Result:
After which I proceed to run the following stored procedure where I want to restore the backup from BLOB storage:
RESTORE DATABASE Database_Name FROM URL = 'https://<account>.blob.core.windows.net/Container/SampleDatabase.bak'
WITH CREDENTIAL = 'Credential_BLOB',
And I get this error:
Msg 41901, Level 16, State 2, Line 3
One or more of the options (credential) are not supported for this statement in SQL Database Managed Instance. Review the documentation for supported options.
However, from the guide which I input the link above, they were able to run the query:
I tried to google for the syntax of the RESTORE statement from the Microsoft Docs library and others who may have encountered similar issue but I did not find any effective result. I would appreciate your help if you have encountered something similar and would like to share your solution. Thank you!
From the error which you have shared, it is easy to interpret that you are using the SQL Database Managed Instance. But the link you have shared doesn't mention anywhere which SQL Server it is using. The approach mentioned in that link might not work in your case because of difference in SQL servers and statement compatibility.
Then, I tried the steps which are given in the Microsoft official document (link shared by #Nick.McDermaid in the comment section). It is working fine without any issue.
Please follow the steps below to achieve the requirement (applicable for SQL Server 2016 (13.x) and later, Azure SQL Managed Instance only).
Use the GUI in SQL Server Management Studio to create the credential by following the steps below.
Connect with your SQL Server 2016 (13.x) and later or Azure SQL Managed Instance
Right-click your database name, hover over Tasks and then select Back up to launch the Back Up Database wizard.
Select URL from the Back up to destination drop-down, and then select Add to launch the Select Backup Destination dialog box.
Select New container on the Select Backup Destination dialog box to launch the Connect to a Microsoft Subscription window.
Sign in to the Azure portal by selecting Sign In and then proceed through the sign-in process. Select your subscription from the drop-drown.
Select your storage account from the drop-down. Select the container you created already from the drop-down. Select Create Credential to generate your Shared Access Signature (SAS). Save this value as you'll need it for the restore.
I also tried to restore the database using the newly created credential and it is working fine.
To create the credential using T-SQL, please follow the steps provided in this link.
I have an Azure Data Factory pipeline that contains copy data task. The task copies the data from Azure Blob storage to SQL Server Table. The SQL Server is hosted on-prem and hence is accessed through integration runtime.
I tested the connections to both Azure Blob Storage and SQL Server from Azure Data Factory and they work.
However, when I try to execute the copy task I get the following error:
The object (covered in black for confidentiality) is the name of the table I want to write to in SQL Server. I can confirm that the table exists. I can confirm that the user that is the integration run time is using to access SQL server is having the required permissions to write to the table.
This is not an issue with Data factory, as you say your connection is successful it seems to be true.
It more of seems to an issue with either not using the correct database or you do clearly have no access on the table.
Can you use the same database credentials login using SSMS and try running select/update queries?
Also can you check if the auto increment is true?
Please find this link for your reference - > https://support.microsoft.com/en-us/topic/error-message-when-you-try-to-insert-data-into-a-custom-table-in-microsoft-dynamics-nav-cannot-find-the-object-navdbname-dbo-companyname$-tablename-because-it-does-not-exist-or-you-do-not-have-permissions-70dc2a61-c5f7-a85e-ae24-0b4d8931d9ef
A few things you can do to further check if the table is accessible.
Open the related Dataset that is used as 'Sink'
In Connection tab of the dataset, try both 'Test connection' and 'Preview data', as in the image below.
In Schema tab, try the 'Import schema' button, as in the image below.
Please find the diagram as below for my issue:
I have 3 servers in the same domain, there is a SQL Server instance A (it's windows service run under domain\User1), In this instance, we have a Stored Procedure used for BULK INSERT a text file from a network shared folder in server C, the domain\User1 has full permissions on this folder.
My issue is: The Stored Procedure runs ok (green arrow) when connecting by SSMS in its (server A). But it failed when I change to SSMS in server B (log in by the same domain\User1 to the same Instance A). The error is "Access denied" to the text file (red arrow). Does the client have a role in this? I think the client does not matter, the file reading is done from the server (by the user that run Instance A service)
Note: If I connect Instance A from SSMS B with SQL Logon User (not windows account), the stored procedure works fine.
Could anyone give me some advice and sorry for my bad English
This is just a link answer but hopefully it helps.
BTW I commend you for taking the time to analyse the issue to the extent of drawing a diagram. This is far higher quality than most questions on here.
I believe you are running into a double hop issue. I searched everywhere for the BULK INSERT permission model and finally found this https://dba.stackexchange.com/questions/189676/why-is-bulk-insert-considered-dangerous
which says this about using BULK INSERT:
When accessing SQL Server via a Windows Login, that Windows account
will be impersonated (even if you switch the security context using
EXECUTE AS LOGIN='...') for doing the file system access
and this
when accessing SQL Server via a SQL Server Login, then the external
access is done in the context of the SQL Server service account
When you have issues with windows authentication and there is three servers and impersonation, it's often a double hop issue.
This may help you with that:
https://dba.stackexchange.com/questions/44524/bulk-insert-through-network
Which in turn references this:
https://thesqldude.com/2011/12/30/how-to-sql-server-bulk-insert-with-constrained-delegation-access-is-denied/
I'm trying to execute a SSIS package on a SQL Server 2008R2. The script retrieve data on a remote server and copy them to its local database.
This job is scheduled every hour, the SQL Agent use a proxy to authenticate itself to the remote machine. Authentication seems to be ok but I get an error during loading of the SSIS package.
This is what I get:
Could not load package because of error 0xC001404A. Description: While trying to find a folder on SQL an OLE DB error was encountered with error code 0x80040E09 (The EXECUTE permission was denied on the object 'sp_ssis_getfolder', database 'msdb', schema 'dbo'.).
When I add the role of sysadmin to this user, the script works well. I don't know which kind of right I have to add to user on database 'mdb' to avoid this error.
Anybody could help me, please ?
Thanks in advance
You could
GRANT EXECUTE ON MSDB.DBO.sp_ssis_getfolder to [proxy]
Or you could try adding that user to one of the dts/ssis operator/executor roles - starting with user, then operator, then admin to see what level it needs - or read the documentation.
db_ssisadmin
db_ssisoperator
db_ssisltduser
See the section under msdb here: http://msdn.microsoft.com/en-us/library/ms189121.aspx