#!/bin/ksh
# This script assigns the user (CFGADM) that will be used in oracle to access tables in APEX
# M. Culp
# 11/06/2010
# 01/04/2010 Made changes to reflect the LS commands
# 02/03/2010
# This should give access to the user in APEX that this is going against
#  
#######################################################################################################

sqlplus -s "/ as sysdba" <<EOF

grant exempt access policy to cfgadm;
grant sysdba to cfgadm;
grant select_catalog_role to cfgadm;
grant create session to cfgadm;
grant select on DBA_HIST_DATABASE_INSTANCE to cfgadm;
grant select on DBA_HIST_SNAPSHOT to cfgadm;
grant select on DBA_HIST_SNAP_ERROR to cfgadm;
grant select on DBA_HIST_BASELINE to cfgadm;
grant select on DBA_HIST_WR_CONTROL to cfgadm;
grant select on DBA_HIST_DATAFILE to cfgadm;
grant select on DBA_HIST_FILESTATXS to cfgadm;
grant select on DBA_HIST_TEMPFILE to cfgadm;
grant select on DBA_HIST_TEMPSTATXS to cfgadm;
grant select on DBA_HIST_SQLSTAT to cfgadm;
grant select on DBA_HIST_SQLTEXT to cfgadm;
grant select on DBA_HIST_SQL_SUMMARY to cfgadm;
grant select on DBA_HIST_SQL_PLAN to cfgadm;
grant select on DBA_HIST_SQLBIND to cfgadm;
grant select on DBA_HIST_OPTIMIZER_ENV to cfgadm;
grant select on DBA_HIST_EVENT_NAME to cfgadm;
grant select on DBA_HIST_SYSTEM_EVENT to cfgadm;
grant select on DBA_HIST_BG_EVENT_SUMMARY to cfgadm;
grant select on DBA_HIST_WAITSTAT to cfgadm;
grant select on DBA_HIST_ENQUEUE_STAT to cfgadm;
grant select on DBA_HIST_LATCH_NAME to cfgadm;
grant select on DBA_HIST_LATCH to cfgadm;
grant select on DBA_HIST_LATCH_CHILDREN to cfgadm;
grant select on DBA_HIST_LATCH_PARENT to cfgadm;
grant select on DBA_HIST_LATCH_MISSES_SUMMARY to cfgadm;
grant select on DBA_HIST_LIBRARYCACHE to cfgadm;
grant select on DBA_HIST_DB_CACHE_ADVICE to cfgadm;
grant select on DBA_HIST_BUFFER_POOL_STAT to cfgadm;
grant select on DBA_HIST_ROWCACHE_SUMMARY to cfgadm;
grant select on DBA_HIST_SGA to cfgadm;
grant select on DBA_HIST_SGASTAT to cfgadm;
grant select on DBA_HIST_PGASTAT to cfgadm;
grant select on DBA_HIST_RESOURCE_LIMIT to cfgadm;
grant select on DBA_HIST_SHARED_POOL_ADVICE to cfgadm;
grant select on DBA_HIST_SQL_WORKAREA_HSTGRM to cfgadm;
grant select on DBA_HIST_PGA_TARGET_ADVICE to cfgadm;
grant select on DBA_HIST_INSTANCE_RECOVERY to cfgadm;
grant select on DBA_HIST_JAVA_POOL_ADVICE to cfgadm;
grant select on DBA_HIST_THREAD to cfgadm;
grant select on DBA_HIST_STAT_NAME to cfgadm;
grant select on DBA_HIST_SYSSTAT to cfgadm;
grant select on DBA_HIST_SYS_TIME_MODEL to cfgadm;
grant select on DBA_HIST_OSSTAT_NAME to cfgadm;
grant select on DBA_HIST_OSSTAT to cfgadm;
grant select on DBA_HIST_PARAMETER_NAME to cfgadm;
grant select on DBA_HIST_PARAMETER to cfgadm;
grant select on DBA_HIST_WAITCLASSMET_HISTORY to cfgadm;
grant select on DBA_HIST_DLM_MISC to cfgadm;
grant select on DBA_HIST_CR_BLOCK_SERVER to cfgadm;
grant select on DBA_HIST_CURRENT_BLOCK_SERVER to cfgadm;
grant select on DBA_HIST_ACTIVE_SESS_HISTORY to cfgadm;
grant select on DBA_HIST_TABLESPACE_STAT to cfgadm;
grant select on DBA_HIST_LOG to cfgadm;
grant select on DBA_HIST_MTTR_TARGET_ADVICE to cfgadm;
grant select on DBA_HIST_TBSPC_SPACE_USAGE to cfgadm;
grant select on DBA_HIST_SERVICE_NAME to cfgadm;
grant select on DBA_HIST_SERVICE_STAT to cfgadm;
grant select on DBA_HIST_SERVICE_WAIT_CLASS to cfgadm;
grant select on DBA_HIST_SNAPSHOT to cfgadm;
grant select on DBA_SEGMENTS to cfgadm;
grant select on DBA_OUTSTANDING_ALERTS to cfgadm;
grant select on DICTIONARY to cfgadm;
grant select on DBA_REGISTRY to cfgadm;
grant select on DBA_HIST_COMP_IOSTAT to cfgadm;
grant select on DBA_HIST_UNDOSTAT to cfgadm;

grant select on DBA_VIEWS to cfgadm;
grant select on DBA_DB_LINKS to cfgadm;

grant select on DBA_TABLES to cfgadm;

grant select on v_\$session to cfgadm;
grant select on v_\$sqlarea to cfgadm;
grant select on v_\$sql_plan to cfgadm;
grant select on v_\$database to cfgadm;
grant select on v_\$instance to cfgadm;
grant select on v_\$datafile_copy to cfgadm;
grant select on v_\$parameter to cfgadm;
grant select on v_\$spparameter to cfgadm;
grant select on v_\$asm_disk to cfgadm;
grant select on v_\$asm_diskgroup to cfgadm;
grant select on v_\$system_fix_control to cfgadm;
grant select on gv_\$parameter to cfgadm;
grant select on gv_\$event_histogram to cfgadm;
grant select on sysman.BHV_SERVER_DETAILS to cfgadm;
grant select on sysman.MGMT_TARGETS to cfgadm;
grant select on sysman.MGMT_TABLE_SIZES to cfgadm;
grant select on sysman.MGMT_TARGET_CREDENTIALS to cfgadm;

EOF

Ready for Action?

LET'S GO!
Copyright 2024 IT Remote dot com
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram