创建Oracle 12c及以后版本CDB模式监控用户脚本:
CREATE USER “C##ONEKEEPER” IDENTIFIED BY “Onek11per”;
alter user “C##ONEKEEPER” set containerdata=all container=current;
grant “CONNECT” to “C##ONEKEEPER” container=all;
grant select on cdb_alert_history to “C##ONEKEEPER” container=all;
grant select on cdb_alert_history to “C##ONEKEEPER” container=all;
grant select on cdb_data_files to “C##ONEKEEPER” container=all;
grant select on cdb_jobs to “C##ONEKEEPER” container=all;
grant select on cdb_objects to “C##ONEKEEPER” container=all;
grant select on cdb_sys_privs to “C##ONEKEEPER” container=all;
grant select on cdb_tab_privs to “C##ONEKEEPER” container=all;
grant select on cdb_tablespace_usage_metrics to “C##ONEKEEPER” container=all;
grant select on cdb_tablespaces to “C##ONEKEEPER” container=all;
grant select on cdb_users to “C##ONEKEEPER” container=all;
grant select on dba_hist_snapshot to “C##ONEKEEPER” container=all;
grant select on dba_hist_tbspc_space_usage to “C##ONEKEEPER” container=all;
grant select on v$archivedest to “C##ONEKEEPER” container=all;
grant select on v$archivedlog to “C##ONEKEEPER” container=all;
grant select on v$asmdiskgroup to “C##ONEKEEPER” container=all;
grant select on v$consys_time_model to “C##ONEKEEPER” container=all;
grant select on v$consysstat to “C##ONEKEEPER” container=all;
grant select on v$dispatcher to “C##ONEKEEPER” container=all;
grant select on v$instance to “C##ONEKEEPER” container=all;
grant select on v$latch to “C##ONEKEEPER” container=all;
grant select on v$latch_children to “C##ONEKEEPER” container=all;
grant select on v$log to “C##ONEKEEPER” container=all;
grant select on v$memory_dynamic_components to “C##ONEKEEPER” container=all;
grant select on v$parameter to “C##ONEKEEPER” container=all;
grant select on v$pdbs to “C##ONEKEEPER” container=all;
grant select on v$pxsession to “C##ONEKEEPER” container=all;
grant select on v$resourcelimit to “C##ONEKEEPER” container=all;
grant select on v$rmanstatus to “C##ONEKEEPER” container=all;
grant select on v$session to “C##ONEKEEPER” container=all;
grant select on v$sgastat to “C##ONEKEEPER” container=all;
grant select on v$sharedserver to “C##ONEKEEPER” container=all;
grant select on v$systime_model to “C##ONEKEEPER” container=all;
grant select on v$sysstat to “C##ONEKEEPER” container=all;
grant select on v$system_event to “C##ONEKEEPER” container=all;
grant select on v$tablespace to “C##ONEKEEPER” container=all;