How to read Transaction Log File

follow link Today morning, one of my colleague came to my desk with an interesting question. “Is there any way to read SQL T-Log file?” I did not have idea about it I searched on google and I found an un-documented functions which is used to read T-Log file. Using this function, we can get list of all transaction performed on database. Function name is fn_dblog() (Formally known as DBCC command).


see The fn_dblog() will accept two parameters:
  1. Starting log sequence number (LSN). We can specify null, it will return everything from start of log.
  2. Ending log sequence number (LSN). We can specify null, it will return everything to end of the log. Demo Code:

اسعار الاسهم الامارات I have created new database named “SampleDatabase”. Then I created new table called “Inventory” and insert some values in table.
Now I want to get all the transaction (Insert, Update, Delete, create Table) performed by on database. So, I can run below query.

أربح المال على الإنترنت في الهند In above code, you can see I used the fn_dblog function in the “FROM” clause. I also used the ��WHERE” predicate to return only transaction log rows that involved a CREATE TABLE, INSERT and/or DELETE transaction created by database user Nisarg-PC\Nisarg.

see url This function is undocumented and you should use it with caution.

الخيارات الثنائية فيبوناكسي استراتيجية

T-SQL script to retrive full backup and transaction log backup

follow link Taking Backup and Restoring database are most essential part of DBA’s life. As a DBA we should always be prepared for disaster. Here disaster in term of Accidental data-loss, storage failure, file or database corruption.We must have an appropriate backup to bring database online within given RTO (Recover Time Objective). According to many database administrator, we must have good backup plan. I respectfully disagree, DBA’s must have good recovery plan. As we know we might have sufficient time to backup database but we have less time to bring database online.When our RTO is nearly zero, at that time each and every minute become very important.

follow To reduce database recovery  time i have created a small script which will list most recently taken full database backup and all the T-Log backups after full backup. Backup scenario is

  • Full Backup at 12:00 AM everyday
  • No differential backup
  • Transnational log backup every two hours.

follow site

go to link  

follow link  

SQL Server: Choosing best high availability technique

click here As a DBA sometimes we came across the situation when we have to choose a best High Availability and Disaster recovery solutions.

get link Each has its own advantages and limitations.

click here To provide an accurate choice which technology to use, DBAs must have through understanding of business needs for high availability, How fast  should fail-over happen,how many replicas  required and if reads can happen on the secondary. Each SQL Server High availability technology has  short comings on a different dimensions.

watch Here is a quick table for reference.

follow Feature  watch Fail over clustering ماهو افضل بنك لتداول الاسهم Database Mirroring Log Shipping Transactional Replication
Storage redundancy ?  No Yes Yes Yes
 No need for special hardware? No Yes Yes Yes
Role change automatically Yes Yes No No
No need for additional server ? None Witness Monitor* Distributor*
Reports read from secondary ? NA No Read only Yes
Scope of availability Instance level Complete Database Complete Database Database Objects
 Multiple secondary client NA No Yes Yes
Auto redirection after failover Yes No: Need custom solution No: Need custom solution No: Need custom solution
Recovery Model Any Full Full Any