Omega Owners Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to OOF

Pages: [1]   Go Down

Author Topic: Stuck at work and booooooored  (Read 1230 times)

0 Members and 1 Guest are viewing this topic.

jimbobmccoy

  • Intermediate Member
  • ***
  • Offline Offline
  • Gender: Male
  • outer london
  • Posts: 311
    • View Profile
Stuck at work and booooooored
« on: 30 March 2012, 00:55:17 »

One of those weeks at work.
Accounts system up the creek, all sorts of fun and games with backups, restores unposting and reposting to get things in balance.
Now some twerp has screwed up the expos system and I'm waiting for a restore to finish before I can have the fun job of querying an SQL database that's in German.

Makes for figuring out which column is what an interesting chore.

It never rains but it pours, but at least I can hope to fill up the tank in an empty petrol station on the way home!!!!
Logged

TheBoy

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Brackley, Northants
  • Posts: 107023
  • I Like Lockdown
    • Whatever Starts
    • View Profile
Re: Stuck at work and booooooored
« Reply #1 on: 30 March 2012, 09:12:56 »

I could lend a hand - I'm great at mistyping SQL UPDATE commands ::)
Logged
Grumpy old man

tunnie

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Surrey
  • Posts: 37573
    • Zafira Tourer & BMW 435i
    • View Profile
Re: Stuck at work and booooooored
« Reply #2 on: 30 March 2012, 09:25:12 »

rollback
--commit

 ::)
Logged

jimbobmccoy

  • Intermediate Member
  • ***
  • Offline Offline
  • Gender: Male
  • outer london
  • Posts: 311
    • View Profile
Re: Stuck at work and booooooored
« Reply #3 on: 30 March 2012, 09:28:20 »

 ;D
Oddly enough I did think of you as I was sat there!
It was a fairly simple update from one column in one table in one database, to the same column, in the same table in a second database.
Having been up for a loooong time when it came time to run it I did stop and think "now what would theboy do?"

And so then I triple checked it and ran it on a test database twice  :D :D
Logged

cem_devecioglu

  • Guest
Re: Stuck at work and booooooored
« Reply #4 on: 30 March 2012, 09:30:07 »

rollback
--commit

 ::)

Tunnie , some databases are autocommit .. so you dont have chance to rollback.. unless you change the configuration parameters.. so its a good practice to arrange those when installing.. also most sql setups use single cpu and low memory usage..
« Last Edit: 30 March 2012, 09:32:11 by cem »
Logged

jimbobmccoy

  • Intermediate Member
  • ***
  • Offline Offline
  • Gender: Male
  • outer london
  • Posts: 311
    • View Profile
Re: Stuck at work and booooooored
« Reply #5 on: 30 March 2012, 09:33:58 »

The error (some numptys screwup) and how the database is set up meant a rollback wasnt possible and a plain restore would have affected other areas of the system (goods in, replenishments to stores etc) so restoring to a new database and just pulling the column needed was best.

Mind you, the 21 hour restore from the offsite backup needs looking in to......completely unviable in a business
Logged

cem_devecioglu

  • Guest
Re: Stuck at work and booooooored
« Reply #6 on: 30 March 2012, 09:45:07 »

rollback
--commit

 ::)

Tunnie , some databases are autocommit .. so you dont have chance to rollback.. unless you change the configuration parameters.. so its a good practice to arrange those when installing.. also most sql setups use single cpu and low memory usage..

forgot to add , your only chance is to start with
begin transaction 
update ........
 
Logged

tunnie

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Surrey
  • Posts: 37573
    • Zafira Tourer & BMW 435i
    • View Profile
Re: Stuck at work and booooooored
« Reply #7 on: 30 March 2012, 09:49:08 »

Yeah thats what I used in my SQL days, but to be honest I did not give a monkey about the company I was working for. Kinda hoped I would screw up their DB.  ;D

Logged

TheBoy

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Brackley, Northants
  • Posts: 107023
  • I Like Lockdown
    • Whatever Starts
    • View Profile
Re: Stuck at work and booooooored
« Reply #8 on: 30 March 2012, 11:17:34 »

rollback
--commit

 ::)
Depends on the database type, and config.  You generally need a BEGINTRANS to start as well ;)

OOF's MySQL is not configured for that due to the connectionless setup.

Besides, the commands were fully tested on the test server - shame I transposed part of the UPDATE on about the 4th command ::).  I did take a backup before starting, but wasn't worth restoring TBH.


//Edit, cem beat me to it
Logged
Grumpy old man

TheBoy

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Brackley, Northants
  • Posts: 107023
  • I Like Lockdown
    • Whatever Starts
    • View Profile
Re: Stuck at work and booooooored
« Reply #9 on: 30 March 2012, 11:26:16 »

;D
Oddly enough I did think of you as I was sat there!
It was a fairly simple update from one column in one table in one database, to the same column, in the same table in a second database.
Having been up for a loooong time when it came time to run it I did stop and think "now what would theboy do?"

And so then I triple checked it and ran it on a test database twice  :D :D
I wear Stetson hats :P ;)
Logged
Grumpy old man

Rods2

  • Omega Lord
  • *****
  • Offline Offline
  • Gender: Male
  • Sandhurst Berkshire
  • Posts: 7604
    • 1999 3.0 Elite Estate
    • View Profile
Re: Stuck at work and booooooored
« Reply #10 on: 30 March 2012, 17:07:30 »

;D
Oddly enough I did think of you as I was sat there!
It was a fairly simple update from one column in one table in one database, to the same column, in the same table in a second database.
Having been up for a loooong time when it came time to run it I did stop and think "now what would theboy do?"

And so then I triple checked it and ran it on a test database twice  :D :D

Just make sure you put on your steel capped boots BEFORE you kick it.  ;) ;D ;D ;D ;D
Logged
US Fracking and Saudi Arabia defending its market share = The good news of an oil glut, lower and lower prices for us and squeaky bum time for Putin!

tunnie

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Surrey
  • Posts: 37573
    • Zafira Tourer & BMW 435i
    • View Profile
Re: Stuck at work and booooooored
« Reply #11 on: 30 March 2012, 17:16:40 »

rollback
--commit

 ::)
Depends on the database type, and config.  You generally need a BEGINTRANS to start as well ;)

OOF's MySQL is not configured for that due to the connectionless setup.

Besides, the commands were fully tested on the test server - shame I transposed part of the UPDATE on about the 4th command ::).  I did take a backup before starting, but wasn't worth restoring TBH.


//Edit, cem beat me to it

Yup, I used that too. Only in the live billing database though, sod everything else.

My SQL, like my linux skills now are very rusty  :(
Logged
Pages: [1]   Go Up
 

Page created in 0.01 seconds with 17 queries.