SQL*Plus Change to File While Being Run
Anyone,
Once you execute a file run in SQL*Plus does the entire file get cached by SQLPlus? (i.e. @C:\temp\myfile.sql)
If I change the file C:\temp\myfile.sql while the session is running (long runing script) will it take effect or not?
I was able to open the file make a change and save but not sure if SQLPlus will pick up my change when it gets to the point in the script where I made the change. Since it was already running.
Thanks,
Miller
That is a very bad idea to begin with.
If you made a change at the location that has not yet reached by the SQL*Plus script processing, you could see those changes (again depending upon where and how you do them).
But in most circumstances, the results will be unpredictable (most likely with error messages) since you cannot control what part of the script the SQL*Plus application is currently executing at the moment you decide to make change to the script.
For example, I started with this script:
REM --- Script start ---
prompt "Waiting ..."
begin
dbms_lock.sleep(20) ;
end ;
begin
dbms_output.put_line('This is text') ;
end ;
prompt "Finished..."
REM --- Script end ----And run this within SQL*Plus. While the PL/SQL block was waiting on the sleep call, I removed the first line of the script (the one that starts with the prompt statement) and saved it. Below is the output from this run:
SQL> @test
"Waiting ..."
PL/SQL procedure successfully completed.
SP2-0734: unknown command beginning "ut_line('T..." - rest of line ignored.
SP2-0042: unknown command "end " - rest of line ignored.
PL/SQL procedure successfully completed.
"Finished..."
SQL>I would not consider this as a successful completion of the script.
At this point, you are probably playing with probability and taking chances.
Message was edited by:
Kamal Kishore
Similar Messages
-
Manipulate file while being downloaded?
Hi,
I was wondering if there is a way that the application server can intercept a file being downloaded and change it's byte code in a certain way.
For example, Imagine I upload a letter on the internet. If the letter is downloaded by John then the first part will be address to John else if the letter is downloaded by ben it will be addressed to ben.
However I do not want to actually build two letters in memory since there could be tousands of users downloading the same letter which would crash the server (imagine this is a very long a big letter).
So is it possible to capture the user download from the application server and convert some of the bytes in that letter accordingly.
I am not intrested to know how to convert the bytes in the letter, but how to make this possible when a file is being downloaded!
regards,
Sim085Since all the instances of the servlet are running on
the same JVM you can synchronize this part of the
code, so that only one instance of the file will be
loaded all the time.hmm .. that sounds intresting. Have to read more on how servlets can create downloadable content.
However from what I unbderstand, before the user starts downloading the file, the servlet needs to return the file in question.
Usually it is still represented as a link to file on the drive! I have always tought that the servlet needs to always save the file on the server, and then inform the Application Server that the download is available from the particular location.
What I am searching for is to create a download that is customizable (manipulated a download time) while taking the least ammount of space in memory and harddisk! At the moment searching for available content on google, would be more then happy to read any articles you people think are relevant on this :)
Regards,
Sim085 -
Help please - how can i change a file extension at run time
hi all
i have a question about file created on the run. for instance, if i need to create a file initially with a an extension of '.in'. and there are some processes writing data to it, and after the file is written. i need to change it to some thing like '.out'. is it possible to do this? can u please provide some samples if you have any solution or suggestion. thanks.do u have the links of these tutorials?IO tutorials...
http://java.sun.com/docs/books/tutorial/essential/io/index.html -
How to change property file contents during run time?
Hi everyone. First post so go easy on me please.
I have a couple of properties that I want to read from a from a file. To achieve this I simply use:
ResourceBundle.getBundle("my.package.MyItems").getString("MyProperty");
This works like a wonder. The problem is, i want to change the property "MyProperty" during runtime. I've found the properties file (MyItems.properties) inside weblogic, but if a change its contents it does not reflect in the application.
I can come up with a couple of justifications:
* I'm not looking in the right folder/changing the wrong file in the server;
* Weblogic caches the properties file, meaning that I have to redeploy the project (defeating the purpose of actually having a properties file).
Can anyone help with this one?
[EDIT] Forgot important info:
* JDeveloper 11.1.1.4
* Weblogic 11.3 (not 100% sure)
* Both JDev and WebLogic running on Windows 7 64 bits
Thank you in advance!
Best Regards
J. Peixoto
Edited by: 868634 on Jul 12, 2011 9:37 AM
Edited by: 868634 on Jul 12, 2011 10:21 AM
JDeveloper 11.1.1.4, not 3I tried it all.
Just an explanation of my context.
I have 1 application with 2 projects in it. First project is called "CommonUI_ViewController" and the second one "FO_ViewController".
The properties file I'm trying to change is located inside "CommonUI_ViewController", in package "PropertiesConfig" and the file is called "PhaseListener.properties".
"FO_ViewController" is dependent on "CommonUI_ViewController". When I run "FO_ViewController" the integrated weblogic server log shows this (among other things):
[10:25:55 AM] Wrote Web Application Module to D:\JDeveloper\dump\system11.1.1.4.37.59.23\o.j2ee\drs\SPV_BPM\FO_ViewControllerWebApp.war
[10:25:57 AM] Wrote Web Application Module to D:\JDeveloper\dump\system11.1.1.4.37.59.23\o.j2ee\drs\SPV_BPM\CommonUI_ViewControllerWebApp.war
Note: both lines above point to folders. "FO_ViewControllerWebApp.war" and "CommonUI_ViewControllerWebApp.war" are NOT war files, but folders that have that name.
I tried changing the properties file in the following locations:
* D:\JDeveloper\dump\system11.1.1.4.37.59.23\o.j2ee\drs\SPV_BPM\FO_ViewControllerWebApp.war\WEB-INF\lib\adflibSPVCommonUI.jar > PropertiesConfig\PhaseListener.properties;
* D:\JDeveloper\dump\system11.1.1.4.37.59.23\o.j2ee\drs\SPV_BPM\CommonUI_ViewControllerWebApp.war\WEB-INF\lib\adflibSPVCommonUI.jar > PropertiesConfig\PhaseListener.properties;
* D:\JDeveloper\dump\system11.1.1.4.37.59.23\o.j2ee\drs\SPV_BPM\CommonUI_ViewControllerWebApp.war\WEB-INF\classes\PropertiesConfig\PhaseListener.properties (no need to open any jar/war to get to this one).
I changed all these files with different values but no change was shown in the application (using the method in the previous post).
I believe that I'm still doing something wrong :/
Thank you for your help so far vinod_t_krishnan!
J. Peixoto -
Redirect the output of SQL*Plus to the file
Hi all,
I have the following command to run:
sqlplus username/password @myfile.sql
I don't know how to redirect the output to the file.
Also in the script myfile.sql I have the defined variable, &VP and
How can I substitute this variable(&VP) at the run time.
Thanks,
JPAssumed you like to replace your defined variable VP by number 4. SInce it is posintional parameter,instead of wrinting &VP, write
VP:=&1
sqlplus>spool redirect.txt
sqlplus>@myfile.sql 4
sqlplus>spool off -
hello
i was trying to save the table continuously. i have created the file path with date n time.
with vi write file, i try to save the table. but what i desire to do is
doing the save file continuously. It means that the vi continues
running, while saving data every 20 rows(for example).
i know it is the problem of looping.
but i was trying to use 'open/create/replace file' vi and 'write file'
vi to be in the while loop..but it appears wrong message.it cannot be
done as it says replace existing file.
i do not know what solution to deal.
regardsTry wiring a False constant to the Advisory Dialog input of the Open/Create/Replace File function. This will eliminate the dialog but you also need to make sure that you have set the function input to open or create.
-
FR Report Throwing error while being run from workspace.
While trying to run FR from HFM workspace, its not opening up and instead following error message pops up:
5200: Error executing query: Not enough storage is available to complete this operation.
Please guide me what can be possible reason and how to proceed?
Thanks in advance,
SatishIncrease Virtual memory of the system from which you are running reports.
You can achieve the same by going to Computer -> Properties -> Advanced System Settings.
Check this page : How to increase virtual memory size in Windows 7
Hope this avoids your issue in future.
Thanks,
Santy. -
How does SQL*PLUS read script files
Hello!
well, it is possible to start sqlplus with an sql script file:
sqlplus user/pass@srv @my_script.sqlok, so what happens if I delete the file my_script.sql ?
My script here is about 1 GB big! sqlplus was half way done when I deleted the file.
Is the sqlplus going to stop with an error? Or just hang?
I copied the my_script.sql file now to the folder again and I think that sqlplus is still working fine. But can I be sure, that all statements in the script have been processed?
Thanks in advance!Results are OS dependent which you declined to share with us.
I suspect *NIX & not Windoze.
On Windoze, you can not delete open file.
On *NIX open file does not actually get deleted until fclose() is called.
All in all, you are OK. -
Code runs correctly when compiled by SQL developer but not SQL Plus
I have a rather large package body I need to deploy and compile ... It's big and complex (I inherited the project). Our it dept is huge and scripts are deployed by the dba team and they seem to only use sql plus. My code deploys and runs fine when compiled in sql developer. Once I compile it from SQL plus it stops working. It runs and using debug statements I can see the values are correct but it no longer inserts the data into the proper tables. I get ZERO errors or warnings when this is compiled in SQL Plus and no errors are generated from the code at run time. I've diffed the extracts of the code from the DB after each deployment and the only difference is the blank lines which SQL Plus strips out when you load the file. Has anyone run into anything remotely similar and if so how did you solve it? I've tried modifying the code to no avail, adding in comments to preserve the white space makes no difference. The thing that really kills me is that there is no error at all.
Ok this is the problem area.... vReplyMessage is a clob. I've replaced it in this section of processing with a varchar2(32000). And now it works. I still would like to know why though. Nothing is changed when I load it though sqlplus or sql developer but this line " update swn_recip_response_t set SWN_RECIP_RESPONSE = vTextReply where notification_id = v_notification_id; " would never execute with the clob. Logging showed that the clob had the correct value though. I am puzzled.
begin
call_SWNPost('http://www.sendwordnow.com/usps/getNotificationResults',vMessageText, vReplyMessage, v_status_code, v_status_phrase, '');
exception
when others then
raise eJavaException;
end;
vTextReply := dbms_lob.substr( vReplyMessage, 32000, 1 );
if (vDebug) then
update PEMS_PROD_2.SWN_POST_LOG set response = 'notif_id == '|| v_notification_id || 'status code == '|| v_status_code|| ' '||vTextReply where log_pk = vLogPK;
commit;
end if;
IF v_status_code = 200 then
v_has_error := 'N';
ELSE
v_has_error := 'Y';
END IF;
-- we handle all exceptions below in case something goes wrong here.
-- this area can die silently.
vTextReply := replace(vTextReply,'<getNotificationResultsResponse xmlns="http://www.sendwordnow.com/usps">', '<getNotificationResultsResponse xmlns:xyz="http://www.sendwordnow.com/usps">');
begin
insert into swn_recip_response_t(notification_id) values (v_notification_id);
exception
when others then
if (vDebug) then
err_num := SQLCODE;
err_msg := SUBSTR(SQLERRM, 1, 100);
insert into PEMS_PROD_2.SWN_POST_LOG (LOG_PK, create_date, REQUEST, notification_id) values(pems_prod_2.swn_post_log_seq.nextval,sysdate,
'err_num - '||to_char(err_num)|| ' error_msg - '|| err_msg, v_notification_id);
commit;
else
null;
end if;
end;
commit;
begin
update swn_recip_response_t
set SWN_RECIP_RESPONSE = vTextReply
where notification_id = v_notification_id;
exception
when others then
if (vDebug) then
err_num := SQLCODE;
err_msg := SUBSTR(SQLERRM, 1, 100);
insert into PEMS_PROD_2.SWN_POST_LOG (log_pk, create_date, REQUEST, notification_id) values(pems_prod_2.swn_post_log_seq.nextval,sysdate,
'err_num - '||to_char(err_num)|| ' error_msg - '|| err_msg, v_notification_id);
commit;
else
null;
end if;
end;
commit;
-- parse through the XML document and update the notification and recipient records
-- parse the clob into an xml dom object
begin
vReplyMessage := vTextReply;
... -
Changing current directory under SQL plus
Can someone please tell me how I change the current directory under SQL Plus? I'm trying to run the nisetup.sql for XMLNEWS application in Oracle's sample application. I tried @"D:\Downloaded Files\XMLNEWSDIR\nisetup.sql", but, that doesn't work.
Can anyone help me on this?
TIA,
A> I do not know of any way to change the default directory once SQL*Plus is running.
One very late response, but... I have been using the Windows GUI version of SQl Plus (SqlplusW.exe) for years and I change the default directory all the time. Here is how:
Use the File, Open pull-down menu dialog, and navigate to the folder you want. Then, select one of the files in that directory. I keep a file named 0~A.sql in each folder where I use SQL Plus for that purpose. It contains only comments, something like:
--SET ECHO ONOnce I open such a file, all the START commands run scripts in that folder.
Now... since the Windows version of SQL Plus has been deprecated, how in the world can I do the same thing in the DOS command window version of SQL Plus?
Why in the world doesn't Oracle provide such an obviously useful feature??? -
SQL*Plus script with a dynamic SPOOL File Location?
Anyone,
I have a numbr of SQL Plus scripts that I need to run many times but each run against a different database. Each script SPOOLS the output like this:
spool c:\temp\BUILD_ASSET.lis
spool c:\temp\BUILD_WORKORDER.lis
etc
(each spool is a seperate script run)
The spool is at the top of each BUILD SQL Script.
Example:
set time on
SET FEEDBACK ON
SET ECHO ON
SET TIMING ON
spool c:\temp\BUILD_ASSET.lisBut I need each run to go into its own directory based on the database I am connected to. Like this:
CONNECT DB1
@C:\temp\BUILD_ASSET.SQL =====> spool c:\temp\DB1\BUILD_ASSET.lis
@c:\temp\BUILD_WORKORDER.SQL =====> spool c:\temp\DB1\BUILD_WORKORDER.lis
etc
CONNECT DB2
@C:\temp\BUILD_ASSET.SQL =====> spool c:\temp\DB2\BUILD_ASSET.lis
@c:\temp\BUILD_WORKORDER.SQL =====> spool c:\temp\DB2\BUILD_WORKORDER.lisIs there a way to dynaically code this without having to create a version of the BUILD scripts for every single DB I connect to?
I would like to have one big script that executes all the individual BUILD scripts.
Seems very easy in concept but I can not see an easy way. I would appreciate any help I can get.
Thanks in advance,
Millercolumn db new_Value db
select sys_context('userenv','db_name') db from dual;
spool c:\temp\&db\file.lis -
My computer is saying it can't find the file 'iTunes64.msi' when I try to update or redownload iTunes how do I fix this? I've tried just about everything I can think of. I am using a dell laptop running windows 7 and have tried changing the file location to run the update in all of my iTunes files as well as when I've tried reinstalling it.
For general advice see Troubleshooting issues with iTunes for Windows updates.
The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for installation or performance issues, or compatibility with QuickTime or third party software.
Your library should be unaffected by these steps but there are also links to backup and recovery advice should it be needed.
tt2 -
SQL*Plus Raises: ORA-3113 End of file on communication channel
I have a Win2000 machine running Oracle client 8i, connecting to an HP-UX server running 9i RAC, with an unknown collection of switches/firewalls in between. Using SQL*Plus I can successfully connect and run queries. However, if I leave the session idle for some time, approximately 15 minutes (though this varies), the next query I execute hangs for a few seconds, then returns with ORA-3113.
I have enabled client-side tracing (ADMIN level). The following extract shows the point at which an error first occurs:
nsprecv: reading from transport...
nttrd: entry
ntt2err: entry
ntt2err: soc 660 error - operation=5, ntresnt[0]=517, ntresnt[1]=54, ntresnt[2]=0
ntt2err: exit
nttrd: exit
nsprecv: transport read error
nserror: nsres: id=0, op=68, ns=12547, ns2=12560; nt[0]=517, nt[1]=54, nt[2]=0; ora[0]=0, ora[1]=0, ora[2]=0
nsdo: nsctxrnk=0
nioqrc: wanted 1 got 0, type 0
nioqper: error from nioqrc
nioqper: nr err code: 0
nioqper: ns main err code: 12547
nioqper: ns (2) err code: 12560
nioqper: nt main err code: 517
nioqper: nt (2) err code: 54
nioqper: nt OS err code: 0
nioqer: entry
nioqce: entry
nioqce: exit
nioqer: exit
nioqrc: exit
nioqbr: entry
nioqbr: state = normal (0)
nioqsm: entry
nsdo: cid=0, opcode=67, bl=1, what=17, uflgs=0x100, cflgs=0x3
nsdo: rank=64, nsctxrnk=0
nsdo: nsctx: state=1, flg=0x420d, mvd=0
nsdo: nsctxrnk=0
nioqsm: send-break: failed to send break...
nioqper: error from send-marker
nioqper: nr err code: 0
nioqper: ns main err code: 12583
nioqper: ns (2) err code: 0
nioqper: nt main err code: 0
nioqper: nt (2) err code: 0
nioqper: nt OS err code: 0
nioqsm: exit
A google search returned one page that suggests the culprit here is the line:
ntt2err: soc 660 error - operation=5, ntresnt[0]=517, ntresnt[1]=54, ntresnt[2]=0
This apparently indicates that the network timed out, a sign of a busy network.
Can anyone:
a) Confirm this or otherwise;
b) Suggest how I may go about proving this to a corporate network operations team;
Cheers, Si.I think the reason can be timeout on one of the firewalls. Network administrators
quite often configure following setting:
"Disconnect idle connection after 15 minutes" - I facedd this problem several
times.
Best Regards
Krystian Zieja / mob -
SQL*Plus report running through concurrent managers
I Created a report in sql*plus from a view table and running it through the concurrent manager in 11.5.10.2. I'm using 4 paramaters, but I made the awards paramaters as required parameters and the from and to creation dates as not required. However, I noticed when trying to run the report with just the awards numbers no data is populated, but when i run the report with awards and dates then the reports shows data. Is there a way to get this report to run with awards only and make dates as an option from the query below?
parameters#
##1 from award number
##2 to award number
##3 from creation date
##4 to creation date
set termout off
set head off
set pages 0
set feedback off
set verify off
set define #
col sort_col noprint
SELECT 'Revenue Report for Date ##3 - ##4, Awards ##1 - ##2', 0 sort_col
FROM DUAL
UNION
SELECT 'AWARD NUMBER^EVENT DATE^DESCRIPTION^REVENUE AMOUNT^CREATION DATE',
1
FROM DUAL
UNION
SELECT project_number
|| '^'
|| event_date
|| '^'
|| description
|| '^'
|| revenue_amount
|| '^'
|| creation_date,
2
FROM apps.pa_events_v
WHERE project_number BETWEEN NVL ('##1', project_number)
AND NVL ('##2', project_number)
AND creation_date BETWEEN TO_DATE (SUBSTR ('##3', 1, 10), 'YYYY/MM/DD')
AND TO_DATE (SUBSTR ('##4', 1, 10), 'YYYY/MM/DD')
ORDER BY 2;
ThanksHi;
Please see below note which could be helpful for your issue:
Unconstrained Msonwa64 Memory Based Planner 64 bit AIX Errors Signal 9 [ID 1274606.1]
JTM Master Program Failing With ORA-1403 on afpgrs [ID 752065.1]
Regard
Helios -
Oracle EBS sql*plus concurrent program
Hello,
I have created some sql*plus concurrent programs. When I run the query in sql*plus or sql developer the results are as expected but when run as a concurrent program I am getting additional rows in the output. This seems to only occur when there are calls to API's such as ARPT_SQL_FUNC_UTIL.
get_salesrep_name_number.
I am not sure where the extra results are coming from since I can't get them in a query but for a small number of cases I am getting unwanted records. I would really like to just have it return the same results as when run outside the context of the concurrent program. Is there any settings I can put in for this? The api's used in the query (function calls) were used since they are taken from standard Oracle views. I would prefer to leave them in as we know they are giving us the correct results and digging into each one to see what it is doing and replacing it with a sub query would take a lot of time.
I could possibly just change this into a PL/SQL package with utl_file but I would prefer not to go to that effort unless absolutely.
Any help on this would be much appreciated.I have a SQL PLPUS script which generates the CSV file, the problem is whenever I run manually(@c:\future_cost.sql) it's works.
I am trying to generate this CSV from Concurrent program my request is completed successfully but it is not throughing data into my CSV.What do you mean by concurrent program?
The more information you provide, the chances of getting accurate answer will increase! :)
Maybe you are looking for
-
How to configure multiple outgoing interfaces + NAT + PfR
Hello, I have the following config running on Cisco2851. Five interfaces (four ADSL and one LAN 10Mb/s) connected to Internet using pppoe. Local policy is used to make working route tracking. The PfR also configured to load balance traffic coming fro
-
How to change browser homepage in Windows 8?
I bought a Toshiba Satellite with Windows 8. I went into control panel and set msn.com as the home page. However when I go to the internet I am taken to http://t.toshiba13.us.msn.com/ instead. How do I change this?? I want to go to msn.com not some T
-
Is there any way of addings notes to titles or amending titles to include a series number?
-
Can someone help me to be able to access the iBooks & iTunes sites now that I've updated ?
-
Hi Need some comments here: I plan to get a 2.66 Ghz Mac Pro, with 2 GB Ram and a ATI Radeon X1900 XT 512MB graphic card plus a 23˜ cinema display HD. I will use this computer to work with FC Studio and Logic Pro (latest versions). No other software