The script assumes "select max(group#) from v\$log" is the same as "select count(*) from v\$log" This is not guaranteed to be true.
The script assumes
"select max(group#) from v$log"
is the same as
"select count(*) from v$log"
This is not guaranteed to be true.