SlideShare uma empresa Scribd logo
Oracle Inter-Session
Communication
Oren Nakdimon
www.db-oriented.com
 oren@db-oriented.com
 +972-54-4393763
@DBoriented
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
http://db-oriented.com
Who Am
I?
INTER-SESSION COMMUNICATION
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
Session Session
Session
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
Session Session
Session
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
Session
SGA
Session
Session
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
Session
SGA
Session
Session
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
Session
Outbox
SGA
Inbox
Session
Session
Outbox
Inbox Outbox
Inbox
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
Session
Outbox
SGA
Inbox
Session
Session
Outbox
Inbox Outbox
Inbox
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
Session
Outbox
SGA
Inbox
Session
Session
Outbox
Inbox Outbox
Inbox
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
Session
Outbox
SGA
Session
Outbox
Inbox
Session
Inbox Outbox
Inbox
Outbox
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
Session
Outbox
SGA
Session
Outbox
Inbox
Session
Inbox Outbox
Inbox
Outbox Inbox
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
Session
Session
Outbox
SGA
Session
Outbox
Inbox
Inbox Outbox
Outbox
Outbox Inbox
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
Session
Session
Outbox
SGA
Session
Outbox
Inbox
Inbox Outbox
Outbox
Outbox Inbox
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
Session
Session
Outbox
SGA
Session
Outbox
Inbox
Inbox Outbox
Outbox
Outbox Inbox
DEMO
Logger
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package pipe_demo as
procedure log(i_text in varchar2);
procedure get_next
(
o_user out varchar2,
o_sid out number,
o_host out varchar2,
o_time out date,
o_text out varchar2
);
end pipe_demo;
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package pipe_demo as
procedure log(i_text in varchar2);
procedure get_next
(
o_user out varchar2,
o_sid out number,
o_host out varchar2,
o_time out date,
o_text out varchar2
);
end pipe_demo;
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package pipe_demo as
procedure log(i_text in varchar2);
procedure get_next
(
o_user out varchar2,
o_sid out number,
o_host out varchar2,
o_time out date,
o_text out varchar2
);
end pipe_demo;
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package body pipe_demo as
c_log_pipe constant varchar2(13) := 'DEMO_LOG_PIPE';
procedure log(i_text in varchar2) is
l_status number;
begin
dbms_pipe.pack_message(user);
dbms_pipe.pack_message(to_number(sys_context('userenv', 'sid')));
dbms_pipe.pack_message(sys_context('userenv', 'host'));
dbms_pipe.pack_message(sysdate);
dbms_pipe.pack_message(i_text);
l_status := dbms_pipe.send_message(c_log_pipe);
if l_status != 0 then
raise_application_error(-20000,
'dbms_pipe.send_message failed with status ' || l_status);
end if;
end log;
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package body pipe_demo as
c_log_pipe constant varchar2(13) := 'DEMO_LOG_PIPE';
procedure log(i_text in varchar2) is
l_status number;
begin
dbms_pipe.pack_message(user);
dbms_pipe.pack_message(to_number(sys_context('userenv', 'sid')));
dbms_pipe.pack_message(sys_context('userenv', 'host'));
dbms_pipe.pack_message(sysdate);
dbms_pipe.pack_message(i_text);
l_status := dbms_pipe.send_message(c_log_pipe);
if l_status != 0 then
raise_application_error(-20000,
'dbms_pipe.send_message failed with status ' || l_status);
end if;
end log;
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package body pipe_demo as
c_log_pipe constant varchar2(13) := 'DEMO_LOG_PIPE';
procedure log(i_text in varchar2) is
l_status number;
begin
dbms_pipe.pack_message(user);
dbms_pipe.pack_message(to_number(sys_context('userenv', 'sid')));
dbms_pipe.pack_message(sys_context('userenv', 'host'));
dbms_pipe.pack_message(sysdate);
dbms_pipe.pack_message(i_text);
l_status := dbms_pipe.send_message(c_log_pipe);
if l_status != 0 then
raise_application_error(-20000,
'dbms_pipe.send_message failed with status ' || l_status);
end if;
end log;
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package body pipe_demo as
c_log_pipe constant varchar2(13) := 'DEMO_LOG_PIPE';
procedure log(i_text in varchar2) is
l_status number;
begin
dbms_pipe.pack_message(user);
dbms_pipe.pack_message(to_number(sys_context('userenv', 'sid')));
dbms_pipe.pack_message(sys_context('userenv', 'host'));
dbms_pipe.pack_message(sysdate);
dbms_pipe.pack_message(i_text);
l_status := dbms_pipe.send_message(c_log_pipe);
if l_status != 0 then
raise_application_error(-20000,
'dbms_pipe.send_message failed with status ' || l_status);
end if;
end log;
pack_message (number)
pack_message (varchar2)
pack_message (date)
pack_message_raw
pack_message_rowid
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package body pipe_demo as
c_log_pipe constant varchar2(13) := 'DEMO_LOG_PIPE';
procedure log(i_text in varchar2) is
l_status number;
begin
dbms_pipe.pack_message(user);
dbms_pipe.pack_message(to_number(sys_context('userenv', 'sid')));
dbms_pipe.pack_message(sys_context('userenv', 'host'));
dbms_pipe.pack_message(sysdate);
dbms_pipe.pack_message(i_text);
l_status := dbms_pipe.send_message(c_log_pipe);
if l_status != 0 then
raise_application_error(-20000,
'dbms_pipe.send_message failed with status ' || l_status);
end if;
end log;
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
procedure get_next
(
o_user out varchar2,
o_sid out number,
o_host out varchar2,
o_time out date,
o_text out varchar2
) is
l_status number;
begin
l_status := dbms_pipe.receive_message(pipename => c_log_pipe);
if l_status != 0 then
raise_application_error(-20000,
'dbms_pipe.receive_message failed with status ' || l_status);
end if;
dbms_pipe.unpack_message(o_user);
dbms_pipe.unpack_message(o_sid);
dbms_pipe.unpack_message(o_host);
dbms_pipe.unpack_message(o_time);
dbms_pipe.unpack_message(o_text);
end get_next;
end pipe_demo;
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
procedure get_next
(
o_user out varchar2,
o_sid out number,
o_host out varchar2,
o_time out date,
o_text out varchar2
) is
l_status number;
begin
l_status := dbms_pipe.receive_message(pipename => c_log_pipe);
if l_status != 0 then
raise_application_error(-20000,
'dbms_pipe.receive_message failed with status ' || l_status);
end if;
dbms_pipe.unpack_message(o_user);
dbms_pipe.unpack_message(o_sid);
dbms_pipe.unpack_message(o_host);
dbms_pipe.unpack_message(o_time);
dbms_pipe.unpack_message(o_text);
end get_next;
end pipe_demo;
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
procedure get_next
(
o_user out varchar2,
o_sid out number,
o_host out varchar2,
o_time out date,
o_text out varchar2
) is
l_status number;
begin
l_status := dbms_pipe.receive_message(pipename => c_log_pipe);
if l_status != 0 then
raise_application_error(-20000,
'dbms_pipe.receive_message failed with status ' || l_status);
end if;
dbms_pipe.unpack_message(o_user);
dbms_pipe.unpack_message(o_sid);
dbms_pipe.unpack_message(o_host);
dbms_pipe.unpack_message(o_time);
dbms_pipe.unpack_message(o_text);
end get_next;
end pipe_demo;
unpack_message (number)
unpack_message (varchar2)
unpack_message (date)
unpack_message_raw
unpack_message_rowid
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
public class Logger {
public static void main(String args[]) throws SQLException {
Properties info = new Properties();
info.put(OracleConnection.CONNECTION_PROPERTY_USER_NAME, DB_USER);
info.put(OracleConnection.CONNECTION_PROPERTY_PASSWORD, DB_PASSWORD);
OracleDataSource ods = new OracleDataSource();
ods.setURL(DB_URL);
ods.setConnectionProperties(info);
try (OracleConnection connection = (OracleConnection) ods.getConnection()) {
DatabaseMetaData dbmd = connection.getMetaData();
System.out.println("Ready...");
System.out.println();
System.out.println("Time Host User SID Message");
System.out.println("--------------- -------------- ----- --- -------");
processRequests(connection);
System.out.println("Bye!");
System.out.println();
}
}
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
public class Logger {
public static void main(String args[]) throws SQLException {
Properties info = new Properties();
info.put(OracleConnection.CONNECTION_PROPERTY_USER_NAME, DB_USER);
info.put(OracleConnection.CONNECTION_PROPERTY_PASSWORD, DB_PASSWORD);
OracleDataSource ods = new OracleDataSource();
ods.setURL(DB_URL);
ods.setConnectionProperties(info);
try (OracleConnection connection = (OracleConnection) ods.getConnection()) {
DatabaseMetaData dbmd = connection.getMetaData();
System.out.println("Ready...");
System.out.println();
System.out.println("Time Host User SID Message");
System.out.println("--------------- -------------- ----- --- -------");
processRequests(connection);
System.out.println("Bye!");
System.out.println();
}
}
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
public class Logger {
public static void main(String args[]) throws SQLException {
Properties info = new Properties();
info.put(OracleConnection.CONNECTION_PROPERTY_USER_NAME, DB_USER);
info.put(OracleConnection.CONNECTION_PROPERTY_PASSWORD, DB_PASSWORD);
OracleDataSource ods = new OracleDataSource();
ods.setURL(DB_URL);
ods.setConnectionProperties(info);
try (OracleConnection connection = (OracleConnection) ods.getConnection()) {
DatabaseMetaData dbmd = connection.getMetaData();
System.out.println("Ready...");
System.out.println();
System.out.println("Time Host User SID Message");
System.out.println("--------------- -------------- ----- --- -------");
processRequests(connection);
System.out.println("Bye!");
System.out.println();
}
}
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
public class Logger {
public static void main(String args[]) throws SQLException {
Properties info = new Properties();
info.put(OracleConnection.CONNECTION_PROPERTY_USER_NAME, DB_USER);
info.put(OracleConnection.CONNECTION_PROPERTY_PASSWORD, DB_PASSWORD);
OracleDataSource ods = new OracleDataSource();
ods.setURL(DB_URL);
ods.setConnectionProperties(info);
try (OracleConnection connection = (OracleConnection) ods.getConnection()) {
DatabaseMetaData dbmd = connection.getMetaData();
System.out.println("Ready...");
System.out.println();
System.out.println("Time Host User SID Message");
System.out.println("--------------- -------------- ----- --- -------");
processRequests(connection);
System.out.println("Bye!");
System.out.println();
}
}
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
public static void processRequests(Connection connection) throws SQLException {
String user;
int sid;
String host;
Timestamp time;
String text = " ";
CallableStatement callableStatement =
connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }");
callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(2, java.sql.Types.INTEGER);
callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(4, java.sql.Types.DATE);
callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR);
do {
callableStatement.executeUpdate();
user = callableStatement.getString(1);
sid = callableStatement.getInt(2);
host = callableStatement.getString(3);
time = callableStatement.getTimestamp(4);
text = callableStatement.getString(5);
System.out.println(time + " " + host + " " + user + " " + String.format("%3s",
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
public static void processRequests(Connection connection) throws SQLException {
String user;
int sid;
String host;
Timestamp time;
String text = " ";
CallableStatement callableStatement =
connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }");
callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(2, java.sql.Types.INTEGER);
callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(4, java.sql.Types.DATE);
callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR);
do {
callableStatement.executeUpdate();
user = callableStatement.getString(1);
sid = callableStatement.getInt(2);
host = callableStatement.getString(3);
time = callableStatement.getTimestamp(4);
text = callableStatement.getString(5);
System.out.println(time + " " + host + " " + user + " " + String.format("%3s",
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
public static void processRequests(Connection connection) throws SQLException {
String user;
int sid;
String host;
Timestamp time;
String text = " ";
CallableStatement callableStatement =
connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }");
callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(2, java.sql.Types.INTEGER);
callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(4, java.sql.Types.DATE);
callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR);
do {
callableStatement.executeUpdate();
user = callableStatement.getString(1);
sid = callableStatement.getInt(2);
host = callableStatement.getString(3);
time = callableStatement.getTimestamp(4);
text = callableStatement.getString(5);
System.out.println(time + " " + host + " " + user + " " + String.format("%3s",
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
CallableStatement callableStatement =
connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }");
callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(2, java.sql.Types.INTEGER);
callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(4, java.sql.Types.DATE);
callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR);
do {
callableStatement.executeUpdate();
user = callableStatement.getString(1);
sid = callableStatement.getInt(2);
host = callableStatement.getString(3);
time = callableStatement.getTimestamp(4);
text = callableStatement.getString(5);
System.out.println(time + " " + host + " " + user + " " + String.format("%3s",
sid) + " " + text);
} while (!text.equals("ABORT"));
callableStatement.close();
}
}
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
CallableStatement callableStatement =
connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }");
callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(2, java.sql.Types.INTEGER);
callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(4, java.sql.Types.DATE);
callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR);
do {
callableStatement.executeUpdate();
user = callableStatement.getString(1);
sid = callableStatement.getInt(2);
host = callableStatement.getString(3);
time = callableStatement.getTimestamp(4);
text = callableStatement.getString(5);
System.out.println(time + " " + host + " " + user + " " + String.format("%3s",
sid) + " " + text);
} while (!text.equals("ABORT"));
callableStatement.close();
}
}
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
CallableStatement callableStatement =
connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }");
callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(2, java.sql.Types.INTEGER);
callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(4, java.sql.Types.DATE);
callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR);
do {
callableStatement.executeUpdate();
user = callableStatement.getString(1);
sid = callableStatement.getInt(2);
host = callableStatement.getString(3);
time = callableStatement.getTimestamp(4);
text = callableStatement.getString(5);
System.out.println(time + " " + host + " " + user + " " + String.format("%3s",
sid) + " " + text);
} while (!text.equals("ABORT"));
callableStatement.close();
}
}
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
CallableStatement callableStatement =
connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }");
callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(2, java.sql.Types.INTEGER);
callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR);
callableStatement.registerOutParameter(4, java.sql.Types.DATE);
callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR);
do {
callableStatement.executeUpdate();
user = callableStatement.getString(1);
sid = callableStatement.getInt(2);
host = callableStatement.getString(3);
time = callableStatement.getTimestamp(4);
text = callableStatement.getString(5);
System.out.println(time + " " + host + " " + user + " " + String.format("%3s",
sid) + " " + text);
} while (!text.equals("ABORT"));
callableStatement.close();
}
}
PIPES
A Single Consumer
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
SGA
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
SGA
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
SGA
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
PIPES
Multiple Consumers
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
SGA
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
DEMO
Multiple Consumers
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package pipe_demo as
procedure log(i_text in varchar2);
procedure get_next
(
o_user out varchar2,
o_sid out number,
o_host out varchar2,
o_time out date,
o_text out varchar2
);
procedure send_many_logs
(
i_text in varchar2,
i_how_many in binary_integer
);
end pipe_demo;
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package body pipe_demo as
...
procedure send_many_logs
(
i_text in varchar2,
i_how_many in binary_integer
) is
c_alert_name constant varchar2(10) := 'DEMO_ALERT';
l_message varchar2(100);
l_status number;
begin
dbms_alert.register(c_alert_name);
dbms_alert.waitone(c_alert_name, l_message, l_status);
for i in 1 .. i_how_many
loop
pipe_demo.log(i_text || '# ' || to_char(i));
end loop;
dbms_alert.remove(c_alert_name);
end send_many_logs;
end pipe_demo;
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package body pipe_demo as
...
procedure send_many_logs
(
i_text in varchar2,
i_how_many in binary_integer
) is
c_alert_name constant varchar2(10) := 'DEMO_ALERT';
l_message varchar2(100);
l_status number;
begin
dbms_alert.register(c_alert_name);
dbms_alert.waitone(c_alert_name, l_message, l_status);
for i in 1 .. i_how_many
loop
pipe_demo.log(i_text || '# ' || to_char(i));
end loop;
dbms_alert.remove(c_alert_name);
end send_many_logs;
end pipe_demo;
ALERTS (SIGNALS)
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
Session
Session
Session
Session
Session
Session
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package body pipe_demo as
...
procedure send_many_logs
(
i_text in varchar2,
i_how_many in binary_integer
) is
c_alert_name constant varchar2(10) := 'DEMO_ALERT';
l_message varchar2(100);
l_status number;
begin
dbms_alert.register(c_alert_name);
dbms_alert.waitone(c_alert_name, l_message, l_status);
for i in 1 .. i_how_many
loop
pipe_demo.log(i_text || '# ' || to_char(i));
end loop;
dbms_alert.remove(c_alert_name);
end send_many_logs;
end pipe_demo;
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package body pipe_demo as
...
procedure send_many_logs
(
i_text in varchar2,
i_how_many in binary_integer
) is
c_alert_name constant varchar2(10) := 'DEMO_ALERT';
l_message varchar2(100);
l_status number;
begin
dbms_alert.register(c_alert_name);
dbms_alert.waitone(c_alert_name, l_message, l_status);
for i in 1 .. i_how_many
loop
pipe_demo.log(i_text || '# ' || to_char(i));
end loop;
dbms_alert.remove(c_alert_name);
end send_many_logs;
end pipe_demo;
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package body pipe_demo as
...
procedure send_many_logs
(
i_text in varchar2,
i_how_many in binary_integer
) is
c_alert_name constant varchar2(10) := 'DEMO_ALERT';
l_message varchar2(100);
l_status number;
begin
dbms_alert.register(c_alert_name);
dbms_alert.waitone(c_alert_name, l_message, l_status);
for i in 1 .. i_how_many
loop
pipe_demo.log(i_text || '# ' || to_char(i));
end loop;
dbms_alert.remove(c_alert_name);
end send_many_logs;
end pipe_demo;
There is also dbms_alert.waitany
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
create or replace package body pipe_demo as
...
procedure send_many_logs
(
i_text in varchar2,
i_how_many in binary_integer
) is
c_alert_name constant varchar2(10) := 'DEMO_ALERT';
l_message varchar2(100);
l_status number;
begin
dbms_alert.register(c_alert_name);
dbms_alert.waitone(c_alert_name, l_message, l_status);
for i in 1 .. i_how_many
loop
pipe_demo.log(i_text || '# ' || to_char(i));
end loop;
dbms_alert.remove(c_alert_name);
end send_many_logs;
end pipe_demo; There is also dbms_alert.removeall
PIPES
Request and Response
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
SGA
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
SGA
Session
Inbox Outbox
Session
Inbox Outbox
Session
Inbox Outbox
dbms_pipe.unique_session_name
This presentation is available in http://db-oriented.com/presentations
©
Oren
Nakdimon
©
Oren
Nakdimon
DBMS_PIPE DBMS_ALERT
Type Named Pipes / Queue Signals / Broadcast
Implementation SGA structure Table
Transactional? Non-Transactional Transactional
Consumers of a specific
message
Single Consumer Zero-to-Multiple Consumers
Blocked Publisher? When pipe is full (“pipe put”
wait event)
When other session signaled
to the same alert and hasn’t
committed yet (TX lock), but
only if there are registered
consumers
Possible Loss of Messages? Instance crash/shutdown Multiple signals to the same
alert before read by the
consumer
THANK YOU
Oren Nakdimon
www.db-oriented.com
 oren@db-oriented.com
 +972-54-4393763
@DBoriented

Mais conteúdo relacionado

Mais procurados

New PLSQL in Oracle Database 12c
New PLSQL in Oracle Database 12cNew PLSQL in Oracle Database 12c
New PLSQL in Oracle Database 12c
Connor McDonald
 
DBMS_SQL
DBMS_SQLDBMS_SQL
MODELS'16 - RESTalk
MODELS'16 - RESTalkMODELS'16 - RESTalk
MODELS'16 - RESTalk
Ana Ivanchikj
 
Firebird 3 Windows Functions
Firebird 3 Windows  FunctionsFirebird 3 Windows  Functions
Firebird 3 Windows Functions
Mind The Firebird
 
JAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) BridgeJAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) Bridge
José Paumard
 
PL/SQL Fundamentals I
PL/SQL Fundamentals IPL/SQL Fundamentals I
PL/SQL Fundamentals I
Nick Buytaert
 
Oracle PLSQL Step By Step Guide
Oracle PLSQL Step By Step GuideOracle PLSQL Step By Step Guide
Oracle PLSQL Step By Step Guide
Srinimf-Slides
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
José Paumard
 
06 Using More Package Concepts
06 Using More Package Concepts06 Using More Package Concepts
06 Using More Package Concepts
rehaniltifat
 
DAC training-batch -2020(PLSQL)
DAC training-batch -2020(PLSQL)DAC training-batch -2020(PLSQL)
DAC training-batch -2020(PLSQL)
RajKumarSingh213
 
ORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERSORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERS
mohdoracle
 
Managing Unstructured Data: Lobs in the World of JSON
Managing Unstructured Data: Lobs in the World of JSONManaging Unstructured Data: Lobs in the World of JSON
Managing Unstructured Data: Lobs in the World of JSON
Michael Rosenblum
 
PL/SQL
PL/SQLPL/SQL
PL/SQL
Vaibhav0
 

Mais procurados (13)

New PLSQL in Oracle Database 12c
New PLSQL in Oracle Database 12cNew PLSQL in Oracle Database 12c
New PLSQL in Oracle Database 12c
 
DBMS_SQL
DBMS_SQLDBMS_SQL
DBMS_SQL
 
MODELS'16 - RESTalk
MODELS'16 - RESTalkMODELS'16 - RESTalk
MODELS'16 - RESTalk
 
Firebird 3 Windows Functions
Firebird 3 Windows  FunctionsFirebird 3 Windows  Functions
Firebird 3 Windows Functions
 
JAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) BridgeJAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) Bridge
 
PL/SQL Fundamentals I
PL/SQL Fundamentals IPL/SQL Fundamentals I
PL/SQL Fundamentals I
 
Oracle PLSQL Step By Step Guide
Oracle PLSQL Step By Step GuideOracle PLSQL Step By Step Guide
Oracle PLSQL Step By Step Guide
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
 
