Quantcast
Channel: SQL Server Database Engine Forum
Viewing all 15872 articles
Browse latest View live

What permissions do I need to provide to a non-sysadmin account to access OLE DB Providers?

$
0
0

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".



SQL cluster on windows 2016

$
0
0

Hi All I have some questions on clustering . Here is the setting

1. SQL server 2016, windows server 2016

2. 4 nodes clusters + fileshare witness

3. Siteareness is enabled , and preferred site configured to node 1 and node 2,   node 3 and node 4 are secondary site

The questions

1. will there be impact on the preferred node order when configured siteareness ?

2. and also node ID impact on the node voting ?

3. For the behavior or dynamic voting, I did a test: If I reboot any node on secondary site (for example node 4), active node on node 1, I checked the dynamic voting of node 4 become zero, and another node in primary site also become 0. So the question is, HOW cluster choosing WHICH node in a site to lower down it's dynamic voting ??

4. cross-site network failure question, what's the outcome of the following

-  Crosssite link down, FSW on backup site, and sql instance owned currently at preferred site

-  Crosssite link down, FSW on preferred site , and sql instance owned currently at preferred site

-  Crosssite link down, FSW on backup site, and sql instance owned currently at backup site

-  Crosssite link down, FSW on preferred site , and sql instance owned currently at backup site

Query to track the activity for Logins, Tables used

$
0
0

We are going to migrate the app <g class="gr_ gr_22 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" data-gr-id="22" id="22">dbs</g> to re-route to <g class="gr_ gr_229 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" data-gr-id="229" id="229">a enterprise</g> data and <g class="gr_ gr_231 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="231" id="231">i</g> am trying to work on a script to look for logins, <g class="gr_ gr_142 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="142" id="142">dbs</g>, tables, if possible, client <g class="gr_ gr_188 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="188" id="188">ip</g> address, or hostname connecting to the server

Is there a script that can look for these details

Thanks

Vamshi 


vamshi

SQL 2017 sp_xml_preparedocument

$
0
0

From the following link

https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-xml-preparedocument-transact-sql?view=sql-server-2017

"A parsed document is stored in the internal cache of  SQL Server. The MSXML parser uses one-eighth the total memory available for  SQL Server. To avoid running out of memory, runsp_xml_removedocument to free up the memory. "

1. does it mean using "Total server memory" of SQL server ? or memory that not govern by "max server memory"?

2. Can check how many memory used by MSXML parser currently ?

3. I got "XML document could not be created because of server memory is low" . So what's need to check ?

Point-in-time restore questions

$
0
0
Assume one has been taking full backups along with TLog backups and we keep 1-2 weeks worth of backups before deleting older files.  Can one restore a Db to a point in time, say 4-5 weeks ago?

Getting error trying to connect to local server

$
0
0

I installed SQL Server 2016 Developer Edition on my work laptop with Windows 10 Enterprise. Everything worked fine after I installed it.  I downloaded the lastest version of SQL Server Management Studio (SSMS) V 17.9 and everything still worked fine.  I setup SSMS to connect to the local server and that worked fine.  The following week it stopped working and I get this error message:

TITLE: Microsoft SQL Server Management Studio
------------------------------

Failed to connect to server XXXXXXXXX. (Microsoft.SqlServer.ConnectionInfo)

------------------------------
ADDITIONAL INFORMATION:

The client was unable to establish a connection because of an error during connection initialization process before login. Possible causes include the following:  the client tried to connect to an unsupported version of SQL Server; the server was too busy to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (Microsoft SQL Server, Error: 233)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=233&LinkId=20476

------------------------------

No process is on the other end of the pipe

------------------------------
BUTTONS:

OK
------------------------------

What could have happened?

I can access other servers with no problems.  Also our company has taken local admin permissions from our domain user account that we use to login our computers  and we need to get a temporary local admin user to install software.  I used the default users when installing SQL Server on my laptop.

Fred



Procedure take more time

$
0
0

sometimes particular SP take more time.  ( no blocking / deadlocks happens)

what are the workaround ? how to identify a cause? 

normally takes 10 ~ 15min   , some times takes 2hrs. ( but data result volume not high).

SQL Server transaction log restore process

$
0
0

Hello,

I have a question related to SQL Server transaction log restore process.
Our purpose is sync our local SQL server database with third party's SQL Server instance 
every midnight they provide us a full backup file
and every half an hour, they provide us a transaction log file.
eg:
Sunday Midnight: full backup file
48 transaction log files
Monday Midnight:full backup file
 48 transaction log files
