March 19, 2011 at 4:51 pm
Henry, Gail's right (as usual) about the necessity for backups, but it seems like you're an accidental DBA. A little background to why what you're doing didn't work.
There are always at least two files to a database. The mdf (data) and ldf (logging). Both of these need to stay in sync. You can't have only one. The next part is you have to consider these files to be always open. Think about sharing an Excel file with everyone, if it helps. Now consider that SQL is much more resitrictive about what you can do when the file's already open and needs to recover when you start mucking about with files that are mid-edit.
What the backup does is create a synced, closed, copy of the database as of a point in time so you can restore it without all those mid-edit problems, and keeps the data clean.
Hopefully that helps a bit.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
March 19, 2011 at 4:53 pm
It's griping because of the single-user mode.
ALTER DATABASE [BTData] SET MULTI_USER WITH NO_WAIT
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
March 19, 2011 at 4:55 pm
Craig Farrell (3/19/2011)
It's griping because of the single-user mode.ALTER DATABASE [BTData] SET MULTI_USER WITH NO_WAIT
Disconnect object explorer before you try running that. The database currently only allows one connection (hence single_user)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 19, 2011 at 5:21 pm
GilaMonster, you are truly my hero today. I cannot express enough gratitude for your help. If this database is loss, it would be a disaster for me because my home-based business depends on it. Thanks to all of you for contributing to this post.
Lesson learned: always back up data the proper way.
🙂
March 20, 2011 at 3:36 am
henryvuong1000 (3/19/2011)
GilaMonster, you are truly my hero today. I cannot express enough gratitude for your help. If this database is loss, it would be a disaster for me because my home-based business depends on it. Thanks to all of you for contributing to this post.Lesson learned: always back up data the proper way.
🙂
You're welcome.
Seriously consider either getting one of your staff (if you can) on a SQL admin course, or get someone in to help you out. SQL is capable of backup that will give you 0 data loss in most disasters, but you have to know how and what to set up
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 21, 2011 at 6:09 am
hi,
why don't you try to attach the DB only using the data file ".mdf" while trying this it asks for creation of new logfile you can select YES and automatically new logfile gets created....
before trying above have a backup(hope you have already) and then detach the db and try attaching
March 21, 2011 at 6:18 am
Rao.V (3/21/2011)
why don't you try to attach the DB only using the data file ".mdf" while trying this it asks for creation of new logfile you can select YES and automatically new logfile gets created....
Not necessarily. The log cannot always be recreated and if it can't, SQL marks the database recovery pending.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 7 posts - 16 through 21 (of 21 total)
You must be logged in to reply to this topic. Login to reply