Friday, 4 October 2013

Restoration of database from RMAN Backup



1.Install Oracle 10g(10.2.0.5) on RHEL 5.6(Required For My setup, You can install as per your Requirement

 2. Create user Oracle and set environmental variables

  export ORACLE_SID=TEST

               3.Create pfile with necessary parameters like  db_name  ,control_files,

                  Background_dump_dest

  4.Start the database in nomount Stage with the pfile.

  >Startup nomount

  5.Start RMAN and connect to the target instance

   $rman TARGET / NOCATALOG

   6.Restore the controlfile from backup piece.

                RMAN>Restore controlfile from ‘Path with backup piece Name’

                7.Catalog all the backup pieces

               RMAN>catalog backuppiece ‘Path with backup piece Name’

              Take controlfile trace and check whether all physical location for datafiles available,

              If not add set newname & switch datafile all commands to the below rman script by            

              Mentioning old path & New Path

              8.Restore and Recover.

              RMAN> run {

              2> allocate channel c1 type disk;

              3> restore database;

              4> recover database;

              5> release channel c1;

              6> }

               9. Open the database in Resetlogs option

              >Alter database open resetlogs;

Diskgroup addition 11gR2 Rac on Windows


Adding  Disk group on 2 - Node 11gr2 RAC on Windows


-->Control Panel\All Control Panel Items\Administrative Tools -->Computer Management --> Disk Management





Create a partition with required size from the Free Space.

In My setup Disk 1 is the shared storage between the Nodes. From the available 7.5 GB am going add one partition with 2GB of Size.




Dont assign drive letter.


.

Do not Format the Volume.






Refresh the Disk Management in other Node, So that the same will appear there too. In case if it has got some default drive letter in other Node, remove the drive letter.




Once the partitions are completed, I used the ASMTOOLG.EXE utility to stamp each partition with an ASM label so that Oracle can recognize these partitions as candidate disks for the ASM instance. I executed the ASMTOOLG.EXE program.

This step is mandatory, otherwise asmca utility will not identify your asmdisk.




When we add label, we could find the candidate device with 2GB of size as we created. Select the same disk and then We can add the prefix as our wish.





Once it is done Use asmca to create diskgroup using those disks.  --> Create Diskgroup




It will display the disk, which we have created. Since we have only one disk, I have used external redundancy.







Check the same in other node. Check whether the diskgroup mounted or not.




Its Done.




Issues Faced,


While trying to stamp asm header, found below error,




Error from Node 2. When I check the status of the diskgroup, it was unmounted. logged in to +ASM2 instance and then mounted those diskgroups,

>alter diskgroup dd2 mount;

Everything worked fine.

Tuesday, 17 September 2013

Online Redo corruption

Hi,

One of my development db was affected because of Online Redo corruption.

Since it is non - critical db I have applied this solution and got my db back.

If you face Online Redo corruption, Please raise SR with oracle before trying this soln.


DB would go upto Mount Stage.

You can fing LGWR error in alertlog file.

Soln.

Create a pfile

>create pfile from spfile;

In Pfile add the undocumented oracle parameter

_allow_resetlogs_corruption=true

then start the db using the edited Pfile.

Now It needs an fake recovery..

So

>startup Mount;

>recover database;

>alter database open resetlogs;


then give checpoint

>alter system checkpoint

>alter system switch logfile

recreate the corruputed redolog file by dropping the existing one.

Remove that undocumented parameter from pfile.
 
Then Found the database is not consistent.. and instance was terminated automatically..
 
In alertlog
 
Found ORA-600
 
The issue was because of some uncommited transactions (corruption) in the undo tablespace
 
So, created New undo tablespace and then assigned undo_tablespace into new undo tablespace, restarted the instance.
 
Finally Issue got cleared..
 
Experts comments welcome...
 
 

Wednesday, 13 February 2013

How to completely uninstall oracle 11g from windows server 2008

In 11g to uninstall oracle software, U have to manually run deinstall.bat

Its not possible thru OUI.

1. Log in as the Administrator.
2. Run  ---> Services.msc --> Stop all Oracle related Services
3. Run ---> From a cmd window, run <<ORACLE_HOME>>\deinstall\deinstall.bat.

It would prompt you for database, and it would take time to complete.

4. Delete the ORACLE_HOME directory.

In Windows server 2003, In HKLM under software u will find one oracle folder, Removing that in enough in server 2003,

Here We have to remove the following things from registry entry,

Run---> regedit--->  

HKLM\System\CurrentControlSet\Services\EventLog\Application\Oracle Services for MTS
HKLM\System\CurrentControlSet\Services\EventLog\Application\OracleDBConsole<SID>
HKLM\System\CurrentControlSet\Services\EventLog\Application\Oracle.<SID>
HKLM\System\CurrentControlSet\Services\EventLog\Application\Oracle.VSSWriter.<SID>
HKLM\CurrentControlSet\Services\Oracle11

HKLM - HKEY_LOCAL_MACHINE

then reboot the server once.

You are done with uninstallation.

Thanks.