本文主要是介绍oracle 卸载数据,tom的脚本,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
oracle 卸载数据,tom的脚本,可以修改一下,做到自己想要的
--1.导出数据
[oracle@localhost ~]$ more flat.sh
#!/bin/shif [ "$1" = "" ]
thencat << EOF
editor: mengl 2016-5-26
usage: flat un/pw [tables|views]example: flat scott/tiger emp deptdescription: Select over standard out all rows of table or view withcolumns delimited by tabs.
EOFexit
fiPW=$1
shiftfor X in $*
do
sqlplus -s $PW << EOF > /tmp/flat$$.sql
set wrap off
set feedback off
set pagesize 0
set verify off
prompt select
select lower(column_name)||'||chr(9)||'
from user_tab_columns
where table_name = upper('$X') andcolumn_id != (select max(column_id) from user_tab_columns wheretable_name = upper('$X'))
order by column_id
/
select lower(column_name)
from user_tab_columns
where table_name = upper('$X') andcolumn_id = (select max(column_id) from user_tab_columns wheretable_name = upper('$X'))
order by column_id
/
prompt from $X
prompt /
prompt exit
exit
EOF
sqlplus -s $PW << EOF
set wrap off
set feedback off
set pagesize 0
set verify off
set trimspool on
set linesize 5000
start /tmp/flat$$.sql
exit
EOF
#rm /tmp/flat$$.sql
done
[oracle@localhost ~]$
--导出数据样例
[oracle@localhost ~]$ ./flat.sh unicomidmp/broadtech ml_2 >1.txt
[oracle@localhost ~]$ more 1.txt
103 10305 GD-WL-SG-XFX-C类-新丰沙田网格-190 236 113.883073 24.054267 1
[oracle@localhost ~]$
--这样,就可以导出文本文件1.txt, 共sqlldr加载。
这篇关于oracle 卸载数据,tom的脚本的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!