Showing posts with label flashback. Show all posts
Showing posts with label flashback. Show all posts

Wednesday, November 19, 2008

Flashback table data prevented by a constraint

When I was reorganizing some tables I deleted some data which at the end I wanted to reuse.
I was pretty confident that with the flashback technology in the Oracle database I could get my data again. So I was surprised when I got the message "ORA-01466: unable to read data - table definition has changed".


I thought I had done something wrong so I build a small test case to see what was happening.


-- Create table with one record
create table t (b varchar2(100));
insert into t values ('hello world - works');
commit;
-- Look at the data
select * from t;
-- What timestamp did I still see my data -19-NOV-08 02.09.23.478019000 PM +00:00
SELECT SYSTIMESTAMP FROM dual;
-- Create an index
create index t_idx on t (b);
-- Delete all the data from my table and commit
delete from t;
commit;
-- There's no data anymore, nice
select * from t;
-- And with the flashback technology I see my data
select * from t as of timestamp to_timestamp('19-NOV-08 02.09.23.478 PM');
-- Insert another record
insert into t values ('hello world - no go');
commit;
-- Do some DDL on the table now, add a constraint
alter table t add constraint t_pk primary key (b)
select * from t;
-- I still see my data at this stage, but now we drop the constraint and delete the records
alter table t drop constraint t_pk;
delete from t;
commit;
-- Use flashback again
select * from t as of timestamp to_timestamp('19-NOV-08 02.09.23.478 PM');
-- I can't get to my data anymore

When reading through the documentation this made it clear: "Oracle Database cannot restore a table to an earlier state across any DDL operations that change the structure of the table".

Oracle does have limits ;-) and time for me to read through the documentation again...

Tuesday, May 13, 2008

Sometimes you love you chose Oracle

The last days it's really hot in Belgium. Working when it's hot is not good for our brains and the computers as they get overheated.

Some people are distracted as they think about the pool all the time, some others get grumphy and some others make mistakes...

In the last couple of days I had to use the flashback feature of the Oracle database more than the last 6 months together. When you get a mail like: "I had to change something, but accidentally deleted the whole text. Can you please put it back?"

At that time you're so glad you use an Oracle database! Can you do something like this in MySQL or MS SQL Server?

SELECT *
FROM my_table AS OF TIMESTAMP TO_TIMESTAMP('2008-05-12 08:00:00', 'YYYY-MM-DD HH24:MI:SS');

Another command I had to use for myself, when I dropped a table in development, but forget to look at the logic of an existing trigger of that dropped table:
FLASHBACK TABLE my_table TO BEFORE DROP;

I guess everybody already knew about flashback in Oracle (if not, Tim Hall wrote a nice compact page about flashback), but then I wonder sometimes why people ask me if APEX also runs with other databases... Oracle has to many nice features buildin, so some want to use another database I guess ;-)

I'm happy the sun is shining and I'm using an Oracle database during these days.

Thursday, December 27, 2007

Flashback 2007... Flashforward 2008...

The last year went unbelievable fast. I've the impression, the older I get, the faster the world goes! Just as last year I took a moment to look back at some of my highlights.


My highlights for 2007 (per month):
  • January: I started helping Ordina to build up an Oracle team. I'm pleased with the result; 15 new people came on board, we worked for some new customers and did some nice projects.
  • February: Oracle Application Express 3.0 was released. I believe this was a big step in the current success of APEX.
  • March 14: the Apex Evangelists website went live. The idea started in October 2006 and after a couple of months of brainstorming and sorting things out, John Scott and I announced a company focusing only on Oracle Application Express.
  • April 2: I had a first discussion about APEX "against/next to" JDeveloper/ADF.
  • April 19: I gave my first APEX presentation in the States during Collaborate '07 in Las Vegas. A few days before I also sat in the APEX panel and organized the APEX Meet-Up.
  • May 17: Announcement of the first European APEX Training Days
  • June: my second ODTUG, in Daytona Beach. During that event I did an APEX presentation, the APEX Meetup and a Podcast with Lewis Cunningham. I also met the Oracle APEX Development team again and I met Patrick Wolf for the first time in real-life.
  • July 11: Launch of Oracle Database 11g
  • August 7: first Apex Evangelists onsite Oracle Application Express Training together with John Scott.
  • September was the month of the most exciting highlights of this year
  • September 4th-6th: First European Apex Training Days
  • September 19th morning: Announcement of the second European Apex Training Days
  • September 19th evening: my first baby... a son, Matthias, got born
  • September 30th: first time "away" with Matthias for a dinner with Steven Feuerstein.
  • October: prepare for November and enjoy Matthias
  • November: my second Oracle Open World. I also did an APEX presentation at OOW and organized the Apex Meetup and Apex Roundtable.
  • December 5: my first UKOUG where I flew in, did an APEX presentation and Roundtable on the same day and had some great food with some nice friends.
  • December 8: my first Mac, a MacBook Pro
  • December 17: presenting together with Lucas Jellema in the Netherlands: "APEX vs ADF"
  • December 27: this post, as I find it unbelievable what I did last year
It has been an amazing year! If I look at my post Flashforward 2007 I'm happy I could meet my "goals". I think I promoted Oracle and APEX even more by building up Apex Evangelists and an Oracle team and doing presentations at several events. I definitely explored new sides of myself by doing these presentations and trying to launch several projects.

In my private life, I got a nice little baby, which is an awesome experience. I didn't find an house, but we bought some land to build one.

Finally to end 2007, I did around 135 blog posts... The stats of this blog:


For 2008 I hope my family stays healthy and we may enjoy life even more as before.

If I'm allowed to ask for more, in private life; it would be nice if I find the time to also be with my family and we could start with the building of our new house.
On professional life; I hope we can let Apex Evangelists grow in 2008, promote APEX even more, give good APEX support to our customers, develop some outstanding software and do some nice projects.

My last lines of my blog post of 2007 is for all of you!
Thank you so much for reading my blog, giving comments and feedback and for meeting you at several events.
I wish you a very Happy New Year!