Tuesday Midnight: full backup file

Because the size of the full backup file is big, >20G, which take more than 7hrs to download to our local
My solution is restored One previous day full backup file+ 48 transaction log files of the day
For example, On Monday morning 1 AM, we start to download the Sunday midnight full backup file, and on Monday midnight, we download all the 48 transaction log files generated by Monday, and restore 
all of them. This solution works, but the size of the full backup file is still a problem.

My question is if its ok to download the full backup file once a week.
such as Monday morning, I still download the Sunday full backup file, and Monday midnight we download 48 transaction log files,the restore is Sunday full+ 48 Monday trans
On Tuesday, we only download that days trans, and restore  Sunday full+ 48 Monday trans+48 Tuesday
On Wednesday restore  Sunday full+ 48 Monday trans+48 Tuesday trans+48 Wednesday trans

Will this works?

Thanks

Linus



Cluster network name resource failed registration......

$
0
0

Hello,

I have a 2 node (Active/Passive) SQL Cluster .   I see the following error in Failover Cluster Manager - Cluster Events.

"Cluster network name resource 'SQL Network Name' failed registration of one or more associated DNS name(s) for the following reason: DNS operation refused.Ensure that the network adapters associated with dependent IP address resources are configured with at least one accessible DNS server."

Please advise how do I fix this?

Thanks,

Veena Srinivas


SQL Database Not Allowing Clients to Connect

$
0
0

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.

SQLServer 2016 - A time-out occurred while waiting for buffer latch -- type 3 and Message A time-out occurred while waiting for buffer latch -- type 4

$
0
0

All,

I see the below errors happening and one of our process timed out around the time this error also showed up. The version is 

SQLServer 2016 Enterprise Edition with AlwaysOn implemented - (SP1-GDR) (KB4057118) - 13.0.4210.6 (X64)  

The below CU8 for SP1 seems to be addressing the issue but I'm thinking that we should apply SP2.   

https://support.microsoft.com/en-us/help/4089819/time-out-error-when-using-availability-groups-in-sql-server-2016-201

I dont see any STACK DUMP  in the error log. Have others too got these errors before? 

Rgn

Below are the errors that I see in the Error Log:

----------------------------------------------------------------------------------------------------------------------------------------

Date10/19/2018 12:12:21 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

Sourcespid36s

Message
A time-out occurred while waiting for buffer latch -- type 4, bp 000000FB6D65DC80, page 1:1, stat 0x10f, database id: 2, allocation unit Id: 6488064, task 0x000000FB4B02FC28 : 0, waittime 300 seconds, flags 0x1000000039, owning task 0x000001238B10B088. Not continuing to wait.

Date10/19/2018 12:07:54 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

Sourcespid54

Message
A time-out occurred while waiting for buffer latch -- type 3, bp 000000FB61CED200, page 3:614688, stat 0x10f, database id: 2, allocation unit Id: 6488064, task 0x000000FB4B057848 : 0, waittime 300 seconds, flags 0x19, owning task 0x000000FB3DAEB468. Not continuing to wait.

Date10/19/2018 12:07:21 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

Sourcespid36s

Message
A time-out occurred while waiting for buffer latch -- type 4, bp 000000FB6D65DC80, page 1:1, stat 0x10f, database id: 2, allocation unit Id: 6488064, task 0x000000FB4B02FC28 : 0, waittime 300 seconds, flags 0x1000000019, owning task 0x000001238B10B088. Not continuing to wait.

Date10/19/2018 12:07:16 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

Sourcespid78s

Message
A time-out occurred while waiting for buffer latch -- type 3, bp 000000FB7E8C8340, page 4:614688, stat 0x10f, database id: 2, allocation unit Id: 6488064, task 0x000000FB4B047088 : 0, waittime 300 seconds, flags 0x19, owning task 0x000000FB3DAEB468. Not continuing to wait.

--------------------------------------------------------------------------------------------------------------------------------------

I also see lot of messages like the following:

--------------------------------------------------------------------------------------------------------------------------------------

Date10/19/2018 12:16:35 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

SourceServer

Message
Process 0:0:0 (0x3004) Worker 0x000000F351F12160 appears to be non-yielding on Scheduler 1. Thread creation time: 13184086844270. Approx Thread CPU Used: kernel 46 ms, user 769250 ms. Process Utilization 34%. System Idle 64%. Interval: 853345 ms.

