affected partition [message #598874] |
Fri, 18 October 2013 11:01 |
|
guddu_12
Messages: 227 Registered: April 2012 Location: UK
|
Senior Member |
|
|
Dear All,
How can i get the partition name which was recently loaded. When my load start it truncate the partition and load the data.once the data is loaded there is another load which will read from earlier loaded partition table. i want to know on the fly which partition was loaded recently.
Any clue
|
|
|
|
|
|
|
Re: affected partition [message #598883 is a reply to message #598874] |
Fri, 18 October 2013 12:04 |
Solomon Yakobson
Messages: 3273 Registered: January 2010 Location: Connecticut, USA
|
Senior Member |
|
|
guddu_12 wrote on Fri, 18 October 2013 12:01Any clue
Depends on how far back load was done. Something like this might give you the answer, if you get lucky:
SCOTT@orcl > select scn_to_timestamp(max(ora_rowscn)) from emp;
select scn_to_timestamp(max(ora_rowscn)) from emp
*
ERROR at line 1:
ORA-08181: specified number is not a valid system change number
ORA-06512: at "SYS.SCN_TO_TIMESTAMP", line 1
SCOTT@orcl > update emp set sal = sal where ename = 'KING';
1 row updated.
SCOTT@orcl > commit;
Commit complete.
SCOTT@orcl > select scn_to_timestamp(max(ora_rowscn)) from emp;
SCN_TO_TIMESTAMP(MAX(ORA_ROWSCN))
---------------------------------------------------------------------------
18-OCT-13 12.59.08.000000000 PM
SCOTT@orcl >
SY.
|
|
|
|
|
Re: affected partition [message #598887 is a reply to message #598885] |
Fri, 18 October 2013 12:10 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
Isn't the question about knowing partition name for the data loaded. The partition for statement should give that. Or am I missing something?
|
|
|
Re: affected partition [message #598888 is a reply to message #598885] |
Fri, 18 October 2013 12:18 |
Solomon Yakobson
Messages: 3273 Registered: January 2010 Location: Connecticut, USA
|
Senior Member |
|
|
BlackSwan wrote on Fri, 18 October 2013 13:07
It depends upon if concurrent OLTP INSERT are occurring.
Not sure what you mean. The only difference ORA_ROWSCN will have is ROWDENEDENCIES/NO ROWDEPENDENCIES (default). With NO ROWDEPENDENCIES all rows within same block will return SCN of last time block changed. But it is irrelevent here, since we are looking not for row last change time but rather for table data last change time
BlackSwan wrote on Fri, 18 October 2013 13:07
It depends upon what problem you are actually trying to solve.
Well, your suggestion to add timestamp column would take care of finding last change time in the future and OP might take your advice. However, it doesn't help OP now, does it?
SY.
|
|
|
Re: affected partition [message #598889 is a reply to message #598887] |
Fri, 18 October 2013 12:19 |
Solomon Yakobson
Messages: 3273 Registered: January 2010 Location: Connecticut, USA
|
Senior Member |
|
|
Lalit Kumar B wrote on Fri, 18 October 2013 13:10Isn't the question about knowing partition name for the data loaded. The partition for statement should give that. Or am I missing something?
Read the question again: i want to know on the fly which partition was loaded recently.
SY.
|
|
|