Showing posts with label due. Show all posts
Showing posts with label due. Show all posts

Wednesday, March 21, 2012

Database Service wont start after installing SP2

I am hoping someone can help me. I am having issues changing the service account MSSQLSERVER. I changed it to Local System only due to issues installing Service Packs up SP2 Critical. I used the Configuration tool to do so. I have installed all patches up to and including Critical update ( KB 934458 ). I had a heck of a time getting them to install under custom service accounts. Now when I change the service accounts back to a custom account using the configuration tool the service wont start at all.

To be clear. The service runs fine under Local System Account, but I want to run it under a limited account. I used the config tool and made sure the permissions groups were added, but it still fails to start. I am not sure what SSL log entries below is referring to.

I am running:

SQL Server Standard Edition x86

Windows 2003 Stnd SP2

Below is the log file:

2007-09-01 23:50:16.15 spid9s Starting up database 'model'.
2007-09-01 23:50:16.20 Server Error: 17190, Severity: 16, State: 1.
2007-09-01 23:50:16.20 Server FallBack certificate initialization failed with error code: 1.
2007-09-01 23:50:16.20 Server Unable to initialize SSL encryption because a valid certificate could not be found, and it is not possible to create a self-signed certificate.
2007-09-01 23:50:16.21 Server Error: 17182, Severity: 16, State: 1.
2007-09-01 23:50:16.21 Server TDSSNIClient initialization failed with error 0x80092004, status code 0x80.
2007-09-01 23:50:16.21 Server Error: 17182, Severity: 16, State: 1.
2007-09-01 23:50:16.21 Server TDSSNIClient initialization failed with error 0x80092004, status code 0x1.
2007-09-01 23:50:16.21 Server Error: 17826, Severity: 18, State: 3.
2007-09-01 23:50:16.21 Server Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.
2007-09-01 23:50:16.21 Server Error: 17120, Severity: 16, State: 1.
2007-09-01 23:50:16.21 Server SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.

I am not DBA or very heavy IT, but rather a developer wearing multiple hats, for the time being. So any help is greatly appreciated.

Thanks, DMC


Can anyone explain to me what SSL log error is referring to?

Wednesday, March 7, 2012

Database Restoration

