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

After setting database read_only if i take transaction log backup with no truncate , does it have side affect?

$
0
0

I want to take transaction backup of database, but i want the log have the last transaction in it.

With no truncate option supports this. But via sql manegment studio, it leaves the database recovery state.

when you leave the database recovery state, you have to restore the last transaction to get normal. And after restoring the transaction log you destroy the backup sequence.

Instead i found a new method, i want to ask if it has a side affect;

Scenerio;

1)  set database read_only

2) take transaction backup with no truncatewith t-sql (By this way you do not have to specify to leave the database  recovery mode)

3) And other transaction log backups (with truncate_only) can go on..... And you are sure that,the last transaction is in the first transaction log backup that we took via no truncate option

Is there a problem with this scenerio?


Database Restore

$
0
0

Hello, 

I am running into the following error when Restoring SQL DB: "The media set has 2 media families but only 1 are provided".  I might have backup onto two media, but I only saved one.  They are essentially duplicate media located in two separate folders. 

Is it possible to restore with only one media, so to by pass this error with a parameter to ignore the second media? 

Your help is much appreciated!

sql server security patch

$
0
0

Hi team,

what are the main difference in sql server patch and sql serve security patch ?

what is the sql server security patch and how to apply the security patch.

2012 SP 2 Issue

$
0
0

I have a warehouse that was running perfectly under 2012 SP1, it uses CDC with net enabled on the source tables to do incremental loads into the warehouse.

We migrated the databases over to a new SQL 2012 SP2 build (also later applied the hot fix for index rebuild), we are using SSIS and the CDC components for our integration.

So once we migrated a few of our tables were hanging on the CDC Source component beyond our timeout (around 10 minutes), typical CDC source time is 15 seconds.

I then tested the query output in the sis output in management studio and boom it works in under 15 seconds as expected,

I then did a Perlman on it and captured the real queries from SSIS, and the get_net_changes TVF call was wrapped in an sp_execute call, I copied it out and ran it in a SSMS window and it hangs, so I've eliminated everything but the query engine and how it behaves with sp_executesql, if I modify the sp_Executesql to include option (recompile) the sp_executesql for the TVF works in under 15 seconds as well.

Running a dbcc freeproccache just prior to running sp_executesql has no effect either.

What I'm believing is that either plan cache utilization or the plan being created is so horrid that the query never finishes, I've let ssms run for over 30 minutes and still not got a plan back.

Since I can't change the SSIS component to use option (recompile) nor is option recompile valid in a TVF (inline) as they are currently written, I'm more concerned that the behavior is the sign of a larger problem in the optimizer with SP2.

Any guidance in resolving this would be appreciated, at the moment we are considering downgrading the new box to SP1.

Additional information:

Tables giving us trouble are fairly wide, have fairly large PK (from a JDE system), and are fairly high volume change wise, if there are no records or very low records in the CT tables then the functions still perform fast, they also perform as expected when using the ALL instead of Net option.

Thanks

John


John Gooding

DBA

$
0
0

HI,

How can i export tables from the linked servers using  sql server  mgmt studio?

Thanks

Ganga


Cannot start SQL Server 2008R2 service on Windows 7 laptop

$
0
0

My SQL Server instance on my laptop was working fine.  After bringing my laptop home last weekend and connecting through my work's VPN and then bringing it back to work on Monday, it now cannot start the SQL Server service.  It did work fine at my home through the VPN.

The SQL Server Error log shows this:

******************************************************************************

2014-07-01 09:11:28.31 Server      Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (X64) 
Jun 28 2012 08:36:30 
Copyright (c) Microsoft Corporation
Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

