My table contains below data
COLLECTION_TIMESTAM VALUE DB_NAME PROPERTY_NAME PROPERTY_VALUE
------------------- ---------- -------------------------
2021-07-24 07:41:42 15670 ewp5s DataGuardStatus Physical Standby
2021-07-24 07:46:42 15971 ewp5s DataGuardStatus Physical Standby
2021-07-24 09:26:42 21953 ewp5s DataGuardStatus Physical Standby
2021-07-24 09:31:42 22255 ewp5s DataGuardStatus Physical Standby
2021-07-24 09:36:42 22556 ewp5s DataGuardStatus Physical Standby
2021-07-20 08:13:05 554 opp201p.allstate.com DataGuardStatus Physical Standby
2021-07-22 01:57:18 5441 opp201p.allstate.com DataGuardStatus Physical Standby
2021-07-22 09:15:48 671 opp213s.allstate.com DataGuardStatus Physical Standby
2021-07-22 09:30:47 432 opp213s.allstate.com DataGuardStatus Physical Standby
My desired output is eliminating .allstate.com
COLLECTION_TIMESTAM VALUE DB_NAME PROPERTY_NAME PROPERTY_VALUE
------------------- ---------- ------------------------- ------------------------------ ------------------------------
2021-07-24 07:41:42 15670 ewp5s DataGuardStatus Physical Standby
2021-07-24 07:46:42 15971 ewp5s DataGuardStatus Physical Standby
2021-07-24 09:26:42 21953 ewp5s DataGuardStatus Physical Standby
2021-07-24 09:31:42 22255 ewp5s DataGuardStatus Physical Standby
2021-07-24 09:36:42 22556 ewp5s DataGuardStatus Physical Standby
2021-07-20 08:13:05 554 opp201p DataGuardStatus Physical Standby
2021-07-22 01:57:18 5441 opp201p DataGuardStatus Physical Standby
2021-07-22 09:15:48 671 opp213s DataGuardStatus Physical Standby
2021-07-22 09:30:47 432 opp213s DataGuardStatus Physical Standby
If i use below query its returning blanks in DB_NAME column. Can anyone advice?
select
collection_timestamp
,VALUE
,substr(target_name,1,instr(target_name,'.',1,1)- 1) db_name
,PROPERTY_NAME
,PROPERTY_VALUE
FROM sysman.mgmt_metrics_raw;
COLLECTION_TIMESTAM VALUE DB_NAME PROPERTY_NAME PROPERTY_VALUE
------------------- ---------- ------------------------- ------------------------------ ------------------------------
2021-07-24 07:41:42 15670 DataGuardStatus Physical Standby
2021-07-24 07:46:42 15971 DataGuardStatus Physical Standby
2021-07-24 09:26:42 21953 DataGuardStatus Physical Standby
2021-07-24 09:31:42 22255 DataGuardStatus Physical Standby
2021-07-24 09:36:42 22556 DataGuardStatus Physical Standby
2021-07-20 08:13:05 554 opp201p DataGuardStatus Physical Standby
2021-07-22 01:57:18 5441 opp201p DataGuardStatus Physical Standby
2021-07-22 09:15:48 671 opp213s DataGuardStatus Physical Standby
2021-07-22 09:30:47 432 opp213s DataGuardStatus Physical Standby
.allstate.com, as you say in words, or do you need to remove the period and everything that comes after it, no matter what that is (as your query does, when there are periods in the string)? Or isallstate.comthe only possible string following a period, if there is a period in the string at all?