Catastrophe! You’ve just accidentally dropped a table which contained really rather important data. What to do?
One thing you can do to recover the situation quickly (if you’re running 10g or later, that is) is to run the following command:
FLASHBACK TABLE MY_SCHEMA.MY_SUPER_IMPORTANT_TABLE TO BEFORE DROP;
The Great Lakes Oracle Conference will be held on May 14/15, 2013 at the Cleveland State University campus. Registration includes two full days of training with more than 30 sessions to choose from, vendor exhibits to peruse, lunches, and a networking reception. And if that weren't enough, there will be keynote presentations from Chris Date and Tom Kyte.
I updated my host OS a few months back after getting repeated notifications (yes, I know, I can shut them off) that 10.04 (I think) was moving out of support.
I'm busy deriving file layouts from PL/SQL. Probably close to 100 file definitions...each of them slightly different, each of them defined in the code. Fun!
There are a mixture of types too, fixed width, csv, etc. Thankfully, I've read enough of the code now that it's relatively easy to figure out. The fixed width variety is what this is about though.
In much of the code, there's a type that's defined, something like this:
type my_record is record
(
column_01 CHAR(10),
column_02 CHAR(10),
column_03 CHAR(10)
I just found this little piece of code to create DDL source code.
SELECT dbms_metadata.get_ddl(replace(OBJECT_TYPE, ' ', '_'), OBJECT_NAME,OWNER) as DDL_SOURCE_CODE
FROM ALL_OBJECTS
WHERE OBJECT_TYPE IN
('SEQUENCE', 'TABLE', 'INDEX',
'VIEW', 'DATABASE LINK', 'MATERIALIZED VIEW',
'FUNCTION', 'PROCEDURE', 'PACKAGE',
'PACKAGE BODY'
)
AND OWNER = '#SCHMEA_NAME#';
Nolan Bushnell, founder of Atari, had this to say via his new book, Find the Next Steve Jobs.
I've taken on an effort to port a custom data integration (PL/SQL, Java, etc) application.
In that regard, I'm doing a fair amount of analysis right now. So I need help finding two tools:
1. A tool that will allow me to map (visually or otherwise) a single data point from source to target(s). I typically use Excel. It's easy to use and available everywhere. Where it falls apart, slightly, is that a single data point may have one or more middle steps (i.e. not target) and one or more targets. I think I want something like this:
During one of my projects I had an issue when I copied the DDL from my test environment into my productive system. Unfortunately I needed some of the test data in the prod system as well. For that I had to migrate most of the sequences starting with their last number. SQL Developer created those sequences starting with 1. This simple code fixed my issue.
select 'DROP SEQUENCE "'||SEQUENCE_NAME||'";' ||
' CREATE SEQUENCE "'||SEQUENCE_NAME||'"' ||
' MINVALUE 1 MAXVALUE 999999999999999999999999999' ||
Have you seen this State Farm ad?
I think it's hilarious.
Riding to batting practice with LC, he starts up with me...
LC: (in response to some statement I made) "Where'd you hear that?"
Me: "The Internet"
LC: "And you believed it?"
I've been scratching my eyes out lately trying to reverse engineer some lots of PL/SQL.
One thing I've seen a lot of is calls to dbms_output.put_line. Fortunately, I've seen some dbms_application_info.set_module and other system calls too. But back to that first one.
1. When I used dbms_output, I would typically only use it in development. Once done, I would remove all calls to it, test and promote to QA. It would never survive the trip to production.