Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 15 Jan 2010 @ 17:13:52 GMT


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


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 ...


     
  <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