Date10/19/2018 12:15:34 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

SourceServer

Message
Process 0:0:0 (0x3004) Worker 0x000000F351F12160 appears to be non-yielding on Scheduler 1. Thread creation time: 13184086844270. Approx Thread CPU Used: kernel 31 ms, user 713515 ms. Process Utilization 34%. System Idle 64%. Interval: 793095 ms.

Date10/19/2018 12:14:34 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

SourceServer

Message
Process 0:0:0 (0x3004) Worker 0x000000F351F12160 appears to be non-yielding on Scheduler 1. Thread creation time: 13184086844270. Approx Thread CPU Used: kernel 31 ms, user 657828 ms. Process Utilization 34%. System Idle 64%. Interval: 732845 ms.

Date10/19/2018 12:13:34 AM
LogSQL Server (Current - 10/19/2018 12:22:00 AM)

SourceServer

Message
Process 0:0:0 (0x3004) Worker 0x000000F351F12160 appears to be non-yielding on Scheduler 1. Thread creation time: 13184086844270. Approx Thread CPU Used: kernel 31 ms, user 602140 ms. Process Utilization 34%. System Idle 64%. Interval: 672595 ms.

There are quite a few more of these messages.

--------------------------------------------------------------------------------------------------------------------------------


Azure SQL Managed Instance xp_cmdshell 'unsupported' or simply won't work?

$
0
0

Hi

Looking to move to a SQL Managed Instance and establishing what changes we'll need to make to our internal monitoring code and see that xp_cmdshell is unsupported in MI does this mean it will work still but isn't supported or it simply will not work in a MI?

...asking here as opposed to Azure forum as there isn't a MI section as yet!

Thanks

SQL Server Database Mail does not use TLS1.2

$
0
0

I have a Windows 2016 DataCenter Version 10.0.14393 Build 14393.

I also have SQL Server 2017 with CU9 Version 14.0.3030.27 installed.

.Net framework is above 4.6.2

TLS 1.0 is turned off.

I can't get database mail to send email to the SMTP server. The error is as follows:

A fatal error occurred while creating a TLS client credential. The internal state is 1003.

Certificate is good.

Please assist.

Min/Max memory setting best practice

$
0
0
[Not sure if best forum for this question is Database Engine forum SQL Server Manageability forum?]  I know there are many articles on this topic, but would like your information.  A senior DBA says OK to set min/max to same value (possibly two thirds of physical memory) as long as memory requirement for OS is taken into account (thus, leaving one third of memory for OS and other apps.)  While every expert article I read offers an algorithm that sets min/max at different values.  What reasons can I use to counter his argument for setting min/max to same value?  Senior DBA says he has never encountered problems or reports of slow servers using his practice. Thanks.

ETL load process locked by a system query running a create index???

$
0
0

Hi,

I suffered a strange issue during the loading of data using SSIS into a clustered columnstore index table 

SQL 2016 Enterprise edition used.

in the middle of the loading, my insert were locked by a create index command executed by the system ????

it was not a user query or user connection.

its a random behavior I suffered it 2 times in the past 2 months.

any idea of the reason of this?

is the system doing some background tasks on the clustered columnstore index which lock it?


SQL Server Linux error: There have been misaligned log IOs which required falling back to synchronous IO. The current IO is on file .ldf.

$
0
0

We're in the process of evaluating SQL Server for Linux 2017.  We're running the latest CU.  We've tested restoring a full backup and then applying log files.  During the restore of log files we are receiving this error:

error: There have been <N> misaligned log IOs which required falling back to synchronous IO.  The current IO is on file <path>.ldf.

I've followed this blog article:

https://blogs.msdn.microsoft.com/saponsqlserver/2014/10/01/message-misaligned-log-ios-which-required-falling-back-to-synchronous-io-in-sql-server-error-log/

and verified that the current Windows server running the database has SAN disks with 512/512.   I tried enabling trace flag 1800 and restarting the SQL Server Linux instance, but as the log files apply it still generates that error.

The Linux server is running on AWS EBS volumes.  The partition was formatted with ext4 using this type of command:

mkfs -t ext4 /dev/nvme2n1

As far as I can tell I should have 512 byte sectors. Here are the outputs of some of the commands I know to check:

