vi sox_list.sh
---------------------------
#!/bin/sh
ORACLE_SID=dbname
ORACLE_HOME=/oracle/app/oracle/product/10.2.0
TNS_ADMIN=/oracle/app/oracle/product/10.2.0/network/admin
export ORACLE_SID ORACLE_HOME TNS_ADMIN
PATH=/usr/bin:/usr/ccs/bin:.:/etc:/src:/usr/sbin:/usr/ucb:/usr/openwin/bin/xview:/usr/local/bin:/oracle/app/oracle/product/10.2.0/bin
export PATH
cd /oracle/SOX
EMAILDBA=`/usr/bin/cat /oracle/SOX/.emaildba`; export EMAILDBA
sqlplus -s sox_audit/sox_audit @userlist_himes.sql
/usr/bin/cat userlist_himes.lst /usr/bin/mailx -s "SOX Uerlist" myemail@gmail.com
/usr/bin/cat userlist_himes.lst /usr/bin/mailx -s "SOX Uerlist" myemail1@gmail.com
/usr/bin/cat userlist_himes.lst /usr/bin/mailx -s "SOX Uerlist" myemail2@gmail.com
vi "userlist_himes.sql"
-------------------------------
spool userlist_himes.lst
set linesize 150
set pagesize 1000
set heading off
SELECT TO_CHAR(sysdate,'DD-MON-YYYY HH24:MI:SS') from dual;
select name from v$database;
set heading on
break on username skip 1
select a.USERNAME,a.ACCOUNT_STATUS,a.PROFILE, b.granted_role from dba_users a, dba_role_privs b
where a.USERNAME=b.GRANTEE
order by username,granted_role;
spool off
exit
No comments:
Post a Comment