Quantcast
Channel: SQL Server Database Engine forum
Viewing all 12963 articles
Browse latest View live

Database Status: Suspect vs Recovery Pending.

$
0
0

what's the different between database status Suspect vs Recovery Pending. ???

what's are the different causes for both Suspect vs Recovery Pending. ???


Stored proc slow after migration

$
0
0

My team just completed a migration of business logic jobs and databases from 2008 R2 to a 2014 Always On cluster.  The 2008 R2 server hosted databases, SSIS packages, and SQL Agent scheduled jobs.  We separated out the scheduled jobs and SSIS packages on a new stand-alone server and the databases migrated to the cluster.  The migrated databases have stored procs in them.  The procs are called from the stand-alone job server using CmdExec job steps as in: SQLCMD -S <fully qualified server name> -d <db name> -Q "EXEC <sproc name>".

One of the stored procs is running very slow, but completes.  What tools can i use to diagnose where the problem query is within the stored proc while the job is running?  I don't have the benefit of running the stored proc code interactively and looking at the resulting execution plan as there are staging tables that need to be processed by other steps in the scheduled job.  Are there DMVs or extended events that can pinpoint the cause of the slow running proc?  Thanks.

Change tracking auto cleanup not working

$
0
0

We have a production clustered instance running SQL Server 2014 SP3 CU1 (version 12.0.6205.1). It hosts (amongst others), two databases with change tracking enabled. Both have auto cleanup enabled and retention period set to 30 days.

I have noticed however, (querying sys.dm_tran_commit_table) that one has retained transactions going back to 4th November 2019 and the other even further back - 2nd December 2018. The same databases in our test environment both have retained transactions back to 31st December 2019, as I would expect.

By chance, I restored backups of the two production databases onto a dev machine the other day for unconnected reasons but, checking those copies now show transactions back, once again, to the expected 31st December 2019.

The only difference I can see is that the test and dev servers are running SQL Server 2014 SP3 CU4 (we are waiting for a suitable window to upgrade production). Is this a bug in SP3 CU1 or could something else be causing it?

Scheduling a job from date to date on monthly basis - SQL Server 2014-2019

$
0
0

Hi,

for a my SQL Server Agent job I need to schedule it from the 25th day to 28th day of each month, but a such schedule seems not possible to implement.

Any suggests to me to solve this issue? Perhaps, is it possible to create a schedule by a T-SQL script?

Many thanks

mssql japanese language

$
0
0

Hi Team,

i would like to install MSSQL using Japanese language version (local), how i can get Japanese local language MSSQL  package?

Thanks and Regards

Nagesh


Corruption caused by "The operating system returned the error '5 (Access is Denied)' while attempting create file "UNC path to directory" at 'fileprod.ccp (1047)

$
0
0

Hello,

Some background: I run a batch file to backup SQL databases running on a VM nightly. The batch file creates a .bak file for each database. This batch job has been running for nearly 12 years without fail. On 2/10 I discovered the error in Event Viewer. I then ran DBCC CHECKDB to find one of the databases corrupt. This error has never occurred prior nor has it popped up since and I am stumped as information on this error is minimal. I understand that the error references a permissions issue so I am hoping to get some help on what might be the cause.

Server 2012 R2
SQL 2012
Error Message: The operating system returned the error '5 (Access is Denied)' while attempting create file "UNC path to directory" at 'fileprod.ccp (1047)

Thanks in advance...

K


MS SQL Server 2019 evaluation license expired (Error code 17051)

$
0
0

We have an installation of SQL Server CTP 2.2, "Evaluation", it has expired and the SQL service has stopped. We want to move to a production version of SQL server 2019 but it is not available yet, as far I know. We have tried to upgrade from Evaluation to Developer to get the SQL service back in run, but without any luck. The actual upgrade process went well, but the version is still Evaluation and SQL service cannot be started. What can we do to get the SQL server up and running again?

Thanks 

user defined table type

$
0
0

Hi,

How can I find out what stored procedures and functions use user defined table type?

