modelsacusei_sample
hoge.php
mv hoge.php $php_file.php
<?php
class #CLASS# extents
SEQ = #TABLE#
aaa
gggg
#COLUMNLIST#
?>
000000000000000000000000
[touhu@sss 20160106]$ echo T_CUSTOMER_REF | awk -f e1.awk > g1.txt
[touhu@sss 20160106]$ cat g1.txt
T_CUSTOMER_REF customerRef
[touhu@sss 20160106]$ awk { print $1 } g1.txt
T_CUSTOMER_REF
[touhu@sss 20160106]$ awk { print $2 } g1.txt
customerRef
[touhu@sss 20160106]$ cat e1.awk
{
zen = tolower($0)
gsub(/^t_/ zen)
gsub(/^m_/ zen)
zen = to_zen(zen)
gsub(/_/ zen)
print $0 zen
}
# _[a-z] の場合は、大文字に変換する
function to_zen(HAN) {
zen = HAN
gsub(/_a/ _A zen)
gsub(/_b/ _B zen)
gsub(/_c/ _C zen)
gsub(/_d/ _D zen)
gsub(/_e/ _E zen)
gsub(/_f/ _F zen)
gsub(/_g/ _G zen)
gsub(/_h/ _H zen)
gsub(/_i/ _I zen)
gsub(/_j/ _J zen)
gsub(/_k/ _K zen)
gsub(/_l/ _L zen)
gsub(/_m/ _M zen)
gsub(/_n/ _N zen)
gsub(/_o/ _O zen)
gsub(/_p/ _P zen)
gsub(/_q/ _Q zen)
gsub(/_r/ _R zen)
gsub(/_s/ _S zen)
gsub(/_t/ _T zen)
gsub(/_u/ _U zen)
gsub(/_v/ _V zen)
gsub(/_w/ _W zen)
gsub(/_x/ _X zen)
gsub(/_y/ _Y zen)
gsub(/_z/ _Z zen)
return zen
}
[touhu@sss 20160106]$
★★★★★
for FILE in aaa.sql ggg.sql ## ここで 対象FILE に 該当するものが渡される
do ## *.sql というよう正規表現での指定も可能 !!
nawk {
gsub(/^英語/ 英語 ¥nwwwww );
gsub(/^V.英語有無フラグ/ V.英語有無フラグ ¥nV.予備3 );
print$0
}
$FILE > B_2
mv B_2 $FILE.new
done
★★★★★
#!/bin/csh
unalias *
setenv NLS_LANG Japanese_Japan.JA16EUC
sqlplus sys/sys @01create.sql
echo
echo 実行中です.しばらくお待ち下さい.
echo NO TABLESPACE_NAME FREE(KBYTES) NO SEGMENT_NAME SEGMENT_TYPE TABLE_NAME SIZE(KBYTES) > result.csv
sqlplus -s sys/sys << EOF2 > free_space.tmp1
set serveroutput on size 1000000
exec shiro_free;
exit
EOF2
awk /^XXX.* $/{printf( %s $0)} /^XXX.* #$/{printf( %s¥n $0)} free_space.tmp1 > free_space.tmp2
sed -e s/XXX//g -e s/ #$/ /g free_space.tmp2 >> result.csv
rm free_space.tmp?
sqlplus -s sys/sys << EOF3
drop procedure shiro_free;
exit
EOF3
exit 0
★★★★★
setenv NLS_LANG Japanese_Japan.JA16EUC
set ORACLE_LOGIN = sys/sys
#
if ($#argv != 1) then
echo
echo $0 > error: required 1 argument(-list/ -run).
echo
exit 1
endif
#
switch ( $1 )
case -list:
sqlplus -s $ORACLE_LOGIN << EOF | tee -a $0.log
set echo off
set pause off
set time on
set timing on
set pages 9999
set lines 112
set trimout on
set trimspool on
set serveroutput on
col TABLE_NAME for a30
col TAB_NO for 9999
col STA_TIME for a20
col END_TIME for a20
SELECT TABLE_NAME LAST_ANALYZED FROM DBA_TABLES
WHERE OWNER = SCOTT
AND TABLE_NAME NOT IN ( ANA_STATS ANA_STATS_LIST )
AND LAST_ANALYZED IS NOT NULL
/
EOF
exit 0
breaksw
case -run:
breaksw
default:
echo
echo $0 > ERROR: invalid argument.
echo
exit
breaksw
endsw
#
echo | tee $0.log
date | tee -a $0.log
echo | tee -a $0.log
★★★★★
#!/bin/csh -f
unalias *
setenv NLS_LANG Japanese_Japan.JA16EUC
sqlplus -s scosco/opnopn << EOF > /dev/null
set heading off
spool count.dat
select count(*) from user_views where view_name = $1 ;
exit
EOF
set vexist=`sed s/[^01]//g count.dat | grep -v ^$`
rm count.dat
exit $vexist
★★★★★
#!/bin/csh -f
unalias *
setenv NLS_LANG Japanese_Japan.JA16EUC
if ($1 == ) then
echo usage: $0 <view_name>
exit 1
endif
echo CREATE OR REPLACE VIEW $1
echo (
sqlplus -s scosco/opnopn << EOF | sed s/ *$//g | grep -v ^$
set serveroutput on
declare
cursor cur_01 is
select count(*) cnt from user_tab_columns where table_name = $1 ;
cursor cur_02 is
select column_name from user_tab_columns where table_name = $1
order by column_id;
i binary_integer;
j binary_integer;
begin
for rec_01 in cur_01 loop
i := rec_01.cnt;
end loop;
j := 0;
for rec_02 in cur_02 loop
if j < i then
dbms_output.put_line(rec_02.column_name || );
else
dbms_output.put_line(rec_02.column_name);
end if;
j := j + 1;
end loop;
end;
/
set long 20000
set pages 50000
set feed off
set linesize 120
set heading off
exec dbms_output.put_line( ) AS );
select text from user_views where view_name = $1 ;
exit
EOF
echo ;
exit 0
★★★★★