Posts

Showing posts with the label EXP-IMP and DataPump

Copy and Delete Dumpfiles from ASM to Local Filesystem Automatically

Hello Everyone, So someone ask you to create a script to take a logical backup of your database and store it in ASM. You decided to create an Export DataPump script that will: 1. Take a full export of the database to +FRA 2. Take a full metadata export of the database and store it in +FRA 3. Copy the dumpfiles in +FRA to your local disk (in case the ASM instace fails) 4. Delete old dumpfiles in +FRA and in the local disk if they are past the retention period. The script provided below will: 1. Perform export datapump and store the dumpfiles in ASM 2. The dumpfiles stored in ASM will be copied to the local disk. The script will read the logfile generated by the export job. If you will take a look at the end of the export logfile, you will see there the list of dumpfiles generated, we just need to extract these string and process it using Unix scripts. Then we can form an ASMCMD command from here. When running ASMCMD command, just make sure you switch to the GRID environmen...

Oracle Export-Import with QUERY parameter on LINUX box

There's this one time when I like to purge a certain table but it is very large. It creates a lot of archive logs when I am performing delete statements using a where clause as a delimiter for the rows I'd like to delete. It is very time consuming and it eats space on the disk. And one more thing is that, there are more rows that I need to delete that the rows I need to keep. So I just tried to purge this very large table using Oracle' EXP and IMP utility. My plan is to export the rows that I want to keep and truncate the table I am purging. Afterwards, I will IMP the dumpfile into that same table. Here's what I did: Environment: OS: RHELinux 5.4 32bit DB: Oracle 10.2.0.4 SQL Query: SQL> select * from sh.sales      where time_id = to_date('28-DEC-01:00:00:00',      'DD-MON-RR:HH24:MI:SS'); The output of this query are the rows that I want to keep. My gameplan is: 1. Perform EXP using QUERY parameter. 2. T...