
SQL 日志与备份还原
文章平均质量分 79
envykok
这个作者很懒,什么都没留下…
展开
-
清理SQL Server 2008数据库日志
清理SQL Server 2008数据库日志 收藏 第一步, 在收缩前先查看日志的大小:SELECT *FROM sysfilesWHERE name LIKE %LOG%GO转载 2010-04-15 01:25:00 · 387 阅读 · 1 评论 -
Help! My SQL Server Log File is too big!
Help! My SQL Server Log File is too big!http://www.builderau.com.au/program/sqlserver/soa/Help-My-SQL-Server-Log-File-is-too-big-/0,339028455,339292404,00.htmOver the years, I have assisted so many different clients whose transactional log file has become转载 2010-08-03 01:19:00 · 422 阅读 · 0 评论 -
Copy SQL Server Database use 'Copy Database Wizard'
<br />http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/copy-sql-server-database<br /> <br />With the type of databases thatcan be set to nightly or even weekly recovery points, the copy databasetask is ideal and a quick way to s转载 2010-08-03 16:41:00 · 244 阅读 · 0 评论 -
SQL Server数据库复制
<br />http://www.zeali.net/entry/557<br /> <br />如果数据库服务可以停下来的话,最快的方法是直接拷贝对应的 .mdf 和 .ldf 文件(在企业管理器选择数据库右键看属性的“数据文件”项确定文件名);然后执行T-SQL命令(比如新的目标数据库名为 test ):<br />-- 如果 test 数据库已经存在,需要先把其分离。<br />-- 如果已经有应用连接到该数据库的话,使用以下语句强制断开现有连接<br />ALTER DATABASE t转载 2010-08-03 16:39:00 · 170 阅读 · 0 评论 -
SQL Server Recovery Models
<br />http://databases.about.com/od/sqlserver/a/recoverymodels.htm<br />SQL Server provides three different recovery models that allow you to specify the way SQL Server manages log files and prepares your enterprise for a disaster. Each of these models rep转载 2010-06-15 23:55:00 · 390 阅读 · 0 评论 -
SQL Script to take a Microsoft Sql database online or offline
http://stackoverflow.com/questions/847076/sql-script-to-take-a-microsoft-sql-database-online-or-offline<br /><br />ALTER DATABASE database-name SET OFFLINE<br /><br />If you run the ALTER DATABASE<br />command whilst users or processes are connected, b转载 2010-08-27 15:26:00 · 177 阅读 · 0 评论 -
Backup compression in SQL Server 2008
Backup compression in SQL Server 2008 http://sqlblog.com/blogs/tibor_karaszi/archive/2007/12/12/backup-compression-in-sql-server-2008.aspxHaving a few moments to spare, I decided to give this a spin. Specifying for the backup to be compressed is re转载 2010-09-20 12:49:00 · 288 阅读 · 0 评论 -
How to get the contents of a SQL Server backup file
<br />http://www.mssqltips.com/tutorial.asp?tutorial=105<br />How to get the contents of a SQL Server backup file<br />(RESTORE HEADERONLY) <br />Overview<br />TheRESTORE HEADERONLY option allows you to see the backup header转载 2010-09-20 12:57:00 · 193 阅读 · 0 评论 -
Best Practice on limit transaction log file over grow
http://blog.sqlauthority.com/2010/05/03/sql-server-shrinkfile-and-truncate-log-file-in-sql-server-2008/UPDATE: Please follow link for SQL SERVER – SHRINKFILE and TRUNCATE Log File in SQL Server 2008.Sometime, it looks impossible to shrinkthe Tru转载 2010-09-09 01:59:00 · 286 阅读 · 0 评论 -
SQL SERVER – How to Stop Growing Log File Too Big
<br />http://blog.sqlauthority.com/<br />I was recently engaged in Performance TuningEngagement in Singapore. The organization had a huge database and hadmore than a million transactions every hour. During the assignment, Inoticed that they were trun转载 2010-09-21 12:20:00 · 297 阅读 · 0 评论 -
Kill All Active Connections To A Database
<br />http://wiki.lessthandot.com/index.php/Kill_All_Active_Connections_To_A_DatabaseJump to: navigation, search<br />Tokill all the connections to your database you can use the ALTERDATABASE command. Sometimes you want to restore the database from a转载 2010-10-06 15:12:00 · 201 阅读 · 0 评论 -
Finding a SQL Server process percentage complete with dynamic management views
http://www.mssqltips.com/tip.asp?tip=1338ProblemSome tasks that are run in SQL Sever take along time to run and it is sometimes difficult to tell whether thesetasks are progressing or not. One common way of determining thatstatus is to look at the转载 2010-10-06 18:50:00 · 200 阅读 · 0 评论 -
Truncate Log File and Pending Replication
http://www.ureader.com/msg/11604551.aspxhttp://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_23370017.htmlERROR MESSAGE:"The log was not truncated because records at the beginning of the log are pending replication. Ensur原创 2010-10-07 02:13:00 · 216 阅读 · 0 评论 -
Replication & Issue Resolution duration back up transaction log
http://www.mssqlcity.com/Articles/Replic/SetupSR/SetupSR.htmSetup Snapshot replication: step by step guideAlexander Chigrikchigrik@mssqlcity.comIntroductionGeneral conceptsReplication topologiesReplication typesReplication agentsChecking necessary conditio原创 2010-10-07 23:25:00 · 262 阅读 · 0 评论 -
Best Practice for renaming a SQL Server Database
Best Practice for renaming a SQL Server Databasehttp://www.mssqltips.com/tip.asp?tip=1891 Written By: Ashish Kumar Mehta -- 12/2/2009 -- 4 comments -- pr转载 2010-07-28 10:39:00 · 218 阅读 · 0 评论 -
Determining Backup or Restore Percent Complete in SQL Server 2008 and SQL Server 2005
Determining Backup or Restore Percent Complete in SQL Server 2008 and SQL Server 2005 If you want to see how far along your restore or backup is then转载 2010-05-11 12:54:00 · 211 阅读 · 0 评论 -
结尾日志备份
在大多数情况下,如在完成恢复模式或者大容量日志恢复模式下,SQLServer数据库要求管理员备份事务日志的结尾部分以获得尚未备份的日志记录。这个在还原操作之前对日志尾部执行的日志备份就叫做结尾日志备份。对于SQLServer数据库来说,在事务日志恢复之前进行事务日志的尾部备份是非常必要的。因为结尾日志备份作业可以防止用户修改数据的丢失并最终确保日志链的完整性。在利用事务日志将数据库恢复转载 2010-05-02 19:21:00 · 415 阅读 · 0 评论 -
SQL数据库不同备份名称存放不同路径还原方法
SQL数据库不同备份名称存放不同路径还原方法 收藏/*-------------------------------------------------------------------- Author : htl258(Tony)-- Date : 2010-04-15 22:07:01-- Version: Microsoft SQL Server 2008 (RT转载 2010-04-18 15:50:00 · 164 阅读 · 0 评论 -
数据还原到指定时间点的处理示例
--数据还原到指定时间点的处理示例--创建测试数据库CREATE DATABASE DbGO--对数据库进行备份BACKUP DATABASE Db TO DISK=转载 2010-04-18 16:19:00 · 281 阅读 · 0 评论 -
数据库还原
USE TESTINGselect* from tab2drop table tab2--备份日志BACKUP LOG TESTING TO DISK=D:/TESTING_log.bak WITH FORMATGO--接下来,我们要先还原完全备份(还原日志必须在还原完全备份的基础上进行)RESTORE DATABASE TESTING FR原创 2010-04-19 23:24:00 · 151 阅读 · 0 评论 -
SQL数据库恢复模型(日志)
----------------------------------------------------------------------1、SQL数据库恢复模型----------------------------------------------------------------------1)完全恢复模型-----------------(1)备份时要备份数据库的转载 2010-04-22 21:40:00 · 384 阅读 · 0 评论 -
Vista下sql2005附加数据库失败问题
Vista下安装SQL Server 2005/2008后,进行附加数据库错误的解决我在Vista下安装了SQL Server 2005,分离数据库后,进行附加时,发生如下错误: 提示“无法打开物理文件…………。操作系统错误 5:"5(拒绝访问。)"(Microsoft SQL Server,错误:5120) 网上很多都是说出现该问题是由于用混合验证方式登录数据库造成转载 2010-04-22 22:15:00 · 226 阅读 · 0 评论 -
Shrink SQL Server 2008 Database + Log File Script
Use DatabaseName --DB shrink--获取database 空余空间, 决定是否作shrinkDBexec [DBNAME].dbo.sp_spaceusedDBCC ShrinkDB(DBNAME) --Log file shrinkUse DatabaseNameGOAlter Database DatabaseName转载 2010-04-22 14:29:00 · 294 阅读 · 0 评论 -
sql:sql server 2005中备份模式与恢复模式的区别
恢复模式是数据库的一种特性,它控制着数据库备份和还原的基本行为.sql server 提供了三种恢复模式,他们决定了有多少和什么样的数据可以被备份下来.1.简单恢复模式 主要应用于小型数据库和不经常改变的数据2.完整恢复模式 可以在最大范围内防止出现故障时丢失数据,它包括数据库备份和食物日志备份,并提供全面保护.这个模式使用数据库和所有日志的备份恢复数据库3.大容转载 2010-04-25 23:22:00 · 179 阅读 · 0 评论 -
关于SQL Server事务日志的问题汇总
关于SQL Server事务日志的问题汇总 1、用BACKUP LOG database WITH NO_LOG清除日志把数据库属性中的故障还原模型改为"简单"可以大大减慢日志增长的速度。 如果把还原模型调到简单,这样就不支持时间点还原了,但是日志文件会很小,如果数据比较重要推荐还是把数据库的还原模型调为完全用BACKUPLOG database WITHNO_转载 2010-04-26 00:03:00 · 162 阅读 · 0 评论 -
得到数据文件与系统默认备份路径
得到系统默认备份路径: declare @path varchar(200) select @path = filename from master.dbo.sysfiles set @path = ltrim(REVERSE(@path)) s原创 2010-04-27 11:54:00 · 294 阅读 · 0 评论 -
SQL日志的概念
今天抽出一点时间解释几个关于SQL日志的概念,他们也经常使初学者望而止步,反正计算机的术语都是很抽象的,所以第一感觉就是头疼,然后然后几次后就没感觉了.以下有些是从书上摘抄的,有的是从网上找的算是借花献佛吧!! 物理日志文件: 这个比较好理解,实实在在的东西,数据库目录下面的.ldf文件就是,有些人喜欢改后缀,感觉不大好,数据库的事务日志记录就在这里面 虚拟日志:转载 2010-04-25 23:30:00 · 335 阅读 · 1 评论 -
Truncate Logs for SQL Server 2008
Truncate Logs for SQL Server 2008I had previously posted how to Truncate Logs for SQL Server 2005. Unfortunately, this method does not work in SQL Server 2008. The reason is because the “WITH TRUN转载 2010-04-25 23:56:00 · 173 阅读 · 0 评论 -
还原bak 文件
--返回由备份集内包含的数据库和日志文件列表组成的结果集RESTORE FILELISTONLY FROM DISK = d:/Northwind.bak--还原由BACKUP备份的数据库RESTORE DATABASE Northwind FROM DISK = d:/Northwind.bak --指定还原后的数据库物理文件名称及路径 (可用于clus转载 2010-04-27 12:36:00 · 278 阅读 · 0 评论 -
SQL Login 问题
当用户使用*.bak去还原时候,database 可能带有user,但这个还没有注册到login里面,可以用: EXEC sp_change_users_login Auto_Fix,username 去自动更新Login http://www.seattletech.com/forum/viewtopic.php?t=71 After the use原创 2010-04-29 12:42:00 · 257 阅读 · 0 评论 -
Knowledge - (1) SQL Log file - Shrink & Truncate
<br /><br />Question: What is a log file, and why is it required? <br />Answer: A log file is a separate file, thatstores the various transactions hitting the database. Each database hasits own log file (one or more) and this (these) log file(s) are转载 2010-10-09 15:45:00 · 243 阅读 · 0 评论