⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 收缩数据库.txt

📁 收缩SQL2000数据库以及一个树型结构的搜索算法.
💻 TXT
字号:
我的操作是在查询分析器中完成,操作方法如下:

1、DUMP TRANSACTION DataBase_Name WITH NO_LOG

2、BACKUP LOG DataBase_Name  WITH NO_LOG  

3、DBCC SHRINKDATABASE(DataBase_Name)

三步分别做的工作是:

1:清空日志
2:截断事务日志
3:收缩数据库


procedure TFormDianZiZiLiao.BitBtn8Click(Sender: TObject);

begin

    dxDBTreeView2.DisplayField := 'ID';
    SetChildStates(dxDBTreeView2.DBSelected);
    dxDBTreeView2.DisplayField := '标题';

end;

procedure TFormDianZiZiLiao.SetChildStates(Node: TTreeNode);
var
  ChildNode:TTreeNode;

begin
  if Node = nil then Exit;
  ChildNode:= Node.getFirstChild;
  while ChildNode <> nil do
  begin
    memo2.Lines.Add(ChildNode.Parent.Text +'---' +ChildNode.Text);
    if ChildNode.HasChildren then
       SetChildStates(ChildNode);
    ChildNode:=Node.GetNextChild(ChildNode);
  end;
end;


procedure TFormDianZiZiLiao.cxDBRichEdit1PropertiesSelectionChange(
  Sender: TObject);
begin
  with cxDBRichEdit1.Paragraph do
  try
   // FUpdating := True;
   // FirstInd.Left := Trunc(FirstIndent*RulerAdj)-4+GutterWid;
   // LeftInd.Left := Trunc((LeftIndent+FirstIndent)*RulerAdj)-4+GutterWid;
  //  RightInd.Left := Ruler.ClientWidth-6-Trunc((RightIndent+GutterWid)*RulerAdj);
    BoldButton.Down := fsBold in cxDBRichEdit1.SelAttributes.Style;
    ItalicButton.Down := fsItalic in cxDBRichEdit1.SelAttributes.Style;
    UnderlineButton.Down := fsUnderline in cxDBRichEdit1.SelAttributes.Style;
    BulletsButton.Down := Boolean(Numbering);
    FontSize.Text := IntToStr(cxDBRichEdit1.SelAttributes.Size);
    FontName.Text := cxDBRichEdit1.SelAttributes.Name;
    case Ord(Alignment) of
      0: LeftAlign.Down := True;
      1: RightAlign.Down := True;
      2: CenterAlign.Down := True;
    end;
   // UpdateCursorPos;
  finally
    //FUpdating := False;
  end;
end;

function TFormDianZiZiLiao.CurrText: TTextAttributes;
begin
  if cxDBRichEdit1.SelLength > 0 then Result := cxDBRichEdit1.SelAttributes
  else Result := cxDBRichEdit1.DefAttributes;
end;

procedure TFormDianZiZiLiao.BoldButtonClick(Sender: TObject);
begin
  if BoldButton.Down then
    CurrText.Style := CurrText.Style + [fsBold]
  else
    CurrText.Style := CurrText.Style - [fsBold];
end;

procedure TFormDianZiZiLiao.ItalicButtonClick(Sender: TObject);
begin
  if ItalicButton.Down then
    CurrText.Style := CurrText.Style + [fsItalic]
  else
    CurrText.Style := CurrText.Style - [fsItalic];
end;

procedure TFormDianZiZiLiao.UnderlineButtonClick(Sender: TObject);
begin
  if UnderlineButton.Down then
    CurrText.Style := CurrText.Style + [fsUnderline]
  else
    CurrText.Style := CurrText.Style - [fsUnderline];
end;

procedure TFormDianZiZiLiao.LeftAlignClick(Sender: TObject);
begin
  cxDBRichEdit1.Paragraph.Alignment := TAlignment(TControl(Sender).Tag);
end;

procedure TFormDianZiZiLiao.BulletsButtonClick(Sender: TObject);
begin
  cxDBRichEdit1.Paragraph.Numbering := TNumberingStyle(BulletsButton.Down);
end;

procedure TFormDianZiZiLiao.FontSizeChange(Sender: TObject);
begin
  CurrText.Size := StrToInt(FontSize.Text);
end;

procedure TFormDianZiZiLiao.FontNameChange(Sender: TObject);
begin
  CurrText.Name := FontName.Items[FontName.ItemIndex];
end;

procedure TFormDianZiZiLiao.GetFontNames;
function EnumFontsProc(var LogFont: TLogFont; var TextMetric: TTextMetric;
  FontType: Integer; Data: Pointer): Integer; stdcall;
begin
  TStrings(Data).Add(LogFont.lfFaceName);
  Result := 1;
end;
var
  DC: HDC;
begin
  DC := GetDC(0);
  EnumFonts(DC, nil, @EnumFontsProc, Pointer(FontName.Items));
  ReleaseDC(0, DC);
  FontName.Sorted := True;
end;


procedure TFormDianZiZiLiao.ToolButton1Click(Sender: TObject);
begin
    //
    if  FontDialog1.Execute then
    begin
        FontName.Text := FontDialog1.Font.Name;
        FontSize.Text := inttoStr(FontDialog1.Font.Size);
        CurrText.Name := FontDialog1.Font.Name;
        CurrText.Style := FontDialog1.Font.Style;
        CurrText.Color  := FontDialog1.Font.Color;
  //      CurrText.
    end;

end;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -