text: CREATE TABLE b_seo_keywords
  (
  	ID NUMBER(18) NOT NULL,
  	SITE_ID CHAR(2 CHAR) NOT NULL,
  	URL VARCHAR2(255 CHAR),
  	KEYWORDS CLOB,
  	CONSTRAINT PK_B_SEO_KEYWORDS PRIMARY KEY (ID)
  )
  /
  
  CREATE INDEX ix_b_seo_keywords_url ON b_seo_keywords (URL, SITE_ID)
  /
  
  CREATE SEQUENCE sq_b_seo_keywords
  /
  
  CREATE TABLE b_seo_search_engine
  (
  	ID NUMBER(18) NOT NULL,
  	CODE VARCHAR(50 CHAR) NOT NULL,
  	ACTIVE CHAR(1 CHAR) DEFAULT 'Y' NULL,
  	SORT NUMBER(5) DEFAULT 100 NULL,
  	NAME VARCHAR(255 CHAR) NOT NULL,
  	CLIENT_ID VARCHAR(255 CHAR) NULL,
  	CLIENT_SECRET VARCHAR(255 CHAR) NULL,
  	REDIRECT_URI VARCHAR(255 CHAR) NULL,
  	SETTINGS CLOB NULL,
  	CONSTRAINT PK_B_SEO_SEARCH_ENGINE PRIMARY KEY (ID)
  )
  /
  CREATE UNIQUE INDEX UX_B_SEO_SEARCH_ENGINE_CODE ON b_seo_search_engine(CODE)
  /
  CREATE SEQUENCE sq_b_seo_search_engine
  /
  
  INSERT INTO b_seo_search_engine (ID, CODE, ACTIVE, SORT, NAME, CLIENT_ID, CLIENT_SECRET, REDIRECT_URI) VALUES (sq_b_seo_search_engine.NEXTVAL, 'google', 'Y', 200, 'Google', '868942902147-qrrd6ce1ajfkpse8ieq4gkpdeanvtnno.apps.googleusercontent.com', 'EItMlJpZLC2WRPKB6QsA5bV9-zo5', 'urn:ietf:wg:oauth:2.0:oob')
  /
  INSERT INTO b_seo_search_engine (ID, CODE, ACTIVE, SORT, NAME, CLIENT_ID, CLIENT_SECRET, REDIRECT_URI) VALUES (sq_b_seo_search_engine.NEXTVAL, 'yandex', 'Y', 300, 'Yandex', 'f848c7bfc1d34a94ba6d05439f81bbd7', 'da0e73b2d9cc4e809f3170e49cb9df01', 'https://oauth.yandex.ru/verification_code')
  /
  
  INSERT INTO b_seo_search_engine (ID, CODE, ACTIVE, SORT, NAME, CLIENT_ID, CLIENT_SECRET, REDIRECT_URI) VALUES (sq_b_seo_search_engine.NEXTVAL, 'yandex_direct', 'Y', 400, 'Yandex.Direct', 'e46a29a748d84036baee1e2ae2a84fc6', '7122987f5a99479bb756d79ed7986e6c', 'https://oauth.yandex.ru/verification_code')
  /
  
  CREATE TABLE b_seo_sitemap
  (
  	ID NUMBER(18) NOT NULL,
  	TIMESTAMP_X DATE DEFAULT SYSDATE,
  	SITE_ID CHAR(2 CHAR) NOT NULL,
  	ACTIVE CHAR(1 CHAR) DEFAULT 'Y' NULL,
  	NAME VARCHAR(255 CHAR) DEFAULT '' NULL,
  	DATE_RUN DATE DEFAULT NULL NULL,
  	SETTINGS CLOB NULL,
  	CONSTRAINT PK_B_SEO_SITEMAP PRIMARY KEY (ID)
  )
  /
  CREATE SEQUENCE sq_b_seo_sitemap
  /
  
  CREATE OR REPLACE TRIGGER b_seo_sitemap_update
  BEFORE UPDATE
  ON b_seo_sitemap
  REFERENCING OLD AS OLD NEW AS NEW
  FOR EACH ROW
  BEGIN
  	IF :NEW.TIMESTAMP_X IS NOT NULL THEN
  		:NEW.TIMESTAMP_X := SYSDATE;
  	ELSE
  		:NEW.TIMESTAMP_X := :OLD.TIMESTAMP_X;
  	END IF;
  END;
  /
  
  CREATE TABLE b_seo_sitemap_runtime
  (
  	ID NUMBER(18) NOT NULL,
  	PID NUMBER(18) NOT NULL,
  	PROCESSED CHAR(1 CHAR) DEFAULT 'N' NOT NULL,
  	ITEM_PATH VARCHAR(700 CHAR) NULL,
  	ITEM_ID NUMBER(18) NULL,
  	ITEM_TYPE CHAR(1 CHAR) DEFAULT 'D' NOT NULL,
  	ACTIVE CHAR(1 CHAR) DEFAULT 'Y'  NULL,
  	ACTIVE_ELEMENT CHAR(1 CHAR) DEFAULT 'Y' NULL,
  	CONSTRAINT PK_B_SEO_SITEMAP_RUNTIME PRIMARY KEY (ID)
  )
  /
  CREATE INDEX IX_SEO_SITEMAP_RUNTIME1 ON b_seo_sitemap_runtime(PID, PROCESSED, ITEM_TYPE, ITEM_ID)
  /
  CREATE SEQUENCE sq_b_seo_sitemap_runtime
  /
  
  CREATE TABLE b_seo_sitemap_iblock
  (
  	ID NUMBER(18) NOT NULL,
  	IBLOCK_ID NUMBER(18) NOT NULL,
  	SITEMAP_ID NUMBER(18) NOT NULL,
  	CONSTRAINT PK_B_SEO_SITEMAP_IBLOCK PRIMARY KEY (ID)
  )
  /
  CREATE INDEX ix_b_seo_sitemap_iblock_1 ON b_seo_sitemap_iblock(IBLOCK_ID)
  /
  CREATE INDEX ix_b_seo_sitemap_iblock_2 ON b_seo_sitemap_iblock(SITEMAP_ID)
  /
  CREATE SEQUENCE sq_b_seo_sitemap_iblock
  /
  
  CREATE TABLE b_seo_sitemap_entity
  (
  	ID NUMBER(18) NOT NULL,
  	ENTITY_TYPE VARCHAR(255 CHAR) NOT NULL,
  	ENTITY_ID NUMBER(18) NOT NULL,
  	SITEMAP_ID NUMBER(18) NOT NULL,
  	CONSTRAINT PK_B_SEO_SITEMAP_ENTITY PRIMARY KEY (ID)
  )
  /
  CREATE INDEX ix_b_seo_sitemap_entity_1 ON b_seo_sitemap_entity(ENTITY_TYPE, ENTITY_ID)
  /
  CREATE INDEX ix_b_seo_sitemap_entity_2 ON b_seo_sitemap_entity(SITEMAP_ID)
  /
  CREATE SEQUENCE sq_b_seo_sitemap_entity
  /
  
  
  
  CREATE TABLE b_seo_adv_campaign
  (
  	ID NUMBER(18) NOT NULL,
  	ENGINE_ID NUMBER(18) NOT NULL,
  	ACTIVE CHAR(1 CHAR) DEFAULT 'Y' NOT NULL,
  	OWNER_ID VARCHAR(255 CHAR) NOT NULL,
  	OWNER_NAME VARCHAR(255 CHAR) NOT NULL,
  	XML_ID VARCHAR(255 CHAR) NOT NULL,
  	NAME VARCHAR(255 CHAR) NOT NULL,
  	LAST_UPDATE DATE NULL,
  	SETTINGS CLOB NULL,
  	CONSTRAINT PK_B_SEO_ADV_CAMPAIGN PRIMARY KEY (ID)
  )
  /
  CREATE SEQUENCE sq_b_seo_adv_campaign
  /
  CREATE UNIQUE INDEX ux_b_seo_adv_campaign ON b_seo_adv_campaign(ENGINE_ID, XML_ID)
  /
  
  
  CREATE TABLE b_seo_adv_group
  (
  	ID NUMBER(18) NOT NULL,
  	ENGINE_ID NUMBER(18) NOT NULL,
  	ACTIVE CHAR(1 CHAR) DEFAULT 'Y' NOT NULL,
  	OWNER_ID VARCHAR(255 CHAR) NOT NULL,
  	OWNER_NAME VARCHAR(255 CHAR) NOT NULL,
  	XML_ID VARCHAR(255 CHAR) NOT NULL,
  	NAME VARCHAR(255 CHAR) NOT NULL,
  	LAST_UPDATE DATE NULL,
  	SETTINGS CLOB NULL,
  	CAMPAIGN_ID NUMBER(18) NOT NULL,
  	CONSTRAINT PK_B_SEO_ADV_GROUP PRIMARY KEY (ID)
  )
  /
  CREATE SEQUENCE sq_b_seo_adv_group
  /
  CREATE UNIQUE INDEX ux_b_seo_adv_group ON b_seo_adv_group(ENGINE_ID, XML_ID)
  /
  CREATE INDEX ix_b_seo_adv_group1 ON b_seo_adv_group(CAMPAIGN_ID)
  /
  
  
  CREATE TABLE b_seo_adv_banner
  (
  	ID NUMBER(18) NOT NULL,
  	ENGINE_ID NUMBER(18) NOT NULL,
  	ACTIVE CHAR(1 CHAR) DEFAULT 'Y' NOT NULL,
  	OWNER_ID VARCHAR(255 CHAR) NOT NULL,
  	OWNER_NAME VARCHAR(255 CHAR) NOT NULL,
  	XML_ID VARCHAR(255 CHAR) NOT NULL,
  	NAME VARCHAR(255 CHAR) NOT NULL,
  	LAST_UPDATE DATE NULL,
  	SETTINGS CLOB NULL,
  	CAMPAIGN_ID NUMBER(18) NOT NULL,
  	GROUP_ID NUMBER(18) NULL,
  	AUTO_QUANTITY_OFF char(1 CHAR) DEFAULT 'N' NULL,
  	AUTO_QUANTITY_ON char(1 CHAR) DEFAULT 'N' NULL,
  	CONSTRAINT PK_B_SEO_ADV_BANNER PRIMARY KEY (ID)
  )
  /
  CREATE SEQUENCE sq_b_seo_adv_banner
  /
  CREATE UNIQUE INDEX ux_b_seo_adv_banner ON b_seo_adv_banner(ENGINE_ID, XML_ID)
  /
  CREATE INDEX ix_b_seo_adv_banner1 ON b_seo_adv_banner(CAMPAIGN_ID)
  /
  CREATE INDEX ix_b_seo_adv_banner2 ON b_seo_adv_banner(AUTO_QUANTITY_OFF, AUTO_QUANTITY_ON)
  /
  
  CREATE TABLE b_seo_adv_region
  (
  	ID NUMBER(18) NOT NULL,
  	ENGINE_ID NUMBER(18) NOT NULL,
  	ACTIVE CHAR(1 CHAR) DEFAULT 'Y' NOT NULL,
  	OWNER_ID VARCHAR(255 CHAR) NOT NULL,
  	OWNER_NAME VARCHAR(255 CHAR) NOT NULL,
  	XML_ID VARCHAR(255 CHAR) NOT NULL,
  	NAME VARCHAR(255 CHAR) NOT NULL,
  	LAST_UPDATE DATE NULL,
  	SETTINGS CLOB NULL,
  	PARENT_ID NUMBER(18) NOT NULL,
  	CONSTRAINT PK_B_SEO_ADV_REGION PRIMARY KEY (ID)
  )
  /
  CREATE SEQUENCE sq_b_seo_adv_region
  /
  CREATE UNIQUE INDEX ux_b_seo_adv_region ON b_seo_adv_region(ENGINE_ID, XML_ID)
  /
  CREATE INDEX ix_b_seo_adv_region1 ON b_seo_adv_region(PARENT_ID)
  /
  
  CREATE TABLE b_seo_adv_link
  (
  	LINK_TYPE CHAR(1 CHAR) NOT NULL,
  	LINK_ID NUMBER(18) NOT NULL,
  	BANNER_ID NUMBER(18) NOT NULL,
  	CONSTRAINT PK_B_SEO_ADV_LINK PRIMARY KEY (LINK_TYPE,LINK_ID,BANNER_ID)
  )
  /
  
  CREATE TABLE b_seo_adv_order
  (
  	ID NUMBER(18) NOT NULL,
  	ENGINE_ID NUMBER(18) NOT NULL,
  	TIMESTAMP_X DATE NOT NULL,
  	CAMPAIGN_ID NUMBER(18) NOT NULL,
  	BANNER_ID NUMBER(18) NOT NULL,
  	ORDER_ID NUMBER(18) NOT NULL,
  	SUM FLOAT NULL,
  	PROCESSED CHAR(1 CHAR) DEFAULT 'N' NULL,
  	CONSTRAINT PK_B_SEO_ADV_ORDER PRIMARY KEY (ID)
  )
  /
  CREATE SEQUENCE sq_b_seo_adv_order
  /
  CREATE UNIQUE INDEX ux_b_seo_adv_order ON b_seo_adv_order (ENGINE_ID, CAMPAIGN_ID, BANNER_ID, ORDER_ID)
  /
  CREATE INDEX ix_b_seo_adv_order1 ON b_seo_adv_order (ORDER_ID, PROCESSED)
  /
  
  
  CREATE TABLE b_seo_adv_log
  (
  	ID NUMBER(18) NOT NULL,
  	ENGINE_ID NUMBER(18) NOT NULL,
  	TIMESTAMP_X DATE NOT NULL,
  	REQUEST_URI VARCHAR(100 CHAR) NOT NULL,
  	REQUEST_DATA CLOB,
  	RESPONSE_TIME FLOAT NOT NULL,
  	RESPONSE_STATUS NUMBER(5),
  	RESPONSE_DATA CLOB,
  	CONSTRAINT PK_B_SEO_ADV_LOG PRIMARY KEY (ID)
  )
  /
  CREATE SEQUENCE sq_b_seo_adv_log
  /
  CREATE INDEX ix_b_seo_adv_log1 ON b_seo_adv_log(ENGINE_ID)
  /
  CREATE INDEX ix_b_seo_adv_log2 ON b_seo_adv_log(TIMESTAMP_X)
  /
  
  CREATE TABLE b_seo_adv_autolog
  (
  	ID NUMBER(18) NOT NULL,
  	ENGINE_ID NUMBER(18) NOT NULL,
  	TIMESTAMP_X DATE NOT NULL,
  	CAMPAIGN_ID NUMBER(18) NOT NULL,
  	CAMPAIGN_XML_ID VARCHAR(255 CHAR) NOT NULL,
  	BANNER_ID NUMBER(18) NOT NULL,
  	BANNER_XML_ID VARCHAR(255 CHAR) NOT NULL,
  	CAUSE_CODE NUMBER(5) NULL,
  	SUCCESS CHAR(1 CHAR) DEFAULT 'Y' NULL,
  	CONSTRAINT PK_B_SEO_ADV_AUTOLOG PRIMARY KEY (ID)
  )
  /
  CREATE SEQUENCE sq_b_seo_adv_autolog
  /
  CREATE INDEX ix_b_seo_adv_autolog1 ON b_seo_adv_autolog(ENGINE_ID)
  /
  CREATE INDEX ix_b_seo_adv_autolog2 ON b_seo_adv_autolog(TIMESTAMP_X)
  /
  
  
  CREATE TABLE b_seo_yandex_direct_stat
  (
  	ID NUMBER(18) NOT NULL,
  	CAMPAIGN_ID NUMBER(18) NOT NULL,
  	BANNER_ID NUMBER(18) NOT NULL,
  	DATE_DAY DATE NOT NULL,
  	CURRENCY CHAR(3 CHAR) NULL,
  	SUM FLOAT DEFAULT 0 NULL,
  	SUM_SEARCH FLOAT DEFAULT 0 NULL,
  	SUM_CONTEXT FLOAT DEFAULT 0 NULL ,
  	CLICKS NUMBER(7) DEFAULT 0 NULL,
  	CLICKS_SEARCH NUMBER(7) DEFAULT 0 NULL,
  	CLICKS_CONTEXT NUMBER(7) DEFAULT 0 NULL,
  	SHOWS NUMBER(7) DEFAULT 0 NULL,
  	SHOWS_SEARCH NUMBER(7) DEFAULT 0 NULL,
  	SHOWS_CONTEXT NUMBER(7) DEFAULT 0 NULL,
  	CONSTRAINT PK_B_SEO_YANDEX_DIRECT_STAT PRIMARY KEY (ID)
  )
  /
  CREATE SEQUENCE sq_b_seo_yandex_direct_stat
  /
  CREATE UNIQUE INDEX ux_seo_yandex_direct_stat ON b_seo_yandex_direct_stat (BANNER_ID,DATE_DAY)
  /
  CREATE INDEX ix_seo_yandex_direct_stat1 ON b_seo_yandex_direct_stat (CAMPAIGN_ID)
  /
  
  CREATE TABLE b_seo_service_rtg_queue (
  	ID NUMBER(18) NOT NULL,
  	DATE_INSERT DATE DEFAULT NULL,
  	TYPE VARCHAR2(20 CHAR) NOT NULL,
  	ACCOUNT_ID VARCHAR2(15 CHAR) DEFAULT NULL,
  	AUDIENCE_ID VARCHAR2(15 CHAR) NOT NULL,
  	CONTACT_TYPE VARCHAR2(15 CHAR) NOT NULL,
  	VALUE VARCHAR2(255 CHAR) NOT NULL,
  	ACTION char(3 CHAR) NOT NULL,
  	DATE_AUTO_REMOVE DATE DEFAULT NULL,
  	PRIMARY KEY (ID)
  )
  /
  CREATE SEQUENCE sq_b_seo_service_rtg_queue
  /
  CREATE OR REPLACE TRIGGER B_SEO_SERVICE_RTG_QUEUE_INSERT
  BEFORE INSERT
  	ON b_seo_service_rtg_queue
  FOR EACH ROW
  	BEGIN
  		IF :NEW.ID IS NULL THEN
  			SELECT sq_b_seo_service_rtg_queue.NEXTVAL INTO :NEW.ID FROM DUAL;
  		END IF;
  	END;
  /
  CREATE INDEX IX_B_SEO_SRV_RTG_QUEUE_1 ON b_seo_service_rtg_queue (ACTION, DATE_AUTO_REMOVE)
  /
  CREATE INDEX IX_B_SEO_SRV_RTG_QUEUE_2 ON b_seo_service_rtg_queue (TYPE, ACTION)
  /
  
  CREATE TABLE b_seo_service_log (
  	ID NUMBER(18) NOT NULL,
  	DATE_INSERT DATE NOT NULL,
  	TYPE VARCHAR2(20 CHAR) NOT NULL,
  	CODE VARCHAR2(20 CHAR) DEFAULT NULL,
  	MESSAGE VARCHAR2(1000 CHAR) NOT NULL,
  	GROUP_ID VARCHAR2(20 CHAR) NOT NULL,
  	PRIMARY KEY (ID)
  )
  /