Dbms_pipe
hi,
iam looking at logging event with trigger concept ,in that trigger use dbms_pipe to send the message , but i am confused where send has been send . please tell me for what purpose logging events and use of dbms_pipe.
797525 wrote:
iam just student when i going through the triggers concept i found event logging ,message has been send through the dbms_pipe ,let me write code.,I'm guessing this is a rather old book. It wouldn't make sense to use DBMS_PIPE for this sort of thing in any reasonably modern system.
but if i run this query
errrors shows that declare dbms_pipe error.Most likely, whatever user owns the trigger does not have access to the DBMS_PIPE package. The DBA would need to grant the user EXECUTE access on DBMS_PIPE for this code to compile.
and you ask me about log file on database or flat file i really don't know
if it is how to view in log file ,where it will be located if oracle 10g.Without some other process that is listening on the same port and unpacking the messages, this call to DBMS_PIPE won't be written anywhere. It would be lost at a minimum when Oracle shut down. You'd need to have something like an external application that knows to look for a pipe named INV_PIPE and to pull messages from that pipe. That external application would have to write the message somewhere that you could see it.
Justin
Similar Messages
-
Problems using DBMS_PIPE package
Hi! Im using the SQL Navigator for Oracle to develop PL/SQL code and now I've got a problem with the DBMS_PIPE package. When i use the methods like create_pipe etc. in a normal pl/sql window it works without problems. But when i place such a DBMS_PIPE.CREATE_PIPE... call into a function in my own pl/sql package there's the error PLS-00201: identifiere 'sys.dbms_pipe' must be declared!
what do i have to do to use the dbms_pipe package in a package developed by my own.
thanks in advise
Ingologin to your SYS schema and grant execute on the DBMS_PIPE package to the oracle user under which you
are creating your PL/SQL procedure:
SQL> grant execute on SYS.DBMS_PIPE TO <username> ; -
Error geting while using DBMS_PIPE
following package use DBMS_PIPE procs
CREATE OR REPLACE package body OE.work_on_pipe
is
procedure write_local_pipe
is
message varchar2(30);
begin
message:='rahul';
dbms_pipe.reset_buffer;
dbms_pipe.pack_message(message);
dbms_output.put(message||' write on local buffer');
end;
procedure read_local_pipe
is
message varchar2(30);
begin
dbms_pipe.unpack_message(message);
dbms_output.put(message||' read from local buffer');
end;
end;
m getting error on line
dbms_pipe.pack_message(message);
Error messaage displayed as
Probe:Exception raised in DBMS_DEBUG package
anybody knows whts this error?
Thanks in advance
Rahulare you getting this error during compilation or during execution, because i am not getting any problems when i am compiling
And also please let us know from where you are executing this, from sqlplus or from toad or from other tools -
Dbms_Pipe Package.
Hi,
Can any one please tell me for which perpus we have to use dbms_pipe package.Please give one simple example.
Thanks,
Sanjeev.user13483989 wrote:
Can any one please tell me for which perpus we have to use dbms_pipe package.Please give one simple example.For the same reason pipes are used when writing code that runs directly on the operating system (instead inside Oracle) - IPC or Inter Process Communication.
See http://en.wikipedia.org/wiki/Inter-process_communication for basic details. -
How to use dbms_pipe to execute a shell program
Hi ,
I have a stored procedure....with an if else condition in it
what i want is
if condition is true... then
execute the shell script
else
do nothing
how do i achieve this ? how do i execute a shell script from with in stored proc .. i heard dbms_pipe can be help ful ..could any one throw more light or an example to achieve this?learning_man wrote:
sure i have gone through that option... but the thing is that.....i wnat to run the shell script only if a certain condition inside the stored proc passed some thing like
if condition = true then
dbms_scheduler.create_job(
job_name => 'TESTSH',
job_type => 'EXECUTABLE',
job_action => '/mydir/myscript.sh',
start_date => SYSTIMESTAMP,
enabled => TRUE,
comments => 'testsh');
else
dont do anything...
end if;
where as scheduler is used to schedule .... the time... i dont want to schedule the time.... i want to run the shell script based on some condition becoming true inside the procAbove code snippet does exactly what you're talking about.
Max
http://oracleitalia.wordpress.com -
Hi,
Below block is executed successfully but when i use it to dynamically fetch the values in SQL* Plus no values are getting printed.
Please help me out in rectifying the issue.
SET serveroutput on size 1000000
SET wrap on
SET linesize 80
DECLARE
v_text VARCHAR2 (4000);
v_res NUMBER;
v_num NUMBER;
v_date DATE;
v_usr user_users.username%TYPE;
v_err NUMBER;
pipe_name VARCHAR2 (300);
BEGIN
pipe_name := DBMS_PIPE.unique_session_name;
LOOP
v_res := DBMS_PIPE.receive_message (pipe_name, 2);
DBMS_PIPE.unpack_message (v_date);
DBMS_PIPE.unpack_message (v_usr);
DBMS_PIPE.unpack_message (v_num);
DBMS_PIPE.unpack_message (v_text);
DBMS_OUTPUT.put (TO_CHAR (v_date, 'DD-MON-YYYY HH24:MI:SS') || ' ');
DBMS_OUTPUT.put (v_usr || ' ');
DBMS_OUTPUT.put (v_num);
DBMS_OUTPUT.new_line;
DBMS_OUTPUT.put_line (' ' || v_text);
EXIT WHEN v_res = 0;
END LOOP;
END;
/kumar0828 wrote:
Yes i understood that.
When the PL/SQL block encounters the DBMS_OUTPUT_PUT_LINE that time the contents of the array will be displayed on the terminal.As Billy already said. This is wrong. SQL*plus will read and show the content of the buffer if certain circumstances are met. Therefore you will first get the message: Pl/sql Block executed. Then you will get the message from the buffer.
I want to know whether the code is proper to store the contents into the array. This code will try to read from apipe that is only known to your session. Usually pipes are used to read messages from other sessions.
This line would prevent that.
pipe_name := DBMS_PIPE.unique_session_name;It will read data from a pipe that does not exists outside of your own session. Is that what you want?
Edited by: Sven W. on Sep 25, 2012 12:07 PM -
DBMS_PIPE package in the library
Where do I find the DBMS_PIPE package. Right now I'm working on migrating forms to 6i. And i got this error in a procedure(G$_GET_PIPE_MESSAGES) which is called in a trigger.
DBMS_PIPE package has
1. PACK_MESSAGE procedure
2. SEND_MESSAGE function
3. RECEIVE_MESSAGE function
4. UNPACK_MESSAGE proceduredbms_pipe is a database package owned by SYS:
http://www.oracle.com/pls/db102/ranked?word=dbms_pipe&remark=federated_search
cheers -
hi all,
we are using dbms_pipe with our application and sudenly we are gettinmg the below error.
Sun Feb 05 08:25:13 2012 trnsfr_get_list: ORA-20001: Send Timeout on pipe ORA$PIPE$00E2CB3E0001Any Comments please..
Edited by: user8792751 on 05-Feb-2012 23:44Any Comments please..My Comments:
1). You haven't included any relevant information (such as version, platform, how you are using pipes, etc)
2). http://bit.ly/zIpos4 -
Need info. about dbms_pipe!
Hi all,
Can anybody give me some explanation & an example of dbms_pipe.
My requirement is, i want to run host commands through PL/SQL procedure. My host command will be a pro*c executable.
In order to run a host command in a pl/sql procedure, i think of only dbms_pipe.
If anyone has any idea about it, pls. mail me.
ByeThere is very nice example in the Oracle Application Developer's Guide. I think, it is exactly that you want.
Have a look at http://otn.oracle.com/doc/server.804/a58241/ch8.htm#1679
Radek -
Running OS command using DBMS_PIPE
Hi,
I have reproduce the exemple in the documentation DBMS_PIPE - Example 3: Execute System Commands using the proc daemon.pc. It works, the commands are getting executed, but I have no control over them. What I need is for the calling PL/SQL function to wait for the OS command to finnish before continuing with the execution the PL/SQL function.
Any hint would be appreciated. Thanks.odie_63 wrote:
Justin Cave wrote:
The normal way to approach that sort of requirement would be to use a Java stored procedure.Or a DBMS_SCHEDULER external program with "use_current_session" set to true.
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sched.htm#i1013568
On 10g+ I'd definitely give this a go. -
Hi to all!
Unfortunately, I didn't find package DBMS_PIPE in this database edition!
How I can walk it around? Or may be there is a trick ?
Thanks in advance,
Konstantin.Please verify that it does not exist. In my installation of XE, I run
SQL>
select distinct owner, object_name from dba_procedures where object_name like 'DBMS_PIPE';
OWNER
OBJECT_NAME
SYS
DBMS_PIPE
SQL> -
DBMS_PIPE FOR IN-HOUSE CHATTING
hi everybody!
i wanted to know if i could use dbms_pipe package for making an application for chatting between different users simultaenouslyIt is probably possible to get this to work, but it may be more painful that the alternatives...
If you have a long-runing process, Oracle provides a view to let you monitor its progress v$session_longops. You can use the DBMS_APPLICATION_INFO package to record user-defined information into this view. Oracle Enterprise Manager has a nice interface for displaying the information in this view with a progress bar that you might be interested in mimicing in your application.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Alternative of DBMS_PIPE
oracle 8i and above if there is an alternative to run oracle programs ( procedure, Queries .. ) in background apart for DBMS_PIPE
> an alternative to run oracle programs ( procedure, Queries .. ) in background
apart for DBMS_PIPE
DBMS_PIPE itself does not run processes/queries in the background. DBMS_PIPE is an IPC (Inter Process Communication) mechanism - it means that there is a peer or server process om the other side of that IPC channel doing the work.
DBMS_PIPE is not running the query in background. A background process (e.g. DBMS_JOB) is running the query. This process received the instructions of what query to run via an IPC call, courtesy of something like a database pipe.
DBMS_PIPE is one of a couple of IPC mechanisms one can use in Oracle. The simplest one is a table (which serves as a SGA for "client" processes to communicate with "background" processes). AQ is another form of IPC in Oracle.
Do not confuse the IPC method with the processing architecture. To do anything in the background, a background process is needed. In Oracle this means that background processing (for queries) can be done via
- DBMS_JOB/DBMS_SCHEDULER processes
- AQ processes
- PQ processes -
Dbms_pipe / maxpipesize / locking
i use dbms_pipe in an application for debugging in development environment:
this environment consists of the following parts:
1) oracle server with plsql application and dbms_pipe for debug messages (SEND_MESSAGE)
2) windows service with odp.net waiting for messages from pipe (RECEIVE_MESSAGE) servicing multiple clients over telnet connection (broadcasts the debug message from pipe on all clients connected with telnet)
everything works fine - but some questions are open:
my sending pipe func looks like following:
create or replace PROCEDURE "DEBUG" (p_mandnr number, p_msg varchar2, p_type number) as
v_status number:=0;
v_lockHandle varchar2(200);
begin
dbms_lock.allocate_unique('control_lock', v_lockHandle);
v_status := dbms_lock.request(v_lockHandle, dbms_lock.x_mode);
if v_status=0 then
if v_status=0 then
dbms_pipe.pack_message(length(p_msg));
dbms_pipe.pack_message(p_msg);
dbms_pipe.pack_message(p_mandnr);
dbms_pipe.pack_message(p_type);
v_status := dbms_pipe.send_message('plsql_debug',0,1000000000);
if v_status<>0 then
dbms_pipe.purge('plsql_debug');
v_status:=dbms_pipe.remove_pipe('plsql_debug');
end if;
end if;
v_status := dbms_lock.release(v_lockHandle);
end if;
exception
when others then
case sqlcode
when -6558 then -- ORA-06558: buffer in dbms_pipe package is full. No more items allowed
dbms_pipe.reset_buffer;
else
null;
end case;
v_status := dbms_lock.release(v_lockhandle);
end;
1) do i have do lock the access to the pipe ?
2) if i specify a maxpipesize in the SEND_MESSAGE call with an implicity created pipe - what happens, if the message length is less than maxpipesize
3) what happens, if the windows service (RECEIVE_MESSAGE) do not run (so is not consuming messages from pipe), but the oracle server is writing messages to the pipe:
- the pipe gets an overflow ?
- if maxpipesize is reached the pipe is purged?
- if sending is blocked, so the SEND_MESSAGE returns immediately or waits for free space in the pipe (HORROR - so the entire application would be blocked)
- is there a life-timeout for messages in the pipe ?
thx for helpingYou are able to execute it using an anonymous block because you have the execute privilege via a role. To be able to create procedures with it, you must be granted the execute privilege on SYS.DBMS_PIPE directly, not via a role.
So log in as SYS, execute "grant execute on dbms_pipe to <your user>" and you are able to create your own procedures with dbms_pipe.
Groet,
Rob. -
hi all
can i or not user dbms_pipe with rac? if not what can i use insted?
now i migrate my application to rac enviroment and seems to my that dbms_pipe dosnt not work propretyly
thanks in advicei still have the same problem
i have load balance on server and client site
When i run my app and log on RAC1 and then when i run report, my app start another session (progres bar).
If this session log on RAC1 then every thikn works fine, but sometime this session log on RAC2, and my progres bar dosn't work. Hi dont get message from first session.
How can i resolve this?
Ultimately i turn off load balance on server site and in application i will be redirect new connection to correct server?
Thanks in advice
Maybe you are looking for
-
How can I resolve these issues? Please help
-
Safari crashing several times today
I am having a problem with Safari just today. While I am going from one website to another, it just disappears. I can see the toolbar on top, but the screen in gone. this has happened about 8-10 times tonight. No matter what I do the screen will not
-
ABC Analysis [Update Item Assignment Window]
Hello Friends I am working on Inventory Cycle count in EBS R12. I am facing a problem. I create an ABC Analysis for ##FGI sub inventory in M1 Organization on Vision Instance. Then i checked 22 items in my On-Hand Availability Window. But when i check
-
Hi everyone. Just upgraded to iMac 5K. Lightroom 5.7 is running slow, 1:1 zoom ratio isn't right and my wacom intous4 tablet pen is not responding smoothly. Appreciate all advise and thanks.
-
ClassCastException extent.close(iterator)
I'm doing something like the following: Extent ext = commonManager.getExtent(c, includeSubClasses); Query query = commonManager.newQuery(ext); Iterator it = ((Collection)query.execute()).iterator(); //iterate over instances query.close(it); ext.close