06 Using More Package Concepts
06 Using More Package Concepts06 Using More Package Concepts
06 Using More Package Concepts
 
DAC training-batch -2020(PLSQL)
DAC training-batch -2020(PLSQL)DAC training-batch -2020(PLSQL)
DAC training-batch -2020(PLSQL)
 
ORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERSORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERS
 
Managing Unstructured Data: Lobs in the World of JSON
Managing Unstructured Data: Lobs in the World of JSONManaging Unstructured Data: Lobs in the World of JSON
Managing Unstructured Data: Lobs in the World of JSON
 
PL/SQL
PL/SQLPL/SQL
PL/SQL
 

Semelhante a Oracle Inter-Session Communication

Plsql
PlsqlPlsql
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
AOE
 
Penetration Testing for Easy RM to MP3 Converter Application and Post Exploit
Penetration Testing for Easy RM to MP3 Converter Application and Post ExploitPenetration Testing for Easy RM to MP3 Converter Application and Post Exploit
Penetration Testing for Easy RM to MP3 Converter Application and Post Exploit
JongWon Kim
 
Write Less (Code) With More (Features) [UKOUG 22]
Write Less (Code) With More (Features) [UKOUG 22]Write Less (Code) With More (Features) [UKOUG 22]
Write Less (Code) With More (Features) [UKOUG 22]
Oren Nakdimon
 
Real-Time Query for Data Guard
Real-Time Query for Data Guard Real-Time Query for Data Guard
Real-Time Query for Data Guard
Uwe Hesse
 
Distributed Applications with Perl & Gearman
Distributed Applications with Perl & GearmanDistributed Applications with Perl & Gearman
Distributed Applications with Perl & Gearman
Issac Goldstand
 
Study2study#4 nginx conf_1_24
Study2study#4 nginx conf_1_24Study2study#4 nginx conf_1_24
Study2study#4 nginx conf_1_24
Naoya Nakazawa
 
linux-namespaces.pdf
linux-namespaces.pdflinux-namespaces.pdf
linux-namespaces.pdf
Ignat Korchagin
 
