Showing posts with label MS SQL Server Database 2008. Show all posts
Showing posts with label MS SQL Server Database 2008. Show all posts

Sunday 26 October 2014

step by step to create dblink in MS SQL database to connect Oracle Database


Step1: Download Oracle client

Step2: Install Oracle Client in the server where MS SQL Database installed 

Step3: Configure tnsnames.ora file in Oracle client

Step4: Start SQL Server Management Studio





Step5:  Enter the login name and password for a SQL administrator account such as sa. 


Step6: Click to expand the SQL Server | Server Objects.
Right-click Linked Server and click New Linked Server.


 Step7 : Create a SQL Server Linked Server Object

  1. Start SQL Server Management Studio
  2. Expand Server Objects
  3. Expand Linked Servers
  4. Expand Providers

  1. Make Sure MSDASQL (Microsoft OLE DB Provider for ODBC Drivers) is installed on the server
  2. Right Click on Linked Servers
  3. Select New Linked Server...
  4. Assign a name to the Linked Server; I suggest a single word name like oracle_db.
  5. Select Microsoft OLE DB Provider for Oracle
  6. Set the Product Name to Oracle Database.
  7. Set the Data Source to the tnsname

  1. Select Security page
  2. Select Be made using this security context
  3. Set the Remote login field to the Oracle Database User Id
  4. Set the With password field to the Oracle Database Password
  1. Click OK button

Step8 : Test the new Linked Server




Monday 18 August 2014

How to purge Log in SqlServer Database



Step1: Open the SQL Server Management Studio by choosing Start > Programs > Microsoft SQL Server 2008 > SQL Server Management Studio.

Step2:  right-click on Database and open new sql query and execute following query to shrink Database log file to 20MB

USE [DB_NAME]
GO
ALTER DATABASE [DB_NAME] SET RECOVERY SIMPLE WITH NO_WAIT
dbcc shrinkfile(DB_Log_File_Name,20)
ALTER DATABASE [DB_NAME] SET RECOVERY FULL WITH NO_WAIT
GO

Note: Above colored texts are variable

USE [servicedesk]
GO
ALTER DATABASE [servicedesk] SET RECOVERY SIMPLE WITH NO_WAIT
dbcc shrinkfile(servicedesk_log,20)
ALTER DATABASE [servicedesk] SET RECOVERY FULL WITH NO_WAIT
GO