Oracle

在時區文件升級期間忘記執行 END_UPGRADE (ORA-56924)

  • August 28, 2015

我執行以下命令將我的時區文件從 4 升級到 14。問題是在執行升級後我忘記執行DBMS_DST.END_UPGRADE並將數據庫備份並啟用傳入連接。

exec DBMS_DST.BEGIN_PREPARE(14);

TRUNCATE TABLE SYS.DST$TRIGGER_TABLE;
TRUNCATE TABLE sys.dst$affected_tables;
TRUNCATE TABLE sys.dst$error_table;

BEGIN
DBMS_DST.FIND_AFFECTED_TABLES
(affected_tables => 'sys.dst$affected_tables',
log_errors => TRUE,
log_errors_table => 'sys.dst$error_table');
END;
/

SELECT * FROM sys.dst$affected_tables;
0 rows returned

EXEC DBMS_DST.END_PREPARE;

shut immediate;

startup upgrade

EXEC DBMS_DST.BEGIN_UPGRADE(14);

shut immediate;

startup

SELECT version FROM v$timezone_file;

當我意識到這一點時,翻到一周後。當我嘗試執行時,DBMS_DST.END_UPGRADE我得到以下資訊:

ERROR at line 1:
ORA-56929: Ending an upgrade window failed
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_DST", line 1277
ORA-06512: at line 5

我也嘗試在升級模式下執行它,但沒有運氣。當我在網上搜尋時,我看到以下內容:

ORA-56929: Ending an upgrade window failed
Cause: Ending an upgrade window failed or there were tables containing TSTZ data which have not been upgraded.
Action: Check alert or trace file for error(s) or complete upgrading of tables containing TSTZ data.

我將如何“完成包含 TSTZ 數據的表的升級。”?

只需正常啟動數據庫並執行 DBMS_DST.UPGRADE_DATABASE

然後您必須看到消息“升級視窗已成功結束”。和“失敗:0”

通過執行仔細檢查它是否成功:

1:

SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
   FROM DATABASE_PROPERTIES
   WHERE PROPERTY_NAME LIKE 'DST_%'
   ORDER BY PROPERTY_NAME;

2:

SELECT * FROM v$timezone_file;

– 更新版本的文件必須出現在此處。

最後,確保版本與以下查詢匹配:

CONN / as sysdba
select VERSION from v$timezone_file;
select TZ_VERSION from registry$database;

–如果升級後它們不同,則可以通過以下方式更新 registry$database

CONN / as sysdba

update registry$database set TZ_VERSION = (select version FROM v$timezone_file);
commit;

希望能幫助到你。

引用自:https://dba.stackexchange.com/questions/112573