Monday, December 31, 2012

Oracle Data Guard Functionality & Benefits


Oracle Data Guard is design to protect database against data loss & to resolve data corruption issues. Once the database corruption is detected, Oracle Data Guard can be use to recover database. See the full working picture of the Oracle data guard: 

Data Guard Functionality: 

As we can see in the figure, Oracle Data Guard is the combination of a primary database, and one or more standby databases. Oracle Data Guard maintains primary database transactionally consistent copies in standby database. It maintains transactional consistency using redo data. When the transactions occur in the primary database then redo data get generated and written to the local redo log files. This redo data transferred to the standby sites and applied to the standby databases, keeping them in sync with the primary database which clearly shows in the figure.   


Benefits of Data Guard: 

Data recovery 
Data Guard provides data recovery solution to resolve database corruption & to recover the data.

Data protection facility

Data Guard can provides data protection against data loss. 

Proper usage of system resources

The standby database tables can also be use for backups, reporting, summations, and queries. It reduce primary database workload & saving valuable CPU and I/O cycles. Just like standby database, users can perform normal data manipulation on tables in schemas with logical standby database.

Maximum protection, availability, and performance

It offers maximum protection, availability, performance which help to balance data availability against system performance requirements.

Centralized and simple management

It provides GUI and a command-line interface to automate management and operational tasks across multiple databases in a Data Guard configuration. 

Integrated with Oracle Database

Data Guard is an inbuilt feature of Oracle Database Enterprise Edition. 

So we can easily protect our Oracle database with the help of Oracle Data Guard. 
»»  Read More...

Friday, December 28, 2012

How to Fix MySQL Database Error: “incorrect key file for table try to repair”

The error message “incorrect key file for table try to repair” occurs when I was trying to select database from the table. I really shocked 'why the error occurred' even I did not perform any action on the database. I was searching the proper steps to fix this error & also ensure that it does not happen in the future again. Finally after a long search over the internet, I found that this error not even occur with myi table but can also occur with temp tables. Here is the full description of two scenarios: 

1. While you are trying to select data from the table:

Error: “Incorrect key file for table '.\XXX.MYI'; try to repair it”
Reason: This is the symptom of myi table corruption!!

Solution: 

1. Stop mysql
2. rename the .myi file  
3. restart mysql
4. REPAIR TABLE -- MySQL will see that the .MYI file is missing and rebuild it. But this time, it will be in a different spot on disk.

2. Whenever you try to fetch records from a table:  error:

Error: “Incorrect key file for table '/tmp/#sql_64d_0.MYI'; try to repair it”

Reason: Sometimes this error happens with temp tables, it means that there isn't enough disk space left on the partition where the temporary file would be written. Presumably MySQL has started to write data out to the file but then the disk space runs out, and that's when it errors out., it's likely you've run out of disk space. It's a temporary table, so you can't repair it. 

Solution: The simple solution of this error is to check your disk space, and make sure there should be some enough free space. You can do free some space by compressing and/or delete some old log files and backup files.

In my case, the error message occurs with myi table & get resolved by first method. so I only needed to repair myi table. 
»»  Read More...

Wednesday, December 26, 2012

How to Fix DBCC CHECKDB Error: Msg 5030, Level 16, State 12, Line 1


Have you ever received such error messages after running following DBCC commands


  • DBCC CHECKDB
  • DBCC CHECKTABLE
  • DBCC CHECKALLOC
  • DBCC CHECKCATALOG
  • DBCC CHECKFILEGROUP


The full error message description is:


“ Msg 5030, Level 16, State 12, Line 1 The database could not be exclusively locked to perform the operation. 
Msg 7926, Level 16, State 1, Line 1 
Check statement aborted. The database could not be checked as a database snapshot could not be created and the database or table could not be locked. See Books Online for details of when this behavior is expected and what workarounds exist. Also see previous errors for more details. “


In this case, DBCC CHECKDB command gets failed & show above error message. There are many reasons behind this error message. Some are: 


Causes behind this error:


  • When you run the DBCC CHECKDB command on the database, at that time another connection is using the same database.  
  • If the SQL Server database has file group that is marked as read-only, this error can occur. The reason behind it is that when DBCC CHECK check database consistency then it create and use an internal database snapshot. In this case, If a read-only file group exists then the internal database snapshot is not created & this error occur.


Solution to resolve this issue: 



1.First you should create a database snapshot for the database on which you want to perform the checks. 
2.After that run the DBCC CHECK command against the database snapshot.
3.Drop the database snapshot after the DBCC CHECK command is completed.


If it does not fix your problem, but after using above steps at least DBCC CHECKDB will finish and you'll have a better idea where the real problem exist.
»»  Read More...

Monday, December 24, 2012

Why Interbase Database Get Corrupt & How to repair it?


InterBase is a relational database management system & can be run on the many operating systems such as Linux, Microsoft Windows, Mac OS X and Solaris. In Interbase database, corruption does occur due to many causes but  it is very important to find the exact cause of the corruption otherwise you can loose your data. 

Here are some known causes of InterBase database corruption:


  • Shutting off the power on the server due electrical power interruption cause to database corruption. To avoid this cause, there is a necessity of having a source of uninterrupted power supply on your server. 
  • Copy database file or other file access to the database when the server is running. 
  • When the Database files become too large. For UNIX platform servers the limit is 2 GB, for Windows NT/2000 - 4 GB. 
  • If the server got crash while writing to disk, in this case the database may get corrupted.
  • Connecting to database during the database restoration process. 
  • When you try to move InterBase database from one OS to another by copying the database files. It can also lead to database corruption. 
  • If the client and server versions are not same then in this case the server get crash. Due to Server Crash your database got corrupted. 


