Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Практика. Отчет по производственной практике 2.docx
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
2 Мб
Скачать
☆

Приложение б.2.

-- Create table

create table GTM_MALDEB_MAIN

(

id NUMBER not null,

god NUMBER(4),

ytv NUMBER(1) default 0,

plan_pdf BLOB default Empty_Blob(),

plan_pdf_name VARCHAR2(150)

)

tablespace USERS

pctfree 10

initrans 1

maxtrans 255

storage

(

initial 64K

next 1M

minextents 1

maxextents unlimited

);

-- Add comments to the table

comment on table GTM_MALDEB_MAIN

is 'Информация по планам малодебитный фонд (обобщенная)';

-- Add comments to the columns

comment on column GTM_MALDEB_MAIN.id

is 'Первичный ключ';

comment on column GTM_MALDEB_MAIN.god

is 'Год';

comment on column GTM_MALDEB_MAIN.ytv

is 'Признак утверждения: 0 - не утвержден, 1 - утвержден';

comment on column GTM_MALDEB_MAIN.plan_pdf

is 'План в формате PDF';

comment on column GTM_MALDEB_MAIN.plan_pdf_name

is 'Имя файла PDF';

-- Create/Recreate primary, unique and foreign key constraints

alter table GTM_MALDEB_MAIN

add constraint PK_GTM_PLANMALDEB_MAIN_ID primary key (ID)

using index

tablespace INDX

pctfree 10

initrans 2

maxtrans 255

storage

(

initial 64K

next 1M

minextents 1

maxextents unlimited

);

Приложение б.3.

-- Create table

create table GTM_MALDEB_LOG

(

id NUMBER not null,

gtm_maldeb_id NUMBER,

date_oper DATE,

user_fio VARCHAR2(150),

user_text VARCHAR2(1500),

sname VARCHAR2(30),

login VARCHAR2(50)

)

tablespace USERS

pctfree 10

initrans 1

maxtrans 255

storage

(

initial 64K

next 1M

minextents 1

maxextents unlimited

);

-- Add comments to the table

comment on table GTM_MALDEB_LOG

is 'История изменений позиции плана малодебитный фонд';

-- Add comments to the columns

comment on column GTM_MALDEB_LOG.id

is 'Первичный ключ';

comment on column GTM_MALDEB_LOG.gtm_maldeb_id

is 'Ключ на таблицу GTM_MALDEB';

comment on column GTM_MALDEB_LOG.date_oper

is 'Дата и время';

comment on column GTM_MALDEB_LOG.user_fio

is 'ФИО пользователя';

comment on column GTM_MALDEB_LOG.user_text

is 'Текст изменений';

comment on column GTM_MALDEB_LOG.sname

is 'Краткое наименование предприятия';

comment on column GTM_MALDEB_LOG.login

is 'Доменное имя пользователя';

-- Create/Recreate primary, unique and foreign key constraints

alter table GTM_MALDEB_LOG

add constraint GTM_MALDEBLOG_ID primary key (ID)

using index

tablespace INDX

pctfree 10

initrans 2

maxtrans 255

storage

(

initial 64K

next 1M

minextents 1

maxextents unlimited

);

alter table GTM_MALDEB_LOG

add constraint GTM_MALDEBLOG_MALDEBID foreign key (GTM_MALDEB_ID)

references GTM_MALDEB (ID) on delete cascade;

Приложение б.4.

-- Create table

create table GTM_MALDEB_CHAT

(

id NUMBER not null,

gtm_maldeb_id NUMBER,

date_oper DATE,

user_fio VARCHAR2(150),

user_text VARCHAR2(1500),

sogl_sost NUMBER,

sname VARCHAR2(30),

login VARCHAR2(50)

)

tablespace USERS

pctfree 10

initrans 1

maxtrans 255

storage

(

initial 64K

next 1M

minextents 1

maxextents unlimited

);

-- Add comments to the table

comment on table GTM_MALDEB_CHAT

is 'Переписка в процессе согласования малодебитный фонд';

-- Add comments to the columns

