如果RDS SQL Server实例的系统字符集排序规则和时区设置与业务逻辑不符,或者应用程序需要处理多个时区的数据时,您可以通过修改数据库实例的字符集排序规则和时区配置来确保数据在不同时区之间的转换和展示准确无误。
背景信息
实例默认的字符集排序规则:Chinese_PRC_CI_AS
实例默认的时区:China Standard Time
系统库包括
master
、msdb
、tempdb
、model
。
关于可选择的字符集排序规则和时区,请以控制台显示为准。
如果您要修改自建数据库的字符集排序规则,请使用
ALTER DATABASE <自建数据库名称> COLLATE <字符集排序规则>
命令。
修改系统字符集排序规则
修改字符集前,请确保实例中没有任何用户创建的数据库(非系统数据库)。实例中存在用户数据库时,控制台将不显示字符集修改入口。
如果删除了实例中的数据库,删除任务可能还在备实例中等待执行,为避免冲突,请确定主备实例均没有数据库后再修改字符集排序规则。
- 访问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查询或修改系统字符集排序规则和时区。