I'm looking to enable change data capture on a SQL Server Database.
Version: Microsoft SQL Azure (RTM) - 12.0.2000.8 Apr 9 2020 16:39:55 Copyright (C) 2019 Microsoft Corporation
Used below command to check if the CDC is enabled on the db and it returned '0'
SELECT is_cdc_enabled
FROM sys.databases
WHERE name = 'XXXX';
Tried to enable the CDC at the database level by issuing below command ..
EXEC sys.sp_cdc_enable_db
It returned below error message
Msg 22830, Level 16, State 1, Procedure sys.sp_cdc_enable_db_internal, Line 198 [Batch Start Line 4]
Could not update the metadata that indicates database XXXX is enabled for Change Data Capture. The failure occurred when executing the command 'SetCDCTracked(Value = 1)'. The error returned was 22845: 'Cannot enable change data capture in this edition of SQL Server.'. Use the action and error to determine the cause of the failure and resubmit the request.
Now my question is- do I need admin privileges to enabled CDC or is this feature not available with Azure SQL server version? Thanks for reading and your help is appreciated.
Please reference this document: Enable and Disable Change Data Capture (SQL Server)
The feature only support Azure SQL managed instance. For Azure SQL database, wen can not Enable and Disable Change Data Capture.
Hope this helps.
CDC is now Available for Azure SQL Databases
Related
I am using SQL Server 2014 and I need to access the database using a VPN. I have no issue logging on the SQL Server using my VPN but I can't expand the database or query it.
When I click the database to expand it, I get the following message:
The database XXXX is not accessible. (ObjectExplorer)
------------------------------
Program Location:
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.DatabaseNavigableItem.get_CanGetChildren()
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItem.RequestChildren(IGetChildrenRequest request)
at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ExplorerHierarchyNode.BuildChildren(WaitHandle quitEvent)
If I query a table from the database, I get the following message:
Msg 916, Level 14, State 1, Line 2
The server principal "Bi" is not able to access the database "HMS_ARL" under the current security context.
Any kind of help would be much appreciated.
I'm trying to create an External Data Source for PolyBase via ODBC connectors in SQL Server 2019, but I'm getting the error:
OLE DB provider "MSOLEDBSQL" for linked server "(null)" returned message "Cannot generate SSPI context".
Msg -2146893042, Level 16, State 1, Line 11
SQL Server Network Interfaces: No credentials are available in the security package
I am using SSMS 18.4 and I'm running the following command:
CREATE EXTERNAL DATA SOURCE TEST
WITH (
LOCATION = 'odbc://sap.company.com',
CONNECTION_OPTIONS = 'DSN=SAP',
CREDENTIAL = my_creds
);
I did a fair amount of reading and it seems like the error can be 1 of many things. But I can't really find anything where it relates to External Data Sources.
Any advice or guesses will be appreciated.
I'm running SQL 2019 Developer (RTM) 64 bit on Windows 10
I have an ODBC entry called SAP that connects succesfully
my_creds has been created in SQL with SAP user name and password.
My SQL 2019 PolyBase Engine service is running under Network Service (same with the PolyBase Data Movement service).
TCP/IP has been enabled on the PolyBase service.
I upgrade the SQL 2014 Express to a Standard edition without changing the instance name. There was a success and it seems to be working fine, except the SQL AGENT.
Error message from configuration manager:
The request failed or the service did not respond in a timely fashion.
Consult the event log or other applicable error logs details.
Trying with the server administrator user. Built in account/Local service also don't work.
Event log doesn't show anything except that it's turned on and then off.
This is what I see in DETAILS. doesn't tell me anything:
Provider
[ Name] SQLAgent$SQLEXPRESS
EventID 102
[ Qualifiers] 16384
Level 4
Task 2
Keywords 0x80000000000000
Trying to run it from CMD with admin rights:
StartServiceCtrlDispatcher failed (error 0).
Read somewhere to try to turn off VIA protocol. I don't have any protocol called VIA.
Any ideas?
Thanks
Just after I posted I checked the security and found out that the BUILTIN\USERS didn't have sysadmin permission..
After adding it, it was resolved!
I had a similar issue when I upgraded the SQL Server 2017 from Express to Standard. The SQL Server Agent would not start even after the upgrade.
I an error message in the SQLAgent Log
(C:\Program Files\Microsoft SQL Server\MSSQL14.SQL2017EXPRESS\MSSQL\Log)
2017-12-18 16:21:06 - ! [298] SQLServer Error: 229, The EXECUTE permission was denied on the object 'sp_sqlagent_update_agent_xps', database 'msdb', schema 'dbo'. [SQLSTATE 42000] (DisableAgentXPs)
Changing the SQL agent service Log On account to "Local System" does not work (as you described).
Ultimately what worked for me is changed the Log On account to "NT Service\MSSQL$SQL2017EXPRESS" works.
This user was created when I named the SQL Server "SQL2017EXPRESS" during installation. If you open up SSMS, connect to your database instance, and open up Security->Logins, you should able find a list of database NT Service users that have access the system database (msdb). Try using one of those users as your Log On user for the SQL Agent Service.
I think you install Standard edition, it would create a user call NT Service\MSSQLAgent$2014.
During research, I tried in the instruction in this article. It appears using Sql Server Configuration Manager to change the Log On user didn't work for me. Instead, changing the Log On user from Administrator->View Local Services works.
I know this is late, but I hope it helps someone in the future; a fix that has worked for me after an upgrade from Express to Standard was to run the Repair option (see image) from the Maintenance node of the SQL Server Installation Center. Once the repair completes & restart finishes, Agent works as expected.
Use Repair option from the Maintenance page of the SQL Server Installation Center
I had this same issue with SQL 2019 after upgrading from express to standard. Doing the Repair from the installation maintenance section fixed the agent for me.
I want to query a supplier Azure SQL PDWH from our on-premises server (SQL 2014) to extract data from that Azure SQL PDWH and insert into a database that is located on the on-premises server. In the end this should automated via stored procedures that reside in the on-premises database and are scheduled.
To do so I have setup a linked server between the Azure SQL DWH and our on-premises server using the following scripts that I found here:
https://blogs.msdn.microsoft.com/sqlcat/2011/03/07/linked-servers-to-sql-azure/
/*
Create new linked server
*/
-- Make a link to the cloud
EXEC sp_addlinkedserver
#server=N'read_only_dwhs',
#srvproduct=N'Azure SQL Db',
#provider=N'SQLNCLI',
#datasrc=N'server.database.windows.net,1433',
#catalog='xxxxxx';
GO
--Set up login mapping
EXEC sp_addlinkedsrvlogin
#rmtsrvname = 'read_only_dwhs',
#useself = 'FALSE',
#locallogin=NULL,
#rmtuser = 'xxxxxx',
#rmtpassword = 'xxxxxx'
GO
These statements run without errors. However, when I execute the sp_testlinkedserver it returns a time-out error after about 10 seconds.
OLE DB provider "SQLNCLI11" for linked server "read_only_dwhs" returned message "Login timeout expired".
OLE DB provider "SQLNCLI11" for linked server "read_only_dwhs" returned message "Unable to complete login process due to delay in prelogin response".
Msg 258, Level 16, State 1, Line 23
TCP Provider: Timeout error [258].
I checked with IT and they confirm that nothing is blocked by the firewall relating this and that TCP/IP is enabled. Our supplier also confirms that our IP is added to the Azure Firewall. I have no problem querying direct from the Azure SQL PDWH database via visual studio community 2015.
Also tools like these: http://sqlazuremw.codeplex.com/ give the same error on connecting.
I searched for hours, but whatever I do it keeps returning the same error message.
Any help is appreciated.
Update 2016 09 27:
After some more testing with IT it seems like this has to do with our firewall settings.
When I directly query via the database from the on-premises server (connected via remote desktop) to the Azure DWH I get no errors and everything works. I am than also able to query from my local machine, using the same on-premises database.
However, when another colleague logs on to the on-premises server I am not able anymore to query from my local machine (with the time-out errors above) until I login again to the (on-premises) server with my credentials.
I think that the firewall rule is too strict in only allowing information to be sent/received to the Azure DWH if my credentials are active on the on-premises server.
Update 2016 09 28:
The issue seems to be fixed for now. IT managed to apply the correct settings to the firewall. The server can now communicate with the Azure DWH even when colleagues are logged on to the server.
This might help some-one else.
I'm trying to set up transactional replication in SQL Server 2012 using AdventureWorks 2012. And right at the end of the publications setup i get the following error:
SQL Server could not start the Snapshot Agent.
Additional Information:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
SQL ServerAgent is not currently running so it cannot be modified of this action.
Changed database context to 'AdventureWorks2012'.(Microsoft SQL Server,Error 22022)
I'm guessing this error isn't allowing me to execute the following code:
USE ADRepl;
SELECT * FROM Person.BusinessEntity
As every time I do execute this I get the following error:
Msg 208, Level 16, State 1, Line 2
Invalid object name 'Person.BusinessEntity'.
Make your sql agent property as automatic.
Set the SQL server agent service Automatically.
Press windows key+R
type services.msc
right Click on sql server agent
properties >> startup >> select automatically.