[root@ ~]# cat /sys/block/nvme2n1/queue/logical_block_size
512
[root@ ~]# cat /sys/block/nvme2n1/queue/hw_sector_size
512

[root@ ~]# fdisk -l /dev/nvme2n1

Disk /dev/nvme2n1: 1073.7 GB, 1073741824000 bytes, 2097152000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@ ~]# tune2fs -l /dev/nvme2n1
tune2fs 1.42.9 (28-Dec-2013)
Filesystem volume name:   <none>
Last mounted on:          /sql/log
Filesystem UUID:          5d00c2b1-ab6f-4740-a178-a60a7e4687d5
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              65536000
Block count:              262144000
Reserved block count:     13107200
Free blocks:              237685822
Free inodes:              65535987
First block:              0
Block size:               4096
Fragment size:            4096
Group descriptor size:    64
Reserved GDT blocks:      1024
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Flex block group size:    16
Filesystem created:       Mon Oct 15 06:22:56 2018
Last mount time:          Sat Oct 20 10:49:32 2018
Last write time:          Sat Oct 20 10:49:32 2018
Mount count:              10
Maximum mount count:      -1
Last checked:             Mon Oct 15 06:22:56 2018
Check interval:           0 (<none>)
Lifetime writes:          172 GB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      85c2a066-e296-42f3-8ad0-278cbaa2564e
Journal backup:           inode blocks

The one things I'm wondering about is the 4096 output that the tune2fs is producing. Does anyone have recommendation on how to resolve this?

Thanks,

Jonathan

How to determine whether the connection is NTLM or Kerberos

$
0
0
How to determine whether the connection is NTLM or Kerberos, and what is the difference between these two things?

calculated columns with convert in indexed views

$
0
0

Hi,

I have a report where I need to get some aggregations and grouped by columns with imprecise types.

As you can not use imprecise columns in indexed views I tried to add precise computed columns in my source tables and use them instead. I cannot do it. I get "A severe error occurred on the current command.  The results, if any, should be discarded.". Below I attached my sample code.

Is there some explanation behind it? Are computed columns with type casts considered as dependencies or something?

CREATE TABLE [dbo].[TopCase](
	[Id] [uniqueidentifier] NOT NULL primary key,
	[IdentityID] [bigint] IDENTITY(1,1) NOT NULL,
	[Deductible_CurrentValue] [float] NULL,
	[Deductible_CurrentValue_numeric]  AS (CONVERT([numeric](18,5),[Deductible_CurrentValue])) PERSISTED,
)
GO

CREATE TABLE [dbo].[TopService](
	[Id] [uniqueidentifier] NOT NULL primary key,
	[IdentityID] [bigint] IDENTITY(1,1) NOT NULL,
	[CaseId] [uniqueidentifier] NULL,
)
GO

create view dbo.testView1
with schemabinding
 as
	SELECT 
		 c.[IdentityID]
		 ,c.[Deductible_CurrentValue_numeric]
	FROM [dbo].[TopCase] c
	inner join [dbo].[TopService] cs on cs.caseid=c.id
GROUP BY 
	c.[IdentityID]
	,c.[Deductible_CurrentValue_numeric]
	
go

CREATE UNIQUE CLUSTERED INDEX [iiiiiiiiiiiiiiiiiii] ON [dbo].[testView1](
	[IdentityID] ASC
)
go


Best,

Rafael


Rafal


Restoring a database to a point in time to different name, it is possible?

$
0
0

Hello guys,

I've a SQL server 2016 and one database with transaction log set FULL, backups (data and log) occurs every night, I would like to explain this example for purpose:

During working day one user delete by mistake one or more rows, I have to restore these records from transaction log but I cannot restore entire db to a point in time because meanwhile other usershave continued to work.

So my aim is restore database to a point in time (before user has deleted the rows) to different database name, then I can recover rows doing an insert into select ..

I have simulated this situation and I tried to restore database to a different name but it get me an error:

"exclusive access could not be obtained because the database is in use"

Someone can help me and explain how I can do to recover these rows?

thanks!

Andrew



Link Server problem

$
0
0

I am having some problem on linkedserver  version SQL 2016

I have two sql instances on windows 2 nodes cluster. 

 when both instance sitting on the same server. link server and distribute transaction work perfects.

but once I move one of it to another server , it doesn't work and through the following error.

I am using "Be make using login's current security context " in security of link server setting:


Viewing all 15872 articles
Browse latest View live