Showing posts with label management. Show all posts
Showing posts with label management. Show all posts

Wednesday, March 21, 2012

Recovering database from Transactional Log File(.ldf file)

Hi

I am in a trouble without doing any mistake. I restarted while in parallely my sql server was restarting i.e I opened a management studio.

When it booted up next time. I see that my database is gone. Though it is showed up in the server but has no node below it.

I then checked the mdf files and ldf files and found mdf file to be of 0 KB and ldf file is of 1.73 GB. My database was in full recovery mode but i did not take any database backup.

Here ais the entry from my SQL server log:

The operating system returned error 38(Reached the end of the file.) to SQL Server during a read at offset 0000000000000000 in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Hello.mdf'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

I wonder if now there is a case to recover my database..Can I restore/recover the database from .ldf file as it was in full recovery model?Any help i shighly appreciated.It is not possible to recover the mdf file with ldf alone. The transaction log files holds the log information that is used to recover the database. MDF is the data file which contains the startup information for the database and points to the other files in the database. User data and objects will be stored in this file.|||

The LDF file would be the log file of the database. There is no way from SQL Server to recover a database from the LDF file alone. However you could try other tools such as:

Lumigent Log Explorer

Red Gate

The above have tools to read SQL Server Database LDF files and might be of some help to you.

|||

As mentioned by vidya and amit its not possible to restore database from LDF. This is the significance of Backups. You have to have Backup of all the database which can be easily scheduled. In this case though your db is in FULLRecovery model, you have to have a base line(full) backup to restore the database. I don't think any tool can help you on this.

Madhu

|||I have the LDF file and the database file (MDF). The MDF file is 2 days old then ldf file. Is there any way, I can apply all the transaction for these 2 days.

Rajeev

Friday, March 9, 2012

Recover a deleted SQL Express database

One of my SQL Express databases was deleted by mistake through MS SQL Server Management Studio Express. It is not in the Recycle Bin and I have tried to use a tool such a Active@. Undelete to recover the file but it cannot find the deleted file.

I have a backup file *.bak in the ...MSSQL\Backup folder I made using MS SQL Server Management Studio Express. When I try to use the restore database feature in SSMSE I get various errors.

Any Suggestions on how to recover the deleted file or

Any suggestions or documentation on using the restore feature in SSMSE?

Any help at all?

Thanks

George

You are in luck you have a .bak use the link below to download the eval version of SQL Server install it as a named instance and right click at the top of management studio and register the Express. Then use the Backup and restore wizard to restore in .bak to recreate your database. In the Backup and Restore wizard choose the restore from device option. Post again if you need more help.

Hope this helps.

http://www.microsoft.com/sql/downloads/trial-software.mspx

|||

Does anyone know why I can't recovery a deleted SQL Database file like I can most other deleted files. Is there something special about this file. I can't believe someone hasn't developed a procedure or application that can do this.

In addition is there a known error in SSMSE that prevents it from restoring a backup made with SSMSE through SSMSE.

Frustration is mounting!

Thanks

George

|||

The reason is database files are system files when you delete it you are undoing a task so there is no file to recover. That is the reason you use either the.bak which is the best or Transaction Log to recover. Run a search for SQL Server recovery in the BOL (books online).

There is nothing preventing it from recovering but you need the Backup and Restore Wizard which is part of Management Studio to do the Restore. That is the reason I gave you the Eval version or you could buy the developer edition it is about $32 on the web.

Hope this helps.

|||

Can I install the eval version of SQL Server on my XP Pro machine. At the present I do have access to a Window Server 200X. If so what will it conflict with the SQL Express that I have installed?

Thanks for you help.

George

|||

Yes you can the eval is Microsoft way of getting users comfortable with the product so SQL Server 2005 eval almost self install after you choose components please choose all components. One more thing the reason you need the Backup and Restore Wizard is when you choose the restore from device option SQL Server chooses the file part for you through the .bak file so you need the Wizard and it is part of Management Studio.

There is no conflict just install the eval as named instance right click at the top of Management Studio and register the Express so you it becomes local to the eval which is Enterprise edition and choose restore from device option in the Backup and Restore Wizard. Post again if you need more help. Hope this helps.

|||

