Thursday, May 24, 2012

Convert schema to Read Only

There are times where you want to restrict a schema to Read Only mode. Say you want to freeze your production system, and you don't want anybody to modify any data.

The quickest way to do is to make the tablespaces read only

In this example below, I have RMANNI schema and my database is ORCLDB11G

Login as SYS or SYSTEM

1) Find all the tablespaces used by the RMANNI schema

select distinct tablespace_name from dba_tables where owner ='RMANNI';
select distinct tablespace_name from dba_indexes where owner ='RMANNI';

2) Change tablespace to Read Only ( Make sure that you have no transactions pending a commit or rollback)

 alter tablespace rmanni_data read only;
 alter tablespace rmanni_indx read only;



3) Now when you query dba_tablespaces and check the status column, they will show as READ ONLY instead of ONLINE
 

4) If you try make any modification to the schema, you will get a error message now



5) To make the tablespaces back to read write,






you can see the status changed from READ ONLY to ONLINE

***Only issue/bug I noticed is, even if the tablespace is read only, Oralce allows me to create empty tables.


Tuesday, May 15, 2012

Removing Heatsink From Corsair Vengeance

The new corsair Vengance series RAM comes with huge heat sinks or heat spreaders.

In my opinion, if you dont over clock your computer, then you dont need any heat sinks for your RAM, Moreover the cooler master hyper 212 Plus CPU fan was also blocking one of the RAM Slot.

So, the solution is simple,
1) Pop open the nubs from the slots on the either side of the RAM ( flat head screw driver would work fine)
2) Take your home hair dryer, blow hot air on either side of the RAM,
3) Slowly and gently pull the head sink from either side of the RAM
4) Remove any glue stuck on the chip ( just rub on the chip with your finger )