Thursday, March 8, 2012
Bug in DBCC SHRINKDATABASE ?
My real DB size is 5 MB and transaction log 30 MB. But transaction log
allocated 900 MB. And if I run
DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
it does not shrink me transaction log neither a bit. Why ????
I do not want to have so big transaction log.
BJ
Run DBCC SHRINKFILE instead
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> Hi,
> My real DB size is 5 MB and transaction log 30 MB. But transaction log
> allocated 900 MB. And if I run
> DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> it does not shrink me transaction log neither a bit. Why
????
> I do not want to have so big transaction log.
|||I tried
DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
and nothing happened.
"Uri Dimant" wrote:
> BJ
> Run DBCC SHRINKFILE instead
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> ????
>
>
|||B.J
What are you really trying to do?
You have emptied the file, have you tried to remove it by using EM?
Are you trying to reduce the size of the log file?
Are you trying to delete/remove the log file?
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...[vbcol=seagreen]
> I tried
> DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> and nothing happened.
> "Uri Dimant" wrote:
|||I want to reduce transaction log size.
when I right click my database and point to all task / shrink database / files
then I have :
Data
current size : 5 MB
Space used : 4 MB
Log
current size : 900,62 MB
Space used : 33,4 MB
And this does not like me. I have allocated to much size. I want to truncate
log to 35 MB. I did all combination of options in all task / shrink database
and no result and also I have not set minimal transaction log so I do not
know wehre is problem.
Hope I said you what you want.
"Uri Dimant" wrote:
> B.J
> What are you really trying to do?
> You have emptied the file, have you tried to remove it by using EM?
> Are you trying to reduce the size of the log file?
> Are you trying to delete/remove the log file?
>
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
>
>
|||BJ
1) Backup Log file (to truncate a commited transaction (inactive portion)
2) Run DBCC SHRINKFILE
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database /
files
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
truncate
> log to 35 MB. I did all combination of options in all task / shrink
database[vbcol=seagreen]
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
log[vbcol=seagreen]
|||Hi B.J.
Try to look up BACKUP LOG and DBCC SHRINKFILE in BOL and make sure that you
do the right things. It could be that you haven't truncated the logfile
correctly and/or haven't shrinked the logfile but the database.
Regards
Steen
B.J. wrote:[vbcol=seagreen]
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink
> database / files then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
> truncate log to 35 MB. I did all combination of options in all task /
> shrink database and no result and also I have not set minimal
> transaction log so I do not know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
|||B J
Have a look at these articles on shrinking the Transaction log.
INF: How to Shrink the SQL Server 7.0 Transaction Log
http://support.microsoft.com/default...b;en-us;256650
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/default...b;en-us;272318
http://www.mssqlserver.com/faq/logs-shrinklog.asp
Usually a transaction log only needs to be around 10 - 20% of the size of
the database. I assume you have a database in Full recovery mode and you do
not perform transaction log backups. Either set your database to simple
recovery mode or start taking regular transaction log backups.
Hope this helps
John
"B.J." wrote:
[vbcol=seagreen]
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database / files
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to truncate
> log to 35 MB. I did all combination of options in all task / shrink database
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
|||I did it and nothing. Read all about how to truncate log from help which is
installed to SQL Server 2000 but it does not work.
"Uri Dimant" wrote:
> BJ
> 1) Backup Log file (to truncate a commited transaction (inactive portion)
> 2) Run DBCC SHRINKFILE
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> files
> truncate
> database
> log
>
>
Bug in DBCC SHRINKDATABASE ?
My real DB size is 5 MB and transaction log 30 MB. But transaction log
allocated 900 MB. And if I run
DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
it does not shrink me transaction log neither a bit. Why '''?
I do not want to have so big transaction log.BJ
Run DBCC SHRINKFILE instead
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> Hi,
> My real DB size is 5 MB and transaction log 30 MB. But transaction log
> allocated 900 MB. And if I run
> DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> it does not shrink me transaction log neither a bit. Why
'''?
> I do not want to have so big transaction log.|||I tried
DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
and nothing happened.
"Uri Dimant" wrote:
> BJ
> Run DBCC SHRINKFILE instead
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> '''?
>
>|||B.J
What are you really trying to do?
You have emptied the file, have you tried to remove it by using EM?
Are you trying to reduce the size of the log file?
Are you trying to delete/remove the log file?
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...[vbcol=seagreen]
> I tried
> DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> and nothing happened.
> "Uri Dimant" wrote:
>|||I want to reduce transaction log size.
when I right click my database and point to all task / shrink database / fil
es
then I have :
Data
current size : 5 MB
Space used : 4 MB
Log
current size : 900,62 MB
Space used : 33,4 MB
And this does not like me. I have allocated to much size. I want to truncate
log to 35 MB. I did all combination of options in all task / shrink database
and no result and also I have not set minimal transaction log so I do not
know wehre is problem.
Hope I said you what you want.
"Uri Dimant" wrote:
> B.J
> What are you really trying to do?
> You have emptied the file, have you tried to remove it by using EM?
> Are you trying to reduce the size of the log file?
> Are you trying to delete/remove the log file?
>
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
>
>|||BJ
1) Backup Log file (to truncate a commited transaction (inactive portion)
2) Run DBCC SHRINKFILE
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database /
files
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
truncate
> log to 35 MB. I did all combination of options in all task / shrink
database[vbcol=seagreen]
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
>
log[vbcol=seagreen]|||Hi B.J.
Try to look up BACKUP LOG and DBCC SHRINKFILE in BOL and make sure that you
do the right things. It could be that you haven't truncated the logfile
correctly and/or haven't shrinked the logfile but the database.
Regards
Steen
B.J. wrote:[vbcol=seagreen]
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink
> database / files then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
> truncate log to 35 MB. I did all combination of options in all task /
> shrink database and no result and also I have not set minimal
> transaction log so I do not know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
>|||B J
Have a look at these articles on shrinking the Transaction log.
INF: How to Shrink the SQL Server 7.0 Transaction Log
http://support.microsoft.com/defaul...kb;en-us;256650
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/defaul...kb;en-us;272318
http://www.mssqlserver.com/faq/logs-shrinklog.asp
Usually a transaction log only needs to be around 10 - 20% of the size of
the database. I assume you have a database in Full recovery mode and you do
not perform transaction log backups. Either set your database to simple
recovery mode or start taking regular transaction log backups.
Hope this helps
John
"B.J." wrote:
[vbcol=seagreen]
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database / f
iles
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to trunca
te
> log to 35 MB. I did all combination of options in all task / shrink databa
se
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
>|||I did it and nothing. Read all about how to truncate log from help which is
installed to SQL Server 2000 but it does not work.
"Uri Dimant" wrote:
> BJ
> 1) Backup Log file (to truncate a commited transaction (inactive portion)
> 2) Run DBCC SHRINKFILE
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> files
> truncate
> database
> log
>
>
Bug in DBCC SHRINKDATABASE ?
My real DB size is 5 MB and transaction log 30 MB. But transaction log
allocated 900 MB. And if I run
DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
it does not shrink me transaction log neither a bit. Why '''?
I do not want to have so big transaction log.BJ
Run DBCC SHRINKFILE instead
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> Hi,
> My real DB size is 5 MB and transaction log 30 MB. But transaction log
> allocated 900 MB. And if I run
> DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> it does not shrink me transaction log neither a bit. Why
'''?
> I do not want to have so big transaction log.|||I tried
DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
and nothing happened.
"Uri Dimant" wrote:
> BJ
> Run DBCC SHRINKFILE instead
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > Hi,
> >
> > My real DB size is 5 MB and transaction log 30 MB. But transaction log
> > allocated 900 MB. And if I run
> >
> > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> >
> > it does not shrink me transaction log neither a bit. Why
> '''?
> > I do not want to have so big transaction log.
>
>|||B.J
What are you really trying to do?
You have emptied the file, have you tried to remove it by using EM?
Are you trying to reduce the size of the log file?
Are you trying to delete/remove the log file?
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
> I tried
> DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> and nothing happened.
> "Uri Dimant" wrote:
> > BJ
> > Run DBCC SHRINKFILE instead
> >
> > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > > Hi,
> > >
> > > My real DB size is 5 MB and transaction log 30 MB. But transaction log
> > > allocated 900 MB. And if I run
> > >
> > > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> > >
> > > it does not shrink me transaction log neither a bit. Why
> > '''?
> > > I do not want to have so big transaction log.
> >
> >
> >|||I want to reduce transaction log size.
when I right click my database and point to all task / shrink database / files
then I have :
Data
current size : 5 MB
Space used : 4 MB
Log
current size : 900,62 MB
Space used : 33,4 MB
And this does not like me. I have allocated to much size. I want to truncate
log to 35 MB. I did all combination of options in all task / shrink database
and no result and also I have not set minimal transaction log so I do not
know wehre is problem.
Hope I said you what you want.
"Uri Dimant" wrote:
> B.J
> What are you really trying to do?
> You have emptied the file, have you tried to remove it by using EM?
> Are you trying to reduce the size of the log file?
> Are you trying to delete/remove the log file?
>
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
> > I tried
> >
> > DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> >
> > and nothing happened.
> >
> > "Uri Dimant" wrote:
> >
> > > BJ
> > > Run DBCC SHRINKFILE instead
> > >
> > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > > > Hi,
> > > >
> > > > My real DB size is 5 MB and transaction log 30 MB. But transaction log
> > > > allocated 900 MB. And if I run
> > > >
> > > > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> > > >
> > > > it does not shrink me transaction log neither a bit. Why
> > > '''?
> > > > I do not want to have so big transaction log.
> > >
> > >
> > >
>
>|||BJ
1) Backup Log file (to truncate a commited transaction (inactive portion)
2) Run DBCC SHRINKFILE
"B.J." <BJ@.discussions.microsoft.com> wrote in message
news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database /
files
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
truncate
> log to 35 MB. I did all combination of options in all task / shrink
database
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
> > B.J
> > What are you really trying to do?
> > You have emptied the file, have you tried to remove it by using EM?
> >
> > Are you trying to reduce the size of the log file?
> >
> > Are you trying to delete/remove the log file?
> >
> >
> >
> >
> >
> >
> > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
> > > I tried
> > >
> > > DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> > >
> > > and nothing happened.
> > >
> > > "Uri Dimant" wrote:
> > >
> > > > BJ
> > > > Run DBCC SHRINKFILE instead
> > > >
> > > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > > news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > > > > Hi,
> > > > >
> > > > > My real DB size is 5 MB and transaction log 30 MB. But transaction
log
> > > > > allocated 900 MB. And if I run
> > > > >
> > > > > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> > > > >
> > > > > it does not shrink me transaction log neither a bit. Why
> > > > '''?
> > > > > I do not want to have so big transaction log.
> > > >
> > > >
> > > >
> >
> >
> >|||Hi B.J.
Try to look up BACKUP LOG and DBCC SHRINKFILE in BOL and make sure that you
do the right things. It could be that you haven't truncated the logfile
correctly and/or haven't shrinked the logfile but the database.
Regards
Steen
B.J. wrote:
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink
> database / files then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to
> truncate log to 35 MB. I did all combination of options in all task /
> shrink database and no result and also I have not set minimal
> transaction log so I do not know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
>> B.J
>> What are you really trying to do?
>> You have emptied the file, have you tried to remove it by using EM?
>> Are you trying to reduce the size of the log file?
>> Are you trying to delete/remove the log file?
>>
>>
>>
>> "B.J." <BJ@.discussions.microsoft.com> wrote in message
>> news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
>> I tried
>> DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
>> and nothing happened.
>> "Uri Dimant" wrote:
>> BJ
>> Run DBCC SHRINKFILE instead
>> "B.J." <BJ@.discussions.microsoft.com> wrote in message
>> news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
>> Hi,
>> My real DB size is 5 MB and transaction log 30 MB. But
>> transaction log allocated 900 MB. And if I run
>> DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
>> it does not shrink me transaction log neither a bit. Why
>> '''? I do not want to have so big transaction log.|||B J
Have a look at these articles on shrinking the Transaction log.
INF: How to Shrink the SQL Server 7.0 Transaction Log
http://support.microsoft.com/default.aspx?scid=kb;en-us;256650
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/default.aspx?scid=kb;en-us;272318
http://www.mssqlserver.com/faq/logs-shrinklog.asp
Usually a transaction log only needs to be around 10 - 20% of the size of
the database. I assume you have a database in Full recovery mode and you do
not perform transaction log backups. Either set your database to simple
recovery mode or start taking regular transaction log backups.
Hope this helps
John
"B.J." wrote:
> I want to reduce transaction log size.
> when I right click my database and point to all task / shrink database / files
> then I have :
> Data
> current size : 5 MB
> Space used : 4 MB
> Log
> current size : 900,62 MB
> Space used : 33,4 MB
>
> And this does not like me. I have allocated to much size. I want to truncate
> log to 35 MB. I did all combination of options in all task / shrink database
> and no result and also I have not set minimal transaction log so I do not
> know wehre is problem.
> Hope I said you what you want.
> "Uri Dimant" wrote:
> > B.J
> > What are you really trying to do?
> > You have emptied the file, have you tried to remove it by using EM?
> >
> > Are you trying to reduce the size of the log file?
> >
> > Are you trying to delete/remove the log file?
> >
> >
> >
> >
> >
> >
> > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
> > > I tried
> > >
> > > DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> > >
> > > and nothing happened.
> > >
> > > "Uri Dimant" wrote:
> > >
> > > > BJ
> > > > Run DBCC SHRINKFILE instead
> > > >
> > > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > > news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > > > > Hi,
> > > > >
> > > > > My real DB size is 5 MB and transaction log 30 MB. But transaction log
> > > > > allocated 900 MB. And if I run
> > > > >
> > > > > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> > > > >
> > > > > it does not shrink me transaction log neither a bit. Why
> > > > '''?
> > > > > I do not want to have so big transaction log.
> > > >
> > > >
> > > >
> >
> >
> >|||I did it and nothing. Read all about how to truncate log from help which is
installed to SQL Server 2000 but it does not work.
"Uri Dimant" wrote:
> BJ
> 1) Backup Log file (to truncate a commited transaction (inactive portion)
> 2) Run DBCC SHRINKFILE
>
>
> "B.J." <BJ@.discussions.microsoft.com> wrote in message
> news:4E607247-C485-468F-B5E7-7EAFAA1C03D9@.microsoft.com...
> > I want to reduce transaction log size.
> >
> > when I right click my database and point to all task / shrink database /
> files
> > then I have :
> > Data
> > current size : 5 MB
> > Space used : 4 MB
> >
> > Log
> > current size : 900,62 MB
> > Space used : 33,4 MB
> >
> >
> > And this does not like me. I have allocated to much size. I want to
> truncate
> > log to 35 MB. I did all combination of options in all task / shrink
> database
> > and no result and also I have not set minimal transaction log so I do not
> > know wehre is problem.
> > Hope I said you what you want.
> >
> > "Uri Dimant" wrote:
> >
> > > B.J
> > > What are you really trying to do?
> > > You have emptied the file, have you tried to remove it by using EM?
> > >
> > > Are you trying to reduce the size of the log file?
> > >
> > > Are you trying to delete/remove the log file?
> > >
> > >
> > >
> > >
> > >
> > >
> > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
> > > > I tried
> > > >
> > > > DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> > > >
> > > > and nothing happened.
> > > >
> > > > "Uri Dimant" wrote:
> > > >
> > > > > BJ
> > > > > Run DBCC SHRINKFILE instead
> > > > >
> > > > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > > > news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > > > > > Hi,
> > > > > >
> > > > > > My real DB size is 5 MB and transaction log 30 MB. But transaction
> log
> > > > > > allocated 900 MB. And if I run
> > > > > >
> > > > > > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> > > > > >
> > > > > > it does not shrink me transaction log neither a bit. Why
> > > > > '''?
> > > > > > I do not want to have so big transaction log.
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||Thank you,
KB help me, exactly
DBCC SHRINKFILE('N_Log', 0);
BACKUP LOG N WITH TRUNCATE_ONLY
DBCC SHRINKFILE('N', 0);
Have a nice day :)
"John Bandettini" wrote:
> B J
> Have a look at these articles on shrinking the Transaction log.
> INF: How to Shrink the SQL Server 7.0 Transaction Log
> http://support.microsoft.com/default.aspx?scid=kb;en-us;256650
> INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
> http://support.microsoft.com/default.aspx?scid=kb;en-us;272318
> http://www.mssqlserver.com/faq/logs-shrinklog.asp
> Usually a transaction log only needs to be around 10 - 20% of the size of
> the database. I assume you have a database in Full recovery mode and you do
> not perform transaction log backups. Either set your database to simple
> recovery mode or start taking regular transaction log backups.
> Hope this helps
> John
> "B.J." wrote:
> > I want to reduce transaction log size.
> >
> > when I right click my database and point to all task / shrink database / files
> > then I have :
> > Data
> > current size : 5 MB
> > Space used : 4 MB
> >
> > Log
> > current size : 900,62 MB
> > Space used : 33,4 MB
> >
> >
> > And this does not like me. I have allocated to much size. I want to truncate
> > log to 35 MB. I did all combination of options in all task / shrink database
> > and no result and also I have not set minimal transaction log so I do not
> > know wehre is problem.
> > Hope I said you what you want.
> >
> > "Uri Dimant" wrote:
> >
> > > B.J
> > > What are you really trying to do?
> > > You have emptied the file, have you tried to remove it by using EM?
> > >
> > > Are you trying to reduce the size of the log file?
> > >
> > > Are you trying to delete/remove the log file?
> > >
> > >
> > >
> > >
> > >
> > >
> > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > news:8404C0B7-1D3C-4B71-B22B-D5EEC6C12A69@.microsoft.com...
> > > > I tried
> > > >
> > > > DBCC SHRINKFILE ('IDFROMSysfile..', EMPTYFILE);
> > > >
> > > > and nothing happened.
> > > >
> > > > "Uri Dimant" wrote:
> > > >
> > > > > BJ
> > > > > Run DBCC SHRINKFILE instead
> > > > >
> > > > > "B.J." <BJ@.discussions.microsoft.com> wrote in message
> > > > > news:0D8B571A-0F7D-4F47-AD2C-3B1FEEB7924B@.microsoft.com...
> > > > > > Hi,
> > > > > >
> > > > > > My real DB size is 5 MB and transaction log 30 MB. But transaction log
> > > > > > allocated 900 MB. And if I run
> > > > > >
> > > > > > DBCC SHRINKDATABASE (MyDB, 0, TRUNCATEONLY)
> > > > > >
> > > > > > it does not shrink me transaction log neither a bit. Why
> > > > > '''?
> > > > > > I do not want to have so big transaction log.
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
Thursday, February 16, 2012
Bring Online (Missing Transaction Log)
is fine. If I try to bring it online I get an error 5181 due to the missing
file.
Is there anyway to get the database going again without the transaction log?
Cheers,
elzikoHi,
Start the database in Emergency mode. So that Database will be started with
out transaction log. After that you can use DTS to transfer the data
and objects to a new database.
How to start the database in Emergency Mode:
Sp_configure "allow updates", 1
go
Reconfigure with override
GO
Update sysdatabases set status = 32768
where name = "BadDbName"
go
Sp_configure "allow updates", 0
go
Reconfigure with override
GO
Note:
Setting the database status to emergency mode tells SQL Server to skip
automatic recovery and
lets you access the data.
Thanks
Hari
MCDBA
"elziko" <elziko@.NOTSPAMMINGyahoo.co.uk> wrote in message
news:u6nrn1kEEHA.1368@.TK2MSFTNGP11.phx.gbl...
> I cant bring my database online since the LDF is missing. However, the MDF
> is fine. If I try to bring it online I get an error 5181 due to the
missing
> file.
> Is there anyway to get the database going again without the transaction
log?
> --
> Cheers,
> elziko
>
Friday, February 10, 2012
both .net transaction and stored procedure transaction together
Hi ALL
I want to know that is it possible that i use the .net transaction and inside of that i use tha stored procedure transaction ,nested transaction with .net and stored procedure?
is it like the nested transaction in stored procedure that we use both 2 transactions in stored procedure or not ?
thanks
To use .NET code in SQL you need to enable CLR Integration via the Surface Area Configuration Utility. This need only be done once.
Next you need to compile your .NET assembly to a DLL. This DLL will be called into MS SQL.
From within MS SQL you load the assembly by using the statement:
CREATE ASSEMBLY <ass_name>
FROM '<path to dll>'
CREATE function <function name> (<any parameters>)
returns <any return value>
[with returns null on null input]
external name <ass_name>.[<dll ns.class>].<dll method>
The .NET assembly can be removed once it is pulled into MS SQL since the binary is from that point onwards referenced internally.
|||Shouldn't a transaction be atomic? Why would you use 2 transactions?|||The transaction is atomic. Once you import the CLR code into the assembly (a one time processes) and you define the T-SQL function to call the imported code you have an atomic function.
The only difference is that MS SQL's internal .NET Framework will be running the code, rather than the T-SQL interpretur.
Hope this helps.
Al
|||Thanks, but I was answering on the original question ;-)
|||SQL Server has no support for nested transactions. Nesting of transactions only increments @.@.TRANCOUNT and it is the final commit that has control over the outcome of the entire transaction. You should however take a look at the new TransactionScope class in .NET Framework 2.0 which has promotable transactions concept. It is not clear if you want to link the .NET transaction with the SQL transaction and this can be done by using the TransactionScope class i.e., if multiple resource managers are involved then transaction automatically becomes a distributed transaction.