-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: VaibhavModak
Message 4 in Discussion
Hi SAM,
target_percent is the desired percentage of free space left in the database file after
the database has been shrunk
Assume a database named mydb with two data files and two log files. Both data and log
files are 10 MB in size. The first data file contains 6 MB of data.
For each file, SQL Server calculates a target size, which is the size to which the
file is to be shrunk. When DBCC SHRINKDATABASE is specified with target_percent, SQL
Server calculates target size to be the target_percent amount of space free in the
file after shrinking. For example, if you specify a target_percent of 25 for shrinking
mydb. SQL Server calculates the target size for this file to be 8 MB (6 MB of data
plus 2 MB of free space). Therefore, SQL Server moves any data from the last 2 MB of
the data file to any free space in the first 8 MB of the data file and then shrinks
the file.
Assume the first data file of mydb contains 7 MB of data. Specifying target_percent of
30 allows this data file to be shrunk to the desired free percentage of 30. However,
specifying a target_percent of 40 does not shrink the data file because SQL Server
will not shrink a file to a size smaller than the data currently occupies. You can
also think of this issue another way: 40 percent desired free space + 70 percent full
data file (7 MB out of 10 MB) is greater than 100 percent. Because the desired
percentage free plus the current percentage that the data file occupies is over 100
percent (by 10 percent), any target_size greater than 30 will not shrink the data
file.
- SQL Server 2000 Books Online (BOL)
By Backing up the database, I meant you create a backup of the database files in case
something wrong happens later while working on SQL Server.
For backingup your database, you can use the Backup/Restore wizard built in SQL
Server.
Perform the following steps:
1) Open Enterprise Manager.
2) Right click on the database which you want to backup
3) Choose All Tasks-->Backup Database
4) Give a name and click Add (Destination)
5) Give a filename and the path where you want to store the backup. (Ideal extension
is .bak)
6) Go to Options tab and select the option Verify backup on completion.
7) Click ok
Your database backup will be created at the specified location.
Check the documentation for SQL Server in case you have any problem or drop a line
here in the group.
Regards,
Vaibhav Modak
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]