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