Friday, April 19, 2013


Remotely run the dump file for Oracle

When we have TWO servers
  1. server 1 (client server )
    • Platform - Linux Ret Hat
    • Oracle - Client
  2. server 2 (host server - the target server host the DB) - Linux Ret Hat
    • Platform - Linux Ret Hat
    • Oracle - Full Version
The following are the suggested steps to achieve this.
  1. Ensure the client server's Oracle Client is Administrator Type. If not, please do re-run the runInstaller
  2. This to ensure the Oracle Client provide 'import' and 'export' services.
  3. Add the host server IP into client server's
    • File name - host.allow
      • E.g: /etc/host.allow
      • Line to be added -> nfs: 10.116.1.123
    • File name - hosts
      • E.g: /etc/hosts
      • 10.116.1.123 ORCL dbmain.company.com
  4. Both server need to start the following services
    • portmap
    • netfs
    • nfs
    • E.g : $ /sbin/service nfs start
  5. Add the following line into file etc/exports
    /home linux(rw,sync) linuxd600(rw,sync)
    /u01 10.116.1.123(rw,sync)
  6. Must define the database address for establishing connection instead of pure text such as :-
    $ imp host_user/host.com@'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST='$DB_HOST')(PORT='$DB_PORT')))(CONNECT_DATA=(SID='$DB_SID')))' FILE=/get/dump/file/directory/dbdump.dmp FULL=y
    • Please define it in tnsnames.ora file E.g: /u01/app/oracle/product/11.2.0/client_1/network/admin/tnsnames.ora
      ORCL=
        (DESCRIPTION =
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = TCP)(HOST = dbmain.company.com)(PORT = 1521))
          )
          (CONNECT_DATA =
            (SID = orcl)
          )
        )
    • No need to restart listener as Oracle Client do not have such services being installed.
  7. Set the proper environment variables
    $ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/client_1
    $ PATH=$PATH:$ORACLE_HOME/bin
    $ LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib; export LD_LIBRARY_PATH
    $ export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
  8. Now is the time to execute the dump file.
    $ imp cnm_developerX/password@ORCL FILE=/get/dump/file/directory/dbdump.dmp FULL=y

No comments: