What's the different of using MSDTC cluster or MSDTC Local ??
Seems windows 2016 clustering no need to have a cluster MSDTC resource
What's the different of using MSDTC cluster or MSDTC Local ??
Seems windows 2016 clustering no need to have a cluster MSDTC resource
I have a linked server that I am creating.
EXEC master.dbo.sp_addlinkedserver @server = N'LINKEDSERVER', @srvproduct=N'', @provider=N'IhOLEDB.iHistorian', @datasrc=N'linkedservername', @provstr=N'Server=localserver;User ID=nonsysadminaccnt'
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'LINKEDSERVER',@useself=N'False',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'LINKEDSERVER',@useself=N'True',@locallogin=N'nonsysadminaccnt',@rmtuser=NULL,@rmtpassword=NULL
However when I try to run a query with the nonsysadminaccnt I get the following error:
> Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source
> object of OLE DB provider "IhOLEDB.iHistorian" for linked server
> "LINKEDSERVER".
On the sysadmin account I see a folder with "Providers". On the nonsysadmin account I don't see a folder with "Providers". This leads me to believe that the nonsysadmin account doesn't have access to the provider. However, I can't find any
information on how to provide permissions to the nonsysadmin account.
How can I provide access to the provider to the nonsysadmin account?
Just to be clear, there is no username/password that should be supplied to the OLEDB connection string. For example this is the python code that everyone currently uses to connect to the Historian server.
conn = w32.Dispatch('ADODB.Connection')
connection_string = r"Provider=IhOLEDB.iHistorian.1;Data Source=linkedservername;Mode=Read".
I am new to SQL partition, trying to partition a table like below
UniquePk int primary key ,
CountryID int
ID int -- unique within the country
Polygon geography.
Polygon is indexed and depend on the primary key.
Now, I want partition by CountryID but SQL does not let me do it because the special index depend on the clustered primary key
Seems I have to make the (CountryID, ID) combo primary key (CLUSTERED) and then partition by CountryID.
Can any expert confirm? or point me a direction?
Thanks,
John
Problem: Clients can't connect to database.
Solution: Open Management Studio. Take database offline and bring it back on line.
When I open the Management Studio I notice that the expand arrow next to the database is missing. I try left clicking on the database and nothing happens(doesn't expand to see Tables, Views etc.).
If I right click, take it offline and then back online it will expand and clients can connect.
This happens to only one of the two databases being used and happens almost every night.
Hi Team,
When we restart SQL Server Services from Configuration manager, it's getting failing. This is SQL Server 2016 (AlwaysOn)
But when i reboot windows server then sql services comingup successfully.
2018-10-12 22:40:57.27 spid14s Server is listening on [ 'any' <ipv6> 52065].Hi all.
I am trying to get understanding of contained user in Sql 2012 which is a new feature of sql 2012.
i am not clear with user that I create using following syntax in database"CREATE USER SalesRep1 WITHOUT LOGIN"
and guest user and the one I create with contained user concept.
Thanx in advance
srm_2010
VVinayPrasad
Hi All,
Greetings!
I am working through a POC on SQL Server database partitioning (SW) and need some help, below is the partition function and schema (RIGHT RANGE)
PRIMARY | <=YEAR1 (31/12/2014) |
YEAR 2015 | <=YEAR1 (31/12/2015) |
YEAR 2016 | <=YEAR1 (31/12/2016) |
YEAR 2017 | <=YEAR1 (31/12/2017) |
MONTH 1 | Jan |
MONTH2 | Feb |
MONTH 3 | Mar |
MONTH 4 | Apr |
MONTH 5 | May |
MONTH 6 | Jun |
MONTH 7 | Jul |
MONTH 8 | Aug |
MONTH 9 | Sep |
MONTH 10 | Oct |
MONTH 11 | Nov |
MONTH 12 | Dec |
For the current year we are using monthly file as monthly partition. For next year Jan Partition will be merged in YEAR 2017 and will be reused for JAN 2018 and for all other files as we move ahead.
We have no issues merging the monthly files into the YEAR 2017 partition, but as we move along we like to move the monthly data from Year 2017 to 2016 to 2015 to PRIMARY partition
How can this be achieved
Hi Everyone,
The current problem description is as follows:
I have uploaded two files on OneDrive.
File 1: "script.zip" Link is:
https://1drv.ms/u/s!AuV9gXqFVffxhEQgLpnrQ79O0cf8
Download and scan using anti-virus and unzip the file. Unzipped size is 15MB.
File 2: "GrantFritchey_SSC_Guru_Test.sql" Link is:
https://1drv.ms/u/s!AuV9gXqFVffxhEUDp310bNPqZ2QF
Download and scan using anti-virus.
Link of discussion on SQLServerCentral.com:
https://www.sqlservercentral.com/Forums/2000350/SQL-Server-2017-2012-Express-Edition-Insert-Select-Performance-Issue-with-very-less-data?PageIndex=1
Do the following:
1) Create a new database in SQL Server Developer 2017.
2) Use the new database.
3) Execute "script.sql" (takes 23 seconds), it will create 6 tables, 3 indexes and populate the data in the tables. Total data in all tables is around 10 MB. I provided "script.sql".
4) Then execute a test written by Grant Fritchey (SQLServerCentral.com Guru). File is "GrantFritchey_SSC_Guru_Test.sql" (takes 12 seconds) on the data in the new database.
The description of test created by Grant Fritcheyis:
1) Grant created a SELECT that returns 1967190 rows from these tables.
2) The result of the SELECT is stored in a real table, temp table and table variable.
Grants results (CPU times not mentioned by him):
Insert into Real table: elapsed time = 5 seconds.
Insert into Temp table: elapsed time = 1.011 seconds.
Insert into Table variable: elapsed time = 0.944 seconds.
My result:
Insert into Real table: CPU time = 8563 ms. Elapsed time = 9036 ms.
Insert into Temp table: CPU time = 1515 ms. Elapsed time = 1546 ms.
Insert into Table variable: CPU time = 1437 ms. Elapsed time = 1464 ms.
We can see that test results that Grant got is similar to result I got, "Insert into real table table" taking much longer than "Insert into temp table/table variable".
We can also see the elapsed time(9.036 seconds) of "Insert into Real Table" is approximately 6 times the elapsed time (1.546 seconds) of "Insert into temp table/table variable". Why this difference?
Reason given by SQLServerCentral(Gurus) for this difference was: "Insert into real table" is written to disk, where as "Insert into temp table/table variable" is written to RAM. And writing to disk is much slower than writing to RAM. So there is an IO time difference.
I Agree.
Question is: Why is CPU time (8.563 seconds) in case of "Insert into real table" approximately 6 times the CPU time (1.515 seconds) of "Insert into temp table/table variable". As the SELECT and the underlying data is same the CPU times should be consistent across all three. Only difference should be in IO time. Any guess why CPU times are not consistent?
Please try running this test and share the CPU times and elapsed times of the Insert into real table vs insert into temp table/table variable.
Running this test and posting a reply should not take more than 5 minutes, as the files are really small, creating an empty new database and
executing just 2 scripts will not take more than a minute.
Regards,
Sharat K Gupta
Hi Everyone,
I have a simple Question.
When we do SET STATISTICS TIME ON and run a query.
We get results like:
SQL Server Execution Times:
CPU time = 5672 ms, elapsed time = 5867 ms.
As I understand:
elapsed time = CPU time + IO time.
IO time = IO time (read) + IO time (write) + network time.
Is my understanding correct?
Regards
Sharat K Gupta
<deadlock><victim-list><victimProcess id="process11634c19088" /></victim-list><process-list><process id="process11634c19088" taskpriority="0" logused="0" waitresource="PAGE: 11:13:52372905 " ownerId="57900000774" transactionname="SELECT" lasttranstarted="2018-10-12T09:48:05.360" XDES="0x3e7feedc00" lockMode="S" schedulerid="12" kpid="8544" status="suspended" spid="72" sbid="0" ecid="0" priority="0" trancount="0" lastbatchstarted="2018-10-12T09:48:05.360" lastbatchcompleted="2018-10-12T09:48:05.377" lastattention="1900-01-01T00:00:00.377" clientapp=".Net SqlClient Data Provider" hostname="hostname1" hostpid="6912" loginname="ENETTAD\SVC_APP" isolationlevel="read committed (2)" xactid="57900000774" currentdb="11" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056" databaseName="database1"><executionStack><frame procname="database1.dbo.uspBatch_Search" line="88" stmtstart="5068" stmtend="7128" sqlhandle="0x03000b00fad68c201937da0036a9000001000000000000000000000000000000000000000000000000000000"> SELECT @TotalRowCount = COUNT(*) FROM dbo.Batch JOIN #child ce ON ce.ECN = requestednce WHERE BatchId = ISNULL(@BatchId, BatchId) AND RequestedUsername = ISNULL(@RequestedUsername, RequestedUsername) AND requestednce = ISNULL(@requestednce, requestednce) AND BatchStatusId = ISNULL(@StatusId, BatchStatusId) AND BatchStatusId != @NewStatusId and BatchStatusId != @CancelledStatusId AND ( (@IsReportRequired = @true AND ReportBlobId IS NOT NULL) OR (@IsReportRequired = @false)) AND ( ( (@DateType = @CreatedDate AND CreatedDate BETWEEN cast(@FromDate AS varchar(20)) AND cast(@ToDate AS varchar(20)) ) OR (@IncludeCurrent = @true AND ( BatchStatusId IN (@QueuedStatus,@InProgressStatus,@ReportingStatus) OR CompletedDate BETWEEN cast(@FromDate AS varchar(20)) AND cast(@ToDate AS varchar(20))) ) ) OR @DateType = @IgnoreDateRange </frame><frame procname="adhoc" line="1" stmtstart="386" sqlhandle="0x01000b005101d12e207be87f2100000000000000000000000000000000000000000000000000000000000000"> EXEC @RETURN_VALUE = [dbo].[uspBatch_Search] @ECN = @p0, @BatchId = @p1, @requestednce = @p2, @RequestedUsername = @p3, @DateType = @p4, @FromDate = @p5, @ToDate = @p6, @StatusId = @p7, @IsReportRequired = @p8, @IncludeCurrent = @p9, @StartRowIndex = @p10, @SortExpression = @p11, @MaximumRows = @p12, @TotalRowCount = @p13 OUTPUT </frame><frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"> unknown </frame></executionStack><inputbuf> (@p0 int,@p1 int,@p2 int,@p3 varchar(8000),@p4 varchar(8000),@p5 datetime,@p6 datetime,@p7 int,@p8 tinyint,@p9 bit,@p10 int,@p11 varchar(8000),@p12 int,@p13 int output,@RETURN_VALUE int output)EXEC @RETURN_VALUE = [dbo].[uspBatch_Search] @ECN = @p0, @BatchId = @p1, @requestednce = @p2, @RequestedUsername = @p3, @DateType = @p4, @FromDate = @p5, @ToDate = @p6, @StatusId = @p7, @IsReportRequired = @p8, @IncludeCurrent = @p9, @StartRowIndex = @p10, @SortExpression = @p11, @MaximumRows = @p12, @TotalRowCount = @p13 OUTPUT </inputbuf></process><process id="process2e950984e8" taskpriority="0" logused="10880" waitresource="PAGE: 11:13:14044552 " waittime="241" ownerId="57900000848" transactionname="user_transaction" lasttranstarted="2018-10-12T09:48:05.367" XDES="0xf7c3c0c3b0" lockMode="IX" schedulerid="2" kpid="5476" status="suspended" spid="234" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2018-10-12T09:48:05.370" lastbatchcompleted="2018-10-12T09:48:05.367" lastattention="1900-01-01T00:00:00.367" clientapp=".Net SqlClient Data Provider" hostname="hostname1" hostpid="6912" loginname="ENETTAD\SVC_APP" isolationlevel="read committed (2)" xactid="57900000848" currentdb="11" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056" databaseName="database1"><executionStack><frame procname="database1.dbo.uspBatch_Update" line="32" stmtstart="1934" stmtend="2586" sqlhandle="0x03000b00b243467b8df206000ba7000001000000000000000000000000000000000000000000000000000000"> UPDATE Batch SET BatchStatusId = @BatchStatusId, ReportBlobId = @ReportBlobId, CompletedDate = @CompletedDate, ImportReportVersion = @ImportReportVersion, ExportReportVersion = @ExportReportVersion, ErrorCode = @ErrorCode WHERE BatchId = @BatchI </frame><frame procname="adhoc" line="1" stmtstart="236" sqlhandle="0x01000b009c24d728c05a7d06ab00000000000000000000000000000000000000000000000000000000000000"> EXEC @RETURN_VALUE = [dbo].[uspBatch_Update] @RequestId = @p0, @BatchId = @p1, @BatchStatusId = @p2, @ReportBlobId = @p3, @CompletedDate = @p4, @ErrorCode = @p5, @ImportReportVersion = @p6, @ExportReportVersion = @p7 </frame><frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"> unknown </frame></executionStack><inputbuf> (@p0 uniqueidentifier,@p1 int,@p2 int,@p3 varchar(8000),@p4 datetime,@p5 int,@p6 int,@p7 int,@RETURN_VALUE int output)EXEC @RETURN_VALUE = [dbo].[uspBatch_Update] @RequestId = @p0, @BatchId = @p1, @BatchStatusId = @p2, @ReportBlobId = @p3, @CompletedDate = @p4, @ErrorCode = @p5, @ImportReportVersion = @p6, @ExportReportVersion = @p7 </inputbuf></process></process-list><resource-list><pagelock fileid="13" pageid="52372905" dbid="11" subresource="FULL" objectname="database1.dbo.Batch" id="lock9f21680580" mode="IX" associatedObjectId="72060857777979392" databaseName="database1"><owner-list><owner id="process2e950984e8" mode="IX" /></owner-list><waiter-list><waiter id="process11634c19088" mode="S" requestType="wait" /></waiter-list></pagelock><pagelock fileid="13" pageid="14044552" dbid="11" subresource="FULL" objectname="database1.dbo.Batch" id="lock1506883db00" mode="S" associatedObjectId="72060857777979392" databaseName="database1"><owner-list><owner id="process11634c19088" mode="S" /></owner-list><waiter-list><waiter id="process2e950984e8" mode="IX" requestType="wait" /></waiter-list></pagelock></resource-list></deadlock>
Hi SQL Server Gurus,
New DBA for SQL Server here need some urgent help.
I have a 800GB database and i'm trying to rebuild the Secondary Node which was down due to some issue. We have full DB backup and it takes around 9 hours to complete and the restore of the full DB backup takes around 10 hours.
Command:
restore database [dbname] 'C:\temp\fulldbbackup.bak' with norecovery, stats
However, the transaction log backups continuously running and i need to apply it into the Secondary node (which is in Norecovery Mode). The transaction logs generated for the 10 hours is around 7GB only. The 7GB transaction log will take me 11 hours as well.
Is it so slow!!!!!!!!!!!!!!!!!!!!
here's the command i used: (there are around 100 files)
RESTORE LOG DBName from DISK = 'C:\temp\DBName\trans_log_2018_06_07_051003_6924971.trn' WITH NORECOVERY,STATS
RESTORE LOG DBName from DISK = 'C:\temp\DBName\trans_log_2018_06_07_052002_5593358.trn' WITH NORECOVERY,STATS
RESTORE LOG DBName from DISK = 'C:\temp\DBName\trans_log_2018_06_07_054003_8381476.trn' WITH NORECOVERY,STATS
RESTORE LOG DBName from DISK = 'C:\temp\DBName\trans_log_2018_06_07_055004_4179314.trn' WITH NORECOVERY,STATS
RESTORE LOG DBName from DISK = 'C:\temp\DBName\trans_log_2018_06_07_061007_9681859.trn' WITH NORECOVERY,STATS
My inquiries are:
1. Why it's sooooo slooww restoring the Transaction log.
2. How can i query in secondary node the what have been processed or log applied.
3. How can i make this restore faster? i've been working on this the last 4 days.
Need some help please., Windows 2012R2, SQLserver 2014.
NOTE: i can only stop the Database but not the instance as there are several databases running.
Thanks,
exec
sp_fulltext_databaseN'enable'
fails with the following message:Msg 7619, Level 16, State 1, Procedure sp_fulltext_database, Line 46
Execution of a full-text operation failed. The parameter is incorrect.
the microsoft search sevice is running (I restarted it just to be sure)
how can I get the functionality up and running again?
From last one week i am installing and unistalling sql server in windows 10 but is always showing an two three messages while installing 1.Attemp to perform unauthorized access 2. SSIS exception
Than at last data base engine failed ,Rs failed,DQ ,FullText,Replication,IS all are failed
Detail File :
(01) 2018-10-06 17:29:16 Slp: Prompting user if they want to retry this action due to the following failure:
(01) 2018-10-06 17:29:16 Slp: ----------------------------------------
(01) 2018-10-06 17:29:16 Slp: The following is an exception stack listing the exceptions in outermost to innermost order
(01) 2018-10-06 17:29:16 Slp: Inner exceptions are being indented
(01) 2018-10-06 17:29:16 Slp:
(01) 2018-10-06 17:29:16 Slp: Exception type: Microsoft.SqlServer.Configuration.Sco.ScoException
(01) 2018-10-06 17:29:16 Slp: Message:
(01) 2018-10-06 17:29:16 Slp: Attempted to perform an unauthorized operation.
(01) 2018-10-06 17:29:16 Slp: HResult : 0x84bb0001
(01) 2018-10-06 17:29:16 Slp: FacilityCode : 1211 (4bb)
(01) 2018-10-06 17:29:16 Slp: ErrorCode : 1 (0001)
(01) 2018-10-06 17:29:16 Slp: Data:
(01) 2018-10-06 17:29:16 Slp: WatsonData = netfxperf.dll@OpenPerformanceData@CollectPerformanceData@ClosePerformanceData
(01) 2018-10-06 17:29:16 Slp: DisableRetry = true
(01) 2018-10-06 17:29:16 Slp: Inner exception type: System.UnauthorizedAccessException
(01) 2018-10-06 17:29:16 Slp: Message:
(01) 2018-10-06 17:29:16 Slp: Attempted to perform an unauthorized operation.
(01) 2018-10-06 17:29:16 Slp: HResult : 0x80070005
(01) 2018-10-06 17:29:17 Slp: Stack:
(01) 2018-10-06 17:29:17 Slp: at Microsoft.SqlServer.Configuration.Sco.PerformanceCounter.LoadPerformanceCounter(String symbolInstallPath, String counterPrefixServiceName)
(01) 2018-10-06 17:29:17 Slp: at Microsoft.SqlServer.Configuration.Sco.PerformanceCounter.RegisterPerformanceCounterCore(String libraryFileName, String openFunction, String collectionFunction, String
closeFunction, String symbolInstallPath, String counterPrefixServiceName)
(01) 2018-10-06 17:29:17 Slp: at Microsoft.SqlServer.Configuration.Sco.PerformanceCounter.RegisterPerformanceCounter(String libraryFileName, String openFunction, String collectionFunction, String
closeFunction, String symbolInstallPath)
(01) 2018-10-06 17:29:17 Slp: ----------------------------------------
(01) 2018-10-06 17:30:53 Slp: User has chosen to cancel this action
(01) 2018-10-06 17:30:53 SSIS: ERROR: Failed to set up SSIS service performance counters. Exception: Microsoft.SqlServer.Configuration.Sco.ScoException: Attempted to perform an unauthorized operation. ---> System.UnauthorizedAccessException: Attempted to
perform an unauthorized operation.
what to do next
Good Day Everyone,
I keep getting this error on my SQL Server on average by the hour. This is a SQL2014 server with the latest sp (virtual).
DESCRIPTION: TCP connection closed but a child process of SQL Server may be holding a duplicate of the connection's socket. Consider enabling the TcpAbortiveClose SQL Server registry setting and restarting SQL Server. If the problem persists, contact Technical Support.
I verified no antivirus is causing the issue. I verified CPU, memory everything in tact. Server is behaving normal for clients except our middle tier agent and web servers disconnect every once in a while but it does not align with every instance this error occurs. Any assistance or words of wisdom would be appreciated.
Have a pleasant day.
Best,
Frank
A SQL Server MVP or MSFT Eng should be replying soon as well. Hope this helps. Frank Garcia *** Please select "Vote As Helpful" if the information provided was helpful to you. If an answer to your issue solved the problem then please mark it as"Propose As Answer" located at the bottom. Thank you. ***
hello,
i have 2 sql server 2014 instances which i want to link: server1 and server2. database 'db1' with data i want to query is on server1. i created user 'linked_srv' on both servers with the same password. on server1 i mapped user to 'db1' and add select permission to view 'v1'. on server2 i created new linked server with the following properties:
name: sever1
server type: sql server native client 11.0
and chosen security:
be made using this security context; remote login and password is the same as 'linked_srv' login on both servers.
test connection is successful but there are no objects in server2 catalogs under the linked servers. when i run query:
select * from server1.db1.dbo.v1
i get the following message:
The OLE DB provider "SQLNCLI11" for linked server "server1" does not contain the table ""db1"."dbo"."v1"". The table either does not exist or the current user does not have permissions on that table.
what am i doing wrong or missing?
thanks in advance
I created a extended events, I added the SAS token with full permission in Azure portal, I added a master key and database scoped credential in Azure SQL database, But when I am starting the session, I am getting the following error. Any idea on this issue?
TITLE: Microsoft SQL Server Management StudioHello,
I am looking for script that does reindexing based on the fragmentation level, i have a couple that i created but i want to get some more details about it, thank you.
I am working on Always Encrypted enablement for one of my database. I am seeing an error like :
Sep 19 2018 08:52:53 [Informational] TaskUpdates: Message:Task: 'Performing encryption operations' -- Status: 'Failed' -- Details: 'Task failed due to following error: Cannot save package to file. The model has build blocking errors:
Error SQL71561: Error validating element [dbo].[vwSTUDENTLOAN]: View: [dbo].[vwSTUDENTLOAN] has an unresolved reference to object [testdb].[dbo].[STUDENTLOAN].
When I am trying to encrypt column for entirely different table column for the below, I am getting the above error.
--Table to be encrypted
create Table testtable (Col1 varchar(5000))
Insert into dbo.testtable Select ('Latheesh')
--View Definition
CREATE View [vwSTUDENTLOAN] as
Select
STUDENTLOAN_ID as [vwSTUDENTLOAN_ID],
Cast(GetDate() as datetime) as [DATECREATED],
Cast(GetDate() as datetime) as [DATELASTMODIFIED]
from testdb.dbo.STUDENTLOAN;
I understand, AE tool has a bug that it will check the integrity for all objects and it is not supporting three part naming convention that refers different database.
The Question here is:
I am seeing this behavior is different in different version of SQL Server 2016.
--For the below environment, its working fine.
Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64) Oct 28 2016 18:17:30 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on Windows 10 Enterprise 6.3 <X64> (Build 14393: ) (Hypervisor)
--For the below environment , its not working.
Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64) Oct 28 2016 18:17:30 Copyright (c) Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2016 Standard 6.3 <X64> (Build 14393: ) (Hypervisor)
Can someone help me why there is difference? Or Am I doing something wrong?
Please let me know if I can provide more details.
Please mark this reply as answer if it solved your issue or vote as helpful if it helped.
[Blog]
Hi everyone!
What would be the simplest way to move tables from one filegroup to another filegroup?
Thanks
Doria