標籤:
1.開啟PowerDesigner ——檔案——Reverse Engineer——DataBase
2.選擇所要串連資料庫版本,此處使用的是oracle version 11g。
3.點擊紅色地區,選擇資料來源
4.選擇modify
5.在此填寫你的資料庫名稱、串連地址、使用者名稱。確定
6.選擇你建立立的串連資料庫
7.填寫需要轉換為模型的資料庫的使用者名稱和密碼
8.確定即可匯出為模型
9.如果資料庫中對錶或欄位有注釋,那麼通過下面的操作,可以讓這些注釋反映在物理模型上,在查看pdm圖時更容易理解。
選擇工具——Execute Commands——Edit /Run Script
10.將11步驟中的代碼粘貼到此處,然後執行。即成功加入注釋
11. 需要執行的指令碼語言(不需要做任何修改)
Option ExplicitValidationMode = TrueInteractiveMode = im_Batch Dim mdl ‘the current model ‘get the current active modelSet mdl = ActiveModelIf (mdl Is Nothing) ThenMsgBox "There is no current Model"ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) ThenMsgBox "The current model is not an Physical Data model."ElseProcessFolder mdlEnd If ‘This routine copy name into code for each table, each column and each view‘of the current folderPrivate sub ProcessFolder(folder) Dim Tab ‘running tablefor each Tab in folder.tablesif not tab.isShortcut thenif len(tab.comment) <> 0 thentab.name = tab.commentend ifOn Error Resume NextDim col ‘running columnfor each col in tab.columnsif len(col.comment) <>0 thencol.name =col.commentend ifOn Error Resume Nextnextend ifnextend sub
Power Designer逆向工程匯入Oracle表,轉為模型加註釋