Solved

Export through cmd file

Posted on 2009-05-19
8
1,004 Views
Last Modified: 2013-12-19
I need to export Oracle database from client, where I dont have right to edit tnsname.ora where I have tns entry to use 9i client's exp.exe.

So I write a cmd file

@echo off
setlocal
c:
cd %TEMP%
set TNS_ADMIN=c:\program Files\toAD.861.EN
call "W:\ORA01.920.EN.001\bin\exp.exe

But here it is starting export in interactive more, and asking of username.

Can I use my parfile ?

call "W:\ORA01.920.EN.001\bin\exp.exe parfile=C:\Bakup_Databases\nova_test.par"

is not working, any workaround.

Sachin
0
Comment
Question by:sachin_dba
  • 5
  • 3
8 Comments
 
LVL 16

Expert Comment

by:Peter Kwan
ID: 24429214
You should call like this:

call "W:\ORA01.920.EN.001\bin\exp.exe" parfile=C:\Bakup_Databases\nova_test.par
0
 

Author Comment

by:sachin_dba
ID: 24429328
call "W:\ORA01.920.EN.001\bin\exp.exe" opening command window like:

Export: Release 9.2.0.1.0 - Production on Wed May 20 09:34:39 2009

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Username:

But with parameter file

call "W:\ORA01.920.EN.001\bin\exp.exe" parfile=C:\Bakup_Databases\nova_test.par

command window opens and disappered in 1 sec, and no log file even

Par file is very simple

user/pass@DBname table=HIERARCHIES_FLAT file=c:\program Files\toAD.861.EN\test_nova.dmp log=c:\program Files\toAD.861.EN\test_nova_imp.log

and we can connect with user/pass@DBname while prompting at username.
0
 

Author Comment

by:sachin_dba
ID: 24429366
got some link from google

http://www.lazydba.com/oracle/0__116055.html

Here's how we do it (this assumes that Oracle is installed and
configured on two separate machines).

Export:
dump_bart.cmd:
exp parfile=exp_bart.prf
exp_bart.prf:
userid=system/*****@cmgt.iecokc.com
file=D:\backup\exp_iec_bart.dmp
compress=y
log=exp_iec_bart.log
consistent=y
statistics=none
owner=iec_bart
direct=y


but not able to relate here.
0
 
LVL 16

Expert Comment

by:Peter Kwan
ID: 24429493
You should do like this in your parfile:

userid=user/pass@DBname table=HIERARCHIES_FLAT file="c:\program Files\toAD.861.EN\test_nova.dmp" log="c:\program Files\toAD.861.EN\test_nova_imp.log"
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:sachin_dba
ID: 24429958
thanks, for your help but still not able to start export. command window disappered in a flash with some text.. can we stop the window with some sleep .. or any other workaround?

Sachin
0
 
LVL 16

Accepted Solution

by:
Peter Kwan earned 500 total points
ID: 24430003
You may start your batch by doing this (assume you are windows XP/2000 or above):

1. Start -> Run -> Type in "cmd" in the text box and click "OK"
2. In the command prompt, change the directory to where your batch file is in . ("cd your_directory" without quotes)
3. Type your batch file name (E.g. "export_db.bat", without quotes) and press "Enter".


0
 

Author Comment

by:sachin_dba
ID: 24430231
Finally its done. thanks mate.
0
 

Author Closing Comment

by:sachin_dba
ID: 31583378
its woring .. thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now