Category Archives: Server Application

Recover the Corrupted database in SQL server 2000

Dear All
Today I got one SQL server 2000 database which is in Suspect mode so tried to attach it in my local server but getting error and not able to attach so tried following options to recover it
1) created one new database with same name
2) Stopped SQL server service
3) Replaced corrupted mdf and ldf with newly created database.
4) Started SQL server service
5) shown that database status as SUSPECT
6) Then opened QUERY ANALYSER and executed following commands one by one.

select status from sysdatabases where name = ‘mscit_era3’
update sysdatabases set status= 32768 where name = ‘mscit_era3’
sp_configure ‘allow updates’, 1
reconfigure with override
dbcc rebuild_log (‘mscit_era3’, ‘d:\mscit_era3_log.ldf’)
use mscit_era3
go
alter database mscit_era3 set SINGLE_USER
go
dbcc checkdb (‘mscit_era3’, repair_allow_data_loss)
go
use master
update sysdatabases set status= 0 where name = ‘mscit_era3’
DBCC CHECKALLOC (‘mscit_era3’)
dbcc checkdb (‘mscit_era3′)
alter database mscit_era3 set multi_user

Then lastly again restarted SQL server
and its done

Be sure the LDF file path is d:\mscit_era3_log.ldf’.

Thanks
Prashant Deshpande

Advertisements

1 Comment

Filed under Database Server, SQL Server

Business Objects Installation issue

Dear All

I was trying to Install Business Objects on windows 2003 server and i was getting error “Error 1920. Service ‘Crystal Reports Cache Server'(BOBJCrystalReportsCacheServer) failed to start. Verify that you have sufficient privileges to start system services” so i have tried to install Business objects on different system but getting same error.

Solution :- These error messages appear because of a new feature called Data Execution Prevention (DEP). DEP is a set of hardware and software technologies that perform additional checks on memory to help prevent malicious code from running on a system.
To add services to the DEP feature so the services can run:

Right-click ‘My Computer’ and click ‘Properties’.
Under the ‘Advanced’ tab in the ‘Performances’ section, click ‘Settings’.
Under the ‘Data Execution Prevention’ tab click the ‘Add’ button
and specify the teh service file name along with Path

Thanks

Prashant Deshpande

Leave a comment

Filed under Business Objects, Operating System

Get the Logical File name of SQL server Databases

Dear All

As there was a requirement of shrinking of LOG files  in SQL server and many times we just copy the old Database with new name and we never look for logical file of log file which is required while shrinking teh log file.

Syntax of Shrink database log file is

use Databasename
backup log Databasename with truncate_only
dbcc shrinkfile(“Logical File name “,1)
go

As we don’t know the Logocal File name the following command will help us to get the logical file names of all databases present in SQL server

Open Query Analyser and type

Use Master

select a.name, b.name as ‘Logical filename’, b.filename from sysdatabases a inner join sysaltfiles b on a.dbid = b.dbid where fileid = 2 

 

 Thanks

Prashant Deshpande

Leave a comment

Filed under Database Server, SQL Server

Access Denied Status for Website in IIS

Dear All

Please read the following blog which i have faced and  the solution got for Access Denied Status in  IIS .

Problem: – user was trying to create a Virtual Directory in IIS and getting successfully added but showing status as Access Denied because of which it was not getting browsed

Options Tried :-
          1) In the Directory security tab of virtual directory given access to anonymous user
          2) In the Directory security tab selected digest the windows authentication
          3) Right click virtual directory and used permissions wizard.
          4) Given permission on directory to ASPNET user
          5) Uninstalled and reinstalled IIS on the system

Didin’t got sucess after trying any of the above option.

Solution: – Issue was with drive security permissions , The drive on which the physical directory is present that drive should have following permissions SYSTEM user and CREATOR user should have full control which has resolved the issue.

Your Comments are always welcome

Thanks

Prashant Deshpande

Leave a comment

Filed under IIS, Server Application, Web/Application Server

Working with ADMT tool

Dear All

When we need to tranfer multiple PC’s from one Child Domain say A to another child domain say B in same forest. Instead of creating teh User account and computer account again we can use ADMT tool to migrate user acount and computer account from A to B.

Benefit of using ADMT tool is all users settings will also get migrated so when user will log into new Child domain he will not face any issue only he will be sitting in new place but working with old settings.
Even when we use ADMT tool exchange server mailboxes also get transfered. which is also a good feature.

