Thursday, April 2, 2015

Error truncating partition

If for any reason you had an issue with your TNPM datachannel LDR that took more than 3 days to solve, you may find the following error on a LDR walkback file once it starts processing the backlog:

END OF WALKBACK20165: Error truncating partition
ORA-06512: at "PV_ADMIN.PVM_ERROR", line 137
ORA-06512: at "PV_ADMIN.PVM_DATALOAD", line 3558
ORA-06512: at line 1

This is caused due to the fact that the LDR is trying to do changes on a db partition that is already at the READONLY state. You can confirm it by searching the following on the oracle trace log:

$ORACLE_BASE/diag/rdbms/pv/pv/trace/proviso_PV_LDR_01.log
The Lowest Level Error Code is:
ORA-00372: file 487 cannot be modified at this time
ORA-01110: data file 487: '/(...)/PV_C01_1DGA_000_2014082500_001.dbf'

Unfortunately, the LDR will not proceed until the issue is solved and will keep generating walkbacks.

To solve the problem:

1) Connect to the oracle database as PV_ADMIN
2) Execute the query (replace the correct tablespace_name value as showed on the oracle trace log) :

select tablespace_name, status from dba_tablespaces where tablespace_name like '%C01_1DGA_000_2014082500%';

3) You should get two columns, one with the tablespace name and the other with "READ ONLY"

4) Change the tablespace to READ/WRITE executing the following (use the tablespace name returned by the previous sql query):

alter tablespace tablespace_name read write;

like:
alter tablespace C01_1DGA_000_2014082500 read write;

5) Bounce the LDR and it should work fine