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

FULL DATABASE BACKUP ERROR

$
0
0

CANNOT BACK UP MY 2012 DATABASE. KEEP GETTING ERRORS HELP!!!


AUTO_CLOSE reverts each time SQL Express is restarted

$
0
0
I am trying to set AUTO_CLOSE OFF on SQL Express databases. However, it seems to revert to ON each time SQL Express is restarted.  Is there a way to make it "take" permanently for a database. Or even better, for all databases?  Thanks.

Info from @@Version different Status bar version on SQL Server 2005

$
0
0

Hello friends

I was checking the different version of my databases, but i have noted something curious.  In my engines 2005 i see difference between the result that give me @@Version vs the Status bar 

Why happens this?

Please give me a hand with this.

I don't have idea

Thanks in advance


Getting Error 33222 when enabling audit.

$
0
0

Hello all,

I'm having a bit of difficulty enabling an audit on the database engine.  I'm getting error 33222 when trying to enable it.

Audit "TestAudit" failed to start.  For more information, see the SQL Server error log.  You can also query sys.dm_os_ring_buffers where ring_buffer_type = "RING_BUFFER_XE_LOG". (Microsoft SQL Server. Error: 33222)

00:48:05,spid60,Unknown,Audit: Server Audit: 65538<c/> Initialized and Assigned State: TARGET_CREATION_FAILED
00:48:05,spid60,Unknown,SQL Server Audit failed to access the security log. Make sure that the SQL service account has the required permissions to access the security log.
00:48:05,spid60,Unknown,Error: 33208<c/> Severity: 17<c/> State: 1.
00:48:05,spid60,Unknown,SQL Server Audit could not write to the security log.
00:48:05,spid60,Unknown,Error: 33204<c/> Severity: 17<c/> State: 1.
00:48:05,spid60,Unknown,Audit: Server Audit: 65538<c/> State changed from: START_FAILED to: TARGET_CREATION_FAILED
00:48:05,spid60,Unknown,Audit: Server Audit: 65538<c/> Initialized and Assigned State: START_FAILED
00:48:05,spid60,Unknown,Audit: Server Audit: 65538 Session has been closed
00:48:05,spid60,Unknown,Audit: Server Audit: 65538<c/> State changed from: TARGET_CREATION_FAILED to: SHUTTING_DOWN
00:45:14,spid60,Unknown,Audit: Server Audit: 65538<c/> Initialized and Assigned State: TARGET_CREATION_FAILED
00:45:14,spid60,Unknown,SQL Server Audit failed to access the security log. Make sure that the SQL service account has the required permissions to access the security log.
00:45:14,spid60,Unknown,Error: 33208<c/> Severity: 17<c/> State: 1.
00:45:14,spid60,Unknown,SQL Server Audit could not write to the security log.
00:45:14,spid60,Unknown,Error: 33204<c/> Severity: 17<c/> State: 1.
00:45:14,spid60,Unknown,Audit: Server Audit: 65538<c/> State changed from: START_FAILED to: TARGET_CREATION_FAILED
00:45:14,spid60,Unknown,Audit: Server Audit: 65538<c/> Initialized and Assigned State: START_FAILED
00:45:00,spid60,Unknown,Audit: Server Audit: 65537 Session has been closed
00:45:00,spid60,Unknown,Audit: Server Audit: 65537<c/> State changed from: TARGET_CREATION_FAILED to: SHUTTING_DOWN


This server is not joined to a domain and belongs to the standard WORKGROUP.

Using secpol.msc, I've granted the local user that I'm trying to generate the log with the permission to "generate security audit" and enabled "success, failure" for all the audits under the audit policy.

Under the SSMS, I've also granted permission for user to be a "sysadmin" and granted permission under the "securables" to alter any database, alter any server audit, connect SQL, and control server.

I also provided permissions under the registry folder, HKLM/System/CurrentControlSet/Services/Eventlog/Security.

Are there any additional permissions I need to grant?  Any help would be greatly appreciated and thank you for your time and consideration.

which index choose/create?

$
0
0

Hi experts,

I am creating the below table that will have more than a million records, so I want to be cautions about performance...

CountryIdDateInserted
br22-Jul
br32-Jul
us23-Jul
eu43-Jul
eu23-Jul

