Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: DBUNLOAD is to Watcom as _____ is to Oracle
>http://www.tc.umn.edu/nlhome/m031/hause011
>
>Let me know if it works for you.
i had to modify it a little bit as i don't use a korn shell. here we go:
expimpf.bat: (nt)
---------------------------------------------------------expimpf.bat
exp73 scott/tiger_at_dokver constraints=y file=scheme.dmp grants=y indexes=y owner=dokver rows=n
imp73 scott/tiger_at_dokver show=y full=y file=scheme.dmp recordlength=200 2>scheme.$$$
awk -f orafilt.awk scheme.$$$ >scheme.sql
---------------------------------------------------------orafilt.awk:
BEGIN {
line="";
startbreak=120;
}
function flushline() {
if (1==match(line,/^(CREATE)|(GRANT)|(ALTER)|(REVOKE)/)) {
print ";";
}
while (length(line)>startbreak) {
if ((i=index(line,"--")-1)==-1) { # break before line comments
i=startbreak+index(substr(line,startbreak)," ")-1; if (i==startbreak+0-1) { break; }
/^ "/ {
gsub("^ \"","",$0); # leading space+"
gsub("\"$","",$0); # trailing "
line = line $0;
if (length($0)!=75) {
flushline();
}
}
END {
flushline();
}
the script sometimes fails as "imp73 show=y" sometimes omits linebreaks (eg. something like '...from" ' in one line (78 chars wide), next line immediately starting with ' "table.."'
any comments or improvements welcome :-)
ciao, jan Received on Thu Feb 11 1999 - 02:27:58 CST