Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Database \ ORA-01839 error caused by incorrect system date setting     - How do I switch from NetworkManager to systemd-network on Linux (Linux)

- C ++ How to determine the types of constants (Programming)

- SSH keys using login and password to log prohibited practice (Linux)

- RHEL7 system making use of OpenStack mirror (Linux)

- Install and manage Java under mac (Linux)

- CentOS6.3 build a Python 3.3 environment to access Oracle 11gR2 (Database)

- How to adjust the system time CentOS (Linux)

- Error code: 2013 Lost connection to MySQL server during query (Database)

- Linux + Apache + PHP + Oracle based environment to build (Server)

- Bash added to the Vi mode indicator (Linux)

- APF firewall installation and configuration under Linux (Linux)

- Ubuntu 14.04 modify environment variables (Linux)

- Adding SSH to Github (Linux)

- CentOS 6.6 install Oracle 11gR2 database (Database)

- User and user group management Linux Command (Linux)

- Cross server / client backup command: rsync use (Server)

- Linux dmidecode command detail (Linux)

- CentOS install Java 1.8 (Linux)

- How to use Monit to deploy a server to monitor the system (Server)

- Java Generics (Programming)

  ORA-01839 error caused by incorrect system date setting
  Add Date : 2017-08-31      
  In the morning, I received a message from a developer that said SQL was being executed in a test environment, but the same SQL was executed in another test environment, so I could help analyze the reason. SQL being given as follows:

SQL> select to_date (substr (cvalidate, 6, 10), 'MM-DD') from lcpol where polno = '210010000123931';

Select to_date (substr (cvalidate, 6, 10), 'MM-DD') from lcpol where polno = '210010000123931';


ERROR at line 1:

ORA-01839: date not valid for month specified

 Look at the error message is ORA-01839: date not valid for month specified. First thought may be a data problem caused by the use of TO_DATE error. In any case to go to verify the next is not really the existence of the error. First connected to the implementation of the error that the library, the implementation of SQL, and sure enough, as the developer said being given. Then connected to the implementation of the normal reservoir, the implementation of SQL, and sure enough, Oracle is very friendly to return the results. Since the wrong facts exist, it is necessary to find out the cause of the error.


 According to the first response to the error, go ahead and compare the data on both sides is the same. The results were a bit disappointing, and the data on both sides was exactly the same. SQL itself is a problem? Careful analysis of the next SQL, it should be true ah, although the use of 'MM-DD' formatting not very good, but it should not lead to the implementation of the wrong ah Moreover, the other is the implementation of the correct reservoir. Where is the problem in the end? Is the date of the two libraries set up different parameters? Look at the two databases NLS_CHARACTERSET,

NLS_NCHAR_CHARACTERSET, NLS_DATE_LANGUAGE, NLS_DATE_FORMAT settings are the same. Well, it seems that the problem should not be in the data.


 Looking back, in the conditions polno = '210010000123931' under the cvalidate is what value?

SQL> select cvalidate from lcpol where polno = '210010000123931'; CVALIDATE ---------- 2012-02-29

It seems that the value is also quite special, 4 years will appear once. But special to special, should not be given the. Think directly if the value of what will happen? Well, try it out:

SQL> select to_date (substr ( '2012-02-29', 6, 10), 'MM-DD') from dual;



ERROR at line 1:

ORA-01839: date not valid for month specified


SQL> select to_date (substr ( '2012-02-29', 6, 10), 'MM-DD') from dual;





Test results are the same. Is suddenly unable to do anything, suddenly noticed that although the use of 'MM-DD' to format the date, but the results still have years of information! Think of the current NLS_DATE_FORMAT as 'YYYY-MM-DD', guess Oracle will use the current system date to attach the information of the year. Is that the implementation of the wrong date of the reservoir system is not correct, immediately look at, and sure enough, the system date is 2013!

$ Date

Fri Mar 1 18:45:13 CST 2013

Contact your system management team to fix the system date. After correcting the system date, the SQL execution is normal and the problem is solved.
- Eclipse remove all comments and code spaces (Linux)
- Ubuntu 14.04 Nvidia proprietary drivers for install two graphic cards (Linux)
- Xshell upload files to achieve Windows host Linux (Linux)
- DRBD rapid installation and deployment (Server)
- Install Ubuntu open source drawing program MyPaint 1.2.0 (Linux)
- Linux server alarms using Java (Server)
- Oracle to start to solve the error ORA-27102 (Database)
- To see the Linux device tree (Linux)
- Linux - EXT2 file system is described in detail (Linux)
- Heartbeat cluster components Overview (Server)
- SecureCRT session buffer size settings (Linux)
- Asynchronous JavaScript loading (Programming)
- Use Visual Studio to compile and use WinGDB remote debugging embedded Linux programs (Programming)
- Using IntelliJ IDEA 13 integrated development environment to build Android (Linux)
- Python Multithreaded Programming (Programming)
- How to install Laravel PHP framework on CentOS 7 / Ubuntu 15.04 (Server)
- 17 How to install the Ubuntu 14.04 and Linux Mint Kodi14 (XBMC) (Linux)
- Ubuntu firewall installation and configuration (Linux)
- Linux disk quota-related instruction (Linux)
- 10 Nginx safety tips (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.