Executing imp command through a form [message #303884] |
Mon, 03 March 2008 02:18 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
alister
Messages: 101 Registered: August 2007 Location: India
|
Senior Member |
|
|
Hi Everybody
I want to Know if the given statement below can be executed in a form.
host ('\\accdatserver\d\oracle\ora81\bin\imp.EXE estt/prime@afrestpj ile=\\accappser\e\dump\afres270208.dmp fromuser=prime touser=estt ignore=y');
If yes please let me know how to do it, I also want to use the file name 'afres270208.dmp' of the example as a variable.
Thank you
Alister
|
|
|
Re: Executing imp command through a form [message #303886 is a reply to message #303884] |
Mon, 03 March 2008 02:22 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
alister
Messages: 101 Registered: August 2007 Location: India
|
Senior Member |
|
|
Hi to all once again
The host command should be
host ('\\accdatserver\d\oracle\ora81\bin\imp.EXE estt/prime@afrestpj file=\\accappser\e\dump\afres270208.dmp fromuser=prime touser=estt ignore=y');
It was wrong typed as ile for file
Thank you
Alister
|
|
|
|
|
|
Re: Executing imp command through a form [message #305762 is a reply to message #304671] |
Tue, 11 March 2008 22:37 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
alister
Messages: 101 Registered: August 2007 Location: India
|
Senior Member |
|
|
Hi Everybody
Can anyone tell me if there is a way to use the imp command using a form. I want to decentralise the operation. Now only an administrator is able to do it. If I could use it through a form then I could ask the end users to do it themselves.
Thank you,
Alister.
|
|
|
|
Re: Executing imp command through a form [message #307583 is a reply to message #303884] |
Wed, 19 March 2008 03:46 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
alister
Messages: 101 Registered: August 2007 Location: India
|
Senior Member |
|
|
Hello David,
Thanks for you reply. What is being done is that a few records from a table is send as a dmp file because there is no physical connection between a data base called PRIME and another data base called AFRES to which the data has to be inserted. So as and when there are new records created in PRIME a dmp file is created and send. This dmp file is inserted into AFRES for the end users. So everytime a dmp file arrives the administrator has to import it. Thus I thought that if a form can be created then any end user can import it without having to logon to the data base server. If there is anyother way of doing this operation please let me know. I am using oracle 8.1.7
Thanks again
Alister
|
|
|
|
|
|
Re: Executing imp command through a form [message #309801 is a reply to message #303884] |
Fri, 28 March 2008 20:56 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
amdabd
Messages: 91 Registered: November 2007 Location: My Computer
|
Member |
|
|
hi,
create your backup folder [i.e: 'c:\backup'],
on a PushButton [ WHEN-BUTTON-PRESSED] insert the following code
declare
alrt number;
v_directory varchar2(200) := 'c:\backup';
-------
path varchar2(100):='back_up'||to_char(sysdate,'dd-mm-yyyy-hh-mi-ss');
v_exp varchar2(200) := 'exp scott/tiger@orcl file = '
||v_directory||'\'||path
||'.dmp owner=scott grants=yes'; --for specify user use owner=user
-------
begin
host(v_exp);
if form_success then
set_alert_property('msg',alert_message_text,'Form success');
alrt:=show_alert('msg');
else
message('there are errors ');
end if;
end;
------
enjoy it
---------------------------------
Quote: | Executing imp command through a form
| I'm sorry
however I still enjoy it
[Updated on: Tue, 06 May 2008 19:13] by Moderator Report message to a moderator
|
|
|
|
Re: Executing imp command through a form [message #313912 is a reply to message #303884] |
Tue, 15 April 2008 03:00 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
alister
Messages: 101 Registered: August 2007 Location: India
|
Senior Member |
|
|
Hi amdabd
I believe that the imp command can work only on the machine that oracle is installed. I think that it cannot be invoked from another machine, because when I try to execute it from another machine there is only a flicker and nothing happens.
Thanks to all my friends
Alister
|
|
|
Re: Executing imp command through a form [message #313928 is a reply to message #303884] |
Tue, 15 April 2008 03:45 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
dillango
Messages: 145 Registered: January 2008
|
Senior Member |
|
|
Mr.alister,
Did you tried after instllaing the database client?.
While importing, if the same table exist with valid data, how did you come across the import errors like table creation error, referential intergrity, order of the table import etc..?
Ilango
|
|
|
Re: Executing imp command through a form [message #313946 is a reply to message #303884] |
Tue, 15 April 2008 05:10 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
irfan.ocp
Messages: 29 Registered: February 2008 Location: Karachi, Pakistan
|
Junior Member |
|
|
Dear Alister.
Oracle Export/Import/Sqlldr Command only execute on those PC where Oracle Client or Oracle Database or Specific Component had installed.
Best Option in my view that you installed the Oracle Client which will take less Space as compared to other.
Best Regards,
Muhammad Irfan Bakali.
|
|
|
|
Re: Executing imp command through a form [message #317853 is a reply to message #303884] |
Sun, 04 May 2008 05:04 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
Quote: | Hello David,
Thanks for you reply. What is being done is that a few records from a table is send as a dmp file because there is no physical connection between a data base called PRIME and another data base called AFRES to which the data has to be inserted. So as and when there are new records created in PRIME a dmp file is created and send. This dmp file is inserted into AFRES for the end users. So everytime a dmp file arrives the administrator has to import it. Thus I thought that if a form can be created then any end user can import it without having to logon to the data base server. If there is anyother way of doing this operation please let me know. I am using oracle 8.1.7
Thanks again
Alister
|
Hi Alister,
From what i understood above. This is what i have in mind.
1. Create a folder on the "C" drive or any other drive of your "PRIME" server.create the same folder on your "AFRES" server also in the same drive.
2. Create a batch file(.BAT file) on your "PRIME" server in the folder which you have created and write the EXPORT command in it.
3. Create a smilar batch file(.BAT file) on your "AFRES" server in the same folder and write the IMPORT command in it.
PRIME SERVER SCHEDULAR
Create a schedular which runs on a specific interval. lets assume there are new records inserted every 10 mins. Then create the schedular to run every 15 mins to create the dmp file in the folder.
you can write the MOVE command in the batch file itself to move the dmp file once it is created to the "AFRES" server.
AFRES SERVER SCHEDULAR
Create a schedular to atomatically run the batch file to import.
I hope you have understood what i am trying to get at.
In this way probably you wouldnt have to create a form or manually move the records from one server to the other.
Let me know if it works.
Mudabbir
|
|
|
Re: Executing imp command through a form [message #317914 is a reply to message #303884] |
Sun, 04 May 2008 22:36 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
alister
Messages: 101 Registered: August 2007 Location: India
|
Senior Member |
|
|
Hi Everybody
Thank you mudabbir for your procedure. Everything is fine up to creating and moving the dmp file from the PRIME Server to to AFRES server. But how do I automatically run the scheduler. Is there a way in which I can check to see if there is a new file in the folder an run it just like outlook express looks and alerts the users for new mail. I cannot run the scheduler periodically because the dmp file is created as and when there are a certain number of records. Sometimes every 10 minutes, sometimes no dmp file is created during the entire day. I hope you are able to get my problem. If there is a way of knowing that there is a dmp file then an imp can be executed and the file deleted on the completion of the import.
Thank you once again.
Alister
|
|
|
Re: Executing imp command through a form [message #317938 is a reply to message #303884] |
Mon, 05 May 2008 01:15 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
Hi Alister,
The answer lies in the creation of the Batch file. Let me explain
You have created a folder on your "C" Drive called "BACKUP".
This folder will contain:
1. The batch file which you are running on the "AFRES" server called "MyBatch.bat".
2. The dump file created to be imported "MyDump.dmp".
3. A Folder called "ARCHIVES"
Assume we have created a schedular to run every 10 mins.
MyBatch.bat file
Assume this is the import command which you will have in this file
imp estt/prime@afrestpj file=C:\BACKUP\MyDump.dmp fromuser=prime touser=estt ignore=y
The following lines you will have to add.
set yymmdd=%date:~12,2%%date:~4,2%%date:~7,2% - This will create the date stamp. If today is 5th of may 2008. it creates "080505".
Ren MyDump.dmp MyDump%yymmdd%.dmp - This will rename your MyDump.dmp file to MyDump080505.dmp
Move C:\BACKUP\MyDump%yymmdd%.dmp C:\BACKUP\ARCHIVES\ - This will move the MyDump080505.dmp file to the "Archives" folder.
The reason for this is that when the MyBatch.bat file runs it will look for the MyDump.dmp file in the location and import the file. If it does not find the file, the import command doesnt execute, the ren command doesnt execute and also the move doesnt execute.
I hope you have got it.
Mudabbir
|
|
|
Re: Executing imp command through a form [message #317989 is a reply to message #303884] |
Mon, 05 May 2008 04:17 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
*munnabhai*
Messages: 157 Registered: March 2008 Location: Riyadh
|
Senior Member |
|
|
You can use this as a batch file with log file and put into a window built in schedule as per your desire time
create a directory in D:\drive called backup
d:\backup
copy the below code into text file and change the username and password and save the file as a batch xx.bat
c:\oracle\ora81\bin\EXP USERNAME/PASSWORD FILE=D:\backup\xxx.DMP FULL=Y LOG=D:\backup\xx.LOG
Hope this will work fine.
Regards
|
|
|
|