Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 05 Nov 2003 @ 20:59:51 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023