Click here to Skip to main content
15,898,036 members
Home / Discussions / Database
   

Database

 
AnswerRe: cursor_sql Pin
Paul Conrad29-Oct-07 17:20
professionalPaul Conrad29-Oct-07 17:20 
QuestionLogin failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. Pin
sivaram praveen29-Oct-07 1:06
sivaram praveen29-Oct-07 1:06 
AnswerRe: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. Pin
Colin Angus Mackay29-Oct-07 1:20
Colin Angus Mackay29-Oct-07 1:20 
AnswerRe: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. Pin
Mike Dimmick29-Oct-07 1:25
Mike Dimmick29-Oct-07 1:25 
GeneralRe: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. Pin
sivaram praveen29-Oct-07 1:36
sivaram praveen29-Oct-07 1:36 
AnswerRe: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. Pin
Ian Uy29-Oct-07 4:51
Ian Uy29-Oct-07 4:51 
QuestionMSSQL 2005 Log File Pin
sgsofy28-Oct-07 23:56
sgsofy28-Oct-07 23:56 
AnswerRe: MSSQL 2005 Log File Pin
Mike Dimmick29-Oct-07 1:22
Mike Dimmick29-Oct-07 1:22 
If you attached the database without the log file, SQL Server may have created a new log file, depending on the options you selected. It may well not be in the location you expect. In SQL Server Management Studio, right-click the database and click Properties. Under Files, scroll to see the Path and File Name columns. This will show where the log file is and the name of the file.

The transaction log is used to record all operations that are performed in the database. This is done using slow, reliable I/O in such a way that the log can be used to undo the operations should a power outage or other failure occur, or if a transaction is aborted. In practice the log is also used to defer writing back changes to the database itself - after the log data is written to disk, SQL Server only updates the affected areas in memory, lazy-writing these. It does ensure that the writes to the database file are done in a fairly timely fashion - it tries to ensure that recovery after a failure will take a bounded time, which is configurable (the 'recovery interval' option, which is set per-server, and defaults to 'automatic' which currently means about one minute). When performing a recovery operation, SQL Server may need to actually reperform actions that made it into the log but weren't yet written to the data files.

What happens to log records that represent changes that have been committed, and securely written to disk, depends on whether SQL Server thinks you want to retain the log records. If not, these log records then become available for reuse. When the end of the log file is reached, if the area at the beginning is available for reuse SQL Server will wrap around, otherwise it has to grow.

Whether SQL Server retains the log records depends on the recovery model and whether you've backed up. If the recovery model is set to Simple, SQL Server does not retain the logs. If, however, it is set to Full or Bulk Logged, and you have made at least one full database backup, it assumes that you do want to keep a backup chain and does retain the logs.

Why would you want to do this? Because if you have the log file and log backups available, you can restore not just the last full backup but also roll forward to the point of failure, or to a given point in time. If you are using Full recovery model, you should ensure that you're regularly backing up the transaction logs as well as the database - a full backup does not clear the transaction log chain (unlike Exchange, for example).

If you are using Full or Bulk Logged recovery model but want to reset your log chain, you can issue the command
BACKUP LOG database WITH TRUNCATE_ONLY
which marks all committed transaction log records as reusable. It will then not keep a log chain until you next do a full backup. To actually shrink the log file you will need to then use the Shrink Database feature.

There are tools available that can view the log file but they're not cheap.


DoEvents: Generating unexpected recursion since 1991

GeneralRe: MSSQL 2005 Log File Pin
sgsofy31-Oct-07 7:24
sgsofy31-Oct-07 7:24 
QuestionGet value from Sub Report in SSRS Pin
QPun28-Oct-07 23:16
QPun28-Oct-07 23:16 
AnswerRe: Get value from Sub Report in SSRS Pin
QPun29-Oct-07 15:13
QPun29-Oct-07 15:13 
QuestionSlow inRetrieving data Pin
briogene28-Oct-07 22:54
briogene28-Oct-07 22:54 
AnswerRe: Slow inRetrieving data Pin
soni uma29-Oct-07 0:05
soni uma29-Oct-07 0:05 
GeneralRe: Slow inRetrieving data Pin
Colin Angus Mackay29-Oct-07 0:09
Colin Angus Mackay29-Oct-07 0:09 
GeneralRe: Slow inRetrieving data Pin
soni uma29-Oct-07 0:41
soni uma29-Oct-07 0:41 
AnswerRe: Slow inRetrieving data Pin
Colin Angus Mackay29-Oct-07 0:08
Colin Angus Mackay29-Oct-07 0:08 
AnswerRe: Slow inRetrieving data Pin
Ian Uy29-Oct-07 4:52
Ian Uy29-Oct-07 4:52 
GeneralRe: Slow inRetrieving data Pin
Colin Angus Mackay29-Oct-07 5:12
Colin Angus Mackay29-Oct-07 5:12 
QuestionDoubt in StoredProcedure [modified] Pin
John.L.Ponratnam28-Oct-07 20:37
John.L.Ponratnam28-Oct-07 20:37 
AnswerRe: Doubt in StoredProcedure Pin
neeraj_indianic28-Oct-07 21:11
neeraj_indianic28-Oct-07 21:11 
GeneralRe: Doubt in StoredProcedure Pin
neeraj_indianic28-Oct-07 23:37
neeraj_indianic28-Oct-07 23:37 
AnswerRe: Doubt in StoredProcedure Pin
N a v a n e e t h28-Oct-07 21:16
N a v a n e e t h28-Oct-07 21:16 
AnswerRe: Doubt in StoredProcedure Pin
soni uma28-Oct-07 21:22
soni uma28-Oct-07 21:22 
AnswerRe: Doubt in StoredProcedure Pin
John-ph28-Oct-07 22:38
John-ph28-Oct-07 22:38 
GeneralRe: Doubt in StoredProcedure Pin
John.L.Ponratnam28-Oct-07 22:52
John.L.Ponratnam28-Oct-07 22:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.