Prevent Interbase database corruption: One of most trusted method to prevent database corruption is regularly update your backup. 

Repair corrupt Interbase Database: To repair your corrupt database, you can use command-line utility  -gfix or Database Validation in IBConsole.

GFIX has the following syntax:
Gfix [ options] db_name 

Final Words: If you want that your database never get corrupt then you should run database Validation or command-line 'gfix' from time to time. if the database corruption does occur so you can easily handle it before the severe damage to database & it is too easy to repair.
»»  Read More...

Friday, December 21, 2012

Are you Unable Access Database mdb file? Solution is here...


When I tried to open the .MDB file with MS-Access 2007, it prompted me for a password, but I never created any password for the database. When I tried to leave the password blank, I got following error message: 


“You do not have the necessary permissions to use the mdb object. Have your system administrator or the person who created this object establish the appropriate permissions for you."


I also tried to use the password provided to me on the "one-step security wizard report", but that also did not work & again I got the same error message.


What this error means: 


1.You applied user level security on access database & forgot the password.

2.In most of the cases, this error occurs when you save mdb file in a different program. For example, Microsoft Word permits you to open an Access database, and then to save it.  This may cause the .mdb file to prompt for database password when you again try to open the file in Access database. This occurs although the file may have never been password protected in Access database. In this case, When you try to open mdb file, password prompt occurs because access database checks first byte range. If that byte contains corrupted data, Access treats the file as password protected. 


Solution:


1. You can remove all user-level security that you previously applied, and then you need to give the Admin user Open/Run Database permission in order to open the MDB database file. If your intent was to keep this database secure, but not apply user-level security on the other databases, then you'll need to join the workgroup that was used to secure the MDB database, give the Admin user a password again, then rejoin the default workgroup, then create a shortcut that opens the MDB database with the appropriate workgroup. Then, you could just use the shortcut to open the MDB database, and you will be prompted for your User ID and password. 

2. If the error occurs due to second reason then the only solution is to restore a backup copy of the file. 


Hope the article will help you to resolve the error “You do not have the necessary permissions to use the mdb object.” You can post your comment and share this article with your friends as well.
»»  Read More...

Tuesday, December 18, 2012

How to Fix SQL Database Error: 'msdb' cannot be opened


Have you ever suffer with this error, when you are trying to open your SQL database:

"'msdb' cannot be opened due to inaccessible files or insufficient memory or disk space"

Most of the time, this error leads to database as suspected or recovery pending state

There are numerous causes behind this error message such as: 

1.This error occurs due to insufficient memory or disk space
2.When user account don't have sufficient permission to perform any operation on database or to view database files. 
3.Due to .mdf and .ldf file are not marked as read only 

Solutions:

1) If the error occurs due to insufficient memory or disk space then try to add more space by removing the unnecessary files from hard drive or move the database to another drive. 

2) You should check that the folder(s) where the MDF and LDF were created has read/write permissions on them or not. Set the enough permission to user account to perform the operation on the database.

3) Check operating system file system level, Are.mdf and .ldf file marked as read only or not?
In some cases, this error occurs when the database is set to Autogrow on. So set it to off to resolve this error.

Another Recommended Solution:

STEP1: First identify the database status by following command:

use master
select databaseproperty(‘db_name’,'isShutdown’)

Most of them it would return 1 in this situation

STEP2: After that clear up the internal database status:

use master
alter database db_name set offline

it would return with no error in most cases

STEP3: Get detail error message by following command:

use master
alter database db_name set online

After this step, sql server will first verify the log file, if the log file is okay, it will verify the rest of the data file(s). Most of time it is because of the file location or file properties setting. For example if it is file location issue: 

alter database db_name
modify (file=’logical name’, filename=’physical name’)
go

Important Tip: After resolving error & get back your database in working state, you should create full backup of your database and run DBCC CHECKDB against the database to make sure that now there are no more problem exist.
»»  Read More...

Monday, December 17, 2012

How to Fix Error: “MSACCESS.EXE has generated errors and will shut down”


I am using Access Database 2000 to manage my data. Last two days back, I split my Access database. The frond-end database is resides in each user's computer and link to tables in another Access 2000 that resides on Server. Suddenly I have a problem with Access database on the server. When I am trying to open access database, it is asking me to repair database. During the repairing process, this following error message popped up and shut down the Access application: 


"MSAccess.exe has generated errors and will be closed by Windows. You need to restart. An error log is being created."


Cause: After doing full research on error, I found that this error occurs when back-end file get corrupted. Generally this happens when the front-end database is forcefully closed or crashes during an UPDATE operation. It leaves the database in an inconsistent state & waiting for the UPDATE operation to finish.   



Solutions: 



1. The first step to resolve this error is to restore the file from the latest backup.



2. The second & most recommended solution is 'Compact & Repair' utility. 
Note: Before using this utility, you should ensure that you should have enough disk space for both the original and the compacted versions of the database. 



3. I resolved this issue by importing everything into a new database. This process is a bit of a painful & very lengthy, but not too bad because I got back my database by this step. 



4. Still if you are unable to open your database by above steps then you can also try one another solution that is third party Access Repair Software. These software repairs corrupt access database as well as corrupt database objects. 
Hopefully the article will help you to fix error MSACCESS.EXE has generated errors and will shut down. If you find any another way to fix this error then do share it with me and others too.
»»  Read More...