First Commit - Source Code from Reply
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
#!/bin/ksh
|
||||
|
||||
###########################################################
|
||||
# Progetto: Gateway MNP
|
||||
# Script: crea_partizione.sh
|
||||
# Descrizione: Shell di Creazione delle partizioni per le tabelle MNP
|
||||
#
|
||||
# PARAMETRO OBBLIGATORIO
|
||||
# DIRECTORY ORACLE LOG_PART
|
||||
###########################################################
|
||||
|
||||
#impostazione ambiente
|
||||
export ORACLE_BASE=/oracle/app
|
||||
export ORACLE_HOME=/oracle/app/product/920
|
||||
export PATH=$PATH:$ORACLE_HOME/bin:.:$ORACLE_HOME/OPatch
|
||||
export LIBPATH=/usr/lib:/lib:/oracle/app/product/920/lib32:/oracle/app/product/920/lib
|
||||
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
|
||||
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
|
||||
export ORACLE_TERM=Xterm
|
||||
cd /oracle/UTILITY/PARTIZIONAMENTO
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
TIME=`echo $(date -u +%d/%m/%Y)`
|
||||
else
|
||||
TIME=$1
|
||||
fi
|
||||
echo "DATA:" ${TIME}
|
||||
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
#ESECUZIONE SCRIPT
|
||||
|
||||
#task=refresh_AGCOM_console
|
||||
adesso=$(date)
|
||||
|
||||
#controllo se il task è già in esecuzione
|
||||
#check_rc=`$THIS_PATH/is_RunningConsole $task $$`
|
||||
#if [ $? -eq 0 ]
|
||||
#then
|
||||
|
||||
echo '*******************************'
|
||||
echo '**' $adesso '**' INIZIO CREAZIONE PARTIZIONI
|
||||
$ORACLE_HOME/bin/sqlplus MNP/MNP@MNP @crea_partizione.sql $1 >> crea_partizione.log 2>&1
|
||||
adesso=$(date)
|
||||
echo '**' $adesso '**' FINE PARTIZIONAMENTO
|
||||
|
||||
#else
|
||||
# echo " (WARNING) $(date) Esecuzione non avvenuta per presenza processo precedente : $task"
|
||||
#fi
|
||||
fi
|
||||
@@ -0,0 +1,22 @@
|
||||
set serveroutput on size 1000000
|
||||
DECLARE
|
||||
v_anno number;
|
||||
BEGIN
|
||||
for r_tab_part in
|
||||
(select table_name from user_tables where partitioned = 'YES')
|
||||
loop
|
||||
begin
|
||||
v_anno := to_char(sysdate,'yyyy') + 1;
|
||||
MNP.CREA_PARTIZIONE(to_date('01/04/'||v_anno,'dd/mm/yyyy'),r_tab_part.table_name, '&1');
|
||||
MNP.CREA_PARTIZIONE(to_date('01/07/'||v_anno,'dd/mm/yyyy'),r_tab_part.table_name, '&1');
|
||||
MNP.CREA_PARTIZIONE(to_date('01/10/'||v_anno,'dd/mm/yyyy'),r_tab_part.table_name, '&1');
|
||||
MNP.CREA_PARTIZIONE(to_date('01/01/'||(v_anno+1),'dd/mm/yyyy'),r_tab_part.table_name, '&1');
|
||||
exception when others then
|
||||
dbms_output.put_line('errore di creazione delle partizioni per la tabella '||r_tab_part.table_name||SQLERRM);
|
||||
end;
|
||||
|
||||
end loop;
|
||||
|
||||
END;
|
||||
/
|
||||
exit;
|
||||
Reference in New Issue
Block a user