Posts

Showing posts with the label tables

Using DBMS REDEFINITION package to reorganize tables online

Image
Using DBMS REDEFINITION package to reorganize tables online I needed to partition a table while it was accepting updates. So I decided to use DBMS_REDEFINITION package provide by Oracle. The following privileges must be granted to the user: ALTER ANY TABLE CREATE ANY TABLE DROP ANY TABLE LOCK ANY TABLE SELECT ANY TABLE The following privileges may be required too: CREATE ANY INDEX CREATE ANY TRIGGER First of all you have to create an interim table with the same columns and data type of the table to be redefined. Anyway I used SYS user to perform the following steps: alter session force parallel dml parallel 3; alter session force parallel query parallel 3; Next step is to check if table can be redefined EXEC Dbms_Redefinition.Can_Redef_Table(SMS, SMS_TRANSACTION); With no errors displayed, I can proceed starting the redefintion using the following command. This operation can take quite some time to complete, but any queries and DML are available on table being redefined during the ent...

Using ASNTDIFF and ASNTREP utilities to sync the data between source and target tables in DB2 Q replication

Image
Using ASNTDIFF and ASNTREP utilities to sync the data between source and target tables in DB2 Q replication When you observe that there are some data differences between source and target tables in DB2 Q replication, we can use these 2 utilities( asntdiff, asntrep ) which can compare the source and target and repair them based on our requirement to synchronize the data. ASNTDIFF : asntdiff utility which can compare two relational tables and generate a list of differences between the two. ASNTREP  : asntrep utility will syncronize a source and target table by repairing differences between the two tables. Important note : Its always good to synchronize the tables when there is less amount of activity or no activity going at source so that we can have perfectly synchronized table.     Below tutorial demonstrates the use of asntdiff to compare the source and target and asntrep to repair the target table based on differences generated by asntdiff. Below is the data populated o...