Archives of the TeradataForum
Message Posted: Wed, 05 Nov 2003 @ 20:59:51 GMT
Subj: | | Re: Archive Permissions |
|
From: | | Dan Narva |
This SQL generates 'GRANT' SQL for all databases for which ARCUSER does not already have DUMP rights. You will probably need to tailor
it to your own needs somehow, such as excluding certain databases or users from consideration. Then write a shell script that runs this SQL
as often as you like, and then runs the generated GRANT statements.
You can do the same for RESTORE statements by substituting 'RS' for 'DP' below.
SELECT 'GRANT DUMP ON ' || TRIM(DATABASENAME)
|| ' TO ARCUSER;' (TITLE '')
FROM DBC.DATABASES
WHERE DATABASENAME NOT IN
(SELECT DATABASENAME FROM DBC.ALLRIGHTS
WHERE USERNAME = 'ARCUSER'
AND ACCESSRIGHT = 'DP')
Hope this gives you a good start,
Dan Narva
Meijer
|