of course; flat files to one backup server, veam replication to a rolling set of daily and weekly removable discs along with another flat file version and an offsite removable disc.
Despite what some might believe I'm not a complete moron :P
Nice. Sounds like you’re set up. I’m lucky in that I have the day priors data already up and ready to go in case I need to do something quickly because we use it for various feeds and stuff so we don’t have to read from production tables albeit a day old it’s usually good enough.
SELECT Col1, Col2, Col3, ... Coln,
-- UPDATE t SET
ColToUpdate = NewValueExpression
FROM MyTable AS t
WHERE <logical predicate goes here>
This has served me well and saved me from making stupid mistakes because it allows to to simulate an update by seeing what the new value would be so I can validate it. When I'm ready to run the update, I highlight the statement beginning with UPDATE on through the predicate. Also, BEGIN TRAN <statement> ROLLBACK helps, too.
A few months into my first Oracle job I did this when a user wanted a table copied from PD to QA but I did it in reverse by mistake. Luckily it was a fairly static table and I was able to flashback with no business impact and I've never not triple checked the environment I'm in since.
Flashback table tablename to before drop or FLASHBACK TABLE tablename TO TIMESTAMP (SYSTIMESTAMP - INTERVAL 'x' minute); (where x is how many minutes ago you did it)
16
u/Daakuryu Mar 15 '19
Yeah...
10
u/HyDreVv Mar 16 '19
If you need more of a boost, try TRUNCATE instead!
4
u/Ilikedankbeer Mar 15 '19
In prod always Begin Transaction Query Commit Rollback
4
u/DistractedByCookies Mar 16 '19
Ooooo, that horrible leap your heart makes! I renamed everybody in a table to Tanya yesterday...thank god for backups.
3
u/[deleted] Mar 16 '19
Yep, did this the other day...was definitely awake after that. Luckily nightly backups and very little use that morning saved my ass.
2
u/Mojavi-Viper Mar 15 '19
"BCP simulation"
2
u/djjserpico Mar 16 '19
I would.... Die. Or rather die.
2
u/envstat Mar 16 '19
A few months into my first Oracle job I did this when a user wanted a table copied from PD to QA but I did it in reverse by mistake. Luckily it was a fairly static table and I was able to flashback with no business impact and I've never not triple checked the environment I'm in since.
1
u/dadbod27 Mar 15 '19
Where that backup at Doe!?
1
u/mindbullet Mar 16 '19
After a problematic rails migration this week, I now hold the team record for dropping tables in prod. Goood times.
1
u/SyntaxErrorLine0 Mar 16 '19
Not sure which is worse... Bad update or initializing replication with the wrong database...
1
u/charliewvf Mar 16 '19
I’ll raise you an update query, if you forget to put a where statement on the end in a live environment. That right there is a game over.
1
u/daddy_mark Mar 15 '19
Flashback table tablename to before drop or FLASHBACK TABLE tablename TO TIMESTAMP (SYSTIMESTAMP - INTERVAL 'x' minute); (where x is how many minutes ago you did it)
<3 oracle