Hi!
Could anyone please advice me on whether I could restore
database from a map drive ? This is due to space
limitation of the existing server...
Any other suggestions would be much appreciated..
TIAIt generally work (I've seen some issues with backup/restore over the
network, mainly for larger backups). Worth a try. Make sure that the SQL
Server service account has permissions on the share, and address using UNC
naming.
--
Tibor Karaszi
"NG" <angiecmf@.hotmail.com> wrote in message
news:0a0001c3a1ed$b56a27a0$a601280a@.phx.gbl...
> Hi!
> Could anyone please advice me on whether I could restore
> database from a map drive ? This is due to space
> limitation of the existing server...
> Any other suggestions would be much appreciated..
> TIA|||Could you provide me the steps cause i have tried it and
could not view the map drive from Enterprise Manager...
on NT4 platform MSSQL 7.0 server.
TIA
>--Original Message--
>It generally work (I've seen some issues with
backup/restore over the
>network, mainly for larger backups). Worth a try. Make
sure that the SQL
>Server service account has permissions on the share, and
address using UNC
>naming.
>--
>Tibor Karaszi
>
>"NG" <angiecmf@.hotmail.com> wrote in message
>news:0a0001c3a1ed$b56a27a0$a601280a@.phx.gbl...
>> Hi!
>> Could anyone please advice me on whether I could restore
>> database from a map drive ? This is due to space
>> limitation of the existing server...
>> Any other suggestions would be much appreciated..
>> TIA
>
>.
>|||Don't use mapped drives, just enter the path as an UNC path:
\\servername\sharename\filename
--
Tibor Karaszi
"NG" <angiecmf@.hotmail.com> wrote in message
news:09bf01c3a272$9ec2e4d0$a301280a@.phx.gbl...
> Could you provide me the steps cause i have tried it and
> could not view the map drive from Enterprise Manager...
> on NT4 platform MSSQL 7.0 server.
> TIA
> >--Original Message--
> >It generally work (I've seen some issues with
> backup/restore over the
> >network, mainly for larger backups). Worth a try. Make
> sure that the SQL
> >Server service account has permissions on the share, and
> address using UNC
> >naming.
> >
> >--
> >Tibor Karaszi
> >
> >
> >"NG" <angiecmf@.hotmail.com> wrote in message
> >news:0a0001c3a1ed$b56a27a0$a601280a@.phx.gbl...
> >> Hi!
> >>
> >> Could anyone please advice me on whether I could restore
> >> database from a map drive ? This is due to space
> >> limitation of the existing server...
> >> Any other suggestions would be much appreciated..
> >> TIA
> >
> >
> >.
> >|||i encountered error "Unable to verify the existence of the
backup file location". Do you want to use the backup file
location anyway? and
Microsoft SQL-DMO (ODBC SQLState: 42000)
"Cannot open backup
device '\\Etax_media\temp\tna_sen.bak'. Device error or
device off-line. Backup or restore operation terminating
abnormally"
Please help! Thanks
>--Original Message--
>Don't use mapped drives, just enter the path as an UNC
path:
>\\servername\sharename\filename
>--
>Tibor Karaszi
>
>"NG" <angiecmf@.hotmail.com> wrote in message
>news:09bf01c3a272$9ec2e4d0$a301280a@.phx.gbl...
>> Could you provide me the steps cause i have tried it and
>> could not view the map drive from Enterprise Manager...
>> on NT4 platform MSSQL 7.0 server.
>> TIA
>> >--Original Message--
>> >It generally work (I've seen some issues with
>> backup/restore over the
>> >network, mainly for larger backups). Worth a try. Make
>> sure that the SQL
>> >Server service account has permissions on the share,
and
>> address using UNC
>> >naming.
>> >
>> >--
>> >Tibor Karaszi
>> >
>> >
>> >"NG" <angiecmf@.hotmail.com> wrote in message
>> >news:0a0001c3a1ed$b56a27a0$a601280a@.phx.gbl...
>> >> Hi!
>> >>
>> >> Could anyone please advice me on whether I could
restore
>> >> database from a map drive ? This is due to space
>> >> limitation of the existing server...
>> >> Any other suggestions would be much appreciated..
>> >> TIA
>> >
>> >
>> >.
>> >
>
>.
>|||The first message is some tool (or rather, API) message, not an engine
message. The second is an engine message. It seems that the path is
incorrect or that the SQL Server service account don't have permissions on
the share.
--
Tibor Karaszi
"NG" <angiecmf@.hotmail.com> wrote in message
news:0aff01c3a2ab$d4f047d0$a401280a@.phx.gbl...
> i encountered error "Unable to verify the existence of the
> backup file location". Do you want to use the backup file
> location anyway? and
> Microsoft SQL-DMO (ODBC SQLState: 42000)
> "Cannot open backup
> device '\\Etax_media\temp\tna_sen.bak'. Device error or
> device off-line. Backup or restore operation terminating
> abnormally"
> Please help! Thanks
> >--Original Message--
> >Don't use mapped drives, just enter the path as an UNC
> path:
> >\\servername\sharename\filename
> >
> >--
> >Tibor Karaszi
> >
> >
> >"NG" <angiecmf@.hotmail.com> wrote in message
> >news:09bf01c3a272$9ec2e4d0$a301280a@.phx.gbl...
> >> Could you provide me the steps cause i have tried it and
> >> could not view the map drive from Enterprise Manager...
> >> on NT4 platform MSSQL 7.0 server.
> >> TIA
> >>
> >> >--Original Message--
> >> >It generally work (I've seen some issues with
> >> backup/restore over the
> >> >network, mainly for larger backups). Worth a try. Make
> >> sure that the SQL
> >> >Server service account has permissions on the share,
> and
> >> address using UNC
> >> >naming.
> >> >
> >> >--
> >> >Tibor Karaszi
> >> >
> >> >
> >> >"NG" <angiecmf@.hotmail.com> wrote in message
> >> >news:0a0001c3a1ed$b56a27a0$a601280a@.phx.gbl...
> >> >> Hi!
> >> >>
> >> >> Could anyone please advice me on whether I could
> restore
> >> >> database from a map drive ? This is due to space
> >> >> limitation of the existing server...
> >> >> Any other suggestions would be much appreciated..
> >> >> TIA
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >

Database ''ReportServer$SQLExpressTempDB'' cannot be opened

When I try the open the report file, I got the following error message. Database 'ReportServer$SQLExpressTempDB' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details. Anyony have ideas to fix this error?Yes. Get sufficient access or more memory.

Saturday, February 25, 2012

Database recovery with data file only

