Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database space

Status
Not open for further replies.

New1

IS-IT--Management
Jun 13, 2001
2
US
Hi,
While creating a new database for your enterprise while you have existing databases and you want to calculate how much space available for you which permanent space is to be taken into consideration, maxperm or currentperm , i.e.
you substract the current/max perm of the existing databases from the sysadmin user.
 
Database space is allocated at create time (i.e., sysadmin is decreased by the amount of maxperm specified in the Create Database statement). CurrentPerm reflects the amount of that allocated space actually used for data.

Hope this helps
 
Also if when you subtract your new Databases MaxPerm value from the Parent databases MAX Perm and you would go below Current perm of the Parent database you will get an error on the create Database.

The system will never allow your MAXPERM to go below Current Perm.

for example you have a database ( from exec showspace )

user MaxPerm CurrPerm
SysAdmin 40,000,000 23,815,104

Create database Sysadmin2 from Sysadmin as PERM= 17e6;

would give an error

The request to assign new PERMANENT space is invalid.

because you only have 16 Meg and change available to give away.


If you need to give more space away than you have between MaxPerm and Current Perm, you will have to delete some of your tables from that database to lower your current perm.

So in this case you would have to delete more than 815,104 bytes to get current perm below 23 Meg to allow you to give away 17 Meg of the 40 Meg allocation.



However if you issued

Create database Sysadmin2 from Sysadmin as PERM= 10e6;

It would work just fine and exec showspace would show

user MaxPerm CurrPerm
SysAdmin 30,000,000 23,815,104
SysAdmin2 10,000,000 0

That 10 Meg would be deducted from SysAdmin and given to SysAdmin2.

Conversely when you

Drop Database Sysadmin2;

That 10 Meg would go back to SysAdmin.


user MaxPerm CurrPerm
SysAdmin 40,000,000 23,815,104

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top