2014-07-01 09:11:28.31 Server      (c) Microsoft Corporation.
2014-07-01 09:11:28.31 Server      All rights reserved.
2014-07-01 09:11:28.31 Server      Server process ID is 11076.
2014-07-01 09:11:28.31 Server      System Manufacturer: 'LENOVO', System Model: '43192PU'.
2014-07-01 09:11:28.31 Server      Authentication mode is MIXED.
2014-07-01 09:11:28.31 Server      Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG'.
2014-07-01 09:11:28.31 Server      This instance of SQL Server last reported using a process ID of 9220 at 7/1/2014 9:11:12 AM (local) 7/1/2014 1:11:12 PM (UTC). This is an informational message only; no user action is required.
2014-07-01 09:11:28.31 Server      Registry startup parameters: 
-d C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\master.mdf
-e C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG
-l C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\mastlog.ldf
2014-07-01 09:11:28.31 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2014-07-01 09:11:28.31 Server      Detected 8 CPUs. This is an informational message; no user action is required.
2014-07-01 09:11:28.32 Server      Cannot use Large Page Extensions:  lock memory privilege was not granted.
2014-07-01 09:11:28.35 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
2014-07-01 09:11:28.37 Server      Node configuration: node 0: CPU mask: 0x00000000000000ff:0 Active CPU mask: 0x00000000000000ff:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2014-07-01 09:11:28.39 spid6s      Starting up database 'master'.
2014-07-01 09:11:28.41 spid6s      2 transactions rolled forward in database 'master' (1). This is an informational message only. No user action is required.
2014-07-01 09:11:28.41 spid6s      0 transactions rolled back in database 'master' (1). This is an informational message only. No user action is required.
2014-07-01 09:11:28.41 spid6s      Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2014-07-01 09:11:28.42 spid6s      Resource governor reconfiguration succeeded.
2014-07-01 09:11:28.42 spid6s      SQL Server Audit is starting the audits. This is an informational message. No user action is required.
2014-07-01 09:11:28.42 spid6s      SQL Server Audit has started the audits. This is an informational message. No user action is required.
2014-07-01 09:11:28.43 spid6s      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2014-07-01 09:11:28.43 spid6s      SQL Trace ID 1 was started by login "sa".
2014-07-01 09:11:28.43 spid6s      Starting up database 'mssqlsystemresource'.
2014-07-01 09:11:28.44 spid6s      The resource database build version is 10.50.4000. This is an informational message only. No user action is required.
2014-07-01 09:11:28.46 spid11s     Starting up database 'model'.
2014-07-01 09:11:28.46 spid6s      Server name is 'MYCOMPUTER'. This is an informational message only. No user action is required.
2014-07-01 09:11:28.47 Server      Error: 17190, Severity: 16, State: 1.
2014-07-01 09:11:28.47 Server      Initializing the FallBack certificate failed with error code: 1, state: 1, error number: -2146893802.
2014-07-01 09:11:28.47 Server      Unable to initialize SSL encryption because a valid certificate could not be found, and it is not possible to create a self-signed certificate.
2014-07-01 09:11:28.47 Server      Error: 17182, Severity: 16, State: 1.
2014-07-01 09:11:28.47 Server      TDSSNIClient initialization failed with error 0x80092004, status code 0x80. Reason: Unable to initialize SSL support. Cannot find object or property.

2014-07-01 09:11:28.47 Server      Error: 17182, Severity: 16, State: 1.
2014-07-01 09:11:28.47 Server      TDSSNIClient initialization failed with error 0x80092004, status code 0x1. Reason: Initialization failed with an infrastructure error. Check for previous errors. Cannot find object or property.

2014-07-01 09:11:28.47 Server      Error: 17826, Severity: 18, State: 3.
2014-07-01 09:11:28.47 Server      Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.
2014-07-01 09:11:28.47 Server      Error: 17120, Severity: 16, State: 1.
2014-07-01 09:11:28.47 Server      SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.
2014-07-01 09:11:28.48 spid11s     Clearing tempdb database.

***********************************************************************************

I have tried logging on to Windows as a different user.

I have tried changing the account that SQL Server service uses to Log on from Network Service to Local System or Local Service but I get the error: "Cannot find object or property."

Also, I noticed when I opened up Internet Explorer which the home page is Google, it could not connect, but did connect to other websites.

Any ideas what may have happened to my laptop?

Thanks for your help,

Fred


Fred Schmid

Reindexing Job failed

$
0
0

Hi All,

In one of our production server Reindexing job was failed . I had checked SQLServer log at that time the error is

Error: 701, Severity: 17, State: 123 There is insufficient system memory to run this query.

Can anyone suggest about this issue to resolve.

Date        7/20/2014 2:05:19 AM
Log        Job History (maint_shrinkdatabase_reindex)

Step ID        4
Server        SYDTMS05
Job Name        maint_shrinkdatabase_reindex
Step Name        reindex_AUV_Staging_TMS
Duration        00:07:21
Sql Severity        17
Sql Message ID        3621
Operator Emailed        
Operator Net sent        
Operator Paged        
Retries Attempted        0