I had database whose log file and backup files are unavailable due to a media failure. I had the data file which is up to date.
Is it possible to recover the database?
I had tried using attach database utility but failed with an error message â'Device Activation error. Physical file name â'C:\...\xxx.ldfâ' may be incorrect.
Please advice me if anything can be done.
Thanking You"Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> I had database whose log file and backup files are unavailable due to a
media failure. I had the data file which is up to date.
> Is it possible to recover the database?
> I had tried using attach database utility but failed with an error message
"Device Activation error. Physical file name "C:\...\xxx.ldf" may be
incorrect.
> Please advice me if anything can be done.
> Thanking You
exec sp_attach_single_file_db creates the ldf file for you
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.711 / Virus Database: 467 - Release Date: 25/06/2004|||Hi,
If you have mutiple LDF files as well as if the database is not detached you
may not be able to use sp_attach_single_file_db command.
In this case you can follow the below procedure to bring the database up.
But few of the steps are purely undocuemnted.
A solution for this is:
1. Create a new database with the same name and same MDF and LDF files
2. Stop sql server and rename the existing MDF to a new one and copy the
original MDF to this location and delete the LDF files.
3. STart SQL Server
4. Now your database will be marked suspect
5. Update the sysdatabases to update to Emergency mode. This will not use
LOG files
update sysdatabases set status=32768 where name ='dbname'
6. Restart sql server. now the database will be in emergency mode
7. Now execute the undocumented DBCC to create a log file
DBCC REBUILD_LOG(dbname,'c:\dbname.ldf')
8. Execute sp_resetstatus <dbname>
9. Restart SQL server and see the database is online.
Thanks
Hari
MCDBA
"Bob Simms" <bob_simms@.somewhere.com> wrote in message
news:1vbDc.45061$ly2.28055@.doctor.cableinet.net...
> "Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
> news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> > I had database whose log file and backup files are unavailable due to a
> media failure. I had the data file which is up to date.
> >
> > Is it possible to recover the database?
> >
> > I had tried using attach database utility but failed with an error
message
> "Device Activation error. Physical file name "C:\...\xxx.ldf" may be
> incorrect.
> >
> > Please advice me if anything can be done.
> >
> > Thanking You
> exec sp_attach_single_file_db creates the ldf file for you
>
> --
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.711 / Virus Database: 467 - Release Date: 25/06/2004
>|||A word of warning regarding the technique proposed by Hari. Forcibly
rebuilding the transaction log results in a database with questionable
integrity. Data may be physically corrupt or logically inconsistent because
normal database recovery did not take place.
A preferable method is to restore from backup. If the log must be rebuilt
because no backup is available, I suggest data be exported and then imported
into a clean database.
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> I had database whose log file and backup files are unavailable due to a
media failure. I had the data file which is up to date.
> Is it possible to recover the database?
> I had tried using attach database utility but failed with an error message
"Device Activation error. Physical file name "C:\...\xxx.ldf" may be
incorrect.
> Please advice me if anything can be done.
> Thanking You
>|||Hi Dan,
I accept what you say regarding data integrity.
I suggested /recommended this method only because ken do not have the
database Backup as well as
no LDF files. In this case DBCC REBUILD_LOG will be a easy and faster
approach. After bringing
up the database ken can execute a DBCC CHECKDB and confirm that database is
fine or not.
--
Thanks
Hari
MCDBA
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:ev$$EMZXEHA.1652@.TK2MSFTNGP09.phx.gbl...
> A word of warning regarding the technique proposed by Hari. Forcibly
> rebuilding the transaction log results in a database with questionable
> integrity. Data may be physically corrupt or logically inconsistent
because
> normal database recovery did not take place.
> A preferable method is to restore from backup. If the log must be rebuilt
> because no backup is available, I suggest data be exported and then
imported
> into a clean database.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
> news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> > I had database whose log file and backup files are unavailable due to a
> media failure. I had the data file which is up to date.
> >
> > Is it possible to recover the database?
> >
> > I had tried using attach database utility but failed with an error
message
> "Device Activation error. Physical file name "C:\...\xxx.ldf" may be
> incorrect.
> >
> > Please advice me if anything can be done.
> >
> > Thanking You
> >
>|||Although DBCC CHECKDB can detect physical corruption, there could be logical
errors as well, such as orphaned data and uncommitted data. I wanted Ken to
fully understand the implications of rebuilding the log.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:u$KcfydXEHA.556@.tk2msftngp13.phx.gbl...
> Hi Dan,
> I accept what you say regarding data integrity.
> I suggested /recommended this method only because ken do not have the
> database Backup as well as
> no LDF files. In this case DBCC REBUILD_LOG will be a easy and faster
> approach. After bringing
> up the database ken can execute a DBCC CHECKDB and confirm that database
is
> fine or not.
> --
> Thanks
> Hari
> MCDBA
> "Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
> news:ev$$EMZXEHA.1652@.TK2MSFTNGP09.phx.gbl...
> > A word of warning regarding the technique proposed by Hari. Forcibly
> > rebuilding the transaction log results in a database with questionable
> > integrity. Data may be physically corrupt or logically inconsistent
> because
> > normal database recovery did not take place.
> >
> > A preferable method is to restore from backup. If the log must be
rebuilt
> > because no backup is available, I suggest data be exported and then
> imported
> > into a clean database.
> >
> > --
> > Hope this helps.
> >
> > Dan Guzman
> > SQL Server MVP
> >
> > --
> > Hope this helps.
> >
> > Dan Guzman
> > SQL Server MVP
> >
> > "Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
> > news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> > > I had database whose log file and backup files are unavailable due to
a
> > media failure. I had the data file which is up to date.
> > >
> > > Is it possible to recover the database?
> > >
> > > I had tried using attach database utility but failed with an error
> message
> > "Device Activation error. Physical file name "C:\...\xxx.ldf" may be
> > incorrect.
> > >
> > > Please advice me if anything can be done.
> > >
> > > Thanking You
> > >
> >
> >
>|||Basically using that command breaks your business logic as there's no
guarantee of any constraints (implied or explicit) being true any more.
Also, the use of the command is unsupported and its use is tracked by the
server.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:O5DUi6dXEHA.2844@.TK2MSFTNGP11.phx.gbl...
> Although DBCC CHECKDB can detect physical corruption, there could be
logical
> errors as well, such as orphaned data and uncommitted data. I wanted Ken
to
> fully understand the implications of rebuilding the log.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Hari" <hari_prasad_k@.hotmail.com> wrote in message
> news:u$KcfydXEHA.556@.tk2msftngp13.phx.gbl...
> > Hi Dan,
> >
> > I accept what you say regarding data integrity.
> > I suggested /recommended this method only because ken do not have the
> > database Backup as well as
> > no LDF files. In this case DBCC REBUILD_LOG will be a easy and faster
> > approach. After bringing
> > up the database ken can execute a DBCC CHECKDB and confirm that
database
> is
> > fine or not.
> >
> > --
> > Thanks
> > Hari
> > MCDBA
> > "Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
> > news:ev$$EMZXEHA.1652@.TK2MSFTNGP09.phx.gbl...
> > > A word of warning regarding the technique proposed by Hari. Forcibly
> > > rebuilding the transaction log results in a database with questionable
> > > integrity. Data may be physically corrupt or logically inconsistent
> > because
> > > normal database recovery did not take place.
> > >
> > > A preferable method is to restore from backup. If the log must be
> rebuilt
> > > because no backup is available, I suggest data be exported and then
> > imported
> > > into a clean database.
> > >
> > > --
> > > Hope this helps.
> > >
> > > Dan Guzman
> > > SQL Server MVP
> > >
> > > --
> > > Hope this helps.
> > >
> > > Dan Guzman
> > > SQL Server MVP
> > >
> > > "Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
> > > news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> > > > I had database whose log file and backup files are unavailable due
to
> a
> > > media failure. I had the data file which is up to date.
> > > >
> > > > Is it possible to recover the database?
> > > >
> > > > I had tried using attach database utility but failed with an error
> > message
> > > "Device Activation error. Physical file name "C:\...\xxx.ldf" may be
> > > incorrect.
> > > >
> > > > Please advice me if anything can be done.
> > > >
> > > > Thanking You
> > > >
> > >
> > >
> >
> >
>|||There are many approaches that seem "easier and faster" but
they aren't necessarily good ideas and can actually not
really be "easier and faster" in the long run.
Note Paul's response. I remembered that Sybase used to (or
still does, I don't know) have the command and if it failed
once or twice, you essentially ended up with a useless data
file and couldn't execute the command anymore. There are
even easier sql commands posted up here that users have
problems getting right the first or second time - and all of
us have had those days where typing a simple select doesn't
work. For those reasons, it's probably better for a user to
call support and have someone from PSS walk them through the
process carefully. Ever since it's been posted on
newsgroups, I've seen it abused and misused by companies.
If they end up with nothing but a useless data file, it may
have actually have been "easier and faster" for them to get
the backups read off the failed media from a company that
specializes in that and restore the database from those
files.
-Sue
On Tue, 29 Jun 2004 18:46:10 +0530, "Hari"
<hari_prasad_k@.hotmail.com> wrote:
>Hi Dan,
>I accept what you say regarding data integrity.
>I suggested /recommended this method only because ken do not have the
>database Backup as well as
>no LDF files. In this case DBCC REBUILD_LOG will be a easy and faster
>approach. After bringing
> up the database ken can execute a DBCC CHECKDB and confirm that database is
>fine or not.|||One more note - the command (not the functionality) has been removed in SQL
Server 2005. Also, in SQL Server 2005, the fact that the functionality was
used is persisted permanently in the database so PSS can tell whether any
problems a user is seeing is because of misuse of the functionality.
In SQL Server 2005, emergency mode is documented and there's a new
documented way of recovering from this situation using DBCC CHECKDB.
Regards.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:8j54e0175e35lc2v53m8j771hq1lm8rn32@.4ax.com...
> There are many approaches that seem "easier and faster" but
> they aren't necessarily good ideas and can actually not
> really be "easier and faster" in the long run.
> Note Paul's response. I remembered that Sybase used to (or
> still does, I don't know) have the command and if it failed
> once or twice, you essentially ended up with a useless data
> file and couldn't execute the command anymore. There are
> even easier sql commands posted up here that users have
> problems getting right the first or second time - and all of
> us have had those days where typing a simple select doesn't
> work. For those reasons, it's probably better for a user to
> call support and have someone from PSS walk them through the
> process carefully. Ever since it's been posted on
> newsgroups, I've seen it abused and misused by companies.
> If they end up with nothing but a useless data file, it may
> have actually have been "easier and faster" for them to get
> the backups read off the failed media from a company that
> specializes in that and restore the database from those
> files.
> -Sue
> On Tue, 29 Jun 2004 18:46:10 +0530, "Hari"
> <hari_prasad_k@.hotmail.com> wrote:
> >Hi Dan,
> >
> >I accept what you say regarding data integrity.
> >I suggested /recommended this method only because ken do not have the
> >database Backup as well as
> >no LDF files. In this case DBCC REBUILD_LOG will be a easy and faster
> >approach. After bringing
> > up the database ken can execute a DBCC CHECKDB and confirm that database
is
> >fine or not.
>

