找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 3895|回复: 4

QAD数据库管理

[复制链接]
  • TA的每日心情
    开心
    2016-11-23 21:13
  • 签到天数: 3 天

    连续签到: 1 天

    [LV.2]偶尔看看I

    2

    主题

    3

    回帖

    66

    积分

    注册会员

    积分
    66
    发表于 2016-11-19 20:35:53 | 显示全部楼层 |阅读模式

    网上找到一些QAD数据库的管理方法,供参考。

    1.1 查询数据库用户情况.查看用户名和密码。

    for each _user :
    disp _user._userid  _User._user-name _user._password.
    end.


    1.2查看数据库角色授权情况,查看用户所属组别。


    for each sysprogress.SYSDBAUTH:
    disp _sysdbauth with 3 col.
    end.




    1.3 查看数据表授权情况。


    for each _file no-lock where _hidden = no:
      display   _tbl-type  _file-name   _can-read _can-write  _can-create  _can-delete.
    end.

    查看数据表授权情况
    FOR EACH _file WHERE (_file._tbl-type  = "T" OR  _file._tbl-type  = "S") and _owner ="PUB":
    DISP _file-name  _file._CAN-READ  _file._CAN-DELETE with 3 col .
    END.


    ---------------------------------------------------------------------------------------------


    2.1修改数据库用户密码

    for each _user where  _userid = "sysprogress":
    ASSIGN  _user._Password = ENCODE("password").
    end.

    2.2 给每一个数据表授权命令。

    FOR EACH _file WHERE (_file._tbl-type= "T" OR _file._tbl-type= "S" ) and _owner = "PUB":
    ASSIGN
    _file._CAN-READ= "*"
    _file._CAN-WRITE= "*"
    _file._CAN-CREATE= "*"
    _file._CAN-DELETE= "*".
    END.



    2.3 创建用户,并生成SQL命令授权数据表给该用户,仅限于 类型为T类型的表。

    DEFINE VAR IN_User AS CHARACTER.
    DEFINE VAR IN_Name AS CHARACTER.
    DEFINE VAR IN_Password AS CHARACTER.

    /* Get user ID, name and password */

    UPDATE IN_User IN_Name IN_Password.

    /* Create user for the Data Admin  */

    CREATE _User.
    ASSIGN
    _User._Userid = IN_User
    _User._User-Name = IN_Name
    _User._Password = ENCODE(IN_Password).

    /* Create SQL script */

    OUTPUT TO GRANT_SQL.SQL .

    FOR EACH _file WHERE _Tbl-Type = "T" :
        PUT UNFORMATTED 'grant SELECT ON PUB.' + '"' + _file-name + '"' ' to ' + IN_USER + ';' SKIP .
    END.
    PUT UNFORMATTED "commit;" .

    OUTPUT CLOSE.
    ----------------------------------------------------

    2.5创建一个Progress数据库用户--方法1-密码为空

    FIND FIRST _user WHERE _userid = "SYSPROGRESS" NO-ERROR.
    DELETE _user.
    CREATE _user.
    ASSIGN
       _user._userid   = "SYSPROGRESS"
       _user._Password = ENCODE("").

    This code deletes the old SYSPROGRESS and recreates it with blank password.


    2.6创建一个Progress数据库用户-方法2

    Alternatively, create the sysprogress user programmatically by running 4GL/ABL procedure similar to the following:

    DEFINE VARIABLE cUserName AS CHARACTER   NO-UNDO.

    DEFINE VARIABLE cPassword AS CHARACTER   NO-UNDO.

    ASSIGN

       cUserName = "sysprogress"

       cPassword = ENCODE("Your_Sysprogress_Password").

    /* Delete the sysprogress user record if it exists */

    FIND _User WHERE _User._Userid = "sysprogress" EXCLUSIVE-LOCK NO-WAIT NO-ERROR.

    IF AVAILABLE _User THEN

       DELETE _User.

    /* Create the sysprogress user record */

    CREATE _User.

    ASSIGN

       _userid   = cUserName

       _password = cPassword

    -------------------------------------------------------------------------------------------

    2.7创建一个Progress数据库用户-方法3--dump


    Follow is what i did which may be useful to others

    I logged in DatabaseAdministration with blank User ID and Password

    Dump data content to .d file using "Dump Data Definition -> Table Contents" in Admin menu

    then edited the .d file removed existing users and added one new user details

    "SYSPROGRESS" "pjqtudckibycRKbj" "" ?

    then i inserted back the data contents with "Load Data Definition -> Table Contents" in Admin Menu and restarted the Data administration and
    succeed using sysprogress as login id with blank password


    -------------------------------------------------------------------------------------------


    大家好啊
  • TA的每日心情
    奋斗
    前天 14:48
  • 签到天数: 1716 天

    连续签到: 2 天

    [LV.Master]伴坛终老

    745

    主题

    1142

    回帖

    3万

    积分

    管理员

    进击的思考者

    积分
    39187
    发表于 2016-11-20 21:49:40 | 显示全部楼层
    非常赞的分享。
    该会员没有填写今日想说内容.
    回复

    使用道具 举报

  • TA的每日心情
    慵懒
    2017-1-24 08:19
  • 签到天数: 4 天

    连续签到: 3 天

    [LV.2]偶尔看看I

    2

    主题

    10

    回帖

    95

    积分

    注册会员

    积分
    95
    发表于 2017-1-24 09:10:25 | 显示全部楼层
    繁琐。新的EE版本如果也是这样那就疯狂了。。。
    该会员没有填写今日想说内容.
    回复

    使用道具 举报

  • TA的每日心情
    开心
    昨天 08:43
  • 签到天数: 3007 天

    连续签到: 1 天

    [LV.Master]伴坛终老

    1107

    主题

    1928

    回帖

    4万

    积分

    论坛元老

    积分
    49387
    发表于 2017-12-6 17:40:49 | 显示全部楼层
    谢谢大大分享
    该会员没有填写今日想说内容.
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2024-2-1 09:08
  • 签到天数: 100 天

    连续签到: 2 天

    [LV.6]常住居民II

    21

    主题

    143

    回帖

    1554

    积分

    金牌会员

    积分
    1554
    发表于 2022-3-9 16:05:20 | 显示全部楼层
    赞一个 干货分享
    该会员没有填写今日想说内容.
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|手机版|小黑屋|百度统计|OpenEdgeStudy快乐学习 ( 沪ICP备15012660号 )

    GMT+8, 2024-4-17 05:04 , Processed in 1.103817 second(s), 22 queries .

    Powered by Discuz! X3.5 Licensed

    © 2001-2023 Discuz! Team.

    快速回复 返回顶部 返回列表