Hot answers tagged

2

Let's quickly check the COPY documentation: COPY { table_name [ ( column_name [, ...] ) ] | ( query ) } TO { 'filename' ...} ... Your friend will be the query part. It means that you cannot only copy from a table, but also an arbitrary query. And example can be: COPY (SELECT * FROM ONLY your_table) TO '/path/to/dump.sql'; Notes: you have ...


2

Another answer tells you how to use COPY with a query rather than a bare table to get the data from only the parent table. I'm not sure how that is going to help you, though, if your database has to be always available. The master table will be changing while you copy the data out of it, and so the copy you get will be out of date. But for TRUNCATE, you ...


1

Not in 11g. Not even in 12c, but 12c makes life a bit easier, you can delay the "rebuild" part until a more appropriate time. In 12c there is a new feature, called Asynchronous Global Index Maintenance. You can drop the partition, and that still leaves the global index usable, and marks the no longer needed index entries orphaned. Then later, you can clean ...


1

This is happening because you are trying to alter the table to add partitions when there is a cursor open (active select) on the table. The required locks conflict. You can fix that by first fetching the partition dates into an array, close the cursor and then create partitions from that array. Code sample is below. CREATE OR REPLACE FUNCTION ...



Only top voted, non community-wiki answers of a minimum length are eligible