TA的每日心情 | 开心 2016-11-23 21:13 |
---|
签到天数: 3 天 连续签到: 1 天 [LV.2]偶尔看看I
注册会员
- 积分
- 66
|
网上找到一些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
-------------------------------------------------------------------------------------------
|
|