Message
Executed as user: SCHLOGAU\sqladmin. ...STATE 01000] (Message 0)  DBCC DBREINDEX ("dbo.Consignment", IDX_Consignment_Job_No,90) WITH NO_INFOMSGS [SQLSTATE 01000] (Message 0)  DBCC DBREINDEX ("dbo.Consignment", IDX_Consignment_Processed_Flag,90) WITH NO_INFOMSGS [SQLSTATE 01000] (Message 0)  DBCC DBREINDEX ("dbo.Consignment", IDX_Consignment_Processed_Time,90) WITH NO_INFOMSGS [SQLSTATE 01000] (Message 0)  DBCC DBREINDEX ("dbo.Consignment", IDX_Consignment_JobNo_Country_LastDate,90) WITH NO_INFOMSGS [SQLSTATE 01000] (Message 0)  DBCC DBREINDEX ("dbo.AMSImage", NONCLUSTERED_ON_AMSImage_Processed_Flag,90) WITH NO_INFOMSGS [SQLSTATE 01000] (Message 0)  DBCC DBREINDEX ("dbo.AMSImage", NONCLUSTERED_ON_AMS_TMSDocs_Processed_Data_IMG_PATH,90) WITH NO_INFOMSGS [SQLSTATE 01000] (Message 0)  DBCC DBREINDEX ("dbo.AMSImage", NONCLUSTERED_ON_AMS_TMSDocs_Processed_Data_REF_NAME,90) WITH NO_INFOMSGS [SQLSTATE 01000] (Message 0)  DBCC DBREINDEX ("dbo.AMSImage", NONCLUSTERED_ON_AMS_TMSDocs_Processed_Data...  The step failed.

Master database Rebuild

$
0
0

hi Team,

if we Rebuild the MASTER database [model and msdb ] re-created or not? 

if rebuild the Master database internally what will be happen.

Thanks,


Contained users in SQL 2014

$
0
0

Hello!

After enabling containment option on the instance and DB level I'm trying to migrate users usingsp_migrate_user_to_contained but keep getting the following errors:

1) Should I type the user name as domain\username or just username?

2) Am I doing anything wrong?

Thank you in advance,

Michael


Reorganize database

$
0
0

Dear all,

Is there any method or scripts to reorganize the whole database(instead of table indexes) for SQL 2005? Thx a lot

Thanks and regards,

Wallace

COMPATIBILITY LEVEL not = 110

$
0
0

I using sql server 2012 but my compatibility level can't up to 110 and I can't use LAG and LEAD recognized built-in function 

