The file is relatively simple compared to the user size restriction.
alter database test
name = 'test_datafile1'
,MaxSize = 5 GB
With the user restriction you may try one of the following based upon your database design.
- Log the row owner and calculate the size of the row based on the datatype(s) and their corresponding storage requirements. Then multiply by the number of rows that the user 'owns'
- query the size of the table that the user 'owns' to determine if they have exceeded the limit.
It is a little difficult to say which way would work best because if all user data is in the same table versus separate tables then the approach will be entirely different.