create table AS.DOMAINS ( NAME NVARCHAR(256) NOT NULL, NAME_N NVARCHAR(256) NOT NULL, "DESC" NVARCHAR(256) NOT NULL, IS_CS_USERID NCHAR(1) NOT NULL, IS_DQ_USERID NCHAR(1) NOT NULL, IS_UPN_USERID NCHAR(1) NOT NULL ); create table AS.USERS ( ID NCHAR(32) NOT NULL, NAME NVARCHAR(256) NOT NULL, NAME_N NVARCHAR(256) NOT NULL, "DESC" NVARCHAR(256) NOT NULL, ENABLED NCHAR(1) NOT NULL ); create table AS.LOGINS ( FQLN NVARCHAR(256) NOT NULL, DOMAIN_N NVARCHAR(256) NOT NULL, NAME NVARCHAR(256) NOT NULL, USER_ID NCHAR(32) NOT NULL ); create table AS.GROUPS ( ID NCHAR(32) NOT NULL, NAME NVARCHAR(256) NOT NULL, NAME_N NVARCHAR(256) NOT NULL, "DESC" NVARCHAR(256) NOT NULL, OWNER_ID NCHAR(32) );
create table META.DOMAINS ( ID NCHAR(17) NOT NULL, AS_ID NVARCHAR(128), NAME NVARCHAR(60) NOT NULL, NAME_N NVARCHAR(60) NOT NULL, "DESC" NVARCHAR(200) NOT NULL, OUTBOUND_ONLY NCHAR(1) NOT NULL, TRUSTED_ONLY NCHAR(1) NOT NULL ); create table META.USERS ( ID NCHAR(17) NOT NULL, AS_ID NCHAR(32), NAME NVARCHAR(60) NOT NULL, NAME_N NVARCHAR(60) NOT NULL, "DESC" NVARCHAR(200) NOT NULL ); create table META.LOGINS ( ID NCHAR(17) NOT NULL, AS_ID NVARCHAR(128), FQLN NVARCHAR(128) NOT NULL, NAME NVARCHAR(60) NOT NULL, "DESC" NVARCHAR(200) NOT NULL, DOMAIN_ID NCHAR(17) NOT NULL, OWNER_ID NCHAR(17) NOT NULL, TRUSTED_ONLY NCHAR(1) NOT NULL ); create table META.GROUPS ( ID NCHAR(17) NOT NULL, AS_ID NVARCHAR(32), NAME NVARCHAR(60) NOT NULL, NAME_N NVARCHAR(60) NOT NULL, "DESC" NVARCHAR(200) NOT NULL );
Table or View
|
Description
|
---|---|
X.DOMAIN_MAP
|
Current working set
of domain object mappings.
|
X.USER_MAP
|
Current working set
of user object mappings.
|
X.GROUP_MAP
|
Current working set
of group object mappings.
|
X.AS_LOGINS_N
|
View of AS.LOGINS with
normalized fully qualified login name column, FQLN_N.
|
X.MS_LOGINS_N
|
View of META.LOGINS
with normalized fully qualified login name, FQLN_N.
|
create table X.DOMAIN_MAP ( AS_NAME NVARCHAR(256) NOT NULL, AS_NAME_N NVARCHAR(256) NOT NULL, AS_DESC NVARCHAR(256) NOT NULL, AS_IS_CS_USERID NCHAR(1) NOT NULL, AS_IS_DQ_USERID NCHAR(1) NOT NULL, AS_IS_UPN_USERID NCHAR(1) NOT NULL, META_ID NCHAR(17), META_AS_ID NVARCHAR(128), META_NAME NVARCHAR(60) NOT NULL, META_NAME_N NVARCHAR(60) NOT NULL, META_DESC NVARCHAR(200) NOT NULL, META_OUTBOUND_ONLY NCHAR(1) NOT NULL, META_TRUSTED_ONLY NCHAR(1) NOT NULL ); create table X.USER_MAP ( AS_ID NCHAR(32) NOT NULL, AS_NAME NVARCHAR(256) NOT NULL, AS_NAME_N NVARCHAR(256) NOT NULL, AS_DESC NVARCHAR(256) NOT NULL, AS_ENABLED NCHAR(1) NOT NULL, META_ID NCHAR(17), META_AS_ID NCHAR(32), META_NAME NVARCHAR(60) NOT NULL, META_NAME_N NVARCHAR(60) NOT NULL, META_DESC NVARCHAR(200) NOT NULL ); create table X.GROUP_MAP ( AS_ID NCHAR(32) NOT NULL, AS_NAME NVARCHAR(256) NOT NULL, AS_NAME_N NVARCHAR(256) NOT NULL, AS_DESC NVARCHAR(256) NOT NULL, AS_OWNER_ID NCHAR(32), META_ID NCHAR(17), META_AS_ID NCHAR(32), META_NAME NVARCHAR(60) NOT NULL, META_NAME_N NVARCHAR(60) NOT NULL, META_DESC NVARCHAR(200) NOT NULL ); create view X.AS_LOGINS_N as select AL.*, case when (DX.AS_IS_DQ_USERID || DX.AS_IS_CS_USERID) = 'FF' then upper(AL.NAME) when (DX.AS_IS_DQ_USERID || DX.AS_IS_CS_USERID) = 'FT' then AL.NAME when (DX.AS_IS_DQ_USERID || DX.AS_IS_CS_USERID) = 'TF' then upper(AL.NAME) || '@' || AL.DOMAIN_N else AL.NAME || '@' || AL.DOMAIN_N end as "FQLN_N" from AS.LOGINS AL, X.DOMAIN_MAP_ALL DX where AL.DOMAIN_N = DX.AS_NAME_N ; create view X.MS_LOGINS_N as select ML.*, case when (DX.AS_IS_DQ_USERID || DX.AS_IS_CS_USERID) = 'FF' then upper(ML.NAME) when (DX.AS_IS_DQ_USERID || DX.AS_IS_CS_USERID) = 'FT' then ML.NAME when (DX.AS_IS_DQ_USERID || DX.AS_IS_CS_USERID) = 'TF' then upper(ML.NAME) || '@' || DX.AS_NAME_N else ML.NAME || '@' || DX.AS_NAME_N end as "FQLN_N" from META.LOGINS ML, X.DOMAIN_MAP_ALL DX where ML.DOMAIN_ID = DX.META_ID ;