{"id":187,"date":"2013-07-23T05:03:41","date_gmt":"2013-07-23T05:03:41","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=187"},"modified":"2016-03-02T06:34:04","modified_gmt":"2016-03-02T06:34:04","slug":"set-unused-oracle","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/set-unused-oracle\/","title":{"rendered":"set unused oracle"},"content":{"rendered":"<p>On Large tables dropping a column is time consuming as it needs to work on lot of records.To prevent this you can perform a <strong>logical delete<\/strong> of the column by Using the <strong>SET UNUSED<\/strong>.<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nALTER TABLE table_name SET UNUSED (column_name);\r\nALTER TABLE table_name SET UNUSED (column_name1, column_name2);  \r\n<\/pre>\n<p>Once this is done the column wont be visible to users.<\/p>\n<p>Later you can run a query to delete unused columns from tables<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nALTER TABLE table_name DROP UNUSED COLUMNS;\r\n<\/pre>\n<p>In case you are working with table with less number of rows we can use drop command to drop the table column which performs <strong>Physical delete <\/strong>rather than using SET UNUSED which drops the column later<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nALTER TABLE table_name DROP COLUMN column_name;\r\nALTER TABLE table_name DROP (column_name1, column_name2);\r\n<\/pre>\n<p>Alter table to change Column Type<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nALTER TABLE emp MODIFY ename varchar2(50);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>On Large tables dropping a column is time consuming as it needs to work on lot of records.To prevent this you can perform a logical delete of the column by Using the SET UNUSED. ALTER TABLE table_name SET UNUSED (column_name); ALTER TABLE table_name SET UNUSED (column_name1, column_name2); Once this is done the column wont be&hellip; <a href=\"https:\/\/codethataint.com\/blog\/set-unused-oracle\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-187","post","type-post","status-publish","format-standard","hentry","category-queries-oracle-database-2"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=187"}],"version-history":[{"count":6,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/187\/revisions"}],"predecessor-version":[{"id":1153,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/187\/revisions\/1153"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}