- Installing and configuring oracle instant client x86_64
- Installing perl-DBD-Oracle
- Installing and configuring ora2pg
- Install and Configure Oracle Instant Client for linux I'm going to cover this step in quite a bit of detail; even though there are pre-built .rpm packages available from oracle for both i386 and x86_64 platforms, getting everything in running can be quite a mission if you omit a few vital steps...
- Download the Oracle Instant Client .rpm's from Oracle here
Make sure you get the following :
- oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
- oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
- oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
- Once you've downloaded the .rpm's, you can install them either with rpm or yum (I generally prefer yum as it will automatically handle resolving and installing dependencies for you).
$ sudo yum -y localinstall oracle-instantclient*.rpm
- Update the ld library cache
- Set the Oracle environment variable
$ cat >> /etc/bashrc <<EOF
export TNS_ADMIN=$HOME
export EDITOR=vim
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
EOF
$ source /etc/bashrc - Place your tnsnames.ora file in your home directory
- You can test your oracle client installation by running sqlplus
$ sqlplus64 /nolog
- Install Perl-DBD-Oracle
- Before we start ensure that you have the following packages installed
- perl
- perl-CPAN
- perl-DBD
- perl-DBI
- gcc
- libaio
- libaio-devel
- Download the Perl-DBD-Oracle Source with CPAN
- Install and Configure ora2pg
- Download ora2pg here
- Uncompress the tar archive
$ tar xjvf ora2pg*.tar.bz2 && rm ora2pg*.tar.bz2
- Build ora2pg
- Configure ora2pg
- ORACLE_HOME - you can set this to $ORACLE_HOME
- ORACLE_DSN - set this to the desired entry in you tnsnames.ora
- ORACLE_USER - the oracle username
- ORACLE_PWD - the oracle password
- USER_GRANTS - set this to 1 if you're not connecting as a DBA role
- TYPE - set this to DATA if you only want to export data and ignore structure
- run ora2pg Simply run ora2pg from the command line, by default your data will be dumped to a file called output.sql in the current directory.
$ cat > /etc/ld.so.conf.d/oracle.conf <<EOF
/usr/lib/oracle/11.2/client64/lib
EOF
$ ldconfig
$ perl -MCPAN -e shell
CPAN> get DBD::Oracle
CPAN> exit
$ cd ~/.cpan/build/DBD-Oracle*
$ perl Makefile.PL
$ make
$ make install
$ cd ora2pg*
$ perl Makefile.PL
$ make && make install
$ gedit /etc/ora2pg/ora2pg.conf
Look out for the following configuration properties
No comments:
Post a Comment