{"id":196828,"date":"2013-10-09T15:19:03","date_gmt":"2013-10-09T11:19:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=196828"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=196828","title":{"rendered":"<span class=\"post_title\">\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 Oracle<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0412 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 <a href=\"http:\/\/habrahabr.ru\/post\/196308\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u043e\u0441\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 SNMP \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0442\u044c 9000 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 (\u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u043e\u0432). \u0412\u043e\u043f\u0440\u043e\u0441 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c.<\/p>\n<p>  \u041e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c <a href=\"http:\/\/en.wikipedia.org\/wiki\/Relational_database_management_system\">RDBMS<\/a> (\u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <a href=\"http:\/\/www.oracle.com\/us\/products\/database\/overview\/index.html\">Oracle Database<\/a>). \u041d\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043b\u0438 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u0442\u0430\u043a\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439? \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0414\u0435\u043d\u044c \u0436\u0435\u0441\u0442\u044f\u043d\u0449\u0438\u043a\u0430<\/h4>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u043e\u0448\u0438\u0431\u043e\u043a, \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c\u0438, \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0449\u0438\u043c\u0438\u0441\u044f \u0441 Oracle. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u043e\u0437\u0436\u0435. \u041f\u043e\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443:<\/p>\n<pre><code class=\"sql\">create sequence test_data_seq;  create table test_data (   id             number                              not null,   device_id      number                              not null,   parameter_id   number                              not null,   value          varchar2(100),   event_date     date             default sysdate    not null );  create unique index test_data_pk on test_data(id);  alter table test_data add   constraint pk_test_data primary key(id); <\/code><\/pre>\n<p>  \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e ID \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u043e\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u043e\u0432\u0435\u0442\u0443\u044e\u0442 \u043c\u043d\u043e\u0433\u0438\u0435 <a href=\"http:\/\/stackoverflow.com\/questions\/11296361\/how-to-create-id-with-auto-increment-on-oracle\">online-\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/a>:<\/p>\n<pre><code class=\"sql\">create or replace trigger test_data_bri before insert on test_data for each row begin   select test_data_seq.nextval into :new.id from dual; end; \/ <\/code><\/pre>\n<p>  \u0418 \u043d\u0430\u0447\u043d\u0435\u043c \u043a\u043e\u0434\u0438\u0442\u044c:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0438\u043a\u043e\u0433\u0434\u0430 \u0442\u0430\u043a \u043d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435!<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.amfitel.m2000.ae.tests.jdbc;  import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException;  public class Test { \t \tprivate final static String CLASS_NAME = &quot;oracle.jdbc.driver.OracleDriver&quot;; \tprivate final static String USER_CONN  = &quot;jdbc:oracle:thin:@192.168.124.35:1521:dev101&quot;; \tprivate final static String USER_NAME  = &quot;ais&quot;; \tprivate final static String USER_PASS  = &quot;ais&quot;;  \tprivate Connection c = null;  \tprivate void test() throws SQLException { \t\tStringBuffer sb = new StringBuffer(); \t\tLong timestamp = System.currentTimeMillis();  \t\tfor (int i = 0; i &lt; 1000; i++) { \t\t\tsb.setLength(0); \t\t\tsb.append(&quot;insert into test_data(device_id, parameter_id, value) values (&quot;); \t\t\tsb.append(i); \t\t\tsb.append(&quot;,1,'0')&quot;); \t\t\tCallableStatement st = c.prepareCall(sb.toString()); \t\t\ttry { \t\t\t\tst.execute(); \t\t\t} finally { \t\t\t\tst.close(); \t\t\t} \t\t} \t\tSystem.out.println(1000000L \/ (System.currentTimeMillis() - timestamp)); \t}  \tprivate void start() throws ClassNotFoundException, SQLException { \t\tClass.forName(CLASS_NAME); \t\tc = DriverManager.getConnection(USER_CONN, USER_NAME, USER_PASS); \t}  \tprivate void stop() throws SQLException  { \t\tif (c != null) { \t\t\tc.close(); \t\t} \t}  \tpublic static void main(String[] args) { \t\tTest t = new Test(); \t\ttry { \t\t\ttry { \t\t\t\tt.start(); \t\t\t\tt.test(); \t\t\t} finally { \t\t\t\tt.stop(); \t\t\t} \t\t} catch (Exception e) { \t\t\tSystem.out.println(e.toString()); \t\t} \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0441\u0442\u0430\u0432\u043e\u043a, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443:<\/p>\n<pre><code>614 <\/code><\/pre>\n<p>  \u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e. \u041d\u043e \u044f\u0432\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 9000. \u0427\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435 \u0442\u0430\u043a?<\/p>\n<p>  \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e\u0435 (\u043f\u0443\u043d\u043a\u0442\u044b \u0434\u0430\u043d\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u043b\u0438\u044f\u043d\u0438\u044f \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c):<\/p>\n<ol>\n<li>\u041c\u044b \u043f\u0440\u043e\u0432\u043e\u0446\u0438\u0440\u0443\u0435\u043c <a href=\"http:\/\/my-oracle.it-blogs.com.ua\/post-306.aspx\">hard pase<\/a>, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043d\u043e\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u0443 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f <a href=\"http:\/\/habrahabr.ru\/post\/148151\/\">sql injection<\/a> \u0438\u043b\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u043e\u0433\u043e \u043a\u044d\u0448\u0430, \u043d\u043e \u043d\u0430\u043c \u0445\u0432\u0430\u0442\u0438\u0442 \u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0442\u0430\u043a \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c)<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0441\u0435\u0441\u0441\u0438\u044e, JDBC \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 <a href=\"http:\/\/pic.dhe.ibm.com\/infocenter\/iseries\/v7r1m0\/index.jsp?topic=%2Frzaha%2Ftransaut.htm\">auto commit<\/a> (\u043d\u0438\u0436\u0435 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a \u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438)<\/li>\n<li>\u0412\u044b\u0437\u043e\u0432 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a <a href=\"http:\/\/asktom.oracle.com\/pls\/apex\/f?p=100:11:0::::P11_QUESTION_ID:60122715103602\">\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432<\/a> SQL \u0438 PL\/SQL (\u044d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u043d\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043c\u0430\u0441\u0441\u043e\u0432\u044b\u0445 \u0432\u0441\u0442\u0430\u0432\u043e\u043a)<\/li>\n<li>\u041f\u0440\u0438 \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0435, sequence \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b <a href=\"http:\/\/docs.oracle.com\/cd\/B12037_01\/server.101\/b10759\/statements_6014.htm\">\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/a> (\u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043d\u0430\u0448 \u0441\u043b\u0443\u0447\u0430\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430)<\/li>\n<\/ol>\n<p>  \u0418\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f \u043e\u0442 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430 \u0438 \u0436\u0435\u0441\u0442\u043a\u0438\u0445 \u0440\u0430\u0437\u0431\u043e\u0440\u043e\u0432. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u043c \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0439 \u043a\u043e\u0434, \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043c \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0432 \u043f\u0430\u043a\u0435\u0442:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test_package.sql<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">create or replace package test_package as     procedure addData( p_device    in  number                      , p_parameter in  number                      , p_value     in  number ); end test_package; \/  show errors;  create or replace package body test_package as      procedure addData( p_device    in  number                      , p_parameter in  number                      , p_value     in  number ) as     begin       insert into test_data(id, device_id, parameter_id, value)       values (test_data_seq.nextval, p_device, p_parameter, p_value);     end;  end test_package; \/  show errors; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.amfitel.m2000.ae.tests.jdbc;  import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException;  public class Test { \t \tprivate final static String CLASS_NAME = &quot;oracle.jdbc.driver.OracleDriver&quot;; \tprivate final static String USER_CONN  = &quot;jdbc:oracle:thin:@192.168.124.35:1521:dev101&quot;; \tprivate final static String USER_NAME  = &quot;ais&quot;; \tprivate final static String USER_PASS  = &quot;ais&quot;;  \tprivate final static boolean AUTO_COMMIT_MODE = true;  \tprivate final static String  ADD_DATA_SQL     =  \t\t\t&quot;begin test_package.addData(?,?,?); end;&quot;;  \tprivate Connection c = null; \t \tprivate void test() throws SQLException { \t\tCallableStatement st = c.prepareCall(ADD_DATA_SQL); \t\ttry { \t\t\tLong timestamp = System.currentTimeMillis();  \t\t\tfor (int i = 0; i &lt; 1000; i++) { \t\t\t\tst.setInt(1, i); \t\t\t\tst.setInt(2, 1); \t\t\t\tst.setString(3, &quot;0&quot;); \t\t\t\tst.execute(); \t\t\t} \t\t\tSystem.out.println(1000000L \/ (System.currentTimeMillis() - timestamp)); \t\t} finally { \t\t\tst.close(); \t\t} \t}  \tprivate void start() throws ClassNotFoundException, SQLException { \t\tClass.forName(CLASS_NAME); \t\tc = DriverManager.getConnection(USER_CONN, USER_NAME, USER_PASS); \t\tc.setAutoCommit(AUTO_COMMIT_MODE); \t} \t \tprivate void stop() throws SQLException  { \t\tif (c != null) { \t\t\tc.close(); \t\t} \t}  \tpublic static void main(String[] args) { \t\tTest t = new Test(); \t\ttry { \t\t\ttry { \t\t\t\tt.start(); \t\t\t\tt.test(); \t\t\t} finally { \t\t\t\tt.stop(); \t\t\t} \t\t} catch (Exception e) { \t\t\tSystem.out.println(e.toString()); \t\t} \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0425\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u0447\u043a\u043e\u0439 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u041f\u043e \u043d\u0435\u0439 Oracle \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u0435 SQL, \u0430 PL\/SQL-\u043a\u043e\u0434.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435:<\/p>\n<pre><code>956 <\/code><\/pre>\n<p>  \u041b\u0443\u0447\u0448\u0435, \u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043c\u0430\u043b\u043e.<\/p>\n<h4>\u0411\u044b\u0441\u0442\u0440\u0435\u0435, \u0432\u044b\u0448\u0435, \u0441\u0438\u043b\u044c\u043d\u0435\u0435!<\/h4>\n<p>  \u0427\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043a\u0443? \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c auto commit. \u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Oracle, \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0447\u0430\u0441\u0442\u0430\u044f \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b, \u043d\u043e \u0438 (\u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445) \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0448\u0430\u043d\u0441 \u0441\u043f\u0440\u043e\u0432\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 <a href=\"http:\/\/baks.gaz.ru\/oradoc\/ora\/ora350.htm\">ORA-01555<\/a>. <\/p>\n<p>  \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u0431\u0438\u0437\u043d\u0435\u0441 \u043b\u043e\u0433\u0438\u043a\u043e\u0439. \u0415\u0441\u043b\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u0443\u044e \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c. \u041d\u043e (\u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434) \u043b\u0443\u0447\u0448\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u0435\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0447\u0435\u043c \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u0430\u0436\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0430 \u043e\u0442\u043a\u0443\u043f JDBC.<\/p>\n<p>  \u041a\u0430\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u043f\u0440\u0438 \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445? \u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043d\u0435\u0442. \u0414\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u0430, \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u2014 \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u0442\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044e \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u043e\u043a \u0432 \u043e\u0434\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0441\u0442\u0430\u0432\u043a\u0430 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.amfitel.m2000.ae.tests.jdbc;  import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException;  public class Test { \t \tprivate final static String CLASS_NAME = &quot;oracle.jdbc.driver.OracleDriver&quot;; \tprivate final static String USER_CONN  = &quot;jdbc:oracle:thin:@192.168.124.35:1521:dev101&quot;; \tprivate final static String USER_NAME  = &quot;ais&quot;; \tprivate final static String USER_PASS  = &quot;ais&quot;; \t \tprivate final static boolean AUTO_COMMIT_MODE = false;  \tprivate final static String  ADD_DATA_SQL     =  \t\t\t&quot;begin test_package.addData(?,?,?); end;&quot;;  \tprivate Connection c = null; \t \tprivate void test() throws SQLException { \t\tCallableStatement st = c.prepareCall(ADD_DATA_SQL); \t\ttry { \t\t\tLong timestamp = System.currentTimeMillis();  \t\t\tfor (int i = 0; i &lt; 1000; i++) { \t\t\t\tst.setInt(1, i); \t\t\t\tst.setInt(2, 1); \t\t\t\tst.setString(3, &quot;0&quot;); \t\t\t\tst.execute(); \t\t\t} \t\t\tc.commit(); \t\t\tSystem.out.println(1000000L \/ (System.currentTimeMillis() - timestamp)); \t\t} finally { \t\t\tst.close(); \t\t} \t}  \tprivate void start() throws ClassNotFoundException, SQLException { \t\tClass.forName(CLASS_NAME); \t\tc = DriverManager.getConnection(USER_CONN, USER_NAME, USER_PASS); \t\tc.setAutoCommit(AUTO_COMMIT_MODE); \t} \t \tprivate void stop() throws SQLException  { \t\tif (c != null) { \t\t\tc.close(); \t\t} \t}  \tpublic static void main(String[] args) { \t\tTest t = new Test(); \t\ttry { \t\t\ttry { \t\t\t\tt.start(); \t\t\t\tt.test(); \t\t\t} finally { \t\t\t\tt.stop(); \t\t\t} \t\t} catch (Exception e) { \t\t\tSystem.out.println(e.toString()); \t\t} \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430:<\/p>\n<pre><code>1524 <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0435\u0433\u043e \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435, \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e <a href=\"http:\/\/www.oracle-base.com\/articles\/misc\/temporary-tables.php\">\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445<\/a>:<\/p>\n<pre><code class=\"sql\">drop table test_data;  create global temporary table test_data (   device_id      number                              not null,   parameter_id   number                              not null,   value          varchar2(100),   event_date     date             default sysdate    not null ) on commit delete rows; <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0443\u0431\u0440\u0430\u043b\u0438 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0442\u043e\u043b\u0431\u0435\u0446 id, \u0432\u043d\u0435\u0441\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0430\u043a\u0435\u0442\u0430:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">test_package.sql<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">create or replace package body test_package as      procedure addData( p_device    in  number                      , p_parameter in  number                      , p_value     in  number ) as     begin       insert into test_data(device_id, parameter_id, value)       values (p_device, p_parameter, p_value);     end;  end test_package; \/  show errors; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0435 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 REDO-\u043b\u043e\u0433\u0435 (\u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u0441\u0431\u043e\u0435), \u044d\u0442\u043e \u0432\u0435\u0434\u0435\u0442 \u043a \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u043c\u0443 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044e \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432:<\/p>\n<pre><code>1779 <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c DML-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u043f\u0430\u043a\u0435\u0442\u0443, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043e 2000. \u041d\u0435\u0443\u0436\u0435\u043b\u0438 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0435\u043b?<\/p>\n<p>  \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0435\u0442! \u0421\u0435\u0439\u0447\u0430\u0441, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0432\u0435\u043b\u0438 \u043d\u0430 \u043d\u0435\u0442 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u0435\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439, \u043c\u044b \u0443\u043f\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u043e\u0435 \u0431\u0443\u0442\u044b\u043b\u043e\u0447\u043d\u043e\u0435 \u0433\u043e\u0440\u043b\u044b\u0448\u043a\u043e \u2014 \u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043e \u0441\u0435\u0442\u0438. \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b bulk-\u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043e\u0434\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435.<\/p>\n<p>  \u0412\u043d\u043e\u0441\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Bulk \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.amfitel.m2000.ae.tests.jdbc;  import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException;  public class Test { \t \tprivate final static String CLASS_NAME = &quot;oracle.jdbc.driver.OracleDriver&quot;; \tprivate final static String USER_CONN  = &quot;jdbc:oracle:thin:@192.168.124.35:1521:dev101&quot;; \tprivate final static String USER_NAME  = &quot;ais&quot;; \tprivate final static String USER_PASS  = &quot;ais&quot;; \t \tprivate final static boolean AUTO_COMMIT_MODE = false; \tprivate final static int     BULK_SIZE        = 10; \t \tprivate final static String  ADD_DATA_SQL     =  \t\t\t&quot;begin test_package.addData(?,?,?); end;&quot;;  \tprivate Connection c = null; \t \tprivate void test() throws SQLException { \t\tCallableStatement st = c.prepareCall(ADD_DATA_SQL); \t\ttry { \t\t\tint bulkSize = BULK_SIZE; \t\t\tLong timestamp = System.currentTimeMillis();  \t\t\tfor (int i = 0; i &lt; 1000; i++) { \t\t\t\tst.setInt(1, i); \t\t\t\tst.setInt(2, 1); \t\t\t\tst.setString(3, &quot;0&quot;); \t\t\t\tst.addBatch(); \t\t\t\tif (--bulkSize &lt;= 0) { \t\t\t\t\tst.executeBatch(); \t\t\t\t\tbulkSize = BULK_SIZE; \t\t\t\t} \t\t\t} \t\t\tif (bulkSize &lt; BULK_SIZE) { \t\t\t\tst.executeBatch(); \t\t\t} \t\t\tc.commit(); \t\t\tSystem.out.println(1000000L \/ (System.currentTimeMillis() - timestamp)); \t\t} finally { \t\t\tst.close(); \t\t} \t}  \tprivate void start() throws ClassNotFoundException, SQLException { \t\tClass.forName(CLASS_NAME); \t\tc = DriverManager.getConnection(USER_CONN, USER_NAME, USER_PASS); \t\tc.setAutoCommit(AUTO_COMMIT_MODE); \t} \t \tprivate void stop() throws SQLException  { \t\tif (c != null) { \t\t\tc.close(); \t\t} \t}  \tpublic static void main(String[] args) { \t\tTest t = new Test(); \t\ttry { \t\t\ttry { \t\t\t\tt.start(); \t\t\t\tt.test(); \t\t\t} finally { \t\t\t\tt.stop(); \t\t\t} \t\t} catch (Exception e) { \t\t\tSystem.out.println(e.toString()); \t\t} \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435:<\/p>\n<pre><code>1779 <\/code><\/pre>\n<p>  \u0418 \u043d\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u043c \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b. \u041f\u043e\u0447\u0435\u043c\u0443?<\/p>\n<p>  \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e bulk-\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f DML-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (insert, update, delete). \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c bulk-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u043c\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443, JDBC \u044d\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u0442 bulk, \u043e\u0442\u0441\u044b\u043b\u0430\u044f \u043f\u043e \u0441\u0435\u0442\u0438 \u0440\u043e\u0432\u043d\u043e \u0442\u043e-\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0431\u0435\u0437 \u043d\u0435\u0433\u043e.<\/p>\n<p>  \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u043e\u0442 \u0434\u043e\u0441\u0430\u0434\u043d\u044b\u0439 \u043f\u0440\u043e\u043c\u0430\u0445:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Bulk insert-\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.amfitel.m2000.ae.tests.jdbc;  import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException;  public class Test { \t \tprivate final static String CLASS_NAME = &quot;oracle.jdbc.driver.OracleDriver&quot;; \tprivate final static String USER_CONN  = &quot;jdbc:oracle:thin:@192.168.124.35:1521:dev101&quot;; \tprivate final static String USER_NAME  = &quot;ais&quot;; \tprivate final static String USER_PASS  = &quot;ais&quot;; \t \tprivate final static boolean AUTO_COMMIT_MODE = false; \tprivate final static int     BULK_SIZE        = 10; \t \tprivate final static String  ADD_DATA_SQL     =  \t\t\t&quot;insert into test_data(device_id, parameter_id, value) values (?,?,?)&quot;; \t \tprivate Connection c = null; \t \tprivate void test() throws SQLException { \t\tCallableStatement st = c.prepareCall(ADD_DATA_SQL); \t\ttry { \t\t\tint bulkSize = BULK_SIZE; \t\t\tLong timestamp = System.currentTimeMillis();  \t\t\tfor (int i = 0; i &lt; 1000; i++) { \t\t\t\tst.setInt(1, i); \t\t\t\tst.setInt(2, 1); \t\t\t\tst.setString(3, &quot;0&quot;); \t\t\t\tst.addBatch(); \t\t\t\tif (--bulkSize &lt;= 0) { \t\t\t\t\tst.executeBatch(); \t\t\t\t\tbulkSize = BULK_SIZE; \t\t\t\t} \t\t\t} \t\t\tif (bulkSize &lt; BULK_SIZE) { \t\t\t\tst.executeBatch(); \t\t\t} \t\t\tc.commit(); \t\t\tSystem.out.println(1000000L \/ (System.currentTimeMillis() - timestamp)); \t\t} finally { \t\t\tst.close(); \t\t} \t}  \tprivate void start() throws ClassNotFoundException, SQLException { \t\tClass.forName(CLASS_NAME); \t\tc = DriverManager.getConnection(USER_CONN, USER_NAME, USER_PASS); \t\tc.setAutoCommit(AUTO_COMMIT_MODE); \t} \t \tprivate void stop() throws SQLException  { \t\tif (c != null) { \t\t\tc.close(); \t\t} \t}  \tpublic static void main(String[] args) { \t\tTest t = new Test(); \t\ttry { \t\t\ttry { \t\t\t\tt.start(); \t\t\t\tt.test(); \t\t\t} finally { \t\t\t\tt.stop(); \t\t\t} \t\t} catch (Exception e) { \t\t\tSystem.out.println(e.toString()); \t\t} \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u0434 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043d\u043e\u0432\u0430:<\/p>\n<pre><code>12658 <\/code><\/pre>\n<p>  \u0425\u0430, \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u0438\u0434\u0435\u043c \u043d\u0430 \u0440\u0435\u043a\u043e\u0440\u0434! \u0414\u043e\u0432\u0435\u0434\u044f BULK_SIZE \u0434\u043e 100, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438 \u0432\u043e\u0432\u0441\u0435 \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:<\/p>\n<pre><code>31250 <\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u2026 \u0442\u0435\u0440\u044f\u0442\u044c \u0438\u0445 \u043f\u0440\u0438 commit-\u0435, \u0442\u0430\u043a \u043d\u0438\u0447\u0435\u0433\u043e \u0441 \u043d\u0438\u043c\u0438 \u0438 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0432.<\/p>\n<h4>\u0413\u0434\u0435 \u043b\u043e\u0433\u0438\u043a\u0430?<\/h4>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u0434\u043e\u0431\u0430\u0432\u0438\u043c. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0445\u0435\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/bc7\/dca\/014\/bc7dca0149f79223a03d57fd3bcb0c9e.png\" alt=\"image\"\/><\/p>\n<p>  \u041f\u0443\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 test_device \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 test_parameter. \u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 test_state, \u0430 \u0432 test_history \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0445\u0440\u043e\u043d\u043e\u043b\u043e\u0433\u0438\u044e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 null.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0442\u0438\u043f\u043e\u0432, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0432 test_parameter_type. \u0422\u0438\u043f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 test_history:<\/p>\n<ol>\n<li>\u0422\u0438\u043f &#8216;default&#8217; \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c (\u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438) \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u0437\u0430\u043f\u0438\u0441\u044c \u0432 test_history \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/li>\n<li>\u0422\u0438\u043f &#8216;uptime&#8217; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0431\u0435\u0437\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 test_history \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437 test_state \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e (\u0442\u043e \u0435\u0441\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u043e\u0441\u044c)<\/li>\n<\/ol>\n<p>  \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0442\u0438\u043f\u043e\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">create table test_device (   id             number                              not null,   name           varchar2(100) );  create unique index test_device_pk on test_device(id);  alter table test_device add   constraint pk_test_device primary key(id);  create table test_parameter_type (   id             number                              not null,   name           varchar2(100) );  create unique index test_parameter_type_pk on test_parameter_type(id);  alter table test_parameter_type add   constraint pk_test_parameter_type primary key(id);  create table test_parameter (   id             number                              not null,   type_id        number                              not null,   name           varchar2(100) );  create unique index test_parameter_pk on test_parameter(id);  create index test_parameter_fk on test_parameter(type_id);  alter table test_parameter add   constraint pk_test_parameter primary key(id);  alter table test_parameter add   constraint fk_test_parameter foreign key (type_id)      references test_parameter_type(id);  create table test_state (   device_id      number                              not null,   parameter_id   number                              not null,   value          varchar2(100)                       not null,   last_date      date             default sysdate    not null );  create unique index test_state_pk on test_state(device_id, parameter_id);  create index test_state_fk on test_state(parameter_id);  alter table test_state add   constraint pk_test_state primary key(device_id, parameter_id);  alter table test_state add   constraint fk_test_state foreign key (device_id)      references test_device(id);  alter table test_state add   constraint fk_test_state_parameter foreign key (parameter_id)      references test_parameter(id);  create sequence test_history_seq;  create table test_history (   id             number                              not null,   device_id      number                              not null,   parameter_id   number                              not null,   value          varchar2(100)                       not null,   event_date     date             default sysdate    not null );  create unique index test_history_pk on test_history(id);  create index test_history_device_fk on test_history(device_id);  create index test_history_parameter_fk on test_history(parameter_id);  alter table test_history add   constraint pk_test_history primary key(id);  alter table test_history add   constraint fk_test_history_device foreign key (device_id)      references test_device(id);  alter table test_history add   constraint fk_test_history_parameter foreign key (parameter_id)      references test_parameter(id); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">Insert into TEST_PARAMETER_TYPE    (ID, NAME)  Values    (1, 'default'); Insert into TEST_PARAMETER_TYPE    (ID, NAME)  Values    (2, 'uptime'); COMMIT;  Insert into TEST_PARAMETER    (ID, TYPE_ID, NAME)  Values    (1, 1, 'status'); Insert into TEST_PARAMETER    (ID, TYPE_ID, NAME)  Values    (2, 2, 'uptime'); COMMIT;  insert into test_device(id, name) select rownum, object_name from   all_objects;  commit; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043f\u0430\u043a\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">CREATE OR REPLACE package test_package as     procedure saveData;                      end test_package; \/  show errors;  CREATE OR REPLACE package body test_package as      procedure saveData as     begin            -- \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c history \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0442\u0438\u043f\u0430 default       insert into test_history(id, device_id, parameter_id, value, event_date)       select test_history_seq.nextval, a.device_id, a.parameter_id, a.value, a.event_date       from   test_data a       inner  join test_device b on ( b.id = a.device_id )       inner  join test_parameter c on ( c.id = a.parameter_id )       inner  join test_parameter_type d on ( d.id = c.type_id and d.name = 'default' )       left   join test_state e on ( e.device_id = a.device_id and                                      e.parameter_id = a.parameter_id )       where  e.value is null or e.value &lt;&gt; a.value;              -- \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c history \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0442\u0438\u043f\u0430 uptime       insert into test_history(id, device_id, parameter_id, value, event_date)       select test_history_seq.nextval, a.device_id, a.parameter_id, e.value, e.last_date       from   test_data a       inner  join test_device b on ( b.id = a.device_id )       inner  join test_parameter c on ( c.id = a.parameter_id )       inner  join test_parameter_type d on ( d.id = c.type_id and d.name = 'uptime' )       left   join test_state e on ( e.device_id = a.device_id and                                      e.parameter_id = a.parameter_id )       where  e.value &gt; a.value;              -- \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c state       merge into test_state a       using ( select c.device_id, c.parameter_id, c.value, c.event_date               from   test_data c               inner  join test_device d on ( d.id = c.device_id )               inner  join test_parameter e on ( e.id = c.parameter_id )             ) b       on ( b.device_id = a.device_id and b.parameter_id = a.parameter_id )       when matched then         update set a.value = b.value, a.last_date = b.event_date       when not matched then         insert (device_id, parameter_id, value, last_date)         values (b.device_id, b.parameter_id, b.value, b.event_date);            -- \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043e\u0447\u0438\u0449\u0430\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443       commit;          end;  end test_package; \/  show errors; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435, \u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e, \u0447\u0442\u043e Oracle \u0443\u043c\u0435\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e.<\/p>\n<p>  \u0412\u043d\u0435\u0441\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.amfitel.m2000.ae.tests.jdbc;  import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException;  public class Test { \t \tprivate final static String CLASS_NAME = &quot;oracle.jdbc.driver.OracleDriver&quot;; \tprivate final static String USER_CONN  = &quot;jdbc:oracle:thin:@192.168.124.35:1521:dev101&quot;; \tprivate final static String USER_NAME  = &quot;ais&quot;; \tprivate final static String USER_PASS  = &quot;ais&quot;; \t \tprivate final static boolean AUTO_COMMIT_MODE = false; \tprivate final static int     BULK_SIZE        = 100; \t \tprivate final static String  ADD_DATA_SQL     =  \t\t\t&quot;insert into test_data(device_id, parameter_id, value) values (?,?,?)&quot;;  \tprivate final static String  SAVE_DATA_SQL    =  \t\t\t&quot;begin test_package.saveData; end;&quot;; \t \tprivate Connection c = null; \t \tprivate void test() throws SQLException { \t\tLong timestamp = System.currentTimeMillis();  \t\tCallableStatement st = c.prepareCall(ADD_DATA_SQL); \t\ttry { \t\t\tint bulkSize = BULK_SIZE; \t\t\tfor (int i = 0; i &lt; 1000; i++) { \t\t\t\tst.setInt(1, i); \t\t\t\tst.setInt(2, 1); \t\t\t\tst.setString(3, &quot;0&quot;); \t\t\t\tst.addBatch(); \t\t\t\tif (--bulkSize &lt;= 0) { \t\t\t\t\tst.executeBatch(); \t\t\t\t\tbulkSize = BULK_SIZE; \t\t\t\t} \t\t\t} \t\t\tif (bulkSize &lt; BULK_SIZE) { \t\t\t\tst.executeBatch(); \t\t\t} \t\t} finally { \t\t\tst.close(); \t\t} \t\tst = c.prepareCall(SAVE_DATA_SQL); \t\ttry { \t\t\tst.execute(); \t\t} finally { \t\t\tst.close(); \t\t} \t\tSystem.out.println(1000000L \/ (System.currentTimeMillis() - timestamp)); \t}  \tprivate void start() throws ClassNotFoundException, SQLException { \t\tClass.forName(CLASS_NAME); \t\tc = DriverManager.getConnection(USER_CONN, USER_NAME, USER_PASS); \t\tc.setAutoCommit(AUTO_COMMIT_MODE); \t} \t \tprivate void stop() throws SQLException  { \t\tif (c != null) { \t\t\tc.close(); \t\t} \t}  \tpublic static void main(String[] args) { \t\tTest t = new Test(); \t\ttry { \t\t\ttry { \t\t\t\tt.start(); \t\t\t\tt.test(); \t\t\t} finally { \t\t\t\tt.stop(); \t\t\t} \t\t} catch (Exception e) { \t\t\tSystem.out.println(e.toString()); \t\t} \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435:<\/p>\n<pre><code>5319 <\/code><\/pre>\n<p>  \u0423\u0432\u044b, \u0447\u0443\u0434\u0430 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0441\u044b\u0433\u0440\u0430\u043b\u0430 \u0441\u0432\u043e\u044e \u0440\u043e\u043b\u044c. \u041d\u043e 5000 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435 600. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 Oracle (\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u0435).<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u043b\u0438 \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 <a href=\"http:\/\/en.wikipedia.org\/wiki\/In-memory_database\">InMemory DB<\/a>. \u041d\u043e \u044d\u0442\u043e \u0442\u0435\u043c\u0430 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u0430.<\/p>\n<h4>\u0413\u043e\u0442\u043e\u0432\u044b \u043b\u0438 \u0432\u044b \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435?<\/h4>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u044b \u0434\u043e\u0431\u0438\u043b\u0438\u0441\u044c \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u0431\u043c\u0435\u043d \u043d\u0430 \u0440\u0438\u0441\u043a \u043f\u043e\u0442\u0435\u0440\u0438 \u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043e. \u041f\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u044d\u0442\u043e\u0442 \u0440\u0438\u0441\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u0432\u0435\u0441\u0442\u0438 \u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0443, \u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f. <\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 InMemory \u0438\u043b\u0438 NoSQL DB \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442 \u044d\u0442\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u0440\u0430\u0434\u0438\u043a\u0430\u043b\u044c\u043d\u043e. \u0425\u043e\u0442\u044f \u044d\u0442\u0438 \u0421\u0423\u0411\u0414 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442 \u0437\u0430\u0449\u0438\u0442\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 REDO-\u043b\u043e\u0433\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 <a href=\"http:\/\/www.oracle.com\/technetwork\/ru\/topics\/timesten\/index.html\">Oracle TimesTen<\/a>), \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0432 \u044d\u0442\u0443 \u0437\u0430\u0449\u0438\u0442\u0443 (\u0442\u0430\u043a\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e). <\/p>\n<p>  \u041f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u0430\u0436\u043d\u0435\u0435 \u2014 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0443\u044e \u0441\u043e\u0445\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c? \u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a \u0437\u0430\u0434\u0430\u0447\u0438. \u041c\u044b \u0436\u0435, \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043c\u043e\u0436\u0435\u043c \u0432\u043e\u043f\u043b\u043e\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0436\u0438\u0437\u043d\u044c, \u0434\u043e\u0431\u0438\u0432\u0430\u044f\u0441\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c.<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/196828\/\"> http:\/\/habrahabr.ru\/post\/196828\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0412 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 <a href=\"http:\/\/habrahabr.ru\/post\/196308\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u043e\u0441\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 SNMP \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0442\u044c 9000 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 (\u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u043e\u0432). \u0412\u043e\u043f\u0440\u043e\u0441 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c.<\/p>\n<p>  \u041e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c <a href=\"http:\/\/en.wikipedia.org\/wiki\/Relational_database_management_system\">RDBMS<\/a> (\u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <a href=\"http:\/\/www.oracle.com\/us\/products\/database\/overview\/index.html\">Oracle Database<\/a>). \u041d\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043b\u0438 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u0442\u0430\u043a\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439? \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-196828","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/196828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=196828"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/196828\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=196828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=196828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=196828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}