modelsacusei_sample



hoge.php
mv hoge.php $php_file.php

<?php

class #CLASS# extents

SEQ = #TABLE#

aaa
gggg
#COLUMNLIST#

?>

000000000000000000000000

[touhu@sss 20160106]&#36; echo T_CUSTOMER_REF | awk -f e1.awk > g1.txt
[touhu@sss 20160106]&#36; cat g1.txt
T_CUSTOMER_REF customerRef
[touhu@sss 20160106]&#36; awk &#123; print &#36;1 &#125; g1.txt
T_CUSTOMER_REF
[touhu@sss 20160106]&#36; awk &#123; print &#36;2 &#125; g1.txt
customerRef
[touhu@sss 20160106]&#36; cat e1.awk
&#123;
zen = tolower(&#36;0)
gsub(/^t_/ zen)
gsub(/^m_/ zen)
zen = to_zen(zen)
gsub(/_/ zen)
print &#36;0 zen
&#125;
# _[a-z] の場合は、大文字に変換する
function to_zen(HAN) &#123;
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
&#125;


[touhu@sss 20160106]&#36;
★★★★★


for FILE in aaa.sql ggg.sql ## ここで 対象FILE に 該当するものが渡される
do ## *.sql というよう正規表現での指定も可能 !!
nawk &#123;
gsub(/^英語/ 英語 &yen;nwwwww );
gsub(/^V.英語有無フラグ/ V.英語有無フラグ &yen;nV.予備3 );
print&#36;0
&#125;
&#36;FILE > B_2
mv B_2 &#36;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.* &#36;/&#123;printf( %s &#36;0)&#125; /^XXX.* #&#36;/&#123;printf( %s&yen;n &#36;0)&#125; free_space.tmp1 > free_space.tmp2
sed -e s/XXX//g -e s/ #&#36;/ /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 (&#36;#argv != 1) then
echo
echo &#36;0 > error: required 1 argument(-list/ -run).
echo
exit 1
endif
#
switch ( &#36;1 )
case -list:
sqlplus -s &#36;ORACLE_LOGIN << EOF | tee -a &#36;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 &#36;0 > ERROR: invalid argument.
echo
exit
breaksw
endsw
#
echo | tee &#36;0.log
date | tee -a &#36;0.log
echo | tee -a &#36;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 = &#36;1 ;
exit
EOF
set vexist=`sed s/[^01]//g count.dat | grep -v ^&#36;`
rm count.dat
exit &#36;vexist


★★★★★

#!/bin/csh -f
unalias *
setenv NLS_LANG Japanese_Japan.JA16EUC
if (&#36;1 == ) then
echo usage: &#36;0 <view_name>
exit 1
endif
echo CREATE OR REPLACE VIEW &#36;1
echo (

sqlplus -s scosco/opnopn << EOF | sed s/ *&#36;//g | grep -v ^&#36;
set serveroutput on
declare
cursor cur_01 is
select count(*) cnt from user_tab_columns where table_name = &#36;1 ;
cursor cur_02 is
select column_name from user_tab_columns where table_name = &#36;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 = &#36;1 ;
exit
EOF

echo ;

exit 0

★★★★★