Error processing: DBD::Pg::st execute failed: ERROR: numeric field overflow

Bumped into this message :

Jul  7 00:13:54 server1 /usr/local/play/bin/getintodb.pl[12345]: 1067-345246.xml: 
Error processing: DBD::Pg::st execute failed: 
ERROR:  numeric field overflow
DETAIL:  The absolute value is greater than or equal to 10^2 for field with precision 3, scale 1.

Hehehe… this is from posgresql database..

let’s examine the SQL statement before that error :

Jul  7 00:13:54 server1 /usr/local/bin/getintodb.pl[12345]: 
Calculated max_relative_humidity as 100.0 
Fatal SQL Error for SQL: INSERT INTO forecast_daily_lt
 (data_timestamp,station_id,gust_direction,gust_speed,
gust_timestamp,hail_duration,max_air_temperature,
max_qfe,max_qff,max_qnh,max_rainfall_15m,max_rainfall_30m,
max_relative_humidity,mean_air_temperature,mean_relative_humidity,
mean_wind_dir,mean_wind_speed,min_air_temperature,
min_qfe,min_qff,min_qnh,min_relative_humidity,rainfall_duration,
total_hail,total_rainfall) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) and 
VALUES: 2009-06-07 16:00:00 UTC,67,210,3.2,
2009-06-07 19:00:00+00,0,32.8,
1007.6,1012.0,1012.3,0,0,100.0,
26.1,82.5,200,0.5,23.1,1004.7,1009.2,
1009.4,63.2,0,0,0

database structure.. turn out to be among others..

\d forecast_daily_lt
               Table "public.forecast_daily"
         Column         |           Type           | Modifiers 
------------------------+--------------------------+-----------
 data_timestamp         | timestamp with time zone | 
...
 min_relative_humidity  | numeric(3,1)             | 
 mean_relative_humidity | numeric(3,1)             | 
 max_relative_humidity  | numeric(3,1)             | 
 ...
 total_hail             | numeric(4,1)             | 
 hail_duration          | numeric(3,0)             | 
Indexes:
    "forecast_daily_lt_idx1" UNIQUE, btree (data_timestamp, station_id)

10^2 is equal to 100.

and

numeric(3,1) mean .. 3 total width and with 1 decimal point..

so ..

the maximum it can take is 99.9

hence ..

it can't accept 100.1 which is 4 digit with 1 decimal point already ..

Solution : shall changed field to numeric (4,1)..

to change..

just need to issue this command via the SQL prompt.

 ALTER TABLE forecast_daily_lt ALTER column max_relative_humidity TYPE numeric(4,1);

so that it changed to :

               Table "public.forecast_daily_lt"
         Column         |           Type           | Modifiers 
------------------------+--------------------------+-----------
 max_relative_humidity  | numeric(4,1)             | 

Get Free Email Updates!

Signup now and receive an email once I publish new content.

I will never give away, trade or sell your email address. You can unsubscribe at any time.

Like

Related Post

