 |
 |
Archives of the TeradataForum
Message Posted: Thu, 28 Jun 2007 @ 15:11:38 GMT
Subj: | | Re: Question about Revoke/disable LOGON |
|
From: | | Hanson, Robert |
I use two BTEQ scripts to control the revoke and grant of logons. I run the revoke script prior to any backups or maintenance and run the
grant script when the backups or maintenance are complete.
They are as follows:
.logon tdampfe3/sysdba,xxx
.os erase prod_revoke.out
.export report file=prod_revoke.out
.set titledashes off
select 'revoke logon on all from '||trim(databasenamei)||';' (title '')
from dbc.dbase
where databasenamei not in
('dbc','crashdumps','all','default','dbcmanager','sysdba','systemfe','co
nsole','public')
and databasenamei not like 'arcuser%'
and databasename not like 'bardba%'
and rowtype = 'u'
order by databasenamei;
.export reset
.run file=prod_revoke.out
.logoff
.quit
.logon tdampfe3/sysdba,xxx
.os erase prod_grant.out
.export report file=prod_grant.out
.set titledashes off
select 'grant logon on all to '||trim(databasenamei)||';' (title '')
from dbc.dbase
where databasenamei not in
('dbc','crashdumps','all','default','dbcmanager','sysdba','systemfe','co
nsole','public')
and databasenamei not like 'arcuser%'
and databasename not like 'bardba%'
and rowtype = 'u'
order by databasenamei;
.export reset
.run file=prod_grant.out
.logoff
.quit
| |