Find Specific Word in View Source Code

You can search a specific word in all views source code . And also you can configure this simple code  for package,procedure ... etc .

DECLARE
 CURSOR C1 IS  select VIEW_NAME,OWNER from dba_views where owner not in ('SYS','SYSTEM','DBSNMP','WMSYS','EXFSYS','CTXSYS','XDB','ORDSYS','ORDDATA','MDSYS','OLAPSYS','SYSMAN','RMAN','APEX_030200');
v_output CLOB :=NULL;
BEGIN
FOR C1_REC in C1 LOOP
 select (select * from ( select DBMS_METADATA.GET_DDL('VIEW' ,  C1_REC.VIEW_NAME, C1_REC.OWNER ) AS "TT"   from DUAL) where TT  like ('%@YOUR_WORD%') )   INTO v_output from DUAL ;
IF v_output is not null then
DBMS_OUTPUT.PUT_LINE(C1_REC.OWNER ||'.' || C1_REC.VIEW_NAME);
   v_output :=NULL;
END IF;  
END LOOP;
END;
/

12C Grid Control Manual Target Agent Delete



When deleting agent in 12C grid Console an error appering like that "Unknown error. java.sql.SQLException: ORA-20242: Target myhost.mydomain.com:3875:oracle_emd is monitoring other targets. It cannot be deleted

ORA-06512: at "SYSMAN.MGMT_ADMIN", line 484

ORA-06512: at "SYSMAN.MGMT_ADMIN", line 876

ORA-06512: at line 1"


You need clean manually target host from 12C Enterprise Manager.


cd $OMS_HOME/bin


[oracle@myhost bin]$ ./emcli login -username=sysman -password=<sysman password >


[oracle@myhost bin]$ ./emcli get_targets

[oracle@myhost bin]$ ./emcli sync

[oracle@myhost bin]$ ./emcli delete_target -name=<Target IP> -type="host"

Target "xx.xx.xx.xx:host" deleted successfully


[oracle@myhost bin]$ ./emcli delete_target -name=<Target IP>:3875 -type="oracle_emd"


Target "<Target IP>:3875:oracle_emd" deleted successfully


After deleting target host , you can configure this agent again ..