s.sh

2023年 8月 29日 153.8k 0

#!/bin/sh
# Variables and constants
#
SCRIPT=`basename $0`
HOST_NAME=`hostname`
WHOAMI=`whoami`
TODAY=`date +%Y%m%d`
NOW=`date +%H%M`
FAILURE=1
SUCCESS=0
USAGE1="${SCRIPT}"
USAGE2="e.g. ${SCRIPT}"
SEPARATOR="********************************************************************************"
PARA_NUM=$#
WARNING="-----------------------------------------------------[WARNING]"
INFOLINE="-------------------------------------------------INFO"
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

NAS_PATH=`pwd`

BIN_PATH=${NAS_PATH}/bin
S_LOG_PATH=${NAS_PATH}/source/log
S_SCRIPT_PATH=${NAS_PATH}/source/script
T_LOG_PATH=${NAS_PATH}/target/log
T_SCRIPT_PATH=${NAS_PATH}/target/script
S_XTTS_PATH=${NAS_PATH}/source/xtts
T_XTTS_PATH=${NAS_PATH}/target/xtts
EXPDP_PATH=${NAS_PATH}/dmp
IMPDP_PATH=${NAS_PATH}/dmp
S_BACKUP_DIR=${NAS_PATH}/source/backup
T_BACKUP_DIR=${NAS_PATH}/target/backup

mkdir -p ${S_BACKUP_DIR}
mkdir -p ${S_LOG_PATH}
mkdir -p ${S_SCRIPT_PATH}
mkdir -p ${T_LOG_PATH}
mkdir -p ${T_SCRIPT_PATH}
mkdir -p ${T_XTTS_PATH}

mkdir -p ${S_XTTS_PATH}/incr
mkdir -p ${S_XTTS_PATH}/tmpdir
chmod 755 ${S_XTTS_PATH}/incr
chmod +x $NAS_PATH/bin/rsqlgb.sh

main ()
{
tmp="^^^^^^^^^^^"
while true
do
echo " "
echo " "
echo "$tmp LBS MIGRATION $tmp"
main_menu
done

}

main_menu ()
{
#declare -a menu
IFS=~~
menu[1]="chk_db"
menu[2]="xtts_create_source_directories"
menu[3]="xtts_prepare"
menu[4]="check_xtts_prepare"
menu[5]="xtts_incr_backup"
menu[6]="check_xtts_incr_backup"
menu[7]="xtts_incr_update_from_scn"
menu[8]="export_stat"
menu[9]="export_spm"
menu[10]="check_export_stat"
menu[11]="check_export_spm"
menu[12]="create_migrate_table"
menu[13]="check_migrate_table"
menu[14]="check_running_jobs"
menu[15]="disable_job_aq_parameter"
menu[16]="check_job_aq_parameter"
menu[17]="backup_jobs"
menu[18]="set_jobs_next_date"
menu[19]="kill_running_jobs"
menu[20]="check_session"
menu[21]="kill_session_not_from_local"
menu[22]="drop_problem_indexes"
menu[23]="check_drop_problem_indexes"
menu[24]="emty_recyclebin"
menu[25]="stop_listener"
menu[26]="check_listener"
menu[27]="clear_crontab"
menu[28]="check_crontab"
menu[29]="disable_2_trigger"
menu[30]="check_disable_2_trigger"
menu[31]="restart_db_set_stream_size"
menu[32]="check_streams_pool_size"
menu[33]="set_tbs_readonly"
menu[34]="chk_tbs_readonly"
menu[35]="expdp_tbsmeta"
menu[36]="expdp_fullmeta"
menu[37]="check_dg"
menu[38]="check_expdp_tbsmeta"
menu[39]="check_expdp_fullmeta"
menu[40]="restore_crontab"
menu[41]="check_xtts_incr_update_from_scn"

menu[100]="Other: Exit"
PS3="Please enter your chioce: "
select MENU_READ in `echo "${menu[*]}"`
do
case $REPLY in

1)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
2)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
3)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
4)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
5)
echo "Your Choice is : $MENU_READ"

confirm $MENU_READ
break
;;
6)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
7)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;

8)
echo "Your Choice is :$MENU_READ"
confirm $MENU_READ
break
;;
9)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
10)
echo "Your Choice is :$MENU_READ"
confirm $MENU_READ
break
;;
11)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
12)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
13)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
14)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
15)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
16)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
17)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;

18)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
19)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
20)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
21)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
22)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
23)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
24)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
25)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
26)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
27)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
28)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
29)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;

30)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;

31)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
32)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
33)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
34)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
35)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
36)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
37)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
38)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
39)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
40)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
41)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;

*)
echo "BYE BYE"
echo "Your Choice is to quit the script: $REPLY"
exit 0
;;
esac
done
}

runsql ()
{
sqlplus -S '/ as sysdba'

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论