comment on column GTM_MALDEB_CHAT.id

is 'Первичный ключ';

comment on column GTM_MALDEB_CHAT.gtm_maldeb_id

is 'Ключ на таблицу GTM_MALDEB';

comment on column GTM_MALDEB_CHAT.date_oper

is 'Дата и время';

comment on column GTM_MALDEB_CHAT.user_fio

is 'ФИО пользователя';

comment on column GTM_MALDEB_CHAT.user_text

is 'Комментарий пользователя';

comment on column GTM_MALDEB_CHAT.sogl_sost

is 'Состояние согласования которое коментируется';

comment on column GTM_MALDEB_CHAT.sname

is 'Краткое наименование предприятия';

comment on column GTM_MALDEB_CHAT.login

is 'Доменное имя пользователя';

-- Create/Recreate primary, unique and foreign key constraints

alter table GTM_MALDEB_CHAT

add constraint PK_GTM_MALDEB_CHAT_ID primary key (ID)

using index

tablespace INDX

pctfree 10

initrans 2

maxtrans 255

storage

(

initial 64K

next 1M

minextents 1

maxextents unlimited

);

alter table GTM_MALDEB_CHAT

add constraint GTM_MALDEBCHAT_MALDEBID foreign key (GTM_MALDEB_ID)

references GTM_MALDEB (ID) on delete cascade;

Приложение Б.5.

-- Create table

create table GTM_SKVMER

(

skvmer_num_mer NUMBER(4) not null,

used NUMBER(1) default 0,

kod_typemer NUMBER(2)

)

tablespace USERS

pctfree 10

initrans 1

maxtrans 255

storage

(

initial 64K

next 1M

minextents 1

maxextents unlimited

);

-- Add comments to the table

comment on table GTM_SKVMER

is 'Справочник перспективных мероприятий (малодебитный фонд)';

-- Add comments to the columns

comment on column GTM_SKVMER.skvmer_num_mer

is 'Код мероприятия';

comment on column GTM_SKVMER.used

is 'Использование в малодебитном фонде';

comment on column GTM_SKVMER.kod_typemer

is 'Код типа мероприятия';

-- Create/Recreate primary, unique and foreign key constraints

alter table GTM_SKVMER

add constraint PRIM_GTM_SKVMER primary key (SKVMER_NUM_MER)

using index

tablespace USERS

pctfree 10

initrans 2

maxtrans 255

storage

(

initial 64K

next 1M

minextents 1

maxextents unlimited

);

alter table GTM_SKVMER

add constraint FK_GTM_SKVMER foreign key (SKVMER_NUM_MER)

references alfa.SKVMER (NUM_MER_SKV);

alter table GTM_SKVMER

add constraint FK2_GTM_SKVMER foreign key (KOD_TYPEMER)

references GTM_TYPEMER (KOD_TYPEMER);

-- Grant/Revoke object privileges

grant insert, update, delete on GTM_SKVMER to ALFA;

grant insert, update, delete on GTM_SKVMER to ALFAN;

Приложение Б.6.

-- Create table

create table GTM_TYPEMER

(

kod_typemer NUMBER(2) not null,

name_typemer VARCHAR2(20)

)

tablespace USERS

pctfree 10

initrans 1

maxtrans 255

storage

(

initial 64K

next 1M

minextents 1

maxextents unlimited

);

-- Add comments to the table

comment on table GTM_TYPEMER

is 'Справочник типов мероприятий (малодебитный фонд)';

-- Add comments to the columns

comment on column GTM_TYPEMER.kod_typemer

is 'Код типа мероприятия';

comment on column GTM_TYPEMER.name_typemer

is 'Наименование типа мероприятия';

-- Create/Recreate primary, unique and foreign key constraints

alter table GTM_TYPEMER

add constraint GTM_TYPEMER_PK primary key (KOD_TYPEMER)

using index

tablespace INDX

pctfree 10

initrans 2

maxtrans 255

storage

(

initial 64K

next 1M

minextents 1

maxextents unlimited

);