Thanks, for your patience and explanation. I have restore from the backup. I was able to restore it through SQL Server Manager Express, as advertized.

George

Saturday, February 25, 2012

Records are not listed in order

Hi,
When I used SQL Server Management Studio to open several tables (SQL 2005),
some records are not listed in the order - for example, listed by orderid,
customerid, or so on.
Is there a way that I can have them listed in order?
Many thanks in advance.Hi,
If you do not have a clustered index then data will be displayed based on
the way it gets stored. If you want
any specific order / any batch seeks then go for a clustered index based on
the requirement.
Thanks
Hari
SQL Server MVP
"xfile" <cou-cou@.remove.nospam.com> wrote in message
news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
> Hi,
> When I used SQL Server Management Studio to open several tables (SQL
> 2005), some records are not listed in the order - for example, listed by
> orderid, customerid, or so on.
> Is there a way that I can have them listed in order?
> Many thanks in advance.
>|||The ANSI SQL standard states that data will not be stored in any particular
order.
The exception is when there is a 'clustered' index, in which case the data
is ordered by the index.
Always add a [ORDER BY] clause to your queries to retrieve data in a
determined order.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"xfile" <cou-cou@.remove.nospam.com> wrote in message
news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
> Hi,
> When I used SQL Server Management Studio to open several tables (SQL
> 2005), some records are not listed in the order - for example, listed by
> orderid, customerid, or so on.
> Is there a way that I can have them listed in order?
> Many thanks in advance.
>|||Hi,
Thanks for both of your explanations.
Just to ensure that I understood correctly, what you meant is that it's
perfectly normal for records not displaying in any particular order if
tables are opened with tool such as Management Studio?
If I wish to have it displayed in any particular order, it has be done by
using queries either by writing one or done with application or tools.
Just one final question about the SQL Server Management Studio and that is,
does it come with any functions similar in Access that can with one click to
have data displaying ascending (A-Z) or descending (Z-A)?
Many thanks.
"Arnie Rowland" <arnie@.1568.com> wrote in message
news:%23OLHKNZxGHA.1272@.TK2MSFTNGP05.phx.gbl...
> The ANSI SQL standard states that data will not be stored in any
> particular order.
> The exception is when there is a 'clustered' index, in which case the data
> is ordered by the index.
> Always add a [ORDER BY] clause to your queries to retrieve data in a
> determined order.
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> "xfile" <cou-cou@.remove.nospam.com> wrote in message
> news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
>|||xfile wrote:
> Hi,
> Thanks for both of your explanations.
> Just to ensure that I understood correctly, what you meant is that it's
> perfectly normal for records not displaying in any particular order if
> tables are opened with tool such as Management Studio?
> If I wish to have it displayed in any particular order, it has be done by
> using queries either by writing one or done with application or tools.
That's right.
Just to expand on what Hari and Arnie said. A clustered index
implements some ordering in an internal index structure (not
necessarily at the level of the data rows or data pages) but it does
not directly control the order in which row will be returned from a
query. For that you need to use an ORDER BY clause.

> Just one final question about the SQL Server Management Studio and that is
,
> does it come with any functions similar in Access that can with one click
to
> have data displaying ascending (A-Z) or descending (Z-A)?
>
No. SSMS is a management tool. It isn't really designed with that kind
of application in mind. Returning every row and then dynamically
sorting them wouldn't be a very sensible feature to have in a client
server environment.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||You can right click on the column and select Pane > Criteria to sort the
result.
KL.
"xfile" <cou-cou@.remove.nospam.com> skrev i meddelandet
news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
> Hi,
> When I used SQL Server Management Studio to open several tables (SQL
> 2005), some records are not listed in the order - for example, listed by
> orderid, customerid, or so on.
> Is there a way that I can have them listed in order?
> Many thanks in advance.
>|||You can only guarantee the order of the results by using an
order by clause in the SQL statement.
There is no A-Z or Z-A functionality in SQL Server - that's
just a MS Access thing. All it does is an order by "under
the covers" for you.
When you use an order by clause, you can specify ASC for
ascending or DESC for descending. If you don't specify the
ordering, ASC is the default that will be used.
-Sue
On Tue, 22 Aug 2006 15:50:27 +0800, "xfile"
<cou-cou@.remove.nospam.com> wrote:

