-
-
ORA-02374: conversion error loading table "SCOTT"."PERSON"
-
ORA-12899: value too large for column OCCUPATION (actual: 60, maximum: 50)
-
ORA-02374: conversion error loading table "SCOTT"."PERSON"
-
ORA-12899: value too large for column EMPLOYEE (actual: 75, maximum: 50)
-
ORA-02374: conversion error loading table "SCOTT"."PERSON"
-
ORA-12899: value too large for column EMPLOYEE (actual: 60, maximum: 50)
-
ORA-02374: conversion error loading table "SCOTT"."PERSON"
-
ORA-12899: value too large for column EMPLOYEE (actual: 57, maximum: 50)
-
ORA-02374: conversion error loading table "SCOTT"."PERSON"
-
ORA-12899: value too large for column EMPLOYEE (actual: 60, maximum: 50)
-
ORA-02374: conversion error loading table "SCOTT"."PERSON"
-
ORA-12899: value too large for column EMPLOYEE (actual: 53, maximum: 50)
-
ORA-02374: conversion error loading table "SCOTT"."PERSON"
-
ORA-12899: value too large for column DUTY (actual: 74, maximum: 50)
-
ORA-02374: conversion error loading table "SCOTT"."PERSON"
-
ORA-12899: value too large for column EMPLOYEE (actual: 60, maximum: 50)
-
ORA-02374: conversion error loading table "SCOTT"."ADDRESS"
-
ORA-12899: value too large for column NAME (actual: 70, maximum: 50)
-
ORA-02374: conversion error loading table "SCOTT"."ADDRESS"
-
ORA-12899: value too large for column NAME (actual: 81, maximum: 50)
-
ORA-02374: conversion error loading table "SCOTT"."ADDRESS"
-
ORA-12899: value too large for column PHONENUMBER (actual: 18, maximum: 15)
-
ORA-02374: conversion error loading table "SCOTT"."USER"
- ORA-12899: value too large for column REMARK (actual: 180, maximum: 100)
-
#!/bin/sh
-
-
i=1
-
width=0
-
fn=/tmp/out.log
-
echo > $fn
-
cat t.txt | while read line
-
do
-
i=$(($i+1))
-
errCode='ORA-02374'
-
if [[ $line =~ $errCode ]]
-
then
-
table=`echo $line |awk -F"conversion error loading table" '{print $2}'`
-
fi
-
-
largeCode='ORA-12899'
-
if [[ $line =~ $largeCode ]]
-
then
-
column=`echo $line |awk -F"value too large for column" '{print $2}'|awk -F"(" '{print $1}'`
-
width=`echo $line |awk -F"actual:" '{print $2}'|awk -F"," '{print $1}'`
-
fi
-
-
# alter table
-
if [[ $line =~ $largeCode ]] && [[ $width -gt 0 ]]
-
then
-
echo 'alter table ' $table ' modify ' $column ' varchar2(' $width ');' >> $fn
-
width=0
-
fi
-
-
done
-
-
sort $fn|uniq
-
-
# 求max值
- # awk -F"[()]" '{print $2}'|awk 'BEGIN{ max = 0} {if ($1 > max) max = $1; fi} END{print max}'