Oracle GoldenGate对于Oracle数据库版本的支持

写了个Shell脚本,仅供参考。详细的还请查阅官方认证列表。
脚本是这样的:

[opc@localhost ~]$ cat ./oggver.sh 
#!/bin/bash
while :;do
	read -p  "Please input version of Oracle Database: " dbversion
	dbversion=$(echo "$dbversion" | tr '[:upper:]' '[:lower:]')
	if [[ $dbversion = quit || $dbversion = q ]]; then
		echo "Bye Bye!"
		exit;
	fi
	dbversion=${dbversion//i}
	dbversion=${dbversion//g}
	dbversion=${dbversion//c}
	dbvnum=$(echo $dbversion | awk -F. '{s =  $1 "."; for (i = 2; i <= NF; i++) s = s $i; print s}')
	if [[ ! $dbvnum < 12.201 ]]; then
		echo " *** Use Oracle GoldenGate 12.3 ***"
	elif [[ ! $dbvnum < 11.201 ]]; then
		echo " *** Use Oracle GoldenGate 12.2 ***"
	elif [[ ! $dbvnum < 11.106 ]]; then
		echo " *** Use Oracle GoldenGate 12.1 ***"
	elif [[ ! $dbvnum < 10.204 ]]; then
		echo " *** Use Oracle GoldenGate 11.2 ***"
	else
		echo " *** Use Oracle GoldenGate 10.4 ***"
	fi
done

在notepad++中的效果:
Oracle GoldenGate对于Oracle数据库版本的支持_第1张图片
测试结果:

[opc@localhost ~]$ ./oggver.sh 
Please input version of Oracle Database: 12.2.0.1
 *** Use Oracle GoldenGate 12.3 ***
Please input version of Oracle Database: 11.2.0.1
 *** Use Oracle GoldenGate 12.2 ***
Please input version of Oracle Database: 11.1.0.6
 *** Use Oracle GoldenGate 12.1 ***
Please input version of Oracle Database: 10.2.0.4
 *** Use Oracle GoldenGate 11.2 ***
Please input version of Oracle Database: 10.1
 *** Use Oracle GoldenGate 10.4 ***
Please input version of Oracle Database: 18c
 *** Use Oracle GoldenGate 12.3 ***
Please input version of Oracle Database: 10g
 *** Use Oracle GoldenGate 10.4 ***
Please input version of Oracle Database: 9i
 *** Use Oracle GoldenGate 12.3 ***
Please input version of Oracle Database: quit
Bye Bye!

你可能感兴趣的:(GoldenGate)