Docker change the time zone

Oracle encountered on windows server, asp.net core web api docker's in linux

碰到问题
说ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found

This should be the server's time zone and lead to inconsistent oracle, docker default time zone are Etc / UTC, and my Oracle database does not have the time zone

Solution:
You can view the statement by Oracle which time zone

select tzname, tzabbrev from v$timezone_names

I'm only here in Asia Chongqing, so I selected the following operations are Chongqing

 

 

The Internet to find a lot of information, some said, to change what oracle configuration files, add any parameters, to no avail.

Some say when change docker zone, indeed, but a lot of the method does not work, he did not say so.

My operating system is a modified Ubuntu 16.04 area! Try to change the time zone of various various methods, to no avail.

My solution

1, into the docker  

docker exec d7f -it / bin / bash // d7f is the id or name of the container, here is my id
2, execute the command: dpkg-reconfigure tzdata

root@d7f2ead6bdfa:/app# dpkg-reconfigure tzdata
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Configuring tzdata
------------------

Please select the geographic area in which you live. Subsequent configuration questions will narrow this down by presenting a list of cities, representing the time zones in which they are located.

1. Africa 2. America 3. Antarctica 4. Australia 5. Arctic 6. Asia 7. Atlantic 8. Europe 9. Indian 10. Pacific 11. SystemV 12. US 13. Etc
Geographic area: 6

Please select the city or region corresponding to your time zone.

1. Aden 7. Ashgabat 13. Barnaul 19. Chongqing 25. Dushanbe 31. Hong_Kong 37. Jerusalem 43. Khandyga 49. Macau 55. Novokuznetsk 61. Pyongyang 67. Samarkand 73. Tashkent 79. Tomsk 85. Vladivostok
2. 8. Almaty Atyrau Beirut 14. 20. 26. Colombo Famagusta Hovd 32. 38. 44. Kabul Kolkata Magadan 50. 56. 62. Novosibirsk Qatar Seoul 68. 74. 80. Tbilisi Ujung_Pandang Yakutsk 86.
3. 9 Amman. Bishkek 21. 15. baghdad Damascus the Gaza 27. 33. 39. Irkutsk Kamchatka Krasnoyarsk 45. 51. 57. Makassar Omsk Qyzylorda 63. 69. 75. the Shanghai Tehran Ulaanbaatar 81. 87. Yangon
4. Anadyr 10. Bahrain 16. The Brunei 22 . Dhaka 28. Harbin Istanbul 34. 40. 46. Karachi Kuala_Lumpur Manila 52. 58. 64. Oral Rangoon Singapore 70. 76. 82. Tel_Aviv Urumqi Yekaterinburg 88.
5. 11. Aqtau Baku Chita 17. 23. 29. Dili Hebron 35. Jakarta 41. Kashgar 47. Kuching 53. Muscat 59. Phnom_Penh 65. Riyadh 71. Srednekolymsk 77. Thimphu 83. Ust-Nera 89. Yerevan
6. Aqtobe 12. Bangkok 18. Choibalsan 24. Dubai 30. Ho_Chi_Minh 36. Jayapura 42. Kathmandu 48. Kuwait 54. Nicosia 60. Pontianak 66. Sakhalin 72. Taipei 78. Tokyo 84. Vientiane
Time zone: 19


Current default time zone: 'Asia/Chongqing'
Local time is now: Mon Nov 12 12:56:26 CST 2018.
Universal Time is now: Mon Nov 12 04:56:26 UTC 2018.
 

Step by step down the election, to choose your own time zone

3. Verify

@ d7f2ead6bdfa the root: / App # dpkg -f-the reconfigure the noninteractive tzdata

Current default Time Zone: 'Asia / Chongqing'
the Local Time now IS: 12:56:32 Mon 12 is CST-Nov 2018.
Universal Time now IS: Mon 04-Nov 12 is: 56:32 UTC 2018.
look at my time zone has changed, I am here to restart a little container, application up and running.

Guess you like

Origin www.cnblogs.com/lidezhen/p/11668939.html