这是我以前做的一个网站项目中的开发文档附件。我后来的一段时间都是用PHP+MySQL数据库做网站,很久没接触SQL Server数据库了,但现在又要跟SQL Server数据库打交道了,就把这个附近发了出来,方便参考。

★附件㈠、如何进行SQL Server数据库的备份与恢复

  方法一、利用备份和恢复

  先对源数据库进行完全备份,备份到一个设备(device)上,然后把备份文件复制到目的服务器上(恢复的速度快),进行数据库的恢复操作,在恢复的数据库名中填上源数据库的名字(名字必须相同),选择强制型恢复(可以覆盖以前数据库的选项),在选择从设备中进行恢复,浏览时选中备份的文件就行了。这种方法可以完全恢复数据库,包括外键,主键,索引。

  方法二、直接拷贝数据文件

  把数据库的数据文件(*.mdf)和日志文件(*.ldf)都拷贝到目的服务器,在SQL Server Query Analyzer(中文名:SQL查询分析器)中用语句进行恢复:

EXEC sp_attach_db @dbname = 'test',
@filename1 = 'c:\mssql\data\test_data.mdf',
@filename2 = 'c:\mssql\data\test_log.ldf'

  这样就把test数据库附加到SQL Server中,可以照常使用。如果不想用原来的日志文件,可以用如下的命令:

EXEC sp_detach_db @dbname = 'test'
EXEC sp_attach_single_file_db @dbname = 'test',
@physname = 'c:\mssql\data\test_data.mdf'

  这个语句的作用是仅仅加载数据文件,日志文件可以由SQL Server数据库自动添加,但是原来的日志文件中记录的数据就丢失了。




技术大类 » Windows相关 | 评论(45) | 引用(0) | 阅读(36394)
dgfgf Email Homepage
2012-9-27 08:56
By donning these outside jackets, you'll possess the Karen Millen dresses capability to show away your style assertion. The kind and best superior of overcoats displays your character. There are many benefits of proudly owning this specific coat, which you'll have the ability to avail. like a Karen Millen dress result, buy an superb top quality reliable product this specific product and you'll certainly be articles jointly along with your buy.It doesn't matter precisely in which you place on these sorts of outside jackets. You might place on them anyplace you would like. These overcoats are favored all through the wintertime period thanks towards actuality the preserve the individual wonderful and cosy. You might also place on these overcoats all through the summer time time season, as they'll possess the capability to defend Karen Millen Ireland you within the soft drizzle, which can be definitely a common purpose in UK.
ray ban outlet Email Homepage
2012-9-29 09:22
Whichever sunglasses you choose make sure they are good and worth the cost. You can also buy them in wholesale to save the money.If you are a man FAKE OAKLEYSwith outdoors activities but are worried about vision problems, this article is helpful to you. i will introduce you some cheap clip on sunglasses for men from online stores where the price is lower than that in local stores In learning the knowledge about clip-on discount ray bans  , you'll soon find out how important it is to protect your eyes and therefore enjoy your life better. See if you like the below typical clip-on sunglasses.Cheap clip-on sunglasses for men: suitable for sports. These clip-on sunglasses frame is made from memory metal that is extremely flexible. Both the durability and the flexibility of the memory metal make these clip-on sunglasses very suitable for outdoors activities. The entire weight is less than 40 grams, which makes you enjoy your time without too much burden. The magnetic sunshade is pretty convenient to use and fold while not in use.
MLB Snapback Hats Email Homepage
2013-1-25 10:40
Former Bulldogs Snapback Hats Orson Charles Knit Hats and Ben Jones briefly caught Snapback Hats Sale up when they NBA Snapback Hats
Karen Millen dresses Email Homepage
2013-1-31 10:30
There Karen Millen UK are some low cost shades out there that individuals use in rental homes because they don't need the great cost of replacing them from a renter shifted away; nevertheless you are trying to find your property so you'd like something will almost certainly Karen Millen last, something should be able to utilize for a long time along with stand up to Karen Millen coat individuals little ones pulling for no more shades. There are lots of options for anyone with a best way to find the window blinds for you is usually to call at your community Karen Millen sale shop. Not only can they provide right dimensions for many house windows or specific order those who they just don't bring, but additionally they feature a variety of colours. You can select the budget shades that will match your home decor while keeping to that particular stringent price range. Most inexpensive shades are slat window blinds. They can be horizontal or vertical window shades.
django Email Homepage
2013-11-30 18:58
Uggs Sale the ideal idea Coach Outlet Online  enough time to search for many of reduction Ugg boot. Like big portions? If you began ready your apartment, Coach Outlet  it's always best to consider the most effective way direct to the stage it could be to utilise your inventory throughout Coach Factory Outlet  concern, or maybe you basically won't destination stuff not enough.we're anti- whitening tray because Coach Outlet Online  i will be enjoy just get germ dog breeders
SS
2014-2-25 14:19
Great blog. All posts have something to learn. Your work is very good and i appreciate you and hopping for some more informative posts.
IDRpoker.com Agen Texas Poker Online Indonesia Terpercaya | IDRpoker.com Agen Texas Poker Online Indonesia Terpercaya | Alfamart official partner merchandise FIFA piala dunia Brazil 2014
Official NFL Nike Jerseys Email Homepage
2014-5-11 20:41
高仿包 Homepage
2015-4-29 09:58
Linda Rose Email
2019-1-24 17:42
Thank you for sharing valuable information. Nice post. I enjoyed reading this post.atari breakout
Roller Blinds in Qatar Email Homepage
2022-5-29 09:18
Great post! I am really inspired from archive of post. Looking forward to read more. Thank you for your effort you're a great author
painting works Email Homepage
2022-5-31 00:55
The great thing about this post is quality information. I always like to read amazingly useful and quality content.Your article is amazing, thank you for sharing this article.
Blackout Curtains Email Homepage
2022-6-9 23:32
Nice blog, So exciting photo! Looks totally beautiful! CONGRATS!!! Thanks for sharing these information with all of us.
shz Email
2022-8-18 16:32
We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Great work  Digital Real Estate Business
shzz Email
2022-8-18 16:33
Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!.  Digital Real Estate Business
shz Email
2022-8-18 16:35
Super site! I am Loving it!! Will return once more, Im taking your food additionally, Thanks.  Digital Real Estate Business
shzz Email
2022-8-18 16:37
The material and aggregation is excellent and telltale as comfortably.   Digital Real Estate Business
shz Email
2022-8-18 16:38
I would also motivate just about every person to save this web page for any favorite assistance to assist posted the appearance.  Digital Real Estate Business
shzz Email
2022-8-18 16:40
I surely acquiring more difficulties from each surprisingly more little bit of it  Digital Real Estate Business
shz Email
2022-8-18 16:42
Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging,  Digital Real Estate Business
分页: 2/3 第一页 上页 1 2 3 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]