Database recovery with data file only

I had database whose log file and backup files are unavailable due to a media failure. I had the data file which is up to date.
Is it possible to recover the database?
I had tried using attach database utility but failed with an error message “Device Activation error. Physical file name “C:\...\xxx.ldf” may be incorrect.
Please advice me if anything can be done.
Thanking You
"Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> I had database whose log file and backup files are unavailable due to a
media failure. I had the data file which is up to date.
> Is it possible to recover the database?
> I had tried using attach database utility but failed with an error message
"Device Activation error. Physical file name "C:\...\xxx.ldf" may be
incorrect.
> Please advice me if anything can be done.
> Thanking You
exec sp_attach_single_file_db creates the ldf file for you
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.711 / Virus Database: 467 - Release Date: 25/06/2004
|||Hi,
If you have mutiple LDF files as well as if the database is not detached you
may not be able to use sp_attach_single_file_db command.
In this case you can follow the below procedure to bring the database up.
But few of the steps are purely undocuemnted.
A solution for this is:
1. Create a new database with the same name and same MDF and LDF files
2. Stop sql server and rename the existing MDF to a new one and copy the
original MDF to this location and delete the LDF files.
3. STart SQL Server
4. Now your database will be marked suspect
5. Update the sysdatabases to update to Emergency mode. This will not use
LOG files
update sysdatabases set status=32768 where name ='dbname'
6. Restart sql server. now the database will be in emergency mode
7. Now execute the undocumented DBCC to create a log file
DBCC REBUILD_LOG(dbname,'c:\dbname.ldf')
8. Execute sp_resetstatus <dbname>
9. Restart SQL server and see the database is online.
Thanks
Hari
MCDBA
"Bob Simms" <bob_simms@.somewhere.com> wrote in message
news:1vbDc.45061$ly2.28055@.doctor.cableinet.net... [vbcol=seagreen]
> "Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
> news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> media failure. I had the data file which is up to date.
message
> "Device Activation error. Physical file name "C:\...\xxx.ldf" may be
> incorrect.
> exec sp_attach_single_file_db creates the ldf file for you
>
> --
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.711 / Virus Database: 467 - Release Date: 25/06/2004
>
|||A word of warning regarding the technique proposed by Hari. Forcibly
rebuilding the transaction log results in a database with questionable
integrity. Data may be physically corrupt or logically inconsistent because
normal database recovery did not take place.
A preferable method is to restore from backup. If the log must be rebuilt
because no backup is available, I suggest data be exported and then imported
into a clean database.
Hope this helps.
Dan Guzman
SQL Server MVP
Hope this helps.
Dan Guzman
SQL Server MVP
"Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> I had database whose log file and backup files are unavailable due to a
media failure. I had the data file which is up to date.
> Is it possible to recover the database?
> I had tried using attach database utility but failed with an error message
"Device Activation error. Physical file name "C:\...\xxx.ldf" may be
incorrect.
> Please advice me if anything can be done.
> Thanking You
>
|||A word of warning regarding the technique proposed by Hari. Forcibly
rebuilding the transaction log results in a database with questionable
integrity. Data may be physically corrupt or logically inconsistent because
normal database recovery did not take place.
A preferable method is to restore from backup. If the log must be rebuilt
because no backup is available, I suggest data be exported and then imported
into a clean database.
Hope this helps.
Dan Guzman
SQL Server MVP
Hope this helps.
Dan Guzman
SQL Server MVP
"Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> I had database whose log file and backup files are unavailable due to a
media failure. I had the data file which is up to date.
> Is it possible to recover the database?
> I had tried using attach database utility but failed with an error message
"Device Activation error. Physical file name "C:\...\xxx.ldf" may be
incorrect.
> Please advice me if anything can be done.
> Thanking You
>
|||Hi Dan,
I accept what you say regarding data integrity.
I suggested /recommended this method only because ken do not have the
database Backup as well as
no LDF files. In this case DBCC REBUILD_LOG will be a easy and faster
approach. After bringing
up the database ken can execute a DBCC CHECKDB and confirm that database is
fine or not.
Thanks
Hari
MCDBA
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:ev$$EMZXEHA.1652@.TK2MSFTNGP09.phx.gbl...
> A word of warning regarding the technique proposed by Hari. Forcibly
> rebuilding the transaction log results in a database with questionable
> integrity. Data may be physically corrupt or logically inconsistent
because
> normal database recovery did not take place.
> A preferable method is to restore from backup. If the log must be rebuilt
> because no backup is available, I suggest data be exported and then
imported[vbcol=seagreen]
> into a clean database.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
> news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> media failure. I had the data file which is up to date.
message
> "Device Activation error. Physical file name "C:\...\xxx.ldf" may be
> incorrect.
>
|||Hi Dan,
I accept what you say regarding data integrity.
I suggested /recommended this method only because ken do not have the
database Backup as well as
no LDF files. In this case DBCC REBUILD_LOG will be a easy and faster
approach. After bringing
up the database ken can execute a DBCC CHECKDB and confirm that database is
fine or not.
Thanks
Hari
MCDBA
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:ev$$EMZXEHA.1652@.TK2MSFTNGP09.phx.gbl...
> A word of warning regarding the technique proposed by Hari. Forcibly
> rebuilding the transaction log results in a database with questionable
> integrity. Data may be physically corrupt or logically inconsistent
because
> normal database recovery did not take place.
> A preferable method is to restore from backup. If the log must be rebuilt
> because no backup is available, I suggest data be exported and then
imported[vbcol=seagreen]
> into a clean database.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
> news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> media failure. I had the data file which is up to date.
message
> "Device Activation error. Physical file name "C:\...\xxx.ldf" may be
> incorrect.
>
|||Although DBCC CHECKDB can detect physical corruption, there could be logical
errors as well, such as orphaned data and uncommitted data. I wanted Ken to
fully understand the implications of rebuilding the log.
Hope this helps.
Dan Guzman
SQL Server MVP
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:u$KcfydXEHA.556@.tk2msftngp13.phx.gbl...
> Hi Dan,
> I accept what you say regarding data integrity.
> I suggested /recommended this method only because ken do not have the
> database Backup as well as
> no LDF files. In this case DBCC REBUILD_LOG will be a easy and faster
> approach. After bringing
> up the database ken can execute a DBCC CHECKDB and confirm that database
is[vbcol=seagreen]
> fine or not.
> --
> Thanks
> Hari
> MCDBA
> "Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
> news:ev$$EMZXEHA.1652@.TK2MSFTNGP09.phx.gbl...
> because
rebuilt[vbcol=seagreen]
> imported
a
> message
>
|||Although DBCC CHECKDB can detect physical corruption, there could be logical
errors as well, such as orphaned data and uncommitted data. I wanted Ken to
fully understand the implications of rebuilding the log.
Hope this helps.
Dan Guzman
SQL Server MVP
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:u$KcfydXEHA.556@.tk2msftngp13.phx.gbl...
> Hi Dan,
> I accept what you say regarding data integrity.
> I suggested /recommended this method only because ken do not have the
> database Backup as well as
> no LDF files. In this case DBCC REBUILD_LOG will be a easy and faster
> approach. After bringing
> up the database ken can execute a DBCC CHECKDB and confirm that database
is[vbcol=seagreen]
> fine or not.
> --
> Thanks
> Hari
> MCDBA
> "Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
> news:ev$$EMZXEHA.1652@.TK2MSFTNGP09.phx.gbl...
> because
rebuilt[vbcol=seagreen]
> imported
a
> message
>
|||Basically using that command breaks your business logic as there's no
guarantee of any constraints (implied or explicit) being true any more.
Also, the use of the command is unsupported and its use is tracked by the
server.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:O5DUi6dXEHA.2844@.TK2MSFTNGP11.phx.gbl...
> Although DBCC CHECKDB can detect physical corruption, there could be
logical
> errors as well, such as orphaned data and uncommitted data. I wanted Ken
to[vbcol=seagreen]
> fully understand the implications of rebuilding the log.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Hari" <hari_prasad_k@.hotmail.com> wrote in message
> news:u$KcfydXEHA.556@.tk2msftngp13.phx.gbl...
database[vbcol=seagreen]
> is
> rebuilt
to
> a
>

