scpig
asked on
Oracle: REGEXP_REPLACE
The result I got from a table column has Oracle error information, for example:
select replace(err_msg, chr(10),' ') || '|'
from job_status
where job_trans_id=123456;
ORA-04045: errors during recompilation/revalidation of ORA-04052: error occurred when looking up remote object ORA-00604: error occurred at recursive SQL level 2 ORA-01017: invalid username/password; logon denied ORA-02063: preceding line from DBLINK_ABC.WORLD|
I'd like to search the Oracle error code and to add <b> & </b> in between the Oracle error code, something like this:
<b>ORA-04045:</b> errors during recompilation/revalidation of <b>ORA-04052:</b> error occurred when looking up remote object <b>ORA-00604:</b> error occurred at recursive SQL level 2 <b>ORA-01017:</b> invalid username/password; logon denied <b>ORA-02063:</b> preceding line from DBLINK_ABC.WORLD|
I use REGEXP_REPLACE function as followed, but it does not work. What did I do run for this query?
select REGEXP_REPLACE('(replace(e rr_msg,chr (10),' ') || '|')','([[:ORA:]])\-([[:di git:]]{5}) ','<b>\1 \2</b>') from job_status where job_trans_id=123456;
thanks.
select replace(err_msg, chr(10),' ') || '|'
from job_status
where job_trans_id=123456;
ORA-04045: errors during recompilation/revalidation
I'd like to search the Oracle error code and to add <b> & </b> in between the Oracle error code, something like this:
<b>ORA-04045:</b> errors during recompilation/revalidation
I use REGEXP_REPLACE function as followed, but it does not work. What did I do run for this query?
select REGEXP_REPLACE('(replace(e
thanks.
ASKER
My question is not a dblink issue. I'd like to know how to use REGEXP_REPLACE function correctly for my query.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dblinks have connection string, username and password, and the login attributes of the dblink are wrong (maybe obsolete, maybe password was changed,...)
ORA-01017: invalid username/password; logon denied
This is the main issue. Look for the synonym, get the dblink properties (dba_db_links view) and recreate the dblink using the right username/password.
Cheers,
Javier