Thanks 


extracted high CPU consuming queries.

$
0
0

Good Morning Experts,

I have extracted high CPU consuming queries. Could you please advise on how to proceed. Should i tune them or look for something else? 


Kiran

database data.mdf big file size

$
0
0

my database size is now about 900GB, after shrinking LOGs, the size is 670GB, i tried to shrink data file, but nothing changed, i need to know what is the unallocated space that is taking 28% of the data file size and how to reduce this space and if it is healthy for the database to reduce this space

data files usage space (%)

index :7.62

Unallocated :28.24

data : 63.84

unused : 0.3

UPDATE statement is running over 1 hour

$
0
0

HI All,

I am new to sql tuning.  I have this below update statement which is taking more than an 1 hour. Why it is taking long time or is there a way to speed things up?

UPDATE [dbo].[Test_tbl]
set sql_detail='SELECT ROWID_OBJECT, HUB_STATE_IND, MDM_ID, SEQ_NM, MSP_END_CUST_NM, SEQ_TYP_CD, OST_NM, ALIAS_NM, STATUS_CD, DUNS_NMBR, C3_DUNS, BO_CLASS_CODE, C6, C6_NM2, C6_NM3, LEGAL_NM, EVENT_TYP, PROCESS_STATUS, ADDR_LN1, ADDR_LN2, ADDR_LN3, ADDR_LN4, CITY, STATE_CD, STATE_NM, COUNTY, COUNTRY_CD, COUNTRY_NM, REGION, POSTAL_CD, POSTAL_EXT_CD, ADDR_CLEANSE_DESC, ADDR_STATUS_CD, ACCOUNT.WEBSITE, ACCOUNT.ID FROM TAB1 INNER JOIN TAB2 ACCOUNT ON ROWID_OBJECT = C_B_ACCOUNT.SEQ_ID WHERE C3 <> ''Lead'' AND C3 <> ''C6-Customer'' AND C_B_ACCOUNT.IS_MERGED IS NULL AND C_B_ACCOUNT.SURF_ID IS NOT NULL AND C3 <> ''Entity'' AND C3 <> ''Vendor'' AND C4 <> ''Inactive'' AND C3 <> ''Inactive-Former Customer'' AND C2 <> ''0'' AND C1 = ''Organization'' '
 where [ROWID]='ABC.1jQR6    '
GO



Here is some notes
================
> no blocking
> Table has only 256 rows
> there is an non-clsutered idx created on the filtered column
> below is the table structure


CREATE TABLE [dbo].[Test_tbl]
(
    [ROWID] [nchar](14) NOT NULL,
    [SQL_DETAIL] [nvarchar](4000) NULL,
    [SQL_SEQ] [bigint] NOT NULL,
    [CREATOR] [nvarchar](50) NULL,
    [CREATE_DATE] [datetime2](7) NULL ,
    [UPDATED_BY] [nvarchar](50) NULL ,
    [LAST_UPDATE_DATE] [datetime2](7) NULL
)
GO

CREATE NONCLUSTERED INDEX [NI_Test_tbl_ROWID] ON [dbo].[Test_tbl]
(
    [ROWID] ASC
)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO


Linked server creation using "Be made using user's current security context"

$
0
0

Hi,

I am trying to create linked server using "Be made using user's current security context" from sql server to oracle database. 

But I am getting below invalid password though password is valid. Please let us know the reason of the error-

Please let me know the workaround for this.


Do the DMV views provide the same info as "SQL Profiler" does?

$
0
0

I am very familiar with running SQL Profiler with a set of "minimally invasive" template options and the info is extremely useful.

I am not as familar with the content of the results from running the DMV queries.

Can the DMV views provide the same info as "SQL Profiler" does?

SQLServer configuration does not list service type for all services

$
0
0

Sqlserver server configuration module does not list Service type for all Sql services. I have installed sqlserver 2016

Stored proc slow after migration

$
0
0

