ResetLSN Method

Collapse All Expand All Code: All Code: Multiple Code: C# Code: Visual Basic Code: Visual C++

C#
Visual Basic
Visual C++

Berkeley DB .NET API Documentation
DatabaseEnvironment..::.ResetLSN Method
DatabaseEnvironment Class See Also Send Feedback

Allow database files to be moved from one transactional database environment to another.

Namespace: BerkeleyDB
Assembly: libdb_dotnet62 (in libdb_dotnet62.dll) Version: 6.2.32.0

# Syntax

C#
    public void ResetLSN(
    	string file,
    	bool encrypted
    )

Visual Basic (Declaration)
    Public Sub ResetLSN ( _
    	file As String, _
    	encrypted As Boolean _
    )

Visual C++
    public:
    void ResetLSN(
    	String^ file,
    	bool encrypted
    )

#### Parameters

file
  Type: System..::.String

encrypted
  Type: System..::.Boolean

# Remarks

Database pages in transactional database environments contain references to the environment's log files (that is, log sequence numbers, or LSNs). Copying or moving a database file from one database environment to another, and then modifying it, can result in data corruption if the LSNs are not first cleared.

LSNs should be reset before moving or copying the database file into a new database environment, rather than moving or copying the database file and then resetting the LSNs. Berkeley DB has consistency checks that may be triggered if an application calls ResetLSN on a database in a new environment when the database LSNs still reflect the old environment.

The ResetLSN method modifies the physical file, in-place. Applications should not reset LSNs in files that are currently in use.

# See Also

DatabaseEnvironment Class
BerkeleyDB Namespace