  /*
      CHANGE REPORT for Table SYSTEMUSER
 	- Adding column LASTLOGINTIMESTAMP
          - Adding column PASSWORDCHANGETIMESTAMP
          - Adding column PASSWORDEXPIRES
          - Adding column CHANGEPASSWORDNEXLOGIN
          - Adding column LOCKEDOUT
          - Adding column LASTLOGINATWORKSTATION
          - Adding column LASTLOGINATAPPSERVER
          - Adding column LASTINCORRECTLOGINTIMESTAMP
          - Adding column INCORRECTLOGINSSINCEPWCHANGE
          - Adding column LOGGEDIN
      ACTION is ALTER or modify Table SYSTEMUSER
      */

--ALTER TABLE SYSTEMUSER ADD (LASTLOGINTIMESTAMP DATE NULL);

ALTER TABLE SYSTEMUSER ADD (PASSWORDCHANGETIMESTAMP DATE NULL);


ALTER TABLE SYSTEMUSER ADD (PASSWORDEXPIRES NUMBER DEFAULT 30 NOT NULL);


ALTER TABLE SYSTEMUSER ADD (CHANGEPASSWORDNEXLOGIN VARCHAR2(1) DEFAULT 'N' NOT NULL
                                   CONSTRAINT YN_VALIDATIONNEW86
                                          CHECK (CHANGEPASSWORDNEXLOGIN IN ('Y',
     'N')));


ALTER TABLE SYSTEMUSER ADD (LOCKEDOUT VARCHAR2(1) DEFAULT 'N' NOT NULL
                                   CONSTRAINT YN_VALIDATIONNEW87
                                          CHECK (LOCKEDOUT IN ('Y', 'N')));


ALTER TABLE SYSTEMUSER ADD (LASTLOGINATWORKSTATION NUMBER NULL);


ALTER TABLE SYSTEMUSER ADD (LASTLOGINATAPPSERVER NUMBER NULL);


ALTER TABLE SYSTEMUSER ADD (LASTINCORRECTLOGINTIMESTAMP DATE NULL);


ALTER TABLE SYSTEMUSER ADD (INCORRECTLOGINSSINCEPWCHANGE NUMBER DEFAULT 0 NOT 
    NULL);


ALTER TABLE SYSTEMUSER ADD (LOGGEDIN             NUMBER DEFAULT 0 NOT NULL);


update SYSTEMUSER systemuser 
	set systemuser.PASSWORDEXPIRES = 30,
	systemuser.CHANGEPASSWORDNEXLOGIN = 'N', 
	systemuser.LOCKEDOUT = 'N', 
	systemuser.INCORRECTLOGINSSINCEPWCHANGE = 0,
	systemuser.LOGGEDIN = 0 ;

      
      /*
      CHANGE REPORT for Table USERGROUP
          - Adding column PASSWORDREQUIRED
          - Adding column MULTIPLELOGINALLOWED
          - Adding column PASSWORDCHANGEALLOWED
          - Adding column PASSWORDCOMPLEXITY
          - Adding column MINPASSWORDLENGTH
      ACTION is ALTER or modify Table USERGROUP
      */

ALTER TABLE USERGROUP ADD (PASSWORDREQUIRED     NUMBER DEFAULT 0 NOT NULL);

COMMENT ON COLUMN USERGROUP.PASSWORDREQUIRED IS '0 = Optional 
1 = Mandatory';

ALTER TABLE USERGROUP ADD (MULTIPLELOGINALLOWED NUMBER DEFAULT 0 NOT NULL);

COMMENT ON COLUMN USERGROUP.PASSWORDREQUIRED IS '0 – No check on multiple login
1 – Always check on multiple login';


ALTER TABLE USERGROUP ADD (PASSWORDCHANGEALLOWED NUMBER DEFAULT 0 NOT NULL);

COMMENT ON COLUMN USERGROUP.PASSWORDREQUIRED IS '0 – Do not show option in menu
1 – Show option in menu';


ALTER TABLE USERGROUP ADD (PASSWORDCOMPLEXITY   NUMBER DEFAULT 1 NOT NULL);

COMMENT ON COLUMN USERGROUP.PASSWORDREQUIRED IS '0 – No checks on password.
1 – Minimum length (in combination with attribute MinPasswordLenght.
2 – Use Microsofts password complexity.';

ALTER TABLE USERGROUP ADD (MINPASSWORDLENGTH    NUMBER DEFAULT 8 NOT NULL);

COMMENT ON COLUMN USERGROUP.PASSWORDREQUIRED IS '0 – No check on length of password. 
1 ..20 – Password should have a length of at least n characters.';

update USERGROUP  
	set PASSWORDREQUIRED = 0,
	MULTIPLELOGINALLOWED= 0, 
	PASSWORDCHANGEALLOWED= 0, 
	PASSWORDCOMPLEXITY= 1,
	MINPASSWORDLENGTH= 8 ;