Link to home
Start Free TrialLog in
Avatar of michonfr
michonfr

asked on

EXPORT in SQL-Plus

Hi,

From our client (an NT Workstation), we want to lunch an export that would create a DMP file on our server (HP-Unix 11). For security reason, we're only allowed to use SQL-Plus.
 
Is there an SQL command that we could use to start an export in SQL-Plus (NOT from the OS command line)?

Avatar of jtrifts
jtrifts
Flag of United Kingdom of Great Britain and Northern Ireland image

Have you tried issueing a HOST command from within SQL*PLUS?

Host is able to run an executable that is actually sitting on the host machine...thus mimicking running from the command line.

(I have used it to run SQLLDR successfully)

JT
Avatar of saschek
saschek

No, but you can invoke the export utillity with a double click too.
Or aren't you allowed to start programs on your client?

If you can connect via SQL*Plus, you can establish any access to
the db over Net8-Protocoll. The export utillity connects just this way.
It should allready be installed at your NT-client as
[ORACLE_HOME]/bin/exp.exe - if not install it!
You can launch it from the command line (best) or with double click.
-- Sven
If I were you, I would examine the security policy
regarding the use of import/export and other exe's
and talk with the security folks to help them understand
the implications of their policy.

They're certainly not affording any protection by
preventing you from using export, but allowing you
to use sqlplus.

Yeah..!
You need to use the following 2 commands.
1. Host exp userid=name/passwd .... (This creates dump file on the client)
2. ftp server_name .....! (to send it to UNIX)
Let me know if it works!
Jammalk

I think the correct syntax for host is to simply pass the command (and switches) in as a parameter (i.e. in brackets):

HOST(exp username/password@database);

You should not need to specify the location of exp assuming that Oracle settings are already in the registry...

I suspect that you also have the option to leave out the password in the call (as it is not blanked out)...then exp will probably prompt you for the password (that's the way sqslldr works too...)

As for FTP syntax...I'm not sure of that, but I'd appreciate it if you'd post it after you've got it working so we'll all know...

JT
HOST command will launch a program at NT box, and the question was about executing exp on the server. I think that it is impossible.
HOST command will launch a program at NT box, and the question was about executing exp on the server. I think that it is impossible.
HOST command will launch a program at NT box, and the question was about executing exp on the server. I think that it is impossible.
Sorry for multiple input, our proxy is getting mad.
dda...

you can run exp80 on a client machine though...or am I missing something here?
ahhh....they want to launch it on the client but have the export occur on the server...

That may indeed be impossible...

When you run an export, can you specify the output directory?

If so, then you could set up a Samba share on the client pointing to the server, run the exp using HOST in SQL*PLUS, writing to the Samba share...

BUt don't ask me about Samba as I always get Tech Svcs to set them up...
This is all network solutions, and they want to do server-based export. So I think that is impossible.
i want to know too
Hi
I don't think there is any such facility available. But you can try a roundabout way.

Steps
1.  Create a SHELL script in Unix as below and run on server at startup.
## Start of Shell script
while [ "a" = "a" ]
do
  i=`cat abc.txt`
  if [ $i = "1" ]
  then
    exp username/password@database ...
    echo "0" > abc.txt
  else
    sleep 5    # Check after every five seconds
  fi
loop
## End of Shell script

2.  Create a file abc.txt with permissions 666 containing character "0".
3.  Use UTL_FILE in PL/SQL to overwrite the file abc.txt to "1" whenever you want the export to run.
    example : run_export.sql
    DECLARE
      g_file_ptr     utl_file.file_type ;
    BEGIN
      g_file_ptr := fopen('<directory>','abc.txt','w');
      utl_file.put_line(g_file_ptr,'1');
      utl_file.fclose(g_file_ptr);
    END ;
    /

This will help you in a roundabout way to run your export.

Best of luck.

Anand

Hi,

Just to add ...

Steps 1 and 2 are to be run in the Server.
Step 3 is to be run in the Client SQL-Plus.

Anand
ianand: all this stuff require too much privilegies, I suppose, they do not have shell access at all :)
Avatar of michonfr

ASKER

I realy need an SQL command. We don't have the privilegies to use the command line and the space to create an export on the client side.
I guess that you should ask server admin to create some cron job for you to perform export. Anyway, what is the benefit of having export file on server without access to that file?
ASKER CERTIFIED SOLUTION
Avatar of Mark Geerlings
Mark Geerlings
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
One of the way to create data on other server  from SQL  is simple copy command

copy from system/password@<tnsnames alien> to system/password@<tnsmanes> -
append <owner>.<table_name> -
using -
select * from <owner>.<table_name>
To run this command open sql plus where data needs to be insert
you may create dynamic sql to populate # on copies or create hard sql

Thanks