CREATE TABLE OM_PARAM_ORG (
  NRORG NUMBER(10) NOT NULL, 
  DTINCLUSAO DATE DEFAULT NULL NULL, 
  DTULTATU DATE DEFAULT NULL NULL, 
  NRORGINCLUSAO NUMBER(10) DEFAULT NULL NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT NULL NULL, 
  NRORGULTATU NUMBER(10) DEFAULT NULL NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT NULL NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NOT NULL, 
  IDUTIPRESTRICTION VARCHAR2(1) DEFAULT 'S' NOT NULL,
  CONSTRAINT PK_OM_PARAM_ORG PRIMARY KEY(NRORG)
)
/
ALTER TABLE OM_PARAM_ORG ADD CONSTRAINT CKC_IDATIVO_OM_PARAM_ORG CHECK (IDATIVO IN ('S','N'))
/
ALTER TABLE OM_PARAM_ORG ADD CONSTRAINT CKC_IDUTIPRESTR_OM_PARAM_ORG CHECK (IDUTIPRESTRICTION IN ('S','N'))
/
CREATE TABLE OM_IP_RESTRICTION (
  NRORG NUMBER(10) NOT NULL, 
  DTINCLUSAO DATE DEFAULT NULL NULL, 
  DTULTATU DATE DEFAULT NULL NULL, 
  NRORGINCLUSAO NUMBER(10) DEFAULT NULL NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT NULL NULL, 
  NRORGULTATU NUMBER(10) DEFAULT NULL NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT NULL NULL, 
  NR_IP_RESTRICTION NUMBER(10) NOT NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NOT NULL, 
  DS_IPV4_RESTRICTED VARCHAR2(20) DEFAULT NULL NULL, 
  DS_IPV6_RESTRICTED VARCHAR2(50) DEFAULT NULL NULL, 
  DS_OBS_IP_RESTRICTED VARCHAR2(400) DEFAULT NULL NULL,
  CONSTRAINT PK_OM_IP_RESTRICTION PRIMARY KEY(NR_IP_RESTRICTION, NRORG)
)
/
ALTER TABLE OM_IP_RESTRICTION ADD CONSTRAINT CKC_IDATIVO_OM_IP_RESTRICTION CHECK (IDATIVO IN ('S','N'))