通過Lotusscript代碼從損壞的資料庫中抽取資料

來源:互聯網
上載者:User
文章目錄
  • 問題:
問題:

在某些少見的情況下,一個Notes/Domino資料庫可能因為損壞而無法正常開啟。但當你用
notespeek或者其他工具檢查這個資料庫的時候,發現其中的文檔看起來還是完好無損的。然而你
使用"fixup", "updall -r" 或者"compact" 卻無法修複此問題。有其他方法可以恢複這些文檔並
且可以訪問這些文檔嗎?

回答:

資料庫損壞後,根據損壞的程度以及損壞的類型,有可能可以通過lotusscript代理把那些
文檔從損壞的資料庫拷貝到另一個新的資料庫。如果這損壞的部分只是影響這個資料庫的設計,
那麼這些文檔是可以恢複的。

舉例來說,如果一個使用者的郵件檔案不能被Notes用戶端開啟,你就可以根據他所使用的模版來創
建一個新的郵件資料庫。接著寫一個代理來把這個損壞的資料庫中的文檔拷貝到這個新的郵件數
據庫中。這個代理代碼附在後面。
注意:這個指令碼代碼只是一個處理資料庫損壞的方法,在運行之前,你應當嘗試其他的方法(見後)

代理程式碼範例:

1. 建立一個手工執行的代理在任一個資料庫。

2. 使用下面的範例代碼,並執行,

Sub Initialize
Dim s As New notessession
'Change "" in the next line to the appropriate server name if the database is not local.
Dim srcdb As New notesdatabase("","badfile.nsf") 'replace "badfile.nsf" with the name of the corrupted db
Dim newdb As New notesdatabase("","newfile.nsf") 'replace "newfile.nsf" with the name of the new db
Dim coll As notesdocumentcollection
Dim doc As notesdocument
Set coll=srcdb.alldocuments
For i = 1 To coll.count
Set doc=coll.getnthdocument(i)
Call doc.copytodatabase(newdb)
Next
End Sub

其他可能的解決方案:

-- 嘗試通過log.nsf, 來定位那些損壞的某個文檔或者設計項目,然後拷貝並粘貼這些文檔或元
素到這個資料庫中。
-- 為這個資料庫建立一個副本或著新拷貝。
-- 運行"fixup", "updall -r", 或者"compact" 。
-- 如果這個資料庫有全文索引,可以嘗試刪除並重新建立全文索引。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.