如果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查詢或修改系統字符集排序規則和時區。