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

restoring to copy of db from bkup of original

$
0
0

Hi we run 2012 enterprise and I'm trying to use the ssms restore task to use an older full backup of db A to a newly created db called B.

I scripted B as a "new" DB with recovery simple.  I believe A is also recovery simple.

The ssms error i get is "the backup set holds a backup of a database other than the exising 'B' database".

In the source section of the restore task i chose the specific .bak in the "device" section.  SSMS filled in the db name 4 me in that section.

In the destination section i named "B" as the database.

My concern is that some of the alternative options involve installs of certain agents that i may not have installed.  But I'm willing to try whatever is necessary.   I'm trying to avoid ssis's alternative because my recollection is that route takes forever to run.


Can't access main application database with massive log file

$
0
0
My company looks after a server which is running SQL Server 2014 Standard Edition. The main application database on the server is replicated out to about 20 subscribers. The server has only been in operation for about a week and at the time of setting it up we moved the existing database and replication across from the old server. At that time we also changed the recovery model from Simple to Full.

The performance of the server hasn't been particularly good so far, even though it has 24 logical processors and 32 GB of RAM. However it seems to be SQL Server that has been performing badly due to locks etc. according to the event logs.

This morning we couldn't access any tables in Management Studio and after a period of time we decided to try restarting the service. The service did not seem to stop properly and we were forced to restart the server. After restarting the server everything seemed fine until we tried to expand out the 'Databases' tab in Management Studio. It just says 'expanding...' in the UI and after several minutes brings up a timeout error message. After clicking ok on this message we can browse all the system databases as normal but the main application database is not shown.

One of the problems that has come to light is that the log file has grown extremely large (over 1 TB).

This is a major problem now as you can imagine, since we cannot connect to the database to shrink the log file and no applications can connect to the database Connecting to the database using 'sqlcmd' doesn't work either. We can't 'open' the database.

Look forward to hearing if anyone has come across this before and knows of a solution.

Restore MSDB Database

$
0
0

Hi - I have a corrupt MSDB database and I am not able to run dbcc checkdb with the fix parameter nor am I able to restore from backup - I get an error saying that the operating system returned error 23 in file... (the msdb DB file) - it adds that it is error 823.

I get this when I try to restore any of the databases and when I try to repair msdb.

I am running SQL Server 2008 R2

Any help will be appreciated.

 

Can we disable 'max_rollover_files' to stop file rollover for Xevent session.

$
0
0

Hello,

Is it possible to disable file rollover option for extended events session. If i don't specify value for this it is taking a default value of 5.

ADD TARGET package0.event_file(
		SET filename=N'S:\Trace_temp\query_performance.xel',
		max_file_size=(2),
		max_rollover_files=(0),
		metadatafile=N'S:\Trace_temp\query_performance.xem')

Thanks


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!

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


sysprocesses - physical_io, cpu, memory

$
0
0

when troubleshooting performance issues, are not these three columns in sysprocesses referred to/checked?

most of the articles I find on the subject on the net, seem to refer to various DMVs, but not these columns or even the sysprocesses table.

any particular reason why?

appreciate the feedback.


Design Database for Reports

$
0
0

I am using sql 2008 R2 SE. Currently I have separated out our reports databases that are being used for internal purpose. However these report databases are logshipped secondary databases being hosted on secondary server. The reason I separated reports databases from the transactional databases is I didnt wanted the queries being used for reports causing blocking and deadlocks with queries being used by our apps.

However due to growth in data the queries that I used in the rdl files are taking longer time to run. So some reports are taking very long time to load and output the results. And since I am querying against the standby secondary database I cannot add indexes. But the query execution plan suggests that adding some indexes would improve the performance by almost 90%. If I add these indexes to the primary database then its degrading performance as its causing slowness in the applications. And the applications and the reports built are using different queries.

I want to take experts opinions on how to implement a better strategy for reports in this scenario. Experts please share your valuable thoughts.

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


Temp DB MDF file is not using by SQL Server

$
0
0

Hi All,

When I randomly checking the temp files I noticed that the.mdf file of temp DB is not in use since the 6 .ndf files were created.

There are 6 CPUs and 6 .ndf files created for one of each. Is it stopping SQL Server not to use the primary data file. Any idea?

Thanks


Swapna

What size will release in DB Shrink?

$
0
0

Hi All,

One of my Database is very big in Size and used space is very less. What will happen when I Shink the DB file? I wanted to know what is the max required size of the Database? If I shrink the file will it released the unused space to disk and the total size reduced?


Swapna

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



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

[298] SQLServer Error: 258, Unable to complete login process due to delay in login response [SQLSTATE 08001

$
0
0

Hi Experrts,

we are receiving below error since 1 week, 

The below error logging in SQL AGENT LOG.

[298] SQLServer Error: 258, Unable to complete login process due to delay in login response [SQLSTATE 08001]

Thanks in advance.

Way to insert text having ' (apostrophe) into a SQL table

$
0
0

Solution:-

1:If you insert data through procedure

eg. create proc tt @in varchar(20) as  select @in

exec tt "test's"  --here used "string inputparameter" instead of  'string inputparameter'

2:isert manulay into data base (DML)

eg.select 'test''s'  --add one more '   instead of ' (apostrophe)

Please share if any other solution...

Thanks & Regards

Subhash Chandra

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

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

Viewing all 12644 articles
Browse latest View live


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