sysutils of informix

  1. { ********************************************************************* } 
  2. {                                   } 
  3. {           INFORMIX SOFTWARE, INC.             } 
  4. {                                   } 
  5. {   Sccsid: %W% %E% %U%                     } 
  6. {   Created:    June 1995                       } 
  7. {   Description:create system utilities database tables         } 
  8. {                                   } 
  9. { ********************************************************************* } 
  10.  
  11. set lock mode to wait; 
  12.  
  13. create database sysutils with log; 
  14. database sysutils exclusive; 
  15.  
  16. { onbar } 
  17. { active OnLine servers } 
  18. { The size of srv_name should = IDENTSIZE from rsparam.h      } 
  19. create table bar_server 
  20.     srv_name    char(128) not null,     { server name } 
  21.     srv_node    char(64) not null,  { server node } 
  22.  
  23.     primary key (srv_name) 
  24. ) lock mode row; 
  25. revoke all on bar_server from public
  26. grant select on bar_server to public
  27. grant all on bar_server to root; 
  28.  
  29. { backup objects } 
  30. { object names are unique within an OnLine server } 
  31. { The size of obj_srv_name and obj_name should = IDENTSIZE from rsparam.h.} 
  32. { The size of obj_type should = BAR_MAX_TYPE_LEN in bar.h                 } 
  33. create table bar_object 
  34.     obj_srv_name    char(128) not null references bar_server(srv_name), 
  35.                                               { which server object is from } 
  36.     obj_oid     serial,             { object identifier } 
  37.     obj_name    char(128) not null,     { name of object    } 
  38.     obj_type    char(2) not null,       { type of object:   } 
  39.                                 { B, CD, L, ND, or R } 
  40.     primary key (obj_oid) 
  41. ) lock mode row; 
  42. create unique index bar_obj_idx on bar_object(obj_srv_name, obj_name); 
  43. revoke all on bar_object from public
  44. grant select on bar_object to public
  45. grant all on bar_object to root; 
  46.  
  47. { backup or restore actions attempted against an object } 
  48. create table bar_action 
  49.     act_aid     integer not null,   { action identifier } 
  50.                         { this is not a serial to support whole system } 
  51.  
  52.     act_oid     integer not null references bar_object(obj_oid), 
  53.                                     { object identifier } 
  54.     act_type    smallint not null,  { type of action }  
  55.     act_status  integer default -1, { status of action } 
  56.     act_start   datetime year to second default CURRENT year to second
  57.                                     { time action began } 
  58.     act_end     datetime year to second default CURRENT year to second
  59.                                     { time action ended } 
  60.      
  61.     primary key (act_aid, act_oid) 
  62. ) lock mode row; 
  63. revoke all on bar_action from public
  64. grant select on bar_action to public
  65. grant all on bar_action to root; 
  66.  
  67. { successful backup actions } 
  68. create table bar_instance  
  69.     ins_aid         integer not null,   { action that created the instance } 
  70.     ins_oid         integer not null,   { object identifier } 
  71.     ins_time        integer,    { timestamp from the server } 
  72.     ins_level       smallint default 0 not null, { backup level: 0, 1, or  2 } 
  73.     ins_copyid_hi   integer not null,{ high bytes of the copyid } 
  74.     ins_copyid_lo   integer not null,{ low bytes of the copyid } 
  75.     ins_req_aid     integer not null,{aid of the required BU for an incremental} 
  76.     ins_first_log   integer not null,{ first log needed for restore } 
  77.     ins_verify              integer default 0 not null, {verified? 0=F 1=T} 
  78.     ins_verify_date         datetime year to second
  79.      
  80.     primary key (ins_aid, ins_oid), 
  81.     foreign key (ins_aid, ins_oid) references bar_action(act_aid, act_oid) 
  82. ) lock mode row; 
  83. revoke all on bar_instance from public
  84. grant select on bar_instance to public
  85. grant all on bar_instance to root; 
  86.  
  87.      
  88. {*****************************************************************************} 
  89. {*   creates the catalog for the NSM on the sysutils database                 } 
  90. {*****************************************************************************} 
  91.  
  92. { nsm managed tables } 
  93. create table msm_tdevice  
  94. (  
  95.         tdev_mid             integer,   { internal ID for the device        } 
  96.         tdev_status          integer,   { 0 = NULL, 1=IDLE, 2=READ, 3=WRITE } 
  97.         tdev_sessionid       integer    { session that has locked device    } 
  98.  
  99. ) lock mode row; 
  100. revoke all on msm_tdevice from public
  101. grant select on msm_tdevice to public
  102. grant all on msm_tdevice to informix; 
  103.  
  104. create table msm_ldevice  
  105. (  
  106.         ldev_mid             integer,   { internal ID for the device        } 
  107.         ldev_status          integer,   { 0 = NULL, 1=IDLE, 2=READ, 3=WRITE } 
  108.         ldev_sessionid       integer    { session that has locked device    } 
  109.  
  110. ) lock mode row; 
  111. revoke all on msm_ldevice from public
  112. grant select on msm_ldevice to public
  113. grant all on msm_ldevice to informix; 
  114.  
  115.  
  116. insert into msm_tdevice values (0, 1, 0); 
  117. insert into msm_ldevice values (0, 1, 0); 
  118.  
  119. create table msm_media 
  120.         med_mid             serial not null, { unique deviced ID a serial value } 
  121.         med_int_label       nchar(120),       { Internal Label for the tape      } 
  122.         med_ext_label       nchar(120),       { External Label for the tape      } 
  123.         med_type            char(1),          { T=TAPE, F=FILE                  } 
  124.  
  125.         primary key (med_mid) 
  126.  
  127. ) lock mode row; 
  128.  
  129. revoke all on msm_media from public
  130. grant select on msm_media to public
  131. grant all on msm_media to informix; 
  132.  
  133.          
  134. create table msm_object 
  135.         obj_oid            serial,     { unique Object ID for a session     } 
  136.         obj_name           char(1024), { name as given by onbar             } 
  137.         obj_pathname       char(1024), { server as presented by onbar       } 
  138.         obj_status         char(1),    { A=Active, I=Inactive               } 
  139.         obj_type           char(1),    { D=DBSPACE, L=LOG                   } 
  140.         obj_copy_id_hi     integer,      
  141.         obj_copy_id_lo     integer,      
  142.                                        { msm id for object                  } 
  143.  
  144.         primary key (obj_oid) 
  145. ) lock mode row; 
  146. revoke all on msm_object from public
  147. grant select on msm_object to public
  148. grant all on msm_object to informix; 
  149.  
  150.  
  151. create table msm_location 
  152.         loc_mid             integer references msm_media(med_mid),  { unique device Id      } 
  153.         loc_oid             integer references msm_object(obj_oid), { unique object Id      } 
  154.         loc_seqNo           integer not null                        { Object fragment No.   } 
  155. ) lock mode row; 
  156. revoke all on msm_location from public
  157. grant select on msm_location to public
  158. grant all on msm_location to informix; 
  159.  
  160. grant connect to public
  161. grant dba to root; 
  162. close database

本日志由 flyinweb 于 2009-09-03 18:29:05 发表,目前已经被浏览 264 次,评论 0 次;

作者添加了以下标签: sysutilsINFORMIX

引用通告:http://www.517sou.net/Article/226/Trackback.ashx

评论订阅:http://www.517sou.net/Article/226/Feeds.ashx

相关文章

评论列表

    暂时没有评论
(必填)
(必填,不会被公开)