6 Responses

  1. namran says:

    the following item also appear..

    ORA-00257:
    archiver error. Connect internal only, until freed.

    Cause: The archiver process received an error while trying to archive a redo log. If the problem is not resolved soon, the database will stop executing transactions. The most likely cause of this message is the destination device is out of space to store the redo log file.

    can either increase the size with the above said post.

    or ..

    DELETE archivelog ALL device TYPE disk;

    in rman frees your archive log from unneeded data and fixes this problem,

    until it’s full again.

    Reply
  2. namran says:

    some RMAN detail can be obtained from here.

    http://www.oracle-base.com/articles/11g/RmanEnhancements_11gR1.php

    and for the flash_recovery_area
    further reading ..

    http://www.ucertify.com/article/the-flash-recovery-area.html

    Reply
  3. namran says:

    Setting up the flash recovery area using SQL commands:

    Following are the two-initialization parameters that should be defined in order to set up the flash recovery area:

    * DB_RECOVERY_FILE_DEST_SIZE
    * DB_RECOVERY_FILE_DEST

    Reason to define the above mentioned parameters:
    The DB_RECOVERY_FILE_DEST_SIZE and DB_RECOVERY_FILE_DEST are defined to make the flash recovery area usable without shutting down and restarting the database instance.

    Note: DB_RECOVERY_FILE_DEST_SIZE is defined before DB_RECOVERY_FILE_DEST in order to define the size of the flash recovery area.
    The size of the flash recovery area should be large enough to hold a copy of all data files, all incremental backups, online redo logs, archived redo log not yet backed up on tape, control files, and control file auto backups. The following table shows the various estimated sizes for all the database elements in the Flash Recovery area:

    Configuring DB_RECOVERY_FILE_DEST_SIZE

    ALTER SYSTEM
    SET db_recovery_file_dest_size = 10g scope = BOTH;

    In the above example the size of the flash recovery area is 10GB and the initialization parameter takes effect immediately and stays in effect even after the database restarts.

    The role of the DB_RECOVERY_FILE_DEST parameter is to specify the physical location where all the flash recovery files are to be stored.

    An example of how this parameter specifies the location is given below:

    ALTER SYSTEM
    SET db_ recovery_file_dest =/OFR1? scope = BOTH;

    In the above example OFR1 is the name of the directory that has been specified as the physical location where all the flash recovery files are stored in the flash recovery area.

    Note:

    * If the value specified in the db_recovery_file_dest parameter is cleared then as a result the flash recovery area is disabled.
    * DB_RECOVERY_FILE_DEST_SIZE parameter cannot be cleared up prior to the DB_RECOVERY_FILE_DEST parameter.

    Dynamically Defining the Flash Recovery Area

    ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 2G SCOPE=BOTH
    ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = 'C:ORACLERECOVERY_AREA' SCOPE=BOTH

    You must always specify the size parameter before specifying the location parameter.
    Disabling the Current Flash Recovery Area

    ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = ''

    Note: even after you disable the flash recovery area, the RMAN will continue to access the files located in the flash recovery area for backup and recovery purposes.

    Default File Location and the Flash Recovery Area
    The initialization parameters DB_CREATE_FILE_DEST and DB_CREATE_ONLINE_LOG_DEST_n determine the location of all OMF files.
    Control Files
    If you haven’t set the CONTROL_FILES parameter, Oracle will create the control files in various default locations, according to the following rules:

    • If you specify the DB_CREATE_ONLINE_LOG_DEST_n parameter, Oracle will create an OMF-based control file in n number of locations, with the first directory holding the primary control file.
    • If you specify the DB_CREATE_FILE_DEST and DB_RECOVERY_FILE_DEST parameters, Oracle will create an OMF based control file in both of these locations.
    • If you just specify the DB_RECOVERY_FILE_DEST parameter, Oracle will create an OMF-based control file in the flash recovery area only.
    • If you omit all three of the initialization parameters, Oracle will create a non-OMF-based control file in the system-specific default location.
    Note: If the database creates an OMF control file, and it is using a server parameter file, then the database sets the CONTROL_FILES initialization parameter in the server parameter file.
    Redo Log Files

    If you omit the LOGFILE clause during database creation, Oracle will create the redo log files according to the same rules as mentioned above.
    Backing Up the Flash Recovery Area
    In order to back up the flash recovery area itself using RMAN, you must set CONFIGURE BACKUP OPTIMIZATION to ON.
    You can back up the flash recovery area only to a tape device using these backup commands:

    BACKUP RECOVERY AREA

    o This command backs up all flash recovery files in the current or previous flash recovery area destinations.
    o It backs up only those files that have never been backed up to tape before.
    o The files that the command will back up include full backups, incremental backups, control file autobackups, archive logs, and datafile copies.

    BACKUP RECOVERY FILES

    This command backs up all the files that the BACKUP RECOVERY AREA command does, but from all areas on your file system, not just from the flash recovery area.

    BACKUP RECOVERY FILE DESTINATION

    Use this command to move disk backups created in the flash recovery area to tape.
    Note: Neither of the two commands, BACKUP RECOVERY AREA or BACKUP RECOVERY FILES, will back up any permanent files or the flashback logs in the flash recovery area.

    Managing the Flash Recovery Area
    Space Management

    If you ever receive the out-of-space warning (85) and critical alerts (97) because of space pressure in you flash recovery area, you have the following options:
    o Consider changing your backup retention and archive log retention policies.
    o Increase the size of the DB_RECOVERY_FILE_DEST_SIZE parameter to allocate more space to your current flash recovery area.
    o Use the BACKUP RECOVERY AREA command in the RMAN to back up the contents of the flash recovery area to a tape device.
    o Use the RMAN to delete unnecessary backup files. The RMAN commands CROSSCHECK and DELETE EXPIRED come in handy during this deletion process.

    Data Dictionary Views

    V$RECOVERY_FILE_DEST
    This view is the main source and contains the following columns:

    SPACE_LIMIT :how much space has been allocated to the flash recovery area

    SPACE_USED :space occupied

    SPACE_RECLAIMABLE :how much space you can reclaim by getting rid of obsolete and redundant files in the flash recovery area.
    NUMBER_OF_FILES :number of files

    V$FLASH_RECOVERY_AREA_USAGE

    This view provides information about the flash recovery area disk space usage. Following is its main columns:

    FILE_TYPE :the type of the file and can have any of the following values: controlfile, onlinelog, archivelog, backuppiece, imagecopy, flashbacklog

    PERCENT_SPACE_USED :This represents the disk space used by the file type, in percentage.

    PERCENT_SPACE_RECLAIMABLE :this represents the percentage of disk space reclaimable from the file type after deleting any obsolete or redundant files, and files backed up to a tertiary device.

    Flash Recovery Area Columns in Other Views

    The Yes/No column IS_RECOVERY_DEST_FILE is added to some dictionary views to indicate whether the file was created in the flash recovery area. It exists in V$CONTROLFILE, V$LOGFILE, V$ARCHIVED_LOG, V$DATAFILE_COPY, V$BACKUP_PIECE.
    Moving the Flash Recovery Area

    ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='/u01/app/oracle/new_area' SCOPE=BOTH

    Eventually, Oracle will delete all the transient files from the previous flash recovery area location, when each of them become eligible for deletion. However, if you want to move your current permanent files, transient files, or flashback logs to the new flash recovery area, you can do so by using the standard file-moving procedures.

    Reply
  4. namran says:

    if failed to stop/start for whatever reason
    try :

    shutdown abort;

    startup nomount;

    Reply
  5. ceiling fans with lights and remote says:

    Ceiling fans with lights offers users the option to light up the room
    and gives a decorative look to it. Therefore, environment conscious people often encourage the use of ceiling fans with lights.
    Depending on the homeowner’s choice, they can either have up lights or down lights in them.

    Reply
  6. boobs adult social network adult social network says:

    Heya i am for the first time here. I found this board and I
    find It truly useful & it helped me out much. I hope to present one thing
    again and aid others such as you aided me.

    Reply

Anything to add?

X