In Oracle DB: Is there a way to make LogMiner to escape some characters? -


i'm trying use 'logminer' in manner synchronize dbs.

i've encountered problem when long clob containing single quote character (') won't escaped '', , i'm trying find way tell 'logminer' escape when come table.

for example: have table called text_files name varchar2 , file clob, clob loaded text file. file contains line like:

this won't work!!! 

when short file logminer give me these commands:

insert "testdb"."text_files" ("name","file") values ('test1.txt',empty_clob()); update "testdb"."text_files" set "file"='this won''t work!!!' "name"='test1.txt' commit; 

note single quote escaped , appear twice, can run perfectly.

but when file long (i guess more 1k bytes), , contains line, logminer generate sort of procedure, this:

insert "testdb"."text_files" ("name","file") values ('test2.txt',empty_clob()); declare  loc_c clob;  buf_c varchar(6222) ... begin  select "file" loc_c "testdb"."text_files" "name" = 'test2.txt' update;  buf_c := 'this won't work!!!this won't work!!! ........'; --(line continues)   dbms_lob.write(loc_c, 1024, 1, buf_c); end;   buf_c := '.... '; --file go on..  dbms_lob.write(loc_c, 1024, 1025, buf_c); end;   buf_c := '.... '; --till end of file..  dbms_lob.write(loc_c, 500, 2049, buf_c); end; 

(i don't know why put end; after each write, subject question...)

the point single quote not escaped automatically, , script fail run.

i'm looking solution should work file, (even file containing sql queries, , file containing above procedure text, can't buf_c := ) , should work automatically.

so wonder if encounter problem, , if able solve it.

edit:

i'm using 'logminer' these commands: each file v$archived_log time newer last sync: dbms_logmnr.add_logfile call to:

dbms_logmnr.start_logmnr(options=>dbms_logmnr.dict_from_online_catalog+dbms_logmnr.no_rowid_in_stmt); 

then: select sql_redo v$logmnr_content it's long script, in end, extract each change file, , files numbered chronologically.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -