SQL & PL/SQL :: Copy Command In A Procedure
Feb 22, 2010
I got to pull 30M data into local DB from a remote DB. As of now we have procedure to perform this task using an
Insert /*+append*/ table1
select *
from rdb_view;
I observed using the copy command in sql plus has taken very less time than the procedure.Can we use the Copy command inside the PL/SQL block? I tried with dynamic SQL but It is not allowed I guess.
View 16 Replies
ADVERTISEMENT
Feb 15, 2013
i am trying to copy the data from a remote database which has Oracle 8i thru Sqlplus copy command to the local database which has Oracle 11gR2.
copy from abc/abc@remote
insert emp_new
using
select *
from emp_old
where rownum < 1001;
is it possible to copy the remote database thru sqlplus copy command ?
View 6 Replies
View Related
Oct 3, 2013
I am using the HOST command within Oracle Forms 10g on Windows server to copy a pdf file from the application server to a network folder on another Windows server.
The command works fine if I logon to Windows app server and type it. But it doesn't work when it is launched within Oracle forms using HOST. The command looks as follow
net use \\FileServer\e-file /user:usergroup\username password & copy D:\RepTmp\myReport.pdf \\FileServer\e-file\test\myReport.pdf
Oracle forms doesn't give any error message at all but the pdf file never gets there. Even when I map the network folder as "R:" drive on the Windows app server, a simple copy command like this does not work with HOST:
copy D:\RepTmp\myReport.pdf r:\test\myReport.pdf
Oracle Forms server is running as "SYSTEM" on the Windows server. If HOST won't work, is there any other way to copy the file other than using fpt?
View 1 Replies
View Related
May 11, 2012
When i try to copy a table within the database i get insufficient priv error.
SQL> COPY FROM JACK@JACK -
> CREATE T -
> USING SELECT * FROM JACK.T;
Enter FROM password:
Array fetch/bind size is 15. (arraysize is 15)
Will commit when done. (copycommit is 0)
Maximum long size is 80. (long is 80)
ERROR:
ORA-01031: insufficient privileges
what privilege is required to perform this copy command ?
View 2 Replies
View Related
Jul 29, 2012
I am using the SQL*PLUS COPY command to move the data from my database to another remote database. The data in my database also contains DATETIME format. But since COPY command cannot handle DATETIME format, I am wondering is there any workaround for this.
Note: Due to some limitations, I cannot use other methods like DATABASE LINK or EXPDP/IMPDP commands.
View 12 Replies
View Related
Jun 23, 2010
I am facing one problem we used to copy any document and for open any document in WINDOWS
Host('CMD /C COPY '||'"'||:Old_Doc||'"'||' X:�3�3'||:New_Doc);
Client_Host('Cmd /C Start '||'X:�3�3'||:New_Doc);
But these commands not running in Linux.
View 12 Replies
View Related
Jan 27, 2012
I am very new to oracle and SQL.I am trying to create a store proc that will copy 14 day of data into a table and then truncate the original table. When i compile following code....
CREATE OR REPLACE PROCEDURE STOPROC_TRUNCATE
( dateNum IN NUMBER )
IS
BEGIN
create table AUDIT_14Days as select * from AUDIT where TIMESTAMP >= (SYSDATE - dateNum);
truncate table AUDIT drop storage;
[code]....
View 8 Replies
View Related
Jan 18, 2012
After creating this procedure...we r not able to execute it...
SQL> ed
Wrote file afiedt.buf
1 create or replace procedure dyn_pro1
2 (tablename varchar2,colname varchar2, prodid number) is
3 cmd varchar2(100);
4 begin
5 cmd := 'delete ' || tablename || ' where'|| colname|| '=' ||prodid;
6 execute immediate cmd ;--using College_id;
7* end;
SQL> /
Procedure created.
SQL> exec dyn_pro1('stu_4','COLLEGE_ID',200);
BEGIN dyn_pro1('stu_4','COLLEGE_ID',200); END;
*
ERROR at line 1:
ORA-00933: SQL command not properly ended
ORA-06512: at "APPS.DYN_PRO1", line 6
ORA-06512: at line 1
View 8 Replies
View Related
Nov 6, 2011
I have a procedure in this procedure i use.
EXECUTE IMMEDIATE 'alter user '||use||' identified by '||modp ||' replace '||oldp;
but when i execute it show insufficient privilages but i create for this procedure as public.and grant execute facility to the user.
View 6 Replies
View Related
Aug 28, 2012
I am trying to execute the SQLPLUS command (CONNECT) from the stored procedure.It is throwing below error message.
Stored Procedure:
SQL> select user from dual
2 ;
USER
------------------------------
SYS
SQL> create or replace
2 PROCEDURE PROCEDURE1 AS
3 BEGIN
4 sqlplus sys/sys@D as sysdba;
5 --execute immediate 'create user 'kkk' identified by 'kkk';
6 END PROCEDURE1;
7 /
Warning: Procedure created with compilation errors.
SQL> show err
Errors for PROCEDURE PROCEDURE1:
LINE/COL ERROR
-------- -----------------------------------------------------------------
3/9 PLS-00103: Encountered the symbol "SYS" when expecting one of the
following:
:= . ( @ % ;
The symbol ":=" was substituted for "SYS" to continue.
[code]....
View 29 Replies
View Related
Sep 26, 2011
I am working on form 10g, here i am using post command in save procedure to apply some record in database temporary.
But Frm-40404 Message raise during saving record i need post commond but i dont want to this message should popup, is there any method to avoid the message only?
View 7 Replies
View Related
Sep 13, 2013
we are running SAP application against oracle database. say, if I use brspace or brtools (from SAP side) to shutdown or startup database or collect stats, does this mean it not recommend to use oracle command to shutdown/start & collect stats?
View 3 Replies
View Related
Feb 24, 2013
I am using oracle 11g XE.
My server hard disc crashed yesteday and i don't have any backups / I am able to recover the .dbf by using a recovery tool.
is it possible to use this .dbf into new server and recover my data.
View 3 Replies
View Related
Jun 10, 2011
I've got table rep184_mediate with columns
mydate (it should be changed [mydate + 1 day] when copying) and other columns (should be copied as is).
How do I perform this without writing name of each column?
View 3 Replies
View Related
Feb 16, 2013
I had a query that if the ftp service is enabled on a RHEL server, then, why is the right-click on the URL which is like:
ftp://10.101.18.19
does not yield a save-as box? But if I do a ftp to the server like
ftp <server_name>
the mget for a file works.I hope my query is clear that the file cannot be downloaded from the URL but a command line ftp for the file works.revert with the reply to my query.
View 3 Replies
View Related
Sep 20, 2013
how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me.
xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>.
View 3 Replies
View Related
Mar 6, 2010
I have created one procedure based on one table item master which has a field called item stock or non stock based on this i will fetch data from one of two tables .If its a stock item data will be retrieved from wip_main_acnt table and if its non stock it will pick from ns_main_acnt.my procedure is working fine but all i need is i just want to put an exception that if data is not found in one of the table based on the item selected.I am confused which one to be used whether no_data_found or notfound%.
CREATE OR REPLACE PROCEDURE dflt_pr_acnt (
l_item_code IN VARCHAR2,
l_main_acnt_code OUT VARCHAR2
)
[code]....
View 8 Replies
View Related
Oct 12, 2012
I want copy some tables from one database to another. Which of following is the fastest way:
- INSERT /*+APPEND*/ via database link
- Transportable Tablespaces
- datapump IMP/EXP (I supposed it's the slowest way)
View 2 Replies
View Related
Jul 13, 2010
While trying to copy a database, i used the command: RECOVER DATABASE USING BACKUP CONTROLFILE until cancel; it gave:
ORA-00279: change 7866782806751 generated at 07/12/2010 19:39:23 needed for thread 1
ORA-00289: suggestion : /moteurs/oracle/r11110/R11110/archivelog/2010_07_13/o1_mf_1_1158_%u_.arc
ORA-00280: change 7866782806751 for thread 1 is in sequence #1158
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/data01/oracle/r11110/data/SYSTEM01.dbf'
ORA-01112: media recovery not started what can i do in this case of issue?
View 5 Replies
View Related
Feb 23, 2011
Can I copy rman to use a different database with a different ID
View 6 Replies
View Related
Apr 30, 2010
i could copy data from tableA to tableB with the scenario below
1) Currently we have no unique key / primary key defined on both of this tables, due to the nature of data, so insert/update will not work
2) We cant truncate/insert as user will be accessing this tables when the copying process takes place, so we dont want to end up having a scenario where the table does not contain data at a certain time
Will materialize view full refresh work in refreshing a table so we could avoid the problem faced in point 1 & 2.
View 7 Replies
View Related
Feb 11, 2013
I have two tables namely PERSON and WIFE. I want to make WIFE's data available in PERSON table while keeping entries of WIFE maintained and at the same time adding some the values of PERSON against the data of wife.
PERSON Table
PK NAME ADDRESS IS_MARRIED
1 John ab city Y
2 Varvatos cd town N
3 Smith ef town Y
4 Henry gh city Y
5 Lynda gh city Y
WIFE table
PK PERSON_ID (FK) NAME
1 1 Alice
2 3 Rosy
3 4 Lynda
Now i want to copy data of WIFE table into PERSON table like this PERSON table
PK NAME ADDRESS IS_MARRIED
1 John ab city Y
2 Varvatos cd town N
3 Smith ef town Y
4 Henry gh city Y
5 Lynda gh city Y
6 Alice ab city Y
7 Rosy ef town Y
As in the given example you might have noticed that ADDRESS of wife is same as of her spouse and same goes for IS_MARRIED column. Moreover, the PK is also not duplicated. How to go about this?
Another important factor is Lynda already exits in PERSON table, therefore, i certainly don't want to duplicate her entry.
View 8 Replies
View Related
Mar 29, 2011
Iam using Oracle 10g Release 10.1.0.3.0 Database and Linux Operating System for Server. I have a Stored Procedure which generates a Text File in Oraload Folder. Can I copy it to /home/ftp-docs/ using utl_file.fcopy ? If yes, how to do it ?
View 1 Replies
View Related
May 21, 2006
Is it possible to copy a value in a column from a table into another column in another table using the select statement.
Example: I want to copy the arrival date from the guest table to date_charge in the charges table.
CREATE TABLE GUEST
(ROOM_NUMBER VARCHAR2(2),
DATE_ARRIVAL DATE DEFAULT SYSDATE NOT NULL);
CREATE TABLE CHARGES
(ROOM_NUMBER VARCHAR2(2),
DATE_CHARGE DATE default Sysdate);
[code]....
View 6 Replies
View Related
May 3, 2013
I have two identical tables from different DB's and I need to copy a row from db1 and insert into db2 if it does not exist or update it if it does(on the tables pk).
This is what i was trying until i realized replace drops the whole table where i thought it dropped the row and inserted the new.
copy
from db1
to db2
replace table2
using
select *
from table1
where x = blah
View 3 Replies
View Related
Feb 22, 2011
Would like to know if I can replicate Production database (10.2.0.2) to Test (10.2.0.4).
tell me the process to do that on windows environment.
I wonder if I can do it with two different oracle versions?
View 4 Replies
View Related
May 27, 2013
I have three database fields on my form , field_1 , field_2 and field_3 , user will enter the data in field_1 , and sometime he may not enter in field_2 ,
I want to bring the value of field_1 as it is into field_3 if he does not enter anything in field_2, if he enters the data in field_2 , then field_1 will get concatenated with field_2 and gets copied into field_3.Is there a way to do this automatically at form level using a trigger when-validate-item.In short this should be done after user presses the enter key on field_2.
create table ot_Sale_code_head ( sale_code varchar2(12),code1 varchar2(6),code2 varchar(6),code3 varchar2(12));
insert into ot_Sale_code_head ('A','01.01',NULL,NULL);
--inserted record in form will be 'A','01.01',NULL,'01.01'
insert into ot_Sale_code_head ('B','01.01','PS-P',NULL);
--inserted record in form will be 'B','01.01','PS-P','01.01.PS-P'
View 2 Replies
View Related
Mar 15, 2010
we have a prod DB and an Backup DB. I have been asked to copy selected tables from prod Db to anaylsis DB on a weekly basis. Db version is 9i.
Can I use Db links here?, but the data is huge.
View 1 Replies
View Related
Jun 18, 2012
I am developing an application for making the travel entries for my organization employees.
For that purpose I have 3 datablocks named:
1) Travel header
2) Employee Detail
3) Travel Detail
which are interlinked through constraints.
I want to give 2 options ie. either single booking entry or Group booking entry.
The form is working properly for single booking entry. But when I want to make a group booking wherein many employees have to travel between common locations I have to fill all the travel details again for all employees. I want to avoid that since it wont give a feasibility for this application. I can copy the travel details I have entered for the 1st employee. I am uploading the form layout.
View 3 Replies
View Related
Mar 2, 2011
I have this remote database A and database B. DB A has 10 views and DB B has 10 tables. I have to pull out data from views of DB A and load into tables of DB B at regular intervals. How do I do this job?
View 3 Replies
View Related