The problem is that if I want to create a clustered index it should be composite, date, id and country... is that a good thing? or should I create a new column identity and make that my clustered index...?

Quick investigation performance.

$
0
0

Hi experts,

I have the below issue with an SSRS, it used to take 10 seconds to run last month… now it takes 10 minutes!

Yes, this month there were a lot changes in indexes, and some more load on another dbs… But 10 minutes is way too much! (no changes were introduced at server level, like memory,cxpacket,etc)

 

Below is what I have to investigate:

-SSRS loads for 10 minutes.

-Once I execute it, in activity monitor I see like 40 processes… Half of them waiting on CXPACKET, the other half on PAGEIOLATCH_SH.

-I saw that “wait time (ms) = 670,876” for one of them with CXPACKET as wait type.

- Head Blocker is empty… most of them were blocking themselves…

I do not expect to have a final answer here but, to be led to the correct causes at least! thanks in advance!

SQL backup fails, where are SQL AGENT logs stored?

$
0
0

Hi guys.

- We have 2008 R2 SQL Enterprise in our environment.

- We have configured BACKUP under SQL SERVER AGENT, running backup as a JOB.

- Backup is ran on daily basis.

Randomly backup does not succeded and we would like to find a root of the problem.

In EVENT VIEWER / APPLICATION we see events:

EVENTID: 3014

BACKUP failed to complete the command BACKUP LOG Database001. Check the backup application log for detailed messages.

We would like to find out where are logs of SQL AGENT stored on server, to see what is causing failing backup.

Please help


bostjanc

How can I dump all the data from DBCC Memorystatus?

$
0
0

Hi,