My team just completed a migration of business logic jobs and databases from 2008 R2 to a 2014 Always On cluster.  The 2008 R2 server hosted databases, SSIS packages, and SQL Agent scheduled jobs.  We separated out the scheduled jobs and SSIS packages on a new stand-alone server and the databases migrated to the cluster.  The migrated databases have stored procs in them.  The procs are called from the stand-alone job server using CmdExec job steps as in: SQLCMD -S <fully qualified server name> -d <db name> -Q "EXEC <sproc name>".

One of the stored procs is running very slow, but completes.  What tools can i use to diagnose where the problem query is within the stored proc while the job is running?  I don't have the benefit of running the stored proc code interactively and looking at the resulting execution plan as there are staging tables that need to be processed by other steps in the scheduled job.  Are there DMVs or extended events that can pinpoint the cause of the slow running proc?  Thanks.


The transaction log for database [mydb] is full due to 'LOG_BACKUP'

$
0
0

I have an ETL process that is scheduled to run in the wee hours of the morning. The last few days it has been failing with the error "The transaction log for database [mydb] is full due to 'LOG_BACKUP'"

So we have had issues with having to increase the TLog space, but if I run this same ETL process a little later in the morning, then it completeswith just barely enough room, leaving just a few MB left on the TLog free after completing.  It completes with no errors.

Typically when I see issues with the TLog running out of space I start looking at the size of the data flows being used. 

So now I am considering something else.  Could it be that the TLog isn't getting backed up ?

I ran this, and my Db is getting its Tlog backed up every 3 hours, and the time when this job runs there should have been plenty of time for another run of the 

select database_name, backup_finish_date
from msdb..backupset
where type = 'L'
ORDER BY backup_finish_date desc

So what else can I check?

How to enable TDE for Always on databases

$
0
0
Hi All,

In terms configuring and usage of TDE encryption is there a difference for Standalone instance databases & databases involved in AG?
Because the secondary will be in read-only, just want to know how to configure TDE on AG databases and during failover do we need to take care of any additional steps etc..

- create database master key in master db (DMK).
- creation of certificate in user db
- create a symmetric key in user database  i.e. CREATE DATABASE ENCRYPTION KEY

use master
go
ALTER DATABASE testdb SET ENCRYPTION ON;
go

-Bob


How to add new language to sys.languages

$
0
0

Hi

I to add hebrew language to sys.languages , to create a hebrew user to connect to SqlServer.

We have already tested hebrew strings for the managed errors, using a simple table for translations (correctly).
But some internal errors (not managed), obviously return to the operator using the language of the user connected.
So, to have all errors translated in hebrew, I need to add a language in syslanguages (doesn't include hebrew).
I have not found solutions online.
Could someone you me?
Thanks

DBCC checkdb('master') - Error on masterDB

$
0
0

Hi,

I have a problem with on master DB without any backup.

Meldung 8935, Ebene 16, Status 1, Zeile 1
Tabellenfehler: Objekt-ID 60, Index-ID 1, Partitions-ID 281474980642816, Zuordnungseinheits-ID 281474980642816 (In-row data-Typ). Der Vorgängerlink (1:121) auf Seite (1:200) stimmt nicht mit der vorherigen Seite (1:38) überein, die das übergeordnete (1:275)-Objekt, Slot 42, für diese Seite erwartet.
Meldung 8978, Ebene 16, Status 1, Zeile 1
Tabellenfehler: Objekt-ID 60, Index-ID 1, Partitions-ID 281474980642816, Zuordnungseinheits-ID 281474980642816 (In-row data-Typ). Für Seite (1:200) fehlt ein Verweis der Vorgängerseite (1:121). Möglicherweise liegt ein Kettenverknüpfungsproblem vor.

Any solutions will be helpfull.

thanks,

Jeffrey

What changed Agent XPs to 0?

$
0
0

What could change the "Agent XPs" configuration setting to 0 and leave no trace in the default trace or sql error log? Also is there another way to see who/what changed it?

Platform is Microsoft SQL Server 2012 (SP3-CU4)


Chuck

Viewing all 12963 articles
Browse latest View live


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