如果RDS SQL Server執行個體的系統字元集定序和時區設定與商務邏輯不符,或者應用程式需要處理多個時區的資料時,您可以通過修改資料庫執行個體的字元集定序和時區配置來確保資料在不同時區之間的轉換和展示準確無誤。
背景資訊
-
執行個體預設的字元集定序:Chinese_PRC_CI_AS
-
執行個體預設的時區:China Standard Time
-
系統庫包括
master、msdb、tempdb、model。
-
關於可選擇的字元集定序和時區,請以控制台顯示為準。
-
如果您要修改自建資料庫的字元集定序,請使用
ALTER DATABASE <自建資料庫名稱> COLLATE <字元集定序>命令。
使用限制
-
共用型執行個體不支援修改時區。
-
Serverless執行個體不支援修改系統字元集定序與時區。
修改系統字元集定序
-
修改字元集前,請確保執行個體中沒有任何使用者建立的資料庫(非系統資料庫)。執行個體中存在使用者資料庫時,控制台將不顯示字元集修改入口。
-
如果刪除了執行個體中的資料庫,刪除任務可能還在備執行個體中等待執行,為避免衝突,請確定主備執行個體均沒有資料庫後再修改字元集定序。
訪問RDS執行個體列表,在上方選擇地區,然後單擊目標執行個體ID。
-
在左側導覽列中單擊資料庫管理。
-
在資料庫管理頁面,單擊修改系統字元集定序。
-
在彈出的對話方塊中,設定系統字元集定序,單擊確定。
重要修改字元集會重啟執行個體,該過程將持續2~10分鐘,期間執行個體將處於不可用狀態。
-
您可以在執行個體基本資料頁面查看修改後的系統資料庫字元集。
修改時區
訪問RDS執行個體列表,在上方選擇地區,然後單擊目標執行個體ID。
-
在左側導覽列中單擊資料庫管理。
-
在資料庫管理頁面,單擊修改時區。
-
在彈出的對話方塊中,設定時區,單擊確定。更多詳情,請參見時區與UTC位移量對照表。
重要修改時區會重啟執行個體,高可用系列和叢集系列執行個體將停機1分鐘內,基礎系列執行個體約停機5分鐘內,停機期間執行個體將處於不可用狀態。
-
在彈出對話方塊中,再次單擊確定。
-
您可以在執行個體基本資料頁面查看修改後的時區。
對應欄位名為系統時區。
時區與UTC位移量對照表
部分國家在夏令時開始和結束時,需要手動將時鐘調快或調慢一小時,以切換到夏令時或返回到標準時間。夏令時(Daylight Saving Time,DST)是一種在一年特定時段內調整時鐘的措施,通過將當地時間調整為比標準時間提前一小時,以此節省能源等。具體交替開始和結束日期因國家和地區而有所不同。
|
時區 |
標準時間位移 |
夏令時標記 |
備忘 |
|
Afghanistan Standard Time |
(UTC+04:30) |
無 |
Kabul |
|
Alaskan Standard Time |
(UTC–09:00) |
DST+1小時 |
Alaska |
|
Arabian Standard Time |
(UTC+04:00) |
無 |
Abu Dhabi, Muscat |
|
Atlantic Standard Time |
(UTC–04:00) |
DST+1小時 |
Atlantic Time (Canada) |
|
AUS Central Standard Time |
(UTC+09:30) |
無 |
Darwin |
|
AUS Eastern Standard Time |
(UTC+10:00) |
DST+1小時 |
Canberra, Melbourne, Sydney |
|
Belarus Standard Time |
(UTC+03:00) |
無 |
Minsk |
|
Canada Central Standard Time |
(UTC–06:00) |
無 |
Saskatchewan |
|
Cape Verde Standard Time |
(UTC–01:00) |
無 |
Cabo Verde Is. |
|
Cen. Australia Standard Time |
(UTC+09:30) |
無 |
Adelaide |
|
Central America Standard Time |
(UTC–06:00) |
無 |
Central America |
|
Central Asia Standard Time |
(UTC+06:00) |
無 |
Astana |
|
Central Brazilian Standard Time |
(UTC–04:00) |
無 |
Cuiaba |
|
Central Europe Standard Time |
(UTC+01:00) |
無 |
Belgrade, Bratislava, Budapest, Ljubljana, Prague |
|
Central European Standard Time |
(UTC+01:00) |
DST+1小時 |
Sarajevo, Skopje, Warsaw, Zagreb |
|
Central Pacific Standard Time |
(UTC+11:00) |
無 |
Solomon Islands, New Caledonia |
|
Central Standard Time |
(UTC–06:00) |
DST+1小時 |
Central Time (US and Canada) |
|
Central Standard Time (Mexico) |
(UTC–06:00) |
無 |
Guadalajara, Mexico City, Monterrey |
|
China Standard Time |
(UTC+08:00) |
無 |
Beijing, Chongqing, Hong Kong, Urumqi |
|
E. Africa Standard Time |
(UTC+03:00) |
無 |
Nairobi |
|
E. Australia Standard Time |
(UTC+10:00) |
DST+1小時 |
Brisbane |
|
E. Europe Standard Time |
(UTC+02:00) |
DST+1小時 |
Chisinau |
|
E. South America Standard Time |
(UTC–03:00) |
無 |
Brasilia |
|
Eastern Standard Time |
(UTC–05:00) |
DST+1小時 |
Eastern Time (US and Canada) |
|
Georgian Standard Time |
(UTC+04:00) |
無 |
Tbilisi |
|
GMT Standard Time |
(UTC) |
無 |
Dublin, Edinburgh, Lisbon, London |
|
Greenland Standard Time |
(UTC–03:00) |
DST+1小時 |
Greenland |
|
Greenwich Standard Time |
(UTC) |
無 |
Monrovia, Reykjavik |
|
GTB Standard Time |
(UTC+02:00) |
DST+1小時 |
Athens, Bucharest |
|
Hawaiian Standard Time |
(UTC–10:00) |
無 |
Hawaii |
|
India Standard Time |
(UTC+05:30) |
無 |
Chennai, Kolkata, Mumbai, New Delhi |
|
Jordan Standard Time |
(UTC+02:00) |
無 |
Amman |
|
Korea Standard Time |
(UTC+09:00) |
無 |
Seoul |
|
Middle East Standard Time |
(UTC+02:00) |
無 |
Beirut |
|
Mountain Standard Time |
(UTC–07:00) |
DST+1小時 |
Mountain Time (US and Canada) |
|
Mountain Standard Time (Mexico) |
(UTC–07:00) |
無 |
Chihuahua, La Paz, Mazatlan |
|
US Mountain Standard Time |
(UTC–07:00) |
無 |
Arizona |
|
New Zealand Standard Time |
(UTC+12:00) |
DST+1小時 |
Auckland, Wellington |
|
Newfoundland Standard Time |
(UTC–03:30) |
DST+1小時 |
Newfoundland |
|
Pacific SA Standard Time |
(UTC–03:00) |
無 |
Santiago |
|
Pacific Standard Time |
(UTC–08:00) |
DST+1小時 |
Pacific Time (US and Canada) |
|
Pacific Standard Time (Mexico) |
(UTC–08:00) |
無 |
Baja California |
|
Russian Standard Time |
(UTC+03:00) |
無 |
Moscow, St. Petersburg, Volgograd |
|
SA Pacific Standard Time |
(UTC–05:00) |
無 |
Bogota, Lima, Quito, Rio Branco |
|
SE Asia Standard Time |
(UTC+07:00) |
無 |
Bangkok, Hanoi, Jakarta |
|
China Standard Time |
(UTC+08:00) |
無 |
Kuala Lumpur, Singapore |
|
Tokyo Standard Time |
(UTC+09:00) |
無 |
Osaka, Sapporo, Tokyo |
|
US Eastern Standard Time |
(UTC–05:00) |
DST+1小時 |
Indiana (East) |
|
UTC |
UTC |
無 |
Coordinated Universal Time |
|
UTC–02 |
(UTC–02:00) |
無 |
Coordinated Universal Time–02 |
|
UTC–08 |
(UTC–08:00) |
無 |
Coordinated Universal Time–08 |
|
UTC–09 |
(UTC–09:00) |
無 |
Coordinated Universal Time–09 |
|
UTC–11 |
(UTC–11:00) |
無 |
Coordinated Universal Time–11 |
|
UTC+12 |
(UTC+12:00) |
無 |
Coordinated Universal Time+12 |
|
W. Australia Standard Time |
(UTC+08:00) |
無 |
Perth |
|
W. Central Africa Standard Time |
(UTC+01:00) |
無 |
West Central Africa |
|
W. Europe Standard Time |
(UTC+01:00) |
DST+1小時 |
Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna |
|
Dateline Standard Time |
(UTC-12:00) |
無 |
International Date Line West |
|
Aleutian Standard Time |
(UTC-10:00) |
DST+1小時 |
Aleutian Islands |
|
Marquesas Standard Time |
(UTC-09:30) |
無 |
Marquesas Islands |
|
Easter Island Standard Time |
(UTC-06:00) |
DST+1小時 |
Easter Island |
|
Eastern Standard Time (Mexico) |
(UTC-05:00) |
無 |
Chetumal |
|
Haiti Standard Time |
(UTC-05:00) |
DST+1小時 |
Haiti |
|
Turks And Caicos Standard Time |
(UTC-05:00) |
DST+1小時 |
Turks and Caicos |
|
Paraguay Standard Time |
(UTC-04:00) |
DST+1小時 |
Asuncion |
|
Venezuela Standard Time |
(UTC-04:00) |
無 |
Caracas |
|
SA Western Standard Time |
(UTC-04:00) |
無 |
Georgetown, La Paz, Manaus, San Juan |
|
Tocantins Standard Time |
(UTC-03:00) |
DST+1小時 |
Araguaina |
|
SA Eastern Standard Time |
(UTC-03:00) |
無 |
Cayenne, Fortaleza |
|
Argentina Standard Time |
(UTC-03:00) |
無 |
City of Buenos Aires |
|
Montevideo Standard Time |
(UTC-03:00) |
無 |
Montevideo |
|
Magallanes Standard Time |
(UTC-03:00) |
DST+1小時 |
Punta Arenas |
|
Saint Pierre Standard Time |
(UTC-03:00) |
DST+1小時 |
Saint Pierre and Miquelon |
|
Bahia Standard Time |
(UTC-03:00) |
DST+1小時 |
Salvador |
|
Mid-Atlantic Standard Time |
(UTC-02:00) |
無 |
Mid-Atlantic - Old |
|
Azores Standard Time |
(UTC-01:00) |
DST+1小時 |
Azores |
|
Romance Standard Time |
(UTC+01:00) |
DST+1小時 |
Brussels, Copenhagen, Madrid, Paris |
|
Morocco Standard Time |
(UTC+01:00) |
DST+1小時 |
Casablanca |
|
Sao Tome Standard Time |
(UTC+01:00) |
無 |
Sao Tome |
|
Egypt Standard Time |
(UTC+02:00) |
DST+1小時 |
Cairo |
|
West Bank Standard Time |
(UTC+02:00) |
DST+1小時 |
Gaza, Hebron |
|
South Africa Standard Time |
(UTC+02:00) |
無 |
Harare, Pretoria |
|
FLE Standard Time |
(UTC+02:00) |
DST+1小時 |
Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius |
|
Israel Standard Time |
(UTC+02:00) |
DST+1小時 |
Jerusalem |
|
Kaliningrad Standard Time |
(UTC+02:00) |
無 |
Kaliningrad |
|
Sudan Standard Time |
(UTC+02:00) |
無 |
Khartoum |
|
Libya Standard Time |
(UTC+02:00) |
DST+1小時 |
Tripoli |
|
Namibia Standard Time |
(UTC+02:00) |
DST+1小時 |
Windhoek |
|
Arabic Standard Time |
(UTC+03:00) |
無 |
Baghdad |
|
Turkey Standard Time |
(UTC+03:00) |
無 |
Istanbul |
|
Arab Standard Time |
(UTC+03:00) |
無 |
Kuwait, Riyadh |
|
Astrakhan Standard Time |
(UTC+04:00) |
無 |
Astrakhan, Ulyanovsk |
|
Azerbaijan Standard Time |
(UTC+04:00) |
無 |
Baku |
|
Mauritius Standard Time |
(UTC+04:00) |
無 |
Port Louis |
|
Saratov Standard Time |
(UTC+04:00) |
無 |
Saratov |
|
Georgian Standard Time |
(UTC+04:00) |
無 |
Tbilisi |
|
Volgograd Standard Time |
(UTC+04:00) |
無 |
Volgograd |
|
Caucasus Standard Time |
(UTC+04:00) |
無 |
Yerevan |
|
West Asia Standard Time |
(UTC+05:00) |
無 |
Ashgabat, Tashkent |
|
Ekaterinburg Standard Time |
(UTC+05:00) |
無 |
Ekaterinburg |
|
Pakistan Standard Time |
(UTC+05:00) |
無 |
Islamabad, Karachi |
|
Sri Lanka Standard Time |
(UTC+05:30) |
無 |
Sri Jayawardenepura |
|
Nepal Standard Time |
(UTC+05:45) |
無 |
Kathmandu |
|
Bangladesh Standard Time |
(UTC+06:00) |
無 |
Dhaka |
|
Omsk Standard Time |
(UTC+06:00) |
無 |
Omsk |
|
Myanmar Standard Time |
(UTC+06:30) |
無 |
Yangon (Rangoon) |
|
Altai Standard Time |
(UTC+07:00) |
無 |
Barnaul, Gorno-Altaysk |
|
W. Mongolia Standard Time |
(UTC+07:00) |
DST+1小時 |
Hovd |
|
North Asia Standard Time |
(UTC+07:00) |
無 |
Krasnoyarsk |
|
N. Central Asia Standard Time |
(UTC+07:00) |
無 |
Novosibirsk |
|
Tomsk Standard Time |
(UTC+07:00) |
無 |
Tomsk |
|
North Asia East Standard Time |
(UTC+08:00) |
DST+1小時 |
Irkutsk |
|
Singapore Standard Time |
(UTC+08:00) |
無 |
Kuala Lumpur, Singapore |
|
Taipei Standard Time |
(UTC+08:00) |
無 |
Taipei |
|
Ulaanbaatar Standard Time |
(UTC+08:00) |
無 |
Ulaanbaatar |
|
Aus Central W. Standard Time |
(UTC+08:45) |
無 |
Eucla |
|
Transbaikal Standard Time |
(UTC+09:00) |
無 |
Chita |
|
Yakutsk Standard Time |
(UTC+09:00) |
無 |
Yakutsk |
|
West Pacific Standard Time |
(UTC+10:00) |
無 |
Guam, Port Moresby |
|
Tasmania Standard Time |
(UTC+10:00) |
DST+1小時 |
Hobart |
|
Vladivostok Standard Time |
(UTC+10:00) |
DST+1小時 |
Vladivostok |
|
Lord Howe Standard Time |
(UTC+10:30) |
DST+1小時 |
Lord Howe Island |
|
Bougainville Standard Time |
(UTC+11:00) |
無 |
Bougainville Island |
|
Magadan Standard Time |
(UTC+11:00) |
無 |
Magadan |
|
Norfolk Standard Time |
(UTC+11:00) |
DST+1小時 |
Norfolk Island |
|
Sakhalin Standard Time |
(UTC+11:00) |
無 |
Sakhalin |
|
Fiji Standard Time |
(UTC+12:00) |
無 |
Fiji |
|
Kamchatka Standard Time |
(UTC+12:00) |
DST+1小時 |
Petropavlovsk-Kamchatsky - Old |
|
Chatham Islands Standard Time |
(UTC+12:45) |
DST+1小時 |
Chatham Islands |
|
UTC+13 |
(UTC+13:00) |
無 |
Coordinated Universal Time+13 |
|
Tonga Standard Time |
(UTC+13:00) |
無 |
Nuku'alofa |
|
Samoa Standard Time |
(UTC+13:00) |
DST+1小時 |
Samoa |
|
Line Islands Standard Time |
(UTC+14:00) |
無 |
Kiritimati Island |
相關文檔
通過API查詢或修改系統字元集定序和時區。