空间保证足够,还有100G可用空间,而且也是NTFS格式。并且之前备份也是成功过的,也是放在该盘上的。
我想完全备份操作的兼容性应该很强,跟其它进程的冲突可能性应该很小才对呀。

解决方案 »

  1.   

            private void KillSPID(string DBName) 
            { 
                string strDBName = DBName; 
                string strSQL = String.Empty, strSQLKill = String.Empty; 
                //因为DataReader独占连接,本程序需要两个Connection,并且连接的数据库是master,所以要初始化新的连接字符串 
                string tmpConnectionString = "Data Source=localhost;Integrated Security=SSPI;Initial Catalog=master;";             try 
                { 
                    SqlConnection TmpConn = new SqlConnection(); 
                    SqlConnection conn = new SqlConnection(); 
                    TmpConn.ConnectionString = tmpConnectionString; 
                    conn.ConnectionString = tmpConnectionString; 
                    TmpConn.Open(); 
                    conn.Open();                 //读取连接当前数据库的进程 
                    strSQL = "select spid from master..sysprocesses where dbid=db_id('" + strDBName + "')"; 
                    SqlCommand mycmd = new SqlCommand(strSQL, TmpConn); 
                    SqlDataReader mydr = mycmd.ExecuteReader();                 //开取杀进程的数据连接 
                    SqlCommand mycmd1 = new SqlCommand(); 
                    mycmd1.Connection = conn;                 while (mydr.Read()) 
                    { 
                        strSQLKill = "kill " + mydr["spid"].ToString(); 
                        mycmd1.CommandText = strSQLKill; 
                        mycmd1.CommandType = CommandType.Text; 
                        mycmd1.ExecuteNonQuery(); //杀进程 
                    } 
                    mydr.Close(); 
                    TmpConn.Close(); 
                    conn.Close(); 
                } 
                catch (Exception Err) 
                { 
                    MessageBox.Show(Err.Message); 
                } 
            } 
      

  2.   

    c# 的东东吧,其实我还有T-SQL 的杀进程的代码呢。其实我就想知道是什么原因造成失败,处理的方法有哪些。我尝试过调整完全备份时间来实现的,但是仍然结果一样的不成功,错误提示也一样。
      

  3.   

    既然是OS level的进程, 偶估计你根本没法在SQL里杀死的.你的备份是不是写进了一个压缩的文件夹呀??
      

  4.   

    确实, 很多大的数据库在压缩后会变得很小, 但你的方法是绝对不行的 -- 备份和压缩同时进行在OS level.不过, 你可以用一些第三方的软件, 比如: Red Gate, LiteSpeed, SQLsafe等, 都能用压缩的方式进行备份. (但不是OS level的!!)偶们的170GB的数据库, 备份后是55GB!! -- 看看压了多少.