diff --git a/tools/upgrade/upgrade_checker.py b/tools/upgrade/upgrade_checker.py index 70374e92d8..ddba4a8bbb 100755 --- a/tools/upgrade/upgrade_checker.py +++ b/tools/upgrade/upgrade_checker.py @@ -428,6 +428,15 @@ def check_tenant_status(query_cur): else: logging.info('check tenant info success') + # check tenant lock status + (desc, results) = query_cur.exec_query("""select count(*) from DBA_OB_TENANTS where LOCKED = 'YES'""") + if len(results) != 1 or len(results[0]) != 1: + fail_list.append('results len not match') + elif 0 != results[0][0]: + fail_list.append('has locked tenant, should unlock') + else: + logging.info('check tenant lock status success') + # 6. 检查无恢复任务 def check_restore_job_exist(query_cur): (desc, results) = query_cur.exec_query("""select count(1) from CDB_OB_RESTORE_PROGRESS""") diff --git a/tools/upgrade/upgrade_post.py b/tools/upgrade/upgrade_post.py index cc10931137..133ebc37bd 100755 --- a/tools/upgrade/upgrade_post.py +++ b/tools/upgrade/upgrade_post.py @@ -2059,6 +2059,15 @@ # else: # logging.info('check tenant info success') # +# # check tenant lock status +# (desc, results) = query_cur.exec_query("""select count(*) from DBA_OB_TENANTS where LOCKED = 'YES'""") +# if len(results) != 1 or len(results[0]) != 1: +# fail_list.append('results len not match') +# elif 0 != results[0][0]: +# fail_list.append('has locked tenant, should unlock') +# else: +# logging.info('check tenant lock status success') +# ## 6. 检查无恢复任务 #def check_restore_job_exist(query_cur): # (desc, results) = query_cur.exec_query("""select count(1) from CDB_OB_RESTORE_PROGRESS""") diff --git a/tools/upgrade/upgrade_pre.py b/tools/upgrade/upgrade_pre.py index 181d3e1978..40a113b8b2 100755 --- a/tools/upgrade/upgrade_pre.py +++ b/tools/upgrade/upgrade_pre.py @@ -2059,6 +2059,15 @@ # else: # logging.info('check tenant info success') # +# # check tenant lock status +# (desc, results) = query_cur.exec_query("""select count(*) from DBA_OB_TENANTS where LOCKED = 'YES'""") +# if len(results) != 1 or len(results[0]) != 1: +# fail_list.append('results len not match') +# elif 0 != results[0][0]: +# fail_list.append('has locked tenant, should unlock') +# else: +# logging.info('check tenant lock status success') +# ## 6. 检查无恢复任务 #def check_restore_job_exist(query_cur): # (desc, results) = query_cur.exec_query("""select count(1) from CDB_OB_RESTORE_PROGRESS""")