>Hi,
>Thanks for both of your explanations.
>Just to ensure that I understood correctly, what you meant is that it's
>perfectly normal for records not displaying in any particular order if
>tables are opened with tool such as Management Studio?
>If I wish to have it displayed in any particular order, it has be done by
>using queries either by writing one or done with application or tools.
>Just one final question about the SQL Server Management Studio and that is,
>does it come with any functions similar in Access that can with one click t
o
>have data displaying ascending (A-Z) or descending (Z-A)?
>Many thanks.
>
>"Arnie Rowland" <arnie@.1568.com> wrote in message
>news:%23OLHKNZxGHA.1272@.TK2MSFTNGP05.phx.gbl...
>|||Hi,
Thanks again for all of your kind explanations.
I did find the pane-criteria, and tried a few times and happy with the
results even I have to add all columns into criteria.
I am totally unfamiliar with database and accustomed to Access simple
graphic interface. We started using SQL 2000 last year (from hosting
company) and all queries are built-in with applications, and we recently
upgraded to a new version of the application and also moved to SQL 2005.
SQL 2005 is fast!!!
The purpose is to open some tables and delete testing data.
Again, many thanks for all of your kind explanations.
"KL" <noname@.nowhere.com> wrote in message
news:OWDzCvexGHA.980@.TK2MSFTNGP04.phx.gbl...
>
> You can right click on the column and select Pane > Criteria to sort the
> result.
> KL.
>
> "xfile" <cou-cou@.remove.nospam.com> skrev i meddelandet
> news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
>

Records are not listed in order