Kicking off with Zend Expressive and Doctrine ORM (ZendCon 2016)
Kicking off with Zend Expressive and Doctrine ORM (ZendCon 2016)Kicking off with Zend Expressive and Doctrine ORM (ZendCon 2016)
Kicking off with Zend Expressive and Doctrine ORM (ZendCon 2016)
James Titcumb
 
SQL- Introduction to PL/SQL
SQL- Introduction to  PL/SQLSQL- Introduction to  PL/SQL
SQL- Introduction to PL/SQL
Vibrant Technologies & Computers
 
Dolibarr - information for developers and partners - devcamp Pau 2019
Dolibarr - information for developers and partners - devcamp Pau 2019Dolibarr - information for developers and partners - devcamp Pau 2019
Dolibarr - information for developers and partners - devcamp Pau 2019
Laurent Destailleur
 
Container orchestration from theory to practice
Container orchestration from theory to practiceContainer orchestration from theory to practice
Container orchestration from theory to practice
Docker, Inc.
 
OpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con PythonOpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con Python
PyCon Italia
 
Capistrano2
Capistrano2Capistrano2
Capistrano2
Luca Mearelli
 
Fpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directivesFpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directives
Malik Tauqir Hasan
 
Hello, Is That FreeSWITCH? Then We're Coming to Check You!
Hello, Is That FreeSWITCH? Then We're Coming to Check You!Hello, Is That FreeSWITCH? Then We're Coming to Check You!
Hello, Is That FreeSWITCH? Then We're Coming to Check You!
PVS-Studio
 
PhpBB meets Symfony2
PhpBB meets Symfony2PhpBB meets Symfony2
PhpBB meets Symfony2
Fabien Potencier
 
Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)
brian d foy
 
Set Up & Operate Tungsten Replicator
Set Up & Operate Tungsten ReplicatorSet Up & Operate Tungsten Replicator
Set Up & Operate Tungsten Replicator
Continuent
 
Container Orchestration from Theory to Practice
Container Orchestration from Theory to PracticeContainer Orchestration from Theory to Practice
Container Orchestration from Theory to Practice
Docker, Inc.
 

Semelhante a Oracle Inter-Session Communication (20)

Plsql
PlsqlPlsql
Plsql
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
 
Penetration Testing for Easy RM to MP3 Converter Application and Post Exploit
Penetration Testing for Easy RM to MP3 Converter Application and Post ExploitPenetration Testing for Easy RM to MP3 Converter Application and Post Exploit
Penetration Testing for Easy RM to MP3 Converter Application and Post Exploit
 
Write Less (Code) With More (Features) [UKOUG 22]
Write Less (Code) With More (Features) [UKOUG 22]Write Less (Code) With More (Features) [UKOUG 22]
Write Less (Code) With More (Features) [UKOUG 22]
 
Real-Time Query for Data Guard
Real-Time Query for Data Guard Real-Time Query for Data Guard
Real-Time Query for Data Guard
 
Distributed Applications with Perl & Gearman
Distributed Applications with Perl & GearmanDistributed Applications with Perl & Gearman
Distributed Applications with Perl & Gearman
 
Study2study#4 nginx conf_1_24
Study2study#4 nginx conf_1_24Study2study#4 nginx conf_1_24
Study2study#4 nginx conf_1_24
 
linux-namespaces.pdf
linux-namespaces.pdflinux-namespaces.pdf
linux-namespaces.pdf
 
Kicking off with Zend Expressive and Doctrine ORM (ZendCon 2016)
Kicking off with Zend Expressive and Doctrine ORM (ZendCon 2016)Kicking off with Zend Expressive and Doctrine ORM (ZendCon 2016)
Kicking off with Zend Expressive and Doctrine ORM (ZendCon 2016)
 
SQL- Introduction to PL/SQL
SQL- Introduction to  PL/SQLSQL- Introduction to  PL/SQL
SQL- Introduction to PL/SQL
 
Dolibarr - information for developers and partners - devcamp Pau 2019
Dolibarr - information for developers and partners - devcamp Pau 2019Dolibarr - information for developers and partners - devcamp Pau 2019
Dolibarr - information for developers and partners - devcamp Pau 2019
 
Container orchestration from theory to practice
Container orchestration from theory to practiceContainer orchestration from theory to practice
Container orchestration from theory to practice
 
OpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con PythonOpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con Python
 
Capistrano2
Capistrano2Capistrano2
Capistrano2
 
Fpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directivesFpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directives
 
Hello, Is That FreeSWITCH? Then We're Coming to Check You!
Hello, Is That FreeSWITCH? Then We're Coming to Check You!Hello, Is That FreeSWITCH? Then We're Coming to Check You!
Hello, Is That FreeSWITCH? Then We're Coming to Check You!
 
PhpBB meets Symfony2
PhpBB meets Symfony2PhpBB meets Symfony2
PhpBB meets Symfony2
 
Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)
 
Set Up & Operate Tungsten Replicator
Set Up & Operate Tungsten ReplicatorSet Up & Operate Tungsten Replicator
Set Up & Operate Tungsten Replicator
 
Container Orchestration from Theory to Practice
Container Orchestration from Theory to PracticeContainer Orchestration from Theory to Practice
Container Orchestration from Theory to Practice
 

Último

Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
Ayan Halder
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 

Último (20)

Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 