Please, Help my :( 

this is my pic of problem 

http://up.ssc.vn/images/703Screenshot_143_.png


Setting database option ONLINE to ON for database "dbname"

$
0
0

Hi

Today i faced a wiered issue, One of my database on sql  server 2005 was offline.

Scenerio:One fo my database was offline , I checked in

1. SSMS (GUI) -- DB is offline
2. sys.databases  (status) -- offline
3. Job is using DATABASEPROPERTYEX and its ignoring databases as status is offline.

And we also know (observed) if we change status from online to offline , Message come as below

/******************************************/
Setting database option OFFLINE to ON for database "dbname".
SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
/******************************************/

And when we change from offline to online , message is like

/******************************************/
Setting database option ONLINE to ON for database "dbname".
/******************************************/

Issue : Now When i change database status from offline to online (online to on), below message generated. This only happen once and i am not able to regenerate same

/******************************************/
Setting database option ONLINE to ON for database "dbname".
SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
/******************************************/

Confusion: Why cache stores are flushed while taking database online ??


Thanks Saurabh Sinha http://saurabhsinhainblogs.blogspot.in/ Please click the Mark as answer button and vote as helpful if this reply solves your problem

Cluster nodes

$
0
0

Hi Team,

we have 2 nodes cluster set up, here if it is possible for 1 node put in to one data center and another node is put into  different data center.

ex :

node 1 placed into [ABC DATA CENTER]

node 2 placed into [XYZ DATA CENTER]

Replication

$
0
0

Yesterday due to an incorrect data feed we had to restore 
the database at production server 123, 
which replicates to 456 server.  Please let us know if we have to
 restore the database on 456 server with 123 server and reinitialize replication. 

or is there any other way we can sync the subscriber without restoring the primary database.

thanks,

what is Hyperthred ratio?

$
0
0
Hi,

In layman terms, what does hyperthread ratio mean? How is it used/useful in sql server ?

Books online says, It is the Ratio of the number of logical and physical processors.

I have executed one of Glenn Berry's DMV query on my laptop and gives me the below output.

SELECT cpu_count AS [Logical CPU Count],
hyperthread_ratio AS [Hyperthread Ratio],
cpu_count/hyperthread_ratio AS [Physical CPU Count],
physical_memory_in_bytes/1048576 AS [Physical Memory (MB)], sqlserver_start_time
FROM sys.dm_os_sys_info WITH (NOLOCK) OPTION (RECOMPILE);

Logical CPU Count    Hyperthread Ratio    Physical CPU Count    Physical Memory (MB)    sqlserver_start_time
2            2                1        4086            2014-07-22 16:24:47.377

Thanks in advance.

Job Schedule Skip Notification

$
0
0

Hi All,

I have a requirement where i am asked to set a notification when ever  SQL server agent skips a scheduled job execution to the next run because the job is still running.

Can some please help me with a script to accomplish this or through so light on how to do this .

Thanks in advance!!

Jack

How to Use FULL TEXT Indexing Search on file names with brackets

$
0
0

I would like to use a FULL Text Seach query to find Files on a windows file system

The Problem is when the case comes up where there is a parentheses"()" in the file name. This example was created from a file copy being pasted in the same folder location as the original a few times.

Here is my code:

DECLARE @SearchWord VARCHAR(50) SET @SearchWord = '"KAP1556PP_P01(2).jpg"' SELECT [FileName], [FilePath] FROM [dbo].[tblLegalPlan] WHERE CONTAINS(*, @SearchWord)

When I use Double quotes for the @Searchword I recieve no results.
SET @SearchWord = '"KAP1556PP_P01(2).jpg"'

When I remove the Double  Quotes for the @Searchword I recieve an error message:
SET @SearchWord = 'KAP1556PP_P01(2).jpg'

Msg 7630, Level 15, State 2, Line 8
Syntax error near '('in the full-text search condition 'KAP1556PP_P01(2).jpg'.

When I search for files containing TEXT up to the bracket i Get undesrired results obviously:
SET @SearchWord = '"KAP1556PP_P01*"'

Results

FileName                FilePath
KAP1556PP_P01(1).jpg    BC\EPP\KAP
KAP1556PP_P01(2).jpg    BC\EPP\KAP

I would like results where I can search for the file name and only one file is found matching the search word.

Thanks

Does sql server could export a partition from a partition table ?

$
0
0

Dear :

   Does sql server could export a partition from a partition table ? 

  For example, I need to export all old partition,which is '2013' and drop them.  It is easy in oracle. but how to do with sql

server 2012 ?

RBS Licensing on a SQL Server Standard 2012 Failover Cluster

$
0
0

I am planning to implement a Sharepoint 2013 installation which is primarily to be used for Document Storage. We are considering using Sharepoint RBS with Filestream with SQL 2012 Standard and as far as I can see on our non-production environments this works without any issue - i.e. we enable filestream and RBS with Sharepoint and SQL and everything works as expected on our non production systems. In non production we have single SQL Server nodes. 

However, in production we have planned to have a 2 node SQL 2012 Standard failover cluster.

On this page, it indicates

"To run RBS on a remote server, you must be running SQL Server 2008 R2 Enterprise on the server that is running SQL Server where the metadata is stored in the database."

My question is : Am I entitled to use RBS with Filestream on a SQL 2012 Standard Failover Cluster, or is SQL Enterprise required.

If enterprise is required, we will have to remove the RBS. I have reviewed the links below, but cannot see a definitive answer from a licensing perspective

http://social.technet.microsoft.com/Forums/en-US/76e86936-b7ee-4571-aa02-f45b80867515/which-edition-for-sql-server-2008-r2-with-sharepoint-2010-no-foundation?forum=sharepointadminprevious

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/2b04979f-c619-48a4-b0e4-3add00345fb0/sql-server-2008-edition-comparisons-in-terms-of-high-availability-rbs?forum=sqldisasterrecovery

SQL Server 2005 consuming less memory

$
0
0

Hi Everyone,

We are facing slowness issue with one of our production SQL Server EE 2005 32-bit on Windows 2003. Installed RAM on the server is 4 GB and SQL Server MAX MEMORY is already set to 4 GB and virtual memory is set to 5 GB. But we have observed through task manager and PERFMON that SQL Server is only using around 1600 Mb of memory.

We are not able to find out why is it taking less memory as high load is being generated through application and users have been complaining of slowness.

Need urgent help on this.

Viewing all 12554 articles
Browse latest View live