Hi,
When I used SQL Server Management Studio to open several tables (SQL 2005),
some records are not listed in the order - for example, listed by orderid,
customerid, or so on.
Is there a way that I can have them listed in order?
Many thanks in advance.Hi,
If you do not have a clustered index then data will be displayed based on
the way it gets stored. If you want
any specific order / any batch seeks then go for a clustered index based on
the requirement.
Thanks
Hari
SQL Server MVP
"xfile" <cou-cou@.remove.nospam.com> wrote in message
news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
> Hi,
> When I used SQL Server Management Studio to open several tables (SQL
> 2005), some records are not listed in the order - for example, listed by
> orderid, customerid, or so on.
> Is there a way that I can have them listed in order?
> Many thanks in advance.
>|||The ANSI SQL standard states that data will not be stored in any particular
order.
The exception is when there is a 'clustered' index, in which case the data
is ordered by the index.
Always add a [ORDER BY] clause to your queries to retrieve data in a
determined order.
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"xfile" <cou-cou@.remove.nospam.com> wrote in message
news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
> Hi,
> When I used SQL Server Management Studio to open several tables (SQL
> 2005), some records are not listed in the order - for example, listed by
> orderid, customerid, or so on.
> Is there a way that I can have them listed in order?
> Many thanks in advance.
>|||Hi,
Thanks for both of your explanations.
Just to ensure that I understood correctly, what you meant is that it's
perfectly normal for records not displaying in any particular order if
tables are opened with tool such as Management Studio?
If I wish to have it displayed in any particular order, it has be done by
using queries either by writing one or done with application or tools.
Just one final question about the SQL Server Management Studio and that is,
does it come with any functions similar in Access that can with one click to
have data displaying ascending (A-Z) or descending (Z-A)?
Many thanks.
"Arnie Rowland" <arnie@.1568.com> wrote in message
news:%23OLHKNZxGHA.1272@.TK2MSFTNGP05.phx.gbl...
> The ANSI SQL standard states that data will not be stored in any
> particular order.
> The exception is when there is a 'clustered' index, in which case the data
> is ordered by the index.
> Always add a [ORDER BY] clause to your queries to retrieve data in a
> determined order.
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> "xfile" <cou-cou@.remove.nospam.com> wrote in message
> news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
>> Hi,
>> When I used SQL Server Management Studio to open several tables (SQL
>> 2005), some records are not listed in the order - for example, listed by
>> orderid, customerid, or so on.
>> Is there a way that I can have them listed in order?
>> Many thanks in advance.
>|||xfile wrote:
> Hi,
> Thanks for both of your explanations.
> Just to ensure that I understood correctly, what you meant is that it's
> perfectly normal for records not displaying in any particular order if
> tables are opened with tool such as Management Studio?
> If I wish to have it displayed in any particular order, it has be done by
> using queries either by writing one or done with application or tools.
That's right.
Just to expand on what Hari and Arnie said. A clustered index
implements some ordering in an internal index structure (not
necessarily at the level of the data rows or data pages) but it does
not directly control the order in which row will be returned from a
query. For that you need to use an ORDER BY clause.
> Just one final question about the SQL Server Management Studio and that is,
> does it come with any functions similar in Access that can with one click to
> have data displaying ascending (A-Z) or descending (Z-A)?
>
No. SSMS is a management tool. It isn't really designed with that kind
of application in mind. Returning every row and then dynamically
sorting them wouldn't be a very sensible feature to have in a client
server environment.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||You can right click on the column and select Pane > Criteria to sort the
result.
KL.
"xfile" <cou-cou@.remove.nospam.com> skrev i meddelandet
news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
> Hi,
> When I used SQL Server Management Studio to open several tables (SQL
> 2005), some records are not listed in the order - for example, listed by
> orderid, customerid, or so on.
> Is there a way that I can have them listed in order?
> Many thanks in advance.
>|||You can only guarantee the order of the results by using an
order by clause in the SQL statement.
There is no A-Z or Z-A functionality in SQL Server - that's
just a MS Access thing. All it does is an order by "under
the covers" for you.
When you use an order by clause, you can specify ASC for
ascending or DESC for descending. If you don't specify the
ordering, ASC is the default that will be used.
-Sue
On Tue, 22 Aug 2006 15:50:27 +0800, "xfile"
<cou-cou@.remove.nospam.com> wrote:
>Hi,
>Thanks for both of your explanations.
>Just to ensure that I understood correctly, what you meant is that it's
>perfectly normal for records not displaying in any particular order if
>tables are opened with tool such as Management Studio?
>If I wish to have it displayed in any particular order, it has be done by
>using queries either by writing one or done with application or tools.
>Just one final question about the SQL Server Management Studio and that is,
>does it come with any functions similar in Access that can with one click to
>have data displaying ascending (A-Z) or descending (Z-A)?
>Many thanks.
>
>"Arnie Rowland" <arnie@.1568.com> wrote in message
>news:%23OLHKNZxGHA.1272@.TK2MSFTNGP05.phx.gbl...
>> The ANSI SQL standard states that data will not be stored in any
>> particular order.
>> The exception is when there is a 'clustered' index, in which case the data
>> is ordered by the index.
>> Always add a [ORDER BY] clause to your queries to retrieve data in a
>> determined order.
>> --
>> Arnie Rowland, Ph.D.
>> Westwood Consulting, Inc
>> Most good judgment comes from experience.
>> Most experience comes from bad judgment.
>> - Anonymous
>>
>> "xfile" <cou-cou@.remove.nospam.com> wrote in message
>> news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
>> Hi,
>> When I used SQL Server Management Studio to open several tables (SQL
>> 2005), some records are not listed in the order - for example, listed by
>> orderid, customerid, or so on.
>> Is there a way that I can have them listed in order?
>> Many thanks in advance.
>>
>|||Hi,
Thanks again for all of your kind explanations.
I did find the pane-criteria, and tried a few times and happy with the
results even I have to add all columns into criteria.
I am totally unfamiliar with database and accustomed to Access simple
graphic interface. We started using SQL 2000 last year (from hosting
company) and all queries are built-in with applications, and we recently
upgraded to a new version of the application and also moved to SQL 2005.
SQL 2005 is fast!!!
The purpose is to open some tables and delete testing data.
Again, many thanks for all of your kind explanations.
"KL" <noname@.nowhere.com> wrote in message
news:OWDzCvexGHA.980@.TK2MSFTNGP04.phx.gbl...
>
> You can right click on the column and select Pane > Criteria to sort the
> result.
> KL.
>
> "xfile" <cou-cou@.remove.nospam.com> skrev i meddelandet
> news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
>> Hi,
>> When I used SQL Server Management Studio to open several tables (SQL
>> 2005), some records are not listed in the order - for example, listed by
>> orderid, customerid, or so on.
>> Is there a way that I can have them listed in order?
>> Many thanks in advance.
>