Oracle Inter-Session Communication

  • 1. Oracle Inter-Session Communication Oren Nakdimon www.db-oriented.com  oren@db-oriented.com  +972-54-4393763 @DBoriented
  • 2. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon http://db-oriented.com Who Am I?
  • 4. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon Session Session Session
  • 5. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon Session Session Session
  • 6. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon Session SGA Session Session
  • 7. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon Session SGA Session Session
  • 8. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon Session Outbox SGA Inbox Session Session Outbox Inbox Outbox Inbox
  • 9. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon Session Outbox SGA Inbox Session Session Outbox Inbox Outbox Inbox
  • 10. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon Session Outbox SGA Inbox Session Session Outbox Inbox Outbox Inbox
  • 11. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon Session Outbox SGA Session Outbox Inbox Session Inbox Outbox Inbox Outbox
  • 12. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon Session Outbox SGA Session Outbox Inbox Session Inbox Outbox Inbox Outbox Inbox
  • 13. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon Session Session Outbox SGA Session Outbox Inbox Inbox Outbox Outbox Outbox Inbox
  • 14. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon Session Session Outbox SGA Session Outbox Inbox Inbox Outbox Outbox Outbox Inbox
  • 15. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon Session Session Outbox SGA Session Outbox Inbox Inbox Outbox Outbox Outbox Inbox
  • 17. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package pipe_demo as procedure log(i_text in varchar2); procedure get_next ( o_user out varchar2, o_sid out number, o_host out varchar2, o_time out date, o_text out varchar2 ); end pipe_demo;
  • 18. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package pipe_demo as procedure log(i_text in varchar2); procedure get_next ( o_user out varchar2, o_sid out number, o_host out varchar2, o_time out date, o_text out varchar2 ); end pipe_demo;
  • 19. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package pipe_demo as procedure log(i_text in varchar2); procedure get_next ( o_user out varchar2, o_sid out number, o_host out varchar2, o_time out date, o_text out varchar2 ); end pipe_demo;
  • 20. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package body pipe_demo as c_log_pipe constant varchar2(13) := 'DEMO_LOG_PIPE'; procedure log(i_text in varchar2) is l_status number; begin dbms_pipe.pack_message(user); dbms_pipe.pack_message(to_number(sys_context('userenv', 'sid'))); dbms_pipe.pack_message(sys_context('userenv', 'host')); dbms_pipe.pack_message(sysdate); dbms_pipe.pack_message(i_text); l_status := dbms_pipe.send_message(c_log_pipe); if l_status != 0 then raise_application_error(-20000, 'dbms_pipe.send_message failed with status ' || l_status); end if; end log;
  • 21. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package body pipe_demo as c_log_pipe constant varchar2(13) := 'DEMO_LOG_PIPE'; procedure log(i_text in varchar2) is l_status number; begin dbms_pipe.pack_message(user); dbms_pipe.pack_message(to_number(sys_context('userenv', 'sid'))); dbms_pipe.pack_message(sys_context('userenv', 'host')); dbms_pipe.pack_message(sysdate); dbms_pipe.pack_message(i_text); l_status := dbms_pipe.send_message(c_log_pipe); if l_status != 0 then raise_application_error(-20000, 'dbms_pipe.send_message failed with status ' || l_status); end if; end log;
  • 22. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package body pipe_demo as c_log_pipe constant varchar2(13) := 'DEMO_LOG_PIPE'; procedure log(i_text in varchar2) is l_status number; begin dbms_pipe.pack_message(user); dbms_pipe.pack_message(to_number(sys_context('userenv', 'sid'))); dbms_pipe.pack_message(sys_context('userenv', 'host')); dbms_pipe.pack_message(sysdate); dbms_pipe.pack_message(i_text); l_status := dbms_pipe.send_message(c_log_pipe); if l_status != 0 then raise_application_error(-20000, 'dbms_pipe.send_message failed with status ' || l_status); end if; end log;
  • 23. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package body pipe_demo as c_log_pipe constant varchar2(13) := 'DEMO_LOG_PIPE'; procedure log(i_text in varchar2) is l_status number; begin dbms_pipe.pack_message(user); dbms_pipe.pack_message(to_number(sys_context('userenv', 'sid'))); dbms_pipe.pack_message(sys_context('userenv', 'host')); dbms_pipe.pack_message(sysdate); dbms_pipe.pack_message(i_text); l_status := dbms_pipe.send_message(c_log_pipe); if l_status != 0 then raise_application_error(-20000, 'dbms_pipe.send_message failed with status ' || l_status); end if; end log; pack_message (number) pack_message (varchar2) pack_message (date) pack_message_raw pack_message_rowid
  • 24. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package body pipe_demo as c_log_pipe constant varchar2(13) := 'DEMO_LOG_PIPE'; procedure log(i_text in varchar2) is l_status number; begin dbms_pipe.pack_message(user); dbms_pipe.pack_message(to_number(sys_context('userenv', 'sid'))); dbms_pipe.pack_message(sys_context('userenv', 'host')); dbms_pipe.pack_message(sysdate); dbms_pipe.pack_message(i_text); l_status := dbms_pipe.send_message(c_log_pipe); if l_status != 0 then raise_application_error(-20000, 'dbms_pipe.send_message failed with status ' || l_status); end if; end log;
  • 25. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon procedure get_next ( o_user out varchar2, o_sid out number, o_host out varchar2, o_time out date, o_text out varchar2 ) is l_status number; begin l_status := dbms_pipe.receive_message(pipename => c_log_pipe); if l_status != 0 then raise_application_error(-20000, 'dbms_pipe.receive_message failed with status ' || l_status); end if; dbms_pipe.unpack_message(o_user); dbms_pipe.unpack_message(o_sid); dbms_pipe.unpack_message(o_host); dbms_pipe.unpack_message(o_time); dbms_pipe.unpack_message(o_text); end get_next; end pipe_demo;
  • 26. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon procedure get_next ( o_user out varchar2, o_sid out number, o_host out varchar2, o_time out date, o_text out varchar2 ) is l_status number; begin l_status := dbms_pipe.receive_message(pipename => c_log_pipe); if l_status != 0 then raise_application_error(-20000, 'dbms_pipe.receive_message failed with status ' || l_status); end if; dbms_pipe.unpack_message(o_user); dbms_pipe.unpack_message(o_sid); dbms_pipe.unpack_message(o_host); dbms_pipe.unpack_message(o_time); dbms_pipe.unpack_message(o_text); end get_next; end pipe_demo;
  • 27. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon procedure get_next ( o_user out varchar2, o_sid out number, o_host out varchar2, o_time out date, o_text out varchar2 ) is l_status number; begin l_status := dbms_pipe.receive_message(pipename => c_log_pipe); if l_status != 0 then raise_application_error(-20000, 'dbms_pipe.receive_message failed with status ' || l_status); end if; dbms_pipe.unpack_message(o_user); dbms_pipe.unpack_message(o_sid); dbms_pipe.unpack_message(o_host); dbms_pipe.unpack_message(o_time); dbms_pipe.unpack_message(o_text); end get_next; end pipe_demo; unpack_message (number) unpack_message (varchar2) unpack_message (date) unpack_message_raw unpack_message_rowid
  • 28. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon public class Logger { public static void main(String args[]) throws SQLException { Properties info = new Properties(); info.put(OracleConnection.CONNECTION_PROPERTY_USER_NAME, DB_USER); info.put(OracleConnection.CONNECTION_PROPERTY_PASSWORD, DB_PASSWORD); OracleDataSource ods = new OracleDataSource(); ods.setURL(DB_URL); ods.setConnectionProperties(info); try (OracleConnection connection = (OracleConnection) ods.getConnection()) { DatabaseMetaData dbmd = connection.getMetaData(); System.out.println("Ready..."); System.out.println(); System.out.println("Time Host User SID Message"); System.out.println("--------------- -------------- ----- --- -------"); processRequests(connection); System.out.println("Bye!"); System.out.println(); } }
  • 29. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon public class Logger { public static void main(String args[]) throws SQLException { Properties info = new Properties(); info.put(OracleConnection.CONNECTION_PROPERTY_USER_NAME, DB_USER); info.put(OracleConnection.CONNECTION_PROPERTY_PASSWORD, DB_PASSWORD); OracleDataSource ods = new OracleDataSource(); ods.setURL(DB_URL); ods.setConnectionProperties(info); try (OracleConnection connection = (OracleConnection) ods.getConnection()) { DatabaseMetaData dbmd = connection.getMetaData(); System.out.println("Ready..."); System.out.println(); System.out.println("Time Host User SID Message"); System.out.println("--------------- -------------- ----- --- -------"); processRequests(connection); System.out.println("Bye!"); System.out.println(); } }
  • 30. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon public class Logger { public static void main(String args[]) throws SQLException { Properties info = new Properties(); info.put(OracleConnection.CONNECTION_PROPERTY_USER_NAME, DB_USER); info.put(OracleConnection.CONNECTION_PROPERTY_PASSWORD, DB_PASSWORD); OracleDataSource ods = new OracleDataSource(); ods.setURL(DB_URL); ods.setConnectionProperties(info); try (OracleConnection connection = (OracleConnection) ods.getConnection()) { DatabaseMetaData dbmd = connection.getMetaData(); System.out.println("Ready..."); System.out.println(); System.out.println("Time Host User SID Message"); System.out.println("--------------- -------------- ----- --- -------"); processRequests(connection); System.out.println("Bye!"); System.out.println(); } }
  • 31. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon public class Logger { public static void main(String args[]) throws SQLException { Properties info = new Properties(); info.put(OracleConnection.CONNECTION_PROPERTY_USER_NAME, DB_USER); info.put(OracleConnection.CONNECTION_PROPERTY_PASSWORD, DB_PASSWORD); OracleDataSource ods = new OracleDataSource(); ods.setURL(DB_URL); ods.setConnectionProperties(info); try (OracleConnection connection = (OracleConnection) ods.getConnection()) { DatabaseMetaData dbmd = connection.getMetaData(); System.out.println("Ready..."); System.out.println(); System.out.println("Time Host User SID Message"); System.out.println("--------------- -------------- ----- --- -------"); processRequests(connection); System.out.println("Bye!"); System.out.println(); } }
  • 32. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon public static void processRequests(Connection connection) throws SQLException { String user; int sid; String host; Timestamp time; String text = " "; CallableStatement callableStatement = connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }"); callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(2, java.sql.Types.INTEGER); callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(4, java.sql.Types.DATE); callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR); do { callableStatement.executeUpdate(); user = callableStatement.getString(1); sid = callableStatement.getInt(2); host = callableStatement.getString(3); time = callableStatement.getTimestamp(4); text = callableStatement.getString(5); System.out.println(time + " " + host + " " + user + " " + String.format("%3s",
  • 33. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon public static void processRequests(Connection connection) throws SQLException { String user; int sid; String host; Timestamp time; String text = " "; CallableStatement callableStatement = connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }"); callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(2, java.sql.Types.INTEGER); callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(4, java.sql.Types.DATE); callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR); do { callableStatement.executeUpdate(); user = callableStatement.getString(1); sid = callableStatement.getInt(2); host = callableStatement.getString(3); time = callableStatement.getTimestamp(4); text = callableStatement.getString(5); System.out.println(time + " " + host + " " + user + " " + String.format("%3s",
  • 34. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon public static void processRequests(Connection connection) throws SQLException { String user; int sid; String host; Timestamp time; String text = " "; CallableStatement callableStatement = connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }"); callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(2, java.sql.Types.INTEGER); callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(4, java.sql.Types.DATE); callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR); do { callableStatement.executeUpdate(); user = callableStatement.getString(1); sid = callableStatement.getInt(2); host = callableStatement.getString(3); time = callableStatement.getTimestamp(4); text = callableStatement.getString(5); System.out.println(time + " " + host + " " + user + " " + String.format("%3s",
  • 35. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon CallableStatement callableStatement = connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }"); callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(2, java.sql.Types.INTEGER); callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(4, java.sql.Types.DATE); callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR); do { callableStatement.executeUpdate(); user = callableStatement.getString(1); sid = callableStatement.getInt(2); host = callableStatement.getString(3); time = callableStatement.getTimestamp(4); text = callableStatement.getString(5); System.out.println(time + " " + host + " " + user + " " + String.format("%3s", sid) + " " + text); } while (!text.equals("ABORT")); callableStatement.close(); } }
  • 36. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon CallableStatement callableStatement = connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }"); callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(2, java.sql.Types.INTEGER); callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(4, java.sql.Types.DATE); callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR); do { callableStatement.executeUpdate(); user = callableStatement.getString(1); sid = callableStatement.getInt(2); host = callableStatement.getString(3); time = callableStatement.getTimestamp(4); text = callableStatement.getString(5); System.out.println(time + " " + host + " " + user + " " + String.format("%3s", sid) + " " + text); } while (!text.equals("ABORT")); callableStatement.close(); } }
  • 37. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon CallableStatement callableStatement = connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }"); callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(2, java.sql.Types.INTEGER); callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(4, java.sql.Types.DATE); callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR); do { callableStatement.executeUpdate(); user = callableStatement.getString(1); sid = callableStatement.getInt(2); host = callableStatement.getString(3); time = callableStatement.getTimestamp(4); text = callableStatement.getString(5); System.out.println(time + " " + host + " " + user + " " + String.format("%3s", sid) + " " + text); } while (!text.equals("ABORT")); callableStatement.close(); } }
  • 38. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon CallableStatement callableStatement = connection.prepareCall("{ call PIPE_DEMO.GET_NEXT(?,?,?,?,?) }"); callableStatement.registerOutParameter(1, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(2, java.sql.Types.INTEGER); callableStatement.registerOutParameter(3, java.sql.Types.VARCHAR); callableStatement.registerOutParameter(4, java.sql.Types.DATE); callableStatement.registerOutParameter(5, java.sql.Types.VARCHAR); do { callableStatement.executeUpdate(); user = callableStatement.getString(1); sid = callableStatement.getInt(2); host = callableStatement.getString(3); time = callableStatement.getTimestamp(4); text = callableStatement.getString(5); System.out.println(time + " " + host + " " + user + " " + String.format("%3s", sid) + " " + text); } while (!text.equals("ABORT")); callableStatement.close(); } }
  • 40. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon SGA Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox
  • 41. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon SGA Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox
  • 42. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon SGA Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox
  • 44. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon SGA Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox
  • 46. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon
  • 47. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package pipe_demo as procedure log(i_text in varchar2); procedure get_next ( o_user out varchar2, o_sid out number, o_host out varchar2, o_time out date, o_text out varchar2 ); procedure send_many_logs ( i_text in varchar2, i_how_many in binary_integer ); end pipe_demo;
  • 48. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package body pipe_demo as ... procedure send_many_logs ( i_text in varchar2, i_how_many in binary_integer ) is c_alert_name constant varchar2(10) := 'DEMO_ALERT'; l_message varchar2(100); l_status number; begin dbms_alert.register(c_alert_name); dbms_alert.waitone(c_alert_name, l_message, l_status); for i in 1 .. i_how_many loop pipe_demo.log(i_text || '# ' || to_char(i)); end loop; dbms_alert.remove(c_alert_name); end send_many_logs; end pipe_demo;
  • 49. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package body pipe_demo as ... procedure send_many_logs ( i_text in varchar2, i_how_many in binary_integer ) is c_alert_name constant varchar2(10) := 'DEMO_ALERT'; l_message varchar2(100); l_status number; begin dbms_alert.register(c_alert_name); dbms_alert.waitone(c_alert_name, l_message, l_status); for i in 1 .. i_how_many loop pipe_demo.log(i_text || '# ' || to_char(i)); end loop; dbms_alert.remove(c_alert_name); end send_many_logs; end pipe_demo;
  • 51. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon Session Session Session Session Session Session
  • 52. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package body pipe_demo as ... procedure send_many_logs ( i_text in varchar2, i_how_many in binary_integer ) is c_alert_name constant varchar2(10) := 'DEMO_ALERT'; l_message varchar2(100); l_status number; begin dbms_alert.register(c_alert_name); dbms_alert.waitone(c_alert_name, l_message, l_status); for i in 1 .. i_how_many loop pipe_demo.log(i_text || '# ' || to_char(i)); end loop; dbms_alert.remove(c_alert_name); end send_many_logs; end pipe_demo;
  • 53. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package body pipe_demo as ... procedure send_many_logs ( i_text in varchar2, i_how_many in binary_integer ) is c_alert_name constant varchar2(10) := 'DEMO_ALERT'; l_message varchar2(100); l_status number; begin dbms_alert.register(c_alert_name); dbms_alert.waitone(c_alert_name, l_message, l_status); for i in 1 .. i_how_many loop pipe_demo.log(i_text || '# ' || to_char(i)); end loop; dbms_alert.remove(c_alert_name); end send_many_logs; end pipe_demo;
  • 54. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package body pipe_demo as ... procedure send_many_logs ( i_text in varchar2, i_how_many in binary_integer ) is c_alert_name constant varchar2(10) := 'DEMO_ALERT'; l_message varchar2(100); l_status number; begin dbms_alert.register(c_alert_name); dbms_alert.waitone(c_alert_name, l_message, l_status); for i in 1 .. i_how_many loop pipe_demo.log(i_text || '# ' || to_char(i)); end loop; dbms_alert.remove(c_alert_name); end send_many_logs; end pipe_demo; There is also dbms_alert.waitany
  • 55. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon create or replace package body pipe_demo as ... procedure send_many_logs ( i_text in varchar2, i_how_many in binary_integer ) is c_alert_name constant varchar2(10) := 'DEMO_ALERT'; l_message varchar2(100); l_status number; begin dbms_alert.register(c_alert_name); dbms_alert.waitone(c_alert_name, l_message, l_status); for i in 1 .. i_how_many loop pipe_demo.log(i_text || '# ' || to_char(i)); end loop; dbms_alert.remove(c_alert_name); end send_many_logs; end pipe_demo; There is also dbms_alert.removeall
  • 57. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon SGA Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox
  • 58. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon SGA Session Inbox Outbox Session Inbox Outbox Session Inbox Outbox dbms_pipe.unique_session_name
  • 59. This presentation is available in http://db-oriented.com/presentations © Oren Nakdimon © Oren Nakdimon DBMS_PIPE DBMS_ALERT Type Named Pipes / Queue Signals / Broadcast Implementation SGA structure Table Transactional? Non-Transactional Transactional Consumers of a specific message Single Consumer Zero-to-Multiple Consumers Blocked Publisher? When pipe is full (“pipe put” wait event) When other session signaled to the same alert and hasn’t committed yet (TX lock), but only if there are registered consumers Possible Loss of Messages? Instance crash/shutdown Multiple signals to the same alert before read by the consumer
  • 60. THANK YOU Oren Nakdimon www.db-oriented.com  oren@db-oriented.com  +972-54-4393763 @DBoriented