Database recovery with data file only

I had database whose log file and backup files are unavailable due to a medi
a failure. I had the data file which is up to date.
Is it possible to recover the database?
I had tried using attach database utility but failed with an error message
Device Activation error. Physical file name “C:\...\xxx.ldf” may be i
ncorrect.
Please advice me if anything can be done.
Thanking You"Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> I had database whose log file and backup files are unavailable due to a
media failure. I had the data file which is up to date.
> Is it possible to recover the database?
> I had tried using attach database utility but failed with an error message
"Device Activation error. Physical file name "C:\...\xxx.ldf" may be
incorrect.
> Please advice me if anything can be done.
> Thanking You
exec sp_attach_single_file_db creates the ldf file for you
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.711 / Virus Database: 467 - Release Date: 25/06/2004|||Hi,
If you have mutiple LDF files as well as if the database is not detached you
may not be able to use sp_attach_single_file_db command.
In this case you can follow the below procedure to bring the database up.
But few of the steps are purely undocuemnted.
A solution for this is:
1. Create a new database with the same name and same MDF and LDF files
2. Stop sql server and rename the existing MDF to a new one and copy the
original MDF to this location and delete the LDF files.
3. STart SQL Server
4. Now your database will be marked suspect
5. Update the sysdatabases to update to Emergency mode. This will not use
LOG files
update sysdatabases set status=32768 where name ='dbname'
6. Restart sql server. now the database will be in emergency mode
7. Now execute the undocumented DBCC to create a log file
DBCC REBUILD_LOG(dbname,'c:\dbname.ldf')
8. Execute sp_resetstatus <dbname>
9. Restart SQL server and see the database is online.
Thanks
Hari
MCDBA
"Bob Simms" <bob_simms@.somewhere.com> wrote in message
news:1vbDc.45061$ly2.28055@.doctor.cableinet.net...
> "Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
> news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> media failure. I had the data file which is up to date.
message[vbcol=seagreen]
> "Device Activation error. Physical file name "C:\...\xxx.ldf" may be
> incorrect.
> exec sp_attach_single_file_db creates the ldf file for you
>
> --
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.711 / Virus Database: 467 - Release Date: 25/06/2004
>|||A word of warning regarding the technique proposed by Hari. Forcibly
rebuilding the transaction log results in a database with questionable
integrity. Data may be physically corrupt or logically inconsistent because
normal database recovery did not take place.
A preferable method is to restore from backup. If the log must be rebuilt
because no backup is available, I suggest data be exported and then imported
into a clean database.
Hope this helps.
Dan Guzman
SQL Server MVP
Hope this helps.
Dan Guzman
SQL Server MVP
"Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> I had database whose log file and backup files are unavailable due to a
media failure. I had the data file which is up to date.
> Is it possible to recover the database?
> I had tried using attach database utility but failed with an error message
"Device Activation error. Physical file name "C:\...\xxx.ldf" may be
incorrect.
> Please advice me if anything can be done.
> Thanking You
>|||Hi Dan,
I accept what you say regarding data integrity.
I suggested /recommended this method only because ken do not have the
database Backup as well as
no LDF files. In this case DBCC REBUILD_LOG will be a easy and faster
approach. After bringing
up the database ken can execute a DBCC CHECKDB and confirm that database is
fine or not.
Thanks
Hari
MCDBA
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:ev$$EMZXEHA.1652@.TK2MSFTNGP09.phx.gbl...
> A word of warning regarding the technique proposed by Hari. Forcibly
> rebuilding the transaction log results in a database with questionable
> integrity. Data may be physically corrupt or logically inconsistent
because
> normal database recovery did not take place.
> A preferable method is to restore from backup. If the log must be rebuilt
> because no backup is available, I suggest data be exported and then
imported
> into a clean database.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Ken.net" <Ken.net@.discussions.microsoft.com> wrote in message
> news:577A1B53-8E9E-4AF8-9F44-F4DF18D8D78D@.microsoft.com...
> media failure. I had the data file which is up to date.
message[vbcol=seagreen]
> "Device Activation error. Physical file name "C:\...\xxx.ldf" may be
> incorrect.
>|||Although DBCC CHECKDB can detect physical corruption, there could be logical
errors as well, such as orphaned data and uncommitted data. I wanted Ken to
fully understand the implications of rebuilding the log.
Hope this helps.
Dan Guzman
SQL Server MVP
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:u$KcfydXEHA.556@.tk2msftngp13.phx.gbl...
> Hi Dan,
> I accept what you say regarding data integrity.
> I suggested /recommended this method only because ken do not have the
> database Backup as well as
> no LDF files. In this case DBCC REBUILD_LOG will be a easy and faster
> approach. After bringing
> up the database ken can execute a DBCC CHECKDB and confirm that database
is
> fine or not.
> --
> Thanks
> Hari
> MCDBA
> "Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
> news:ev$$EMZXEHA.1652@.TK2MSFTNGP09.phx.gbl...
> because
rebuilt[vbcol=seagreen]
> imported
a[vbcol=seagreen]
> message
>|||Basically using that command breaks your business logic as there's no
guarantee of any constraints (implied or explicit) being true any more.
Also, the use of the command is unsupported and its use is tracked by the
server.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:O5DUi6dXEHA.2844@.TK2MSFTNGP11.phx.gbl...
> Although DBCC CHECKDB can detect physical corruption, there could be
logical
> errors as well, such as orphaned data and uncommitted data. I wanted Ken
to
> fully understand the implications of rebuilding the log.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Hari" <hari_prasad_k@.hotmail.com> wrote in message
> news:u$KcfydXEHA.556@.tk2msftngp13.phx.gbl...
database[vbcol=seagreen]
> is
> rebuilt
to[vbcol=seagreen]
> a
>|||There are many approaches that seem "easier and faster" but
they aren't necessarily good ideas and can actually not
really be "easier and faster" in the long run.
Note Paul's response. I remembered that Sybase used to (or
still does, I don't know) have the command and if it failed
once or twice, you essentially ended up with a useless data
file and couldn't execute the command anymore. There are
even easier sql commands posted up here that users have
problems getting right the first or second time - and all of
us have had those days where typing a simple select doesn't
work. For those reasons, it's probably better for a user to
call support and have someone from PSS walk them through the
process carefully. Ever since it's been posted on
newsgroups, I've seen it abused and misused by companies.
If they end up with nothing but a useless data file, it may
have actually have been "easier and faster" for them to get
the backups read off the failed media from a company that
specializes in that and restore the database from those
files.
-Sue
On Tue, 29 Jun 2004 18:46:10 +0530, "Hari"
<hari_prasad_k@.hotmail.com> wrote:

