Oacle12c support可插入数据库(PDB)在一个统一的数据库(CDB)中具有不同的字符集、时区文件版本和数据库时区。
出于性能原因,Oracle建议将数据库时区设置为UTC(0:00),因为不需要转换时区。
多租户体系结构允许您为每个可插入数据库指定一个不同的数据库时区,并使用容器数据库的时区作为默认值。
在容器数据库级别设置时区与为非cdb实例设置时区相同。CDB设置是所有可插入数据库的默认值。
1. Check the current time container database
sqlplus / as sysdba
SQL> select dbtimezone from dual;
2. Check the PDB time zone
SQL> alter session set container=orclpdb;
SQL> SELECT dbtimezone FROM DUAL;
3. Modify the PDB time zone, according to the actual need to set the zone
SQL> ALTER DATABASE SET TIME_ZONE='+00:00';
Pdb need to restart after a good modification
SQL> alter pluggable database orclpdb close;
SQL> alter pluggable database orclpdb open;
SQL> select dbtimezone from dual;
Attached (marked red is commonly used in China time zone):
- UTC-12 (IDL - International Date Line)
- UTC-11 (MIT - Midway Standard Time)
- UTC-10 (HST - Hawaii - Aleutian Standard Time)
- UTC-9: 30 (MSIT - Marquesas Islands Standard Time)
- UTC-9 (AKST - Alaska Standard Time)
- UTC-8 (PST - Pacific Standard Time A)
- UTC-7 (MST - Mountain Standard Time in North America)
- UTC-6 (CST - Central Standard Time in North America)
- UTC-5 (EST - North American Eastern Standard Time)
- UTC-4 (AST - Atlantic Standard Time)
- UTC-3: 30 (NST - Newfoundland Standard Time)
- UTC-3 (SAT - South America Standard Time)
- UTC-2 (BRT - Brazil Time)
- UTC-1 (CVT - Cape Verde Standard Time)
- UTC (WET - Western European time zone, GMT - Greenwich Mean Time)
- UTC + 1 (CET - Central European Time Zone)
- UTC + 2 (EET - Europe Eastern Time Zone)
- UTC + 3 (MSK - Moscow region)
- UTC + 3: 30 (IRT - Iran Standard Time)
- UTC + 4 (META - when Middle East zone A)
- UTC + 4: 30 (AFT- Afghanistan Standard Time)
- UTC + 5 (METB - Middle time zone B)
- UTC + 5: 30 (IDT - India Standard Time)
- UTC + 5: 45 (NPT - Nepal Standard Time)
- UTC + 6 (BHT - Bangladesh Standard Time)
- UTC + 6: 30 (MRT - Myanmar Standard Time)
- UTC + 7 (IST - Indochina Standard Time)
- UTC + 8 (EAT - East Standard Time / China Standard Time (BJT))
- UTC + 9 (FET- Far Eastern Standard Time)
- UTC + 9: 30 (ACST - Australia and Central Standard Time)
- UTC + 10 (AEST - Australian Eastern Standard Time)
- UTC + 10: 30 (FAST - Far East Australia Standard Time)
- UTC + 11 (VTT - Vanuatu Standard Time)
- UTC + 11: 30 (NFT - Norfolk Island Standard Time)
- UTC + 12 (PSTB - Pacific Standard Time B)
- UTC + 12: 45 (CIT - Chatham Islands Standard Time)
- UTC + 13 (PSTC - Pacific Standard Time C)
- UTC + 14 (PSTD - Pacific Standard Time D)