"Pits" the day of the ORA-01846 week is invalid

Source: Internet
Author: User

The database migration process has the following time format:

Sun Jul 22 18:14:38 CST 2018

Formatted as Date:

TO_DATE(‘Sun Jul 22 18:14:38 CST 2018‘,‘Dy MON DD HH24:MI:SS "CST" YYYY‘)

The error message in Import oracle11g is

ORA-01846 Day of Week is invalid

Resolution process:
Resolve database time format issues in cases where SQL cannot be modified
First, confirm the database language environment
Use the SQL statement to view the locale parameters of the database that holds the data:

SELECT * FROM V$NLS_PARAMETERS;


Confirm that the current database time format is Chinese Simplified, the date format in the SQL statement is English.
Second, modify the nls_date_language parameters according to the time

    • Method One
      Specify the language parameter for the date when formatting:
TO_DATE(‘Sun Jul 22 18:14:38 CST 2018‘,‘Dy Mon DD HH24:MI:SS YYYY‘,‘NLS_DATE_LANGUAGE = American‘)

    • Method Two
      Modify current session Parameters
alter session set nls_date_language=‘american‘;

After successful modification:

Action Date Format:

Of course, there are more than two ways to modify the Nls_date_language parameter, but it is appropriate to use both methods in this scenario.

"Pits" the day of the ORA-01846 week is invalid

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.