t.sh

2023年 8月 29日 191.3k 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

## Path of file to be generated and find
NAS_PATH=`pwd`
#d $NAS_PATH

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
T_RMAN_PATH=${T_XTTS_PATH}/rman
S_BACKUP_DIR=${NAS_PATH}/source/backup
T_BACKUP_DIR=${NAS_PATH}/target/backup
mkdir -p ${T_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_RMAN_PATH}
mkdir -p ${S_XTTS_PATH}
chmod +x $NAS_PATH/bin/rsqlgb.sh

mkdir -p ${T_XTTS_PATH}/tmpdir

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

}

main_menu ()
{
#declare -a menu
IFS=~~
menu[1]="xtts_getfiles"
menu[2]="check_xtts_getfiles"
menu[3]="apply_incr_backup"
menu[4]="check_apply_incr_backup"
menu[5]="backup_target_db"
menu[6]="check_backup_target_db"
menu[7]="chk_db"
menu[8]="create_users"
menu[9]="check_users"
menu[10]="grant_user_role_sys_privilege"
menu[11]="check_user_role_sys_privilege"
menu[12]="restart_db_disable_audit_dblink"
menu[13]="check_audit_dblink"
menu[14]="check_running_instance"
menu[15]="prepare_impdp_tbsmeta_para"
menu[16]="check_prepare_impdp_tbsmeta_para"
menu[17]="impdp_tbsmeta"
menu[18]="check_impdp_tbsmeta"
menu[19]="check_datafile_missing"
menu[20]="create_BEFORE_FULLDB_IMPDP_restore_point"
menu[21]="check_BEFORE_FULLDB_IMPDP_restore_point"
menu[22]="set_tbs_readwrite"
menu[23]="chk_tbs_readonly"
menu[24]="impdp_fullmeta"
menu[25]="create_impdp_fullmeta_index"
menu[26]="check_impdp_fullmeta"
menu[27]="impdp_trigger"
menu[28]="complie_objects_utlprp"
menu[29]="check_complie_objects_utlprp"
menu[30]="restart_db_enable_audit_dblink"
menu[31]="check_impdp_trigger"
menu[32]="unpack_spm"
menu[33]="import_stat"
menu[34]="check_spm"
menu[35]="check_stat"
menu[36]="gather_dict_fix_stat"
menu[37]="check_fix_stat"
menu[38]="grant_user_role_privilege"
menu[39]="compare_user_role_privilege"
menu[40]="create_problem_indexes_and_manual_obj"
menu[41]="check_problem_indexes"
menu[42]="deploy_rac_kill_procedure"
menu[43]="check_deploy_rac_kill_procedure"
menu[44]="deploy_new_Gath_stat"
menu[45]="check_deploy_new_Gath_stat"
menu[46]="upgrade_audit_package"
menu[47]="check_upgrade_audit_package"
menu[48]="drop_abandom_users"
menu[49]="check_drop_abandom_users"
menu[50]="check_registry"
menu[51]="check_migrate_invalid_objects"
menu[52]="compare_objects"
menu[53]="check_invalid_objects"
menu[54]="fix_mview"
menu[55]="recreate_jobs"
menu[56]="check_recreate_jobs"
menu[57]="check_fix_mview"

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
;;
42)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
43)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
44)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
45)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
46)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
47)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
48)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
49)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
50)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
51)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
52)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
53)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
54)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
55)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
56)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
57)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
58)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
59)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
60)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
61)
echo "Your Choice is : $MENU_READ"
confirm $MENU_READ
break
;;
62)
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数据库

发布评论