Archives of the TeradataForum
Message Posted: Fri, 15 Jan 2010 @ 17:13:52 GMT
Subj: | | Re: Merging user/rights from two machine onto one |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Friday, January 15, 2010 11:22 -->
I would do it using what I think you are calling the "long-winded" way. Reverse engineer the appropriate GRANT statements from the source
system and run them on the target.
SELECT 'GRANT '
|| CASE AccessRight
WHEN 'D' THEN 'DELETE'
WHEN 'DP' THEN 'DUMP'
WHEN 'DT' THEN 'DROP TABLE'
WHEN 'I' THEN 'INSERT'
WHEN 'IX' THEN 'INDEX'
WHEN 'R' THEN 'SELECT'
WHEN 'RF' THEN 'REFERENCES'
WHEN 'RS' THEN 'RESTORE'
WHEN 'U' THEN 'UPDATE'
ELSE 'UNKNOWN_'||AccessRight
END
||' ON '||TRIM(TableName)||' TO '
|| CASE AllnessFlag WHEN 'Y' THEN 'ALL ' ELSE '' END
|| TRIM(UserName)
|| CASE GrantAuthority WHEN 'Y' THEN ' WITH GRANT OPTION' ELSE '' END
||';'
FROM dbc.allrights
WHERE ...
|