update SYSPARAMETERS set VALUESTRING = '1'  where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionHigh'
/

update SYSPARAMETERS set VALUESTRING = '165' where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionLow'
/

update SYSPARAMETERS set VALUESTRING = '2006-02-27' where CONTEXT = 'SYSTEMINFO' and name = 'DBCreationDate'
/

alter table users
   add (manageOwnUsersSystemViews integer,
    manageVirtualDocumentQueries integer,
    allowManageSystemViewType integer,
    systemViewTypeId integer)
/

update users
   set manageOwnUsersSystemViews = 0,
   	   manageVirtualDocumentQueries = 0,
       allowManageSystemViewType = 0,
       systemViewTypeId = 2
/

drop index INDEX_9
/

drop index INDEX_12
/

alter table users modify ( username varchar2(62) )
/

alter table users modify ( lastname varchar2(199) )
/

alter table users modify ( firstname varchar2(199) )
/

alter table groups modify ( name varchar2(62) )
/

alter table groups modify ( name_key varchar2(199) )
/

alter table groups modify ( description varchar2(199) )
/

alter table groups modify ( descr_key varchar2(199) )
/

create unique index INDEX_12 on GROUPS(
NAME asc
)
/

create unique index INDEX_9 on USERS(
USERNAME asc,
EXTERNALSERVERID asc
)
/

commit
/

