01 March 2011

How Do I Do That? - Changing Tables from Read Only or vice versa

Every day is a fun learning experience.  What did I learn today?  How to change tables from read only to read writable.  In my current incarnation (haha) I support a database that has had its life divided up into easily understandable periods of time called YEARS.  So basically, my crosstraining partner has gone through and partitioned off tablespaces into these portions called YEARS and most of these tablespaces are in a read only mode.  I think to make the clients unable to write into them.  And possibly easy to maintain.  Now, I had no idea about this until a client sent an enigmatic email:

From: Client
To: Any DBA that can read this note

Plz request that we can write records.  We can't now.

Love,


Client

See, sometimes you get these notes.  Forget about the fact that there are like 300 instances in different iterations of development, stage and production.  To a client only one (maybe two!) databases exist.  They are like teenagers.  There is only one true love.  And we are supposed to read their minds.  Okay.  And actually, sometimes, after years and years at this job, some DBAs can. Which is very Jedi like.  I am light years away from being at that mental state.

So lucky for me at this particular time, even though I am the caretaker of these particular beasts, I wasn't at my desk.  And we have a lot of very helpful DBAs lounging about, so very helpful Sr. DBA E took this email and asked a few more questions.

From: Sr. DBA E
To: Client 


What database? What tables? Who are you? What is that you need, exactly? 


Sincerely,


Sr. DBA E

Funnily enough, I am still learning to ask these questions without floundering around and looking questionable. Anywhoo, after all the information was gathered and apparently the work done, I came back to my desk and saw this:

From: Sr. DBA E
To: Client 

Done!
Sincerely,

Sr. DBA E

What?  What was done?  I asked Sr DBA E and he said, while waving his hand, "C'mon over to my desk and I'll show you.."  Whereupon I learned how to make tablespaces writable.  It's very easy.  Open Embarcadero or Toad and navigate over to tablespaces area.  Right click on the tablespace that says READONLY and change it in the drop down menu to READ WRITE. That's it. It's that easy.  Or you could be all commandline in SQLplus and do a real ALTER TABLESPACE <tablespace_name> READ WRITE;


This is a really simple explanation and nifty trick.

Sometimes things really are that easy.  Tomorrow I'll try and describe my feelings of awe and admiration over Sr DBA D who amazed me with his bravery and ability to kill  a process without thinking twice about it, and apparently magically fixed an application.  By the way, he'd never even seen this process before.  That's how professionals do.

No comments:

Post a Comment