Wednesday, July 11, 2012

ORA-03001: unimplemented feature


Change the current_schema to the actual table owner by connecting as some other user in sql*plus and try renaming the table:


SQL> alter session set current_schema=scott;
Session altered.
SQL> rename emp to emp_back;
rename emp to emp_back
*
ERROR at line 1:
ORA-03001: unimplemented feature

Now: Try running the following command to rename the same table being in the same session with current_schema=scott;

SQL> alter table emp rename to emp_back;
Table altered.
SQL>




Wednesday, June 27, 2012

How to get explain plan from Netezza?


explain verbose select * from tablename;





Importance of GROOM after Altering a Table...


In Netezza, when you update your table definition, like adding columns, Netezza creates a separate version of the table behind the scenes with the new schema. 

New records then get inserted into the new version. 

During query execution the multiple versions of the table are merged together using a UNION ALL operation.  

To merge the two versions of your table together do a GROOM TABLE tablename VERSIONS; 

How can I find the tables that are versioned? 


SELECT tablename
FROM _v_table
WHERE   RELVERSION<>0



Note:
If you have multiple versions of a table due to adding/dropping a column, you cannot use the groom command to clean up deleted rows until you first use the groom versions command to merge the multiple versions of the table into a single current version.