|
| |
精品推荐 |
 |
|
| |
|
|
|
|
oracle的文本导入、导出技巧
|
日期:2007年12月28日 作者: 查看:[大字体
中字体 小字体]
|
# # 09/23/2003 Bing He &&ê?±àD& # ################################################################################
################################################################################ ## ?÷3ìDòè&&ú
if [ ! $# -eq 2 ] then echo "Usage: $0 <userid/passwd[@connection]> <table_name>" exit else userid=$1 table=$2 fi
################################################################################
################################################################################ ## ?&DD????2ù×÷
lv_temp="wk_${table}.test" lv_temp1="wk_${table}.test1" lv_temp2="wk_${table}.test2" lv_control="${table}.ctl"
sqlplus ${userid} <<! >/dev/null spool ${lv_temp}; desc ${table} spool off; exit ! if [ "$?" -ne 0 ] then echo "Error:sqlplus ${userid} error in generate control file for table ${table} !" echo "please check userid and passwd or oracle_sid." exit fi
if [ -f ${lv_temp} ] then cat ${lv_temp}grep -v "^SQL>" grep -v " Name " grep -v " -------" awk '{print $1}' > ${lv_temp1} lv_line_num=`cat ${lv_temp1} wc -l` lv_line_num=`expr ${lv_line_num} - 2` lv_index=0
rm -f ${lv_temp2} for lineinfo in `cat ${lv_temp1}` do if [ ${lv_index} -eq ${lv_line_num} ] then echo "${lineinfo}" >> ${lv_temp2} else
上一篇:我的一些oracle9i学习笔记,与大家分享
下一篇:使用 SQL*Plus 访问数据库
|
| 相关文章: |
|
|
|
| 相关软件: |
|
|
|
|