When someone from my team tried to take a Database offline, due to a blocking session the database went into transition state. The session is still present and Now I want to know what is the blocking session running while trying to keep database offline before killing it.
If i try with any dmvs or DBCC Input Buffer i'm getting the same error: Database is in Transition.
Please help me how to find what was the session running.
P.S It is a SQL 2005 database
Related
I keep on getting a timeout in my Microsoft SQL Server Management Studio. I'm not running any code. All I am doing is trying to look at the tables within a database in the Object Explorer. I always get:
Execution Timeout Expired
I've looked at some of my settings and it says lockout of 0, meaning it should be unlimited time. I'm not even running any code. Just trying to understand what's in my database by going through the Object Explorer.
Thanks!
It depends on your work environment. But in all cases, I trust it is related to the Database but not the Studio itself.
If you are working on a server that is reached by the network by many other clients, then:
It could be a transient network problem,
High load of requests on the Server,
Deadlock or other problems related to multiprocess contention.
I suggest you troubleshoot your server in idle time, and if possible you detach the databases one by one and work to see which database is resulting in the problem. For this database, you go through the Stored Procedures and Functions and try to enhance them in terms of performance.
I'm new to the forum and am studying Oracle SQL and PL/SQL. I have created a local database and a database link to a remote database to which I have to copy all my objects.
I think I'll be able to do the copying of the objects from local to remote database, but neither my course material nor my googling have given me much of a steer in terms of the modifying the objects to use the remote tables only if the local database is offline.
I'd be hugely grateful if anyone has done a similar task and could point me in the direction of any good material on the subject.
(I'm working with Oracle 11g Express and Oracle SQL Developer)
Many thanks in advance
Edit from original poster:
I got some clarification on the task requirement (see comments below) and I've created a new thread to ask my next question about creating packages at the remote database end. thanks guys for your help so far.
If database A is offline, a database link from database A to database B will not do you any good, as it will not be accessible. The same is the case with PL/SQL, PL/SQL on database A will not be available if database A is down. This is not a problem you will solve with PL/SQL and database links.
Transparent Application Failover (http://docs.oracle.com/cd/B19306_01/java.102/b14355/ocitaf.htm) could solve part of the problem, allowing a connection to failover to database B if database A is down. However, it will not automatically switch back to database A when the database comes back up, unless you try a connection to database A again. You will need to have your PL/SQL code copied on both databases.
There are already robust failover mechanisms in Oracle, some free and required some hacking, such as redo log application, some costly but well supported, such as Oracle Data Guard. I would suggest you review your design and what you are trying to accomplish. If I had to absolutely do what you are trying to do, I would throw a web service in front of each database, use a load balancer in front of the web services that always connected to service A, unless it was down, in which case it would connect to service B.
I am trying to open the database in SQL Server 2012. But it is showing the following error:
Failed to retrieve data for this request.(Microsoft.SqlServer.Management.Sdk.Sft)
Additional Information:
An exception occurred while executing a Transact_SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
There is insufficient system memory in resource pool 'default' to run this query.
(Microsoft SQL Server, Error:701)
Any suggestion to resolve the problem ?
You get this error when the engine gets an OutOfMemeory exception while trying to perform an action. There isn't much you can do about this programmaticly because you are bumping up against the physical constraints of the machine that is hosting the SQL Server instance. Look at your system statistics if you still have uncommitted memory chances are you just need to increase the memory pool limit of the SQL engine. You will need an account with admin privs to do this. I have also run into this issue where query's are getting blocked at the server and queuing up, after a certain point you run out of memory to do anything and you have to restart the server so it's probably worth it to check the jobs pane and make sure you don't have a bunch of queries in the WAIT state.
I currently have a SQL Server 2005 set up and has been running successfully for quite a long period of time without any issues.
As of this morning our website applications have been attempting to perform udpates on various rows. However, every time an update happens the data never gets updated in the database.
Our application's code hasn't been changed in any way, and there appears to be no errors of any kind.
Is there anything in SQL Server that can prevent updates from being performed on a database? Can the size of transaction logs prevent data from being updated on a SQL Server database? Or anything at all that can cause this strange behaviour?
We had similar behaviour on one of our servers and it was due to the log file being on a hard drive that had run out of disk space - so worth checking that.
Also check that the Autogrowth limits haven't been reached:
Every time I run a query, my database does not respond to an immediate second query and complains that it is in recovery mode (though it does not show anything beside the database name). This happens for about 5-10 minutes after which everything goes back to being normal.
I am expecting a major crash so I am copying the tables into a different database but anyone knows why this could happen or if there is a permanent fix?
Normally, a database is only in "Recovery" mode during startup - when SQL Server starts up the database. If your database goes into Recovery mode because of a SQL statement, you almost definitely have some sort of corruption.
This corruption can take one of many forms and can be difficult to diagnose. Before you do anything, you need to check a few things.
Make sure you have good backups of your database - copied onto a separate file system/server.
Check Windows Event Log and look for errors. If any critical errors are found, contact Microsoft.
Check SQL Server ERRORLOG and look for errors. If any critical errors are found, contact Microsoft.
Run chkdsk on all the hard drives on the server.
Run dbcc checkdb against your database. If any errors are found, you can attempt to fix the database with the REPAIR_REBUILD option. If any errors could not be fixed, contact Microsoft.
Restore a backup copy of your database onto a different server. This will confirm whether it is a problem within your database or the SQL Server/machine.
After step #4, #5, and #6, run your queries again to see if you can cause the database to go into Recovery mode. Unfortunately, corruption can occur because of an untold number of reasons, but more important than anything is the data. It will confirm whether it is a problem with your data or elsewhere. As long as you have backups that can be restored to a different SQL Server and a restored copy does not continually go into Recovery mode, you don't have to worry too much.
I always put Number 6 last because setting up a separate server with SQL Server and moving/restoring a large database can take an extensive amount of time; but if you already have a backup/test server in place, this might be a good first option. After all, it won't cause any downtime with your live server.
Finally, don't be afraid to contact Microsoft over this. Databases are often mission-critical, and Microsoft has plenty of tools at their disposal to diagnose problems just like this.
Late answer...
Does your database have autoclose set to true? When set, the DBMS has to bring the database online which may account for your symptoms
This can happen when the SQL Server Service has gone down hard in the middle of write operations and sometimes during mode during server startup. Follow the query in this link to monitor
http://errorbank.blogspot.com/2012/09/mssql-server-database-in-recovery.html
I've only had this happen when the service (or the SQL Server Service) has gone down hard in the middle of write operations. Once it came back, everything was fine.
However, if this happening often, then I would suspect a disk level failure of some sort. I would make sure the database is fully backed up and move it to another server while you run diagnostics / rebuild the problem server.