Downlaod ADMT tool from Microsoft site and install it on Source or target Domian controller and foillow the next steps

Here it will show us the no of user / computer accounts migrated.

Thanks

Prashant Deshpande

Leave a comment

Filed under Active Directory, Server Application

Recover Suspect SQL Server 2005 Database

Dear All

Please Read the follwoing documentation for

Recover Suspect SQL Server 2005 Database
Problem
one of our Digital university client’s SQL server  2005 database that has the wrong database status.  For some reason it is in the ‘Suspect\Offline’ mode.  And I have been told by project manager to check and correct the problem quickly and get the database back online.  How can I do so?   Once the status is correct, do I need to take any further steps? 

Solution

I have taken use of the script below to correct the SQL Server 2005 database status,.  We also need to correct any sort of corruption and understand why this occurred in the first place. 

Database Status Correction Script

The script below will change the database to be in simple recovery mode, which may or may not be the needed configuration for your database.  As such, it is necessary to review the database configurations once this script has been executed.  In addition, it is necessary to change the ‘DBName’ to your database name in single quotes.

EXEC sp_resetstatus ‘DBname’;

ALTER DATABASE DBname SET EMERGENCY

DBCC checkdb(‘DBname’)

ALTER DATABASE DBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE

DBCC CheckDB (‘DBname’, REPAIR_ALLOW_DATA_LOSS)

ALTER DATABASE DBname SET MULTI_USER

Check for Corruption

The next step in this process is very key.  It is necessary to determine if the database has any corruption and ensure that the database will be able to support the users.  If the database has corruption, we may be exposing ourself to more issues by just changing the database status without correcting the underlying issue.  To identify the underlying issue, execute the following commands:

  • DBCC CHECKDB – Validate the overall database integrity
  • DBCC CHECKCATALOG – Validate the system catalog integrity
  • DBCC CHECKTABLE – Validate the integrity for a single table

To resolve the issue, we may need to do one or more of the following:

  • Drop and Recreate Index(es)
  • Move the recoverable data from an existing table to a new table
  • Update statistics
  • DBCC UPDATEUSAGE
  • sp_recompile

To ensure the issue is corrected, it is a good idea to re-run the identification commands listed above and validate that they do not have any issues. 

Thanks

Prashant Deshpande

Leave a comment

Filed under Database Server, Server Application, SQL Server

Remove Mailboxes from exchange server 2007 for corrupted Domain

Dear All

As the Branch Domain controller had some issues, so the users of that domain had to be freshly created on other child domain FS which has resolved the login issue for the users in domain and Pop3 account was configured for them, they were able to send the emails. As the mailboxes are present on exchange server, all the emails for those users are collected by exchange server and those users were unable to receive emails which was a major issue.

As exchange server mailboxes were already created for old child domain so when we were trying to delete these mailboxes in exchange server, it was trying to contact the old child domain controller. Due to some issues in the old child domain controller it was unable to contact it and we were not able to delete those mailboxes from exchange server.

So I tried by restoring System State Backup on another server but as the hardware configuration mismatched the windows 2003 OS crashed after restoring system state backup . Tried the same for multiple times with multiple systems.

Then I thought that, as users are logging from new child domain and exchange server is also not able to contact the old child domain why don’t we remove the child domain entry from forest.

SO I then copied ADSIedit from Support Tools folder of windows 2003 CD and pasted it in c:\windows of root domain controller of forest with enterprise admin and schema admin rights . To use adsiedit tool we need to register the adsiedit.dll as

(I am not including the screen shots for security reasons)

Start -> run -> regsrv32 adsiedit.dll

Then

Start -> run -> adsiedit.msc

Step 1

Explore the tab CN=configuration from left panel

Explore CN=Sites and from the specific site Select CN=servers tab

Here delete domain controller name of the old child domain

Step 2

Explore the tab CN=configuration from left panel

Explore CN=partitions you will see two records ( one is DNS , other is active directory partion ) for each of the Domain present in forest, delete both the records for the old child domain.

 After few minutes it will get replicated to the complete forest and automatically all the mailboxes associated to that domain will be removed from exchange server and even when we press ALT + CTRL + DEL, to login, you will not see the old child domain name in the Domain List  :).

Please use ADSIedit carefully as it explores all Schema data of Forest

Thanks

Prashant Deshpande

2 Comments

Filed under Active Directory, Server Application