>Hi Dan,
>I accept what you say regarding data integrity.
>I suggested /recommended this method only because ken do not have the
>database Backup as well as
>no LDF files. In this case DBCC REBUILD_LOG will be a easy and faster
>approach. After bringing
> up the database ken can execute a DBCC CHECKDB and confirm that database i
s
>fine or not.|||One more note - the command (not the functionality) has been removed in SQL
Server 2005. Also, in SQL Server 2005, the fact that the functionality was
used is persisted permanently in the database so PSS can tell whether any
problems a user is seeing is because of misuse of the functionality.
In SQL Server 2005, emergency mode is documented and there's a new
documented way of recovering from this situation using DBCC CHECKDB.
Regards.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:8j54e0175e35lc2v53m8j771hq1lm8rn32@.
4ax.com...
> There are many approaches that seem "easier and faster" but
> they aren't necessarily good ideas and can actually not
> really be "easier and faster" in the long run.
> Note Paul's response. I remembered that Sybase used to (or
> still does, I don't know) have the command and if it failed
> once or twice, you essentially ended up with a useless data
> file and couldn't execute the command anymore. There are
> even easier sql commands posted up here that users have
> problems getting right the first or second time - and all of
> us have had those days where typing a simple select doesn't
> work. For those reasons, it's probably better for a user to
> call support and have someone from PSS walk them through the
> process carefully. Ever since it's been posted on
> newsgroups, I've seen it abused and misused by companies.
> If they end up with nothing but a useless data file, it may
> have actually have been "easier and faster" for them to get
> the backups read off the failed media from a company that
> specializes in that and restore the database from those
> files.
> -Sue
> On Tue, 29 Jun 2004 18:46:10 +0530, "Hari"
> <hari_prasad_k@.hotmail.com> wrote:
>
is[vbcol=seagreen]
>

Sunday, February 19, 2012

Database Question

If a client is going to pay you $100 a year for the next 5 years and I want to know, say in two years if they have made the payments that were due. How could I calculate this in a database? Would I need a payment schedule with dates that a payment was expected? And if yes how would I know if they made the due payments? I hope you can see what I need to know from this, but if not I will add more.

Thanks for any help.How about a table for payments, like so:


create table dbo.t_issue_saved_report_sql
(
PayID intnot null,
CustomerID int not null,
Amount varchar(255) not null,
DueDate datetime,
PaidDate datetime
)

So when your customer signs up, your program will populate the table with 5 entries, including the due dates for each year and the amount due. This is a simple representation, and I'm sure I'm missing something, but perhaps a start.