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 表空间相关参数

 

create table MAMS_AMDAYINDEX
(
  amdayindexid       VARCHAR2(25) not null,
  indexdate          VARCHAR2(10),
  amuid              VARCHAR2(10),
  nomonfundsales     NUMBER(18,2),
  ppiperiodamt       NUMBER(18,2),
)
tablespace TBS_DEPT		-- 表段MAMS_AMDAYINDEX放在表空间TBS_DEPT中
  pctfree 10			-- 块保留10%空间留给更新该块数据使用
  initrans 1			-- 初始化事务槽个数
  maxtrans 255			-- 最大事务槽个数
  storage			-- 存储参数
  (
    initial 16			-- 区段(extent)一次扩展16
    minextents 1		-- 最小区段数
    maxextents unlimited	-- 最大区段数
  );


pctfree 10,比如一个数据块插入数据直到还剩余10%的空间就不再插入,留下10%用做将来数据更新使用(因为存在可变长度的字段)。这样可以防止迁移行和链接行出现
initrans,maxtrans  表示可以再一个数据块上并发操作的事务槽个数,最大个数
minextents,maxextents  表示可以给该表分配区段的最小最大个数

 

 

 

 

在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

 

 

 

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值