Using this query you lose every section ( of the results losing the meaning.

I've tried unsuccessfully to google on internet each relationship between every results section and the pertinent DMV.

This command retrieves a lot of valuable information.

declare @memoria as table(descript nvarchar(200), figure bigint)

insert into @memoria
(
descript,
figure)

exec('DBCC MEMORYSTATUS')
--DBCC MEMORYSTATUS

select * from @memoria


Capacity Reports for SQL Server 2012

$
0
0

Team,

Please suggest the methods to perform Capacity Reporting for SQL 2012. 600 Databases spanning around 18 instances.

Best Regards,

Sharath


Best Regards, Sharath

0 writes?

$
0
0

Hi,

Can you kindly test this query in the most busiest server have you got?

I am just getting 0

 DECLARE @WriteReads bigint;
SELECT @WriteReads  = cntr_value
  FROM sys.dm_os_performance_counters
  WHERE counter_name = 'Page writes/sec';

WAITFOR DELAY '00:00:10';


SELECT(cntr_value - @WriteReads ) / 10 AS 'Page writes/sec'
  FROM sys.dm_os_performance_counters
  WHERE counter_name = 'Page writes/sec';

Deleted log file (how to create new log file)

$
0
0

Hi All,

I unexpectedly deleted log file..with out deattached the database.

How can i create new log file for the mdf file in same log file location.

Thanks in Advance...

SQL Instance Servers not starting on computer restart

$
0
0

Hello,

    I have an issue that has been going on for a little while and have been unable to figure out what is causing the issue.  Have a Windows 10 Pro computer that is being used for business.  On that computer there are multiple instances of SQL Server running.  Each instance of SQL Server has its own port well out of the norm of used ports (above 40000).  There are no other services that run on these ports, I have verified it with nbstat.

   So when the computer restarts, generally one to four of the five instances will not start.  Windows Event Log shows generally the same message with a different instance name: The MSSQL$SQL16 service terminated with the following service-specific error:
Only one usage of each socket address (protocol/network address/port) is normally permitted.

   Now to get them to work, I have to stop SSIS, SSAS, & SSRS for each instance, then start up the instances of SQL Server, then start up all the others like SSIS, SSAS, SSRS, and SQL Agent.

  Any thoughts on how to make this work correctly?


Michael R. Mastro II

Looking for some useful link with SQL Log messages

$
0
0

Hi there,

"A significant part of sql server process memory has been paged out. This may result in a performance degradation. Duration: 924 seconds[...]"

"Using locked pages in the memory manager"

...

Above messages on SQL Server Error log are very meaningful and useful for us. I am just looking for some link where I can see the most important/relevant.

My goal here is run a stored procedure scheduled on the Agent once a day for digging into the current Error Log file (0) on daily basis and beyond peak-hours and then emailing to some operator alerting the message saved in the log.

By using xp_ReadErrorLog and xp_enumerrorlogs stored procedures would be enough.

Example:

Declare @nfile int = 0

EXEC sys.xp_ReadErrorLog @nfile, 1, N'significant part of sql server process memo'

We can really define native alerts on the server or using some monitoring tool but this innocent and easy piece of code would help to enforce our defensive system.

Thanks,


SQL server assessment

$
0
0

Hello,

We are trying to assess our current production SQL 2012 server, to see if the existing hardware can handle if we add additional users hitting the database in the next couple of months. I reviewed the disk space, RAM. But trying to follow the best practices in forecasting such a growth. If any articles can be shared would be great! Thanks.


sqldev

Please advise about Antivirus Exclusions for SQL Database Files

$
0
0

Hello All,

We have received a request from customer that disbaled the antivirus from Database cluster server(Active\passive).

"The anti-virus can lock up the SQL Server in much the same manner as the snapshots. 
 Unfortunately we can see the issue even when disabling this. The only way to completely take this out of the picture is to temporarily uninstall it from the SQL Servers.  I understand that this is production servers, 
and this would be very temporary until the issue either happens again, or we are comfortable that it isn't happening with this removed."


I have searched Few blogs,found below articles(Pinal dave),
http://blog.sqlauthority.com/2015/05/19/sql-server-antivirus-exclusions-best-practices-with-sql-server/

Should i suggest the customer to excluded from all antivirus scans as mentioned pinal dave.
I hope you will be able to provide the information.

Could you please Confirm if the antivirus software locks a SQL Server files.?


Operating system error 1(Incorrect function.) encountered.

$
0
0

Hi,

I have Driver "D:" with type of File System is "UDF".

When create new Database in SQL 2014, chose Path of new Database is "D:".

Error event 17053 is log in Event Viewer:

If in SQL 2008, Event 17053 is not log.

If type of File System of "D:" is "NTFS", Event 17053 is not log.

Question:

What is Rootcause of issue?

How to fix this issue?

Linked Server Memory Allocation

$
0
0

I am trying to understand how linked server query allocates Memory.

In couple of articles, it was mentioned that Linked server does not use memory from the buffer pool.
I am trying to understand more exactly what this means?

Does this mean linked server query data is not fetched into buffer pool of the local server.

Lets take this scenerio: assume SQL 2014 is being used on both the servers.

Server A - 100GB - SQL Server is using 80GB. Windows - 20GB
Server B - 100GB - SQL Server is using 80GB. Windows - 20GB

A Linked server Query from Server A goes to Server B and fetches some data.
for argument sake, say - it is fetching 2 GB data from the linked server.

So, this 2Gb data comes from the buffer pool of the ServerB into Windows memory(not buffer pool) on ServerA.
Is this right way to interpret linked server memory allocation?


Hope it Helps!!

date issue

$
0
0
we want to use default language (syslanguages) us_english, but all querys are failling because the backend expects the date format 'dmy'. Is there a way to change the date format from mdy to dmy keeping default language us_english.

Deadlock not detected

$
0
0

Hi, I've got a problem with a particular query - it runs for a while then hangs (CPU and IO count remain static). Other processes then get blocked by my query. sp_who2 and SQL Sentry both show that my query is at the head of the blocking chain. However, looking at dm_os_waiting_tasks shows that my query is blocked by one of the processes that I am blocking.

session_id = 558, blocking_session_id = 359

session_id = 359, blocking session_id = 558

Unless I am misunderstanding how this dmv works, what I am seeing is a deadlock. But it is not detected by the engine.


Paul Ross DBA Redrow Homes

Due to storage issue SQL server is not working and moved system DB to new location

$
0
0

Hi,

Due to storage issue SQL server has stopped and I have copied system DB and user Db to new location.

I have changed the startup parameter as well

But SQL server is failing with error "the request failed or the service did not respond in a timely fashion"

Please le me know how can i start the SQL server

Viewing all 15872 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>