SQL Server 2008 R2 database detaches when windows server restarts - sql

I have a weird problem, I have a database and it was working just fine until now, every time I restart my server, the database seem to disappear. After extensive research I found out that the database just detaches, so I have to attach it again after the server restarts. I can't find a solution to this, has anyone come across it?
I did many virus scans, but nothing, so It can't be a virus.
I have also tried repairing the sql and that didn't work.
I have tried to take this database and added to my test environment, and it seem to work fine.
It is not the database itself, I'm guessing something in SQL Server that is corrupt or a virus? I have SQL Server 2008 R2 on a Windows Server 2008

Related

SQL Server 2012 , lost access to database

I have experienced a weird issue a few hours ago and i cannot seem to figure out what has caused this problem.
I have SQL server 2012 installed on a windows server 2012 virtual machine.
I have windows services, Windows applications and web sites accessing a database on this server.
all applications lost access to the database for +/- 10 minutes and it suddenly just came back up again.
during that ten minutes i managed to log onto the SQL server remotely and open management studio and access all the databases but the applications still could not connect.
The database did not go into single user mode, the CPU and memory was normal, i could ping the server from my desktop.
I looked at the event log and SQL logs but couldn't find anything related to why the database could not be accessed.
I am baffled I've been trying to figure this out for the last 2 hours and i not getting anywhere.
I would appreciate any assistance
Thanks
run the dbcc checkdb command. This will check the database and tables for any corruption/errors.

SQL Server 2012 Database restore error

I am trying to restore a database backup from SQL Server 2008 R2 to SQL Server 2012 Standard. It keeps failing with the error seen here: http://screencast.com/t/UWC58GrVnWI
The web server is: Windows Server 2012
I tried renaming the file.
I tried to restore on another server
on SQL 2012 and it worked fine
I tried to restore on another
server on SQL 2008 R2 and it worked fine.
Considering above symptoms, I strongly feel the database .bak file is good. It only fails on this web server. What might be the reason?
If you read the error message you will find out that it is clear - the location is invalid. Now, if you check the path of folders and know the basics of how windows file systems work.... guess what, you find out that this is exactly true.
Fix the location. Done.

SQL Server 2005 not collecting logins in the log file

I am currently running SQL Server 2005 Standard Edition on a Windows 2003 server machine.
I have gone to the properties of the server and confirmed that the Login Auditing is set to both failed and successful logins. For some reason though there is nothing in the logins for fails or successes in the SQL Server logs when I know there have been logins for both.
I have searched out the reason for this and have not been able to come up with anything helpful, so I am hoping that someone here could give me a little direction. This is working on my other SQL Servers, so I know where to look for the results, but there are none there.
After speaking with Microsoft about the issue and doing much research, it was determined that this was an issue with the particular version of SQL (SQL Server 2005 Service Pack 2 9.00.3042) running on that particular version of the windows release. We reinstalled SQL, and then did all the updates and patches to both windows and SQL and this seems to have resolved the issue. The SQL logs are now tracking both success and failed logins.

Can SQL Server 2008 Express exist with SQL Server 2000 on the same server?

I'm wondering if anybody has had any experience in trying to install SQL Server 2008 Express along side with SQL Server 2000. We have a production server running 2000 which all of our current stuff is running on. However, something new is in the pipeline that uses SQL Server 2008 Express.
Hitting Google thus far has given me nothing concrete. There was an obvious no from a preview release of 2008 but nothing about RTM 2008.
I could try installing it but would like to find out as much as I can before doing so. I can see the 2008 install failing, eating 2000 in the process.
The alternative paths that I have include having the 2008 db be turned into a 2000 format (which I'd like to avoid as we only have a 5 connection licenses) and building a new server (we already have enough and it seems overkill). Redoing the 2008 DB is viable as it doesn't use any new whiz-bang features from 2008.
Virtualization can be an option as well, but it's not quite in our cultural yet.
Any insights here will be appreciated.
Keith
yes you can, you have to make the 2008 version a named instance if the 2000 version is a default instance

Any reason to have SQL Server 2005 and 2008 installed on same machine?

I'm setting up a new development server and want to install the latest version of SQL Server 2008 Express.
Will our existing sql2005 databases work with 2008 without modification?
If so is there any reason to install both versions on the same server?
I haven't actually tried migrating a 2005 database to 2008, but generally SQL handles this cleanly and without difficulty. The simplest way to do it would be to make a backup of your database from SQL 2005 and then restore that backup with SQL 2008.
If you want to keep the SQL 2005 copy around and online until you know that the 2008 copy is working, you might need to move the data/log files for your database when restoring the backup onto 2008, since the old data files will be in use by 2005. You can do this using the with move option of restore database, for example:
RESTORE DATABASE mydb FROM disk = 'c:\backupfile.bak'
WITH MOVE 'maindatafile' to 'c:\newdatalocation.mdf',
MOVE 'mainlogfile' to 'c:\newloglocation.ldf'
As to having both installed at the same time, one reason you might decide to do this would be to simplify the job of testing code against both versions, if you were intending to have your software support talking to both versions.
You can detatch a 2005 database and attach it to a 2008 server. I would recommend against installing both on the same machine unless you must (e.g. you're writing code for a third party and they only use 2005).
What I'd highly recommend is using windows server 2008 hyper-v to create 2 virtual machines one with the 2005 environment, the other with 2008. Hyper-v virtual machines are incredibly faster than Virtual server 2007.
The databases should (should!) work unmodified. However, for development it is preferable that you have sql2005 to test your scripts unless you assume all your clients would upgrade to 2008 as well, since 2008 has features that do not exist in SQL Server 2005.
In dev and test environments, having multiple database servers installed is not a problem and can reduce the number of test servers required.
In production, I wouldn't recommend it due to the fact that multiple buffer pools fight and kill your performance.
To me the important thing is will you have prod instances that are 2005 databases? Will you have to support reporting services reports that are on a prod server that only has the 2005 version of reporting servives, etc?
If so, you should have both the 2005 and the 2008 versions on your development machines. I've seen a lot of code that had to be thrown out because developers worked on 2008 when prod was 2005. ALways develop against the version of the software you will have in prod. If you are converting to 2008 but not there in prod yet, you need both, one for maintenance changes and one for future stuff.
Personally I have SQL server 2000, 2005 and 2008 on my machine because we haven't converted everything yet and I have some things which can only be done on the older version. We have found the key to maintaining multiple versions is to install them i nthe correct order. It seems to go badly if you put 2008 on first and then the older versions.
Sometimes you need to be able to test on multiple versions, or you may need 2005 for one thing and 2008 for another.
Sometimes you maintain several different apps, some of which are on one and some on the other, and you haven't updated everything yet. Sometimes you're upgrading, and need to test on both versions during the upgrade. Sometimes you support several different customers, some on one version and some on another. Sometimes you want to upgrade your internal apps, but you're using a software package that is only certified on an older version.
There's lots of reasons.