power designer 16.5 使用總結[轉]


測試環境:power designer 16.5、vs2010、win7

對於破解版的power designer經常出現崩潰、停止工作的情況

請運行pdlegacyshell16.exe,不要運行PdShell16.exe

一、如何調試power designer中的vbs

1.修改注冊HKEY_CURRENT_USER\Software\Microsoft\WindowsScript\Settings,將值改為1

2.在要調試的vbs腳本中插入Stop語句

3.啟動power designer,選擇Tools -> Execute Commands -> Edit/Run Script,打開要步驟2中的腳本執行,當執行到Stop語句時,就會觸發vs2010調試該腳本

 

 

二、添加oracle 表空間相關參數

 

 1 create table MAMS_AMDAYINDEX
 2 (
 3 amdayindexid VARCHAR2(25) not null,
 4 indexdate VARCHAR2(10),
 5 amuid VARCHAR2(10),
 6 nomonfundsales NUMBER(18,2),
 7 ppiperiodamt NUMBER(18,2),
 8 )
 9 tablespace TBS_DEPT    -- 表段MAMS_AMDAYINDEX放在表空間TBS_DEPT中
10 pctfree 10    -- 塊保留10%空間留給更新該塊數據使用
11 initrans 1    -- 初始化事務槽個數
12 maxtrans 255    -- 最大事務槽個數
13 storage    -- 存儲參數
14 (
15 initial 16    -- 區段(extent)一次擴展16
16 minextents 1    -- 最小區段數
17 maxextents unlimited    -- 最大區段數
18 );
19 
20 pctfree 10,比如一個數據塊插入數據直到還剩余10%的空間就不再插入,留下10%用做將來數據更新使用(因為存在可變長度的字段)。這樣可以防止遷移行和鏈接行出現
21 initrans,maxtrans  表示可以再一個數據塊上並發操作的事務槽個數,最大個數
22 minextents,maxextents  表示可以給該表分配區段的最小最大個數
23 
24  

 

 

 

 

在powerdesigner 16.5中添加以上參數

1.雙擊表,彈出table properties窗口
2.選擇標簽頁physical options,注意不是 physical options(Common)
3.在左邊折疊樹找到<physical_properties>,<segment_attributes_clause>,在pctfree,initrans,<deprecated>maxtrans,<storage>,initial,minextents,maxextents,tablespace。選擇到右邊即可
4.選中pctfree在右下角有設置值大小的輸入欄
5.在preview檢查sql參數是否生效

在標簽頁physical options左下角有一個apply to,可以設置一次性應用到其他表格

 

三、取消oracle中的大小寫敏感(取消oracle的雙引號)

Database -> Edit Current DBMS -> General -> Script -> Sql -> Format -> CaseSensitivityUsingQuote -> No

 

四、關閉name自動復制到code

Tools -> General Options -> Dialog -> Operating modes -> Name to Code mirroring -> 取消打鈎

 

五、幾個有用的腳本

 

將comment字段復制到name字段,在逆向工程數據庫時,將注釋寫到name上

 

'******************************************************************************
'* File: CopyComment2Name.vbs
'* Title: Copy Comment to Name Conversion
'* Purpose: To update existing objects in your model with your current naming
'* standards based in your model options by executing the Comment to Name.
'*
'* Model: Physical Data Model
'* Objects: Table, Column, View
'* Category: Naming Standards
'* Author: Tang Tao
'* Created: Apr 11, 2017
'* Mod By: 
'* Modified: 
'* Version: 1.0
'* Comment: 
'* v1.0 - Must have Conversion Tables assigned as a model option and
'* turn on Enable Name/Comment Conversion
'******************************************************************************
Option Explicit
ValidationMode = True
InteractiveMode = im_Batch
' the current model
Dim mdl

' get the current active model
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "There is no current Model "
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
MsgBox "The current model is not an Physical Data model. "
Else
ProcessFolder mdl
End If
Private sub ProcessFolder(folder)
'On Error Resume Next
'running table
Dim tab
for each tab in folder.tables
if not tab.isShortcut then
if tab..Comment <> "" then
tab.Name = tab.Comment
end if
' running column
Dim col
for each col in tab.columns
if col.Comment <> "" and not col.Replica then
col.Name= col.Comment
end if
next
end if
next
'running view
Dim view
for each view in folder.Views
if not view.isShortcut then
view.Name = view.Comment
end if
next

' go into the sub-packages
' running folder
Dim f
For Each f In folder.Packages
if not f.IsShortcut then
ProcessFolder f
end if
Next
end sub

將name字段復制到comment字段,在設計物理模型時,不需要輸入兩次。

 

 

'******************************************************************************
'* File: CopyName2Comment.vbs
'* Title: Copy Name to Comment Conversion
'* Purpose: To update existing objects in your model with your current naming
'* standards based in your model options by executing the Name To Comment.
'*
'* Model: Physical Data Model
'* Objects: Table, Column, View
'* Category: Naming Standards
'* Author: Tang Tao
'* Created: Apr 11, 2017
'* Mod By: 
'* Modified: 
'* Version: 1.0
'* Comment: 
'* v1.0 - Must have Conversion Tables assigned as a model option and
'* turn on Enable Name/Comment Conversion
'******************************************************************************
Option Explicit
ValidationMode = True
InteractiveMode = im_Batch

'the current model
Dim mdl

'get the current active model
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "There is no current Model "
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
MsgBox "The current model is not an Physical Data model. "
Else
ProcessFolder mdl
End If

Private sub ProcessFolder(folder)
'On Error Resume Next
'running table
Dim tab
for each tab in folder.tables
if not tab.isShortcut then
tab.Comment = tab.Name
'running column
Dim col
for each col in tab.Columns
if col.Name<>"" and not col.Replica then
col.Comment = col.Name
end if
next
end if
next

'running view
Dim view
for each view in folder.Views
if not view.isShortcut then
view.Comment = view.Name
end if
next

'go into the sub-packages
'running folder
Dim f 
For Each f In folder.Packages
if not f.IsShortcut then
ProcessFolder f
end if
Next
end sub
 

 

---------------------
作者:tangtao_xp
來源:CSDN
原文:https://blog.csdn.net/tangtao_xp/article/details/70842063


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM