webtet 发表于 2018-9-10 08:53:37

Oracle Study之--Oracle TimeZone升级

SQL> shutdown immediate;  
Database closed.
  
Database dismounted.
  
ORACLE instance shut down.
  

  
SQL> startup upgrade;
  
ORACLE instance started.
  
Total System Global Area627732480 bytes
  
Fixed Size                  1338336 bytes
  
Variable Size             427820064 bytes
  
Database Buffers          192937984 bytes
  
Redo Buffers                5636096 bytes
  
Database mounted.
  
Database opened.
  

  
SQL> set serveroutput on
  
SQL> purge dba_recyclebin;
  
DBA Recyclebin purged.
  

  
SQL> TRUNCATE TABLE SYS.DST$TRIGGER_TABLE;
  
Table truncated.
  

  
SQL> TRUNCATE TABLE sys.dst$affected_tables;
  
Table truncated.
  

  
SQL> TRUNCATE TABLE sys.dst$error_table;
  
Table truncated.
  

  
SQL> alter session set "_with_subquery"=materialize;
  
Session altered.
  

  
将timezone version升级到11:
  
SQL> EXEC DBMS_DST.BEGIN_UPGRADE(11);
  
PL/SQL procedure successfully completed.
  

  
SQL> SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
  
2FROM DATABASE_PROPERTIES
  
3WHERE PROPERTY_NAME LIKE 'DST_%'
  
4ORDER BY PROPERTY_NAME;
  
PROPERTY_NAME                  VALUE
  
------------------------------ ----------------------------------------
  
DST_PRIMARY_TT_VERSION         11
  
DST_SECONDARY_TT_VERSION       4
  
DST_UPGRADE_STATE            UPGRADE
  

  
SQL> SELECT OWNER, TABLE_NAME, UPGRADE_IN_PROGRESS FROM ALL_TSTZ_TABLES where UPGRADE_IN_PROGRESS='YES';
  
OWNER                        TABLE_NAME                     UPG
  
------------------------------ ------------------------------ ---
  
SYSMAN                         MGMT_PROV_NET_CONFIG         YES
  
SYSMAN                         MGMT_PROV_IP_RANGE             YES
  
SYSMAN                         MGMT_PROV_SUITE_INST_MEMBERS   YES
  
SYSMAN                         MGMT_PROV_BOOTSERVER         YES
  
SYSMAN                         AQ$_MGMT_NOTIFY_QTABLE_L       YES
  
SYSMAN                         AQ$_MGMT_LOADER_QTABLE_S       YES
  
SYSMAN                         AQ$_MGMT_LOADER_QTABLE_L       YES
  
SYSMAN                         AQ$_MGMT_NOTIFY_QTABLE_S       YES
  
SYSMAN                         MGMT_PROV_STAGING_DIRS         YES
  
SYSMAN                         MGMT_PROV_OPERATION            YES
  
SYSMAN                         MGMT_PROV_ASSIGNMENT         YES
  
OWNER                        TABLE_NAME                     UPG
  
------------------------------ ------------------------------ ---
  
SYSMAN                         MGMT_CONFIG_ACTIVITIES         YES
  
SYSMAN                         MGMT_PROV_CLUSTER_NODES      YES
  
SYSMAN                         MGMT_PROV_RPM_REP            YES
  
SYSMAN                         MGMT_PROV_DEFAULT_IMAGE      YES
  
IX                           AQ$_STREAMS_QUEUE_TABLE_S      YES
  
IX                           AQ$_STREAMS_QUEUE_TABLE_L      YES
  
IX                           AQ$_ORDERS_QUEUETABLE_S      YES
  
IX                           AQ$_ORDERS_QUEUETABLE_L      YES
  
19 rows selected.
  

  
SQL> shutdown immediate;
  
Database closed.
  
Database dismounted.
  
ORACLE instance shut down.
  

  
SQL> startup
  
ORACLE instance started.
  
Total System Global Area627732480 bytes
  
Fixed Size                  1338336 bytes
  
Variable Size             427820064 bytes
  
Database Buffers          192937984 bytes
  
Redo Buffers                5636096 bytes
  
Database mounted.
  
Database opened.
  

  
SQL> alter session set "_with_subquery"=materialize;
  
Session altered.
  

  
执行timezone升级过程:
  
SQL> set serveroutput on
  
SQL> VAR numfail number
  
SQL> BEGIN
  
2DBMS_DST.UPGRADE_DATABASE(:numfail,
  
3parallel => TRUE,
  
4log_errors => TRUE,
  
5log_errors_table => 'SYS.DST$ERROR_TABLE',
  
6log_triggers_table => 'SYS.DST$TRIGGER_TABLE',
  
7error_on_overlap_time => FALSE,
  
8error_on_nonexisting_time => FALSE);
  
9DBMS_OUTPUT.PUT_LINE('Failures:'|| :numfail);
  
10END;
  
11/
  
Table list: SYSMAN.MGMT_PROV_SUITE_INST_MEMBERS
  
Number of failures: 0
  
Table list: SYSMAN.MGMT_PROV_STAGING_DIRS
  
Number of failures: 0
  
Table list: SYSMAN.MGMT_PROV_RPM_REP
  
Number of failures: 0
  
Table list: SYSMAN.MGMT_PROV_OPERATION
  
Number of failures: 0
  
Table list: SYSMAN.MGMT_PROV_NET_CONFIG
  
Number of failures: 0
  
Table list: SYSMAN.MGMT_PROV_IP_RANGE
  
Number of failures: 0
  
Table list: SYSMAN.MGMT_PROV_DEFAULT_IMAGE
  
Number of failures: 0
  
Table list: SYSMAN.MGMT_PROV_CLUSTER_NODES
  
Number of failures: 0
  
Table list: SYSMAN.MGMT_PROV_BOOTSERVER
  
Number of failures: 0
  
Table list: SYSMAN.MGMT_PROV_ASSIGNMENT
  
Number of failures: 0
  
Table list: SYSMAN.MGMT_CONFIG_ACTIVITIES
  
Number of failures: 0
  
Table list: SYSMAN.AQ$_MGMT_NOTIFY_QTABLE_S
  
Number of failures: 0
  
Table list: SYSMAN.AQ$_MGMT_NOTIFY_QTABLE_L
  
Number of failures: 0
  
Table list: SYSMAN.AQ$_MGMT_LOADER_QTABLE_S
  
Number of failures: 0
  
Table list: SYSMAN.AQ$_MGMT_LOADER_QTABLE_L
  
Number of failures: 0
  
Table list: IX.AQ$_STREAMS_QUEUE_TABLE_S
  
Number of failures: 0
  
Table list: IX.AQ$_STREAMS_QUEUE_TABLE_L
  
Number of failures: 0
  
Table list: IX.AQ$_ORDERS_QUEUETABLE_S
  
Number of failures: 0
  
Table list: IX.AQ$_ORDERS_QUEUETABLE_L
  
Number of failures: 0
  
Failures:0
  
PL/SQL procedure successfully completed.
  

  
结束升级,校验升级信息:
  
SQL> VAR fail number
  
SQL> BEGIN
  
2DBMS_DST.END_UPGRADE(:fail);
  
3DBMS_OUTPUT.PUT_LINE('Failures:'|| :fail);
  
4END;
  
5/
  
An upgrade window has been successfully ended.
  
Failures:0
  
PL/SQL procedure successfully completed.


页: [1]
查看完整版本: Oracle Study之--Oracle TimeZone升级