Friday, March 15, 2013

How to Add or Remove Items from “New” Context Menu in Windows?


In Windows, whenever we right-click on Desktop or in Windows Explorer, we get "New" menu which allows us to create new folder, new shortcut and new files using various known file types. It helps us in creating new files, folders and shortcuts easily and quickly.
Sometimes you may want to remove a few unwanted items from "New" menu to shrink its size or to restrict others from creating new files or shortcuts or you may want to add a few new items to "New" menu such as new file types, etc.
So today in this tutorial, we'll tell you how to add or remove items from "New" menu in Windows. This method will work in all Windows versions:
A. To Add an Item in "New" menu:
1. Type regedit in RUN dialog box and press Enter. It'll open Registry Editor. Now expand "HKEY_CLASSES_ROOT" key.
2. Now look for the file type which you want to add in "New" menu, e.g. for adding MP3 file type look for .MP3 key.
3. Right-click on it and select "New -> Key" and give it name "ShellNew".
4. In right-side pane, right-click and select "New -> String Value". Give it name "NullFile" and press Enter.
5. That's it. You'll immediately get the file type entry in "New" menu.
B. To Remove an Item from "New" menu:
1. Type regedit in RUN dialog box and press Enter. Now expand "HKEY_CLASSES_ROOT" key.
2. Now look for the file type which you want to remove from "New" menu, e.g. for removing MP3 file type look for .MP3 key.
3. Expand it and delete the "ShellNew" key.
4. That's it. The file type will be removed from "New" menu.

Friday, March 8, 2013

Disable all constraints of a table


Disable all constraints of a table

MARCH 17 2011, BY SIMON KRENGER
During maintenance, I had to disable all constraints of a table. I knew that Oracle SQL Developer (I really like it even though it is a developer tool and not aimed at Database Administrators) had built-in functions to do this, but since I could only access the database machine via SSH, I had to do it in SQL*Plus.
Luckily, SQL Developer is quite transparent about the commands it uses and I could therefore easily see what is going on when you disable all constraints on a table using the GUI. So here it goes…
Disable all constraints of a table:
begin
 for cur in (select owner, constraint_name , table_name 
  from all_constraints
  where owner = 'SIMON' and
  TABLE_NAME = 'MY_TABLE') loop
   execute immediate 'ALTER TABLE '||cur.owner||'.'||cur.table_name||' 
   MODIFY CONSTRAINT "'||cur.constraint_name||'" DISABLE ';
   end loop;
end;
/
Remember to enable the constraints again before ending maintenance or else you might end up with a logically inconsistent database:
begin
 for cur in (select owner, constraint_name , table_name 
  from all_constraints
  where owner = 'SIMON' and
  TABLE_NAME = 'MY_TABLE') loop
   execute immediate 'ALTER TABLE '||cur.owner||'.'||cur.table_name||'
   MODIFY CONSTRAINT "'||cur.constraint_name||'" ENABLE ';
   end loop;
end;
http://www.krenger.ch/blog/disable-all-constraints-of-a-table/