Tuesday, June 14, 2011

working with Oracle datapump

First of all, only dumps created by expdp can be imported via impdp!

Second, you need to have the correct entry in your fstab if you are using an NFS mounted share as your datapump directory:


pso:/PSO /PSO nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,timeo=600,actimeo=0 0 0

Make sure the directory itself (PSO in this case) has the proper credentials - it should be owned by Oracle (make sure the group is correct as well) with rwx for all.

Then, create the Oracle server directory that references this directory (or a child of this directory). Note the grant to the schema user 'ARAMARKPURISMA'. This is important if you want to import as the schema user (rather than system).


DROP DIRECTORY ARAMARK;

CREATE OR REPLACE DIRECTORY
ARAMARK AS
'/PSO/Customers/Aramark';


GRANT READ, WRITE ON DIRECTORY SYS.ARAMARK TO ARAMARKPURISMA;

GRANT READ, WRITE ON DIRECTORY SYS.ARAMARK TO SYSTEM WITH GRANT OPTION;


Then, run impdp and remap tablespaces as needed:

impdp system/manager@se04 DIRECTORY='ARAMARK' REMAP_TABLESPACE=PDH_LARGE:MEDIUM remap_tablespace=pdh_medium:medium remap_tablespace=pdh_small:medium remap_tablespace=pdh_batch:medium schemas=purisma remap_schema=purisma:aramarkpurisma DUMPFILE=purisma_allobjs_0512.dmp

wget on linux with a proxy

I had to use wget with a proxy to download unrar from behind my companies firewall.

This is what I had to do.

First, I setup my proxy (note that SOCKS proxy isn't usable)

I added this to my .bash_profile and sourced it:

export http_proxy=http://bastion2.us.dnb.com:8080

Then I executed this command:

wget http://www.rarlab.com/rar/rarlinux-4.0.1.tar.gz

I went to the rarlab website and moused over the unrar for linux download link to see the proper URL to use.