create pluggable database zabbix admin user zbx_admin identified by "system" file_name_convert=( 'ORCLCDB','ZABBIX');
alter pluggable database zabbix open;
alter pluggable database all save state;
alter session set container=zabbix;
To create Oracle user with required privileges, run:
CREATE USER zbx_monitor IDENTIFIED BY "zbx%xxxxxx%";
-- Grant access to the zbx_monitor user.
grant connect, create session to zbx_monitor;
grant select any dictionary to zbx_monitor;
grant select on dba_tablespace_usage_metrics to zbx_monitor;
grant select on dba_tablespaces to zbx_monitor;
grant select on dba_users to zbx_monitor;
grant select on sys.dba_data_files to zbx_monitor;
grant select on v_$active_session_history to zbx_monitor;
grant select on v_$archive_dest to zbx_monitor;
grant select on v_$asm_diskgroup to zbx_monitor;
grant select on v_$database to zbx_monitor;
grant select on v_$datafile to zbx_monitor;
grant select on v_$event_name to zbx_monitor;
grant select on v_$instance to zbx_monitor;
grant select on v_$log to zbx_monitor;
grant select on v_$osstat to zbx_monitor;
grant select on v_$pgastat to zbx_monitor;
grant select on v_$process to zbx_monitor;
grant select on v_$recovery_file_dest to zbx_monitor;
grant select on v_$recovery_file_dest to zbx_monitor;
grant select on v_$restore_point to zbx_monitor;
grant select on v_$session to zbx_monitor;
grant select on v_$sgastat to zbx_monitor;
grant select on v_$sysmetric to zbx_monitor;
grant select on v_$system_event to zbx_monitor;
grant select on v_$system_parameter to zbx_monitor;
grant unlimited tablespace to zbx_monitor;
create profile ZABBIX limit PASSWORD_LIFE_TIME unlimited;
alter user zbx_monitor profile ZABBIX;
alter profile ZABBIX limit PASSWORD_LIFE_TIME unlimited;
set linesize 500
col resource_name for a30
col resource_type for a20
col profile for a20
col limit for a20
select * from dba_profiles where profile='ZABBIX' and resource_name='PASSWORD_LIFE_TIME';
接続確認
$ vi /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/tnsnames.ora << __EOF__
ZABBIX =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.18.211)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zabbix.world)
)
)
__EOF__
export NLS_LANG=Japanese_Japan.AL32UTF8
sqlplus zbx_monitor/password@zabbix