Monday, March 26, 2012

Oracle database vault

command to check if database vault is enabled the database

GO to $ORACLE_HOME/rdbms/lib and execute following:
ar -t libknlopt.a | grep -c kzvidv.o

If it gives output as 0, database vault is disabled and vice versa.


To Enable:

cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk dv_on
make -f ins_rdbms.mk ioracle

To Disable:

cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk dv_off
make -f ins_rdbms.mk ioracle

Tuesday, January 31, 2012

Oracle DB Error:ORA-29702: error occurred in Cluster Group Service operation

Cause:
In case of standalone database,RAC has tobe made off.If its not made off,one can see this error while starting up the database.

Simple Solution:
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk rac_off
make -f ins_rdbms.mk ioracle

Sunday, October 9, 2011

Oracle RMAN -Simple commands

Recovery Manager :RMAN is a oracle utility used for backup and recovery purpose, following are simple commands to initiate with RMAN

connecting to RMAN
===========================

$ rman target sys/
If you’re accessing your target database remotely via Oracle Net, then you will need to
specify a connection string as follows:
$ rman target sys/@
You can also invoke RMAN and then connect to your target database as a second step,
from the RMAN prompt:
$ rman
RMAN> connect target /

Backing Up Your Database
===========================
You’re new to RMAN, and you want to back up your database. You just need to get a backup
created, and you want to take the simplest possible approach.
Solution
Start the rman utility, connect to your target database, and use the backup command to back up
your entire database:
$ rman target /
RMAN> backup database;


Simulating a Failure
================================
You want to simulate a failure as a prelude to testing RMAN’s restore and recovery capabilities.
Solution
To simulate a failure, perform the following steps:
1. Ensure you have a backup.
2. Determine the location and name of a datafile to rename. You will simulate failure by
renaming a datafile so that it appears to have been lost.
3. Stop the database.
4. Rename a datafile at the OS level (simulates media failure).
5. Attempt to start the database.

Before simulating a media failure, ensure that you’re in a noncritical test database environment
and that you have a good RMAN backup of your database. Run the following
command in your target database, and ensure that you have a good backup:
RMAN> connect target /
RMAN> list backup;

Caution If no backup information is listed, then stop here. You need to ensure that you have a good
backup of your database before you simulate media failure.
Determine the location of a target database datafile so that you can rename it to simulate
media failure:

RMAN> report schema;

Shown next is an abbreviated portion of the output of the previous command. This shows
the name of the file that you’re going to rename.

File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
4 22 USERS *** C:\ORA01\BRDSTN\USERS01.DBF

RMAN> shutdown immediate;
RMAN> exit

then rename the datafile to simulate

RMAN> connect target /
RMAN> startup

RMAN-03002: failure of startup command
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: 'C:\ORA01\BRDSTN\USERS01.DBF'



Restoring and Recovering Your Database
==========================================
You’ve experienced a failure and want to use RMAN to restore and recover your database. You
have a current and good backup in the default location, and all needed control files, archived
redo log files, and online redo log files are available.
Solution
Connect to RMAN, and use the following commands to restore and recover your database. In
this recipe you’ll perform the following steps:
1. Connect to the target database.
2. Mount the database.
3. Restore the database.
4. Recover the database.
5. Open the database.


RMAN> connect target /
RMAN> startup mount;
RMAN> restore database;
RMAN> recover database;
RMAN> alter database open;
database opened

Thursday, June 23, 2011

Cloning oracle database using RMAN Duplicate-(ASM to ASM) steps:

Precloning activities:










Source database:



-parameter changes at source datbase-pfile-remote_login_passwordfile= exclusive



-make source database archive log enabled.



-change the sys password to known value and create the passwordfile



-Make sure, you are able to connect to source database from target server(remote connection)



-Keep source database in mount or open state.









Target database:









-create the password file. Password should be same as source############



-parameter remote_login_passwordfile= exclusive



-add foolowing paramters db_file_name_convert = ('+DG_source/oradata','+DG_target/oradata') ###### DATA DISKGROUP.



log_file_name_convert = ('+DG_source_DB_RC/oraredo','+DG_target_DB_RC/oraredo') ####### REDO CONTROL DISKGROUP









Cloning Activity:















Target database:









start the Database in nomount state









Start the Listener.















Check the rman connectting on the Target.



=============================================================



rman target sys/***@source_db









connect auxiliary sys/***@target_db









================================================================









rman_duplicate.sh ######### I kept the Parallelism as 32 only. May be we can increase to 100. It may put load on source server



=================



rman target sys/***@source_db auxiliary sys/***@target_db trace=debug.txt LOG duplicate_${ORACLE_SID}_${DATE}.log
run {

duplicate target database to target_DB FROM ACTIVE DATABASE;

}

exit

EOF



Intiate the Script

==================

nohup /oracle/admin//clone/rman_duplicate.sh > rman_duplicate.out 2>&1 &







Monitor the Log file

tail -f duplicate_target_DB_.log



It will take care of complete cloning.









Tuesday, May 10, 2011

Error while installing CRS ...

Error in cluvfy checks:


Check: User equivalence for user "oracle"
Node Name Comment
------------------------------------ ------------------------
node1 passed
node2 failed
Result: PRVF-4007 : User equivalence check failed for user "oracle"



Solution:
Check for the ssh trust between nodes.
There should not be any banner after ssh.
check the user equivalence as a oracle user

Tuesday, May 3, 2011

Oracle DBA Interview Questions ....

SET 1

1. How did oracle database evolve?
2. What is the sysaux and system tablespace?
3. how to find the free space for undotblspace? Hint----dba_undo_extents?
4. locally managed vs dictionary managed tablespaces?
5. what if redo group is lost? what if redo member is lost?
6. what is snapshot too old error? How recover from it?
7. what is fast_MTTR_target? Hint---mean time to recovery
8. How to get free,used,total tablespace sizes?
9. List out types of backup
10. how to take hot backup?
11. what is undo tablespace?
12. what if control file is lost?
13.what are kernal and os level parameter need to be set prior to installation of oracle?
13. what if backup is going on and if snapshot too old error is occuring
14. what are required export and import parameters?
15. What are mandatory background processes?





Set 2:
1.What happens when we kill smon or pmon?
2.How to recover database if UNDO gets corrupted?
3.What is a fractured block and how to fix it?
4.What is a corrupted block and how to fix it?
5.What are the oracle threads which start when we start the database?
6.How do we check a index is working properly and how do we decide a particular index has to rebuilt?
7.What steps do we need to take if we receive a call that performance has gone
down as a dba?
8.Is it possible to change block size after db creation?
9.If users are not able to connect database or database is down what preliminary steps are to be taken?
10.What does oracle do when we take hot backup where actually modified
blocks are written?
11. On what basis should RAM be determined for a 50gb database?
12.Can we connect a database using listener instead of tnsnames?
13.Normally what are the jobs a DBA has to do on a daily basis?
14. Can we create a physical standby database using hot backup?
15.Is there a limit for concurrent user connections in Oracle?
16.Can we increase user connections by using LISTENER FILE?

Thursday, February 5, 2009

Mahendra Singh Dhoni...

Mahendra Singh Dhoni, sometimes abbreviated as MS Dhoni, महेन्द्र सिंह धोनी) (born July 7, 1981 in Lavali Village ) is an Indian cricketer and the current captain of the Indian team. Initially recognized as an extravagantly flamboyant and destructive batsman, Dhoni has come to be regarded as one of the coolest heads to captain the Indian ODI side. Under his captaincy, India won the 2007 ICC World Twenty20 ,CB Series of 2007-08 _ and IDEA Cup India-Sri Lanka ODI Series of 2008, the first ever bilateral ODI series win of India in Sri Lanka and the Border-Gavaskar trophy 2008 in which they beat Australia 2-0. Currently Dhoni is the top ODI batsman in the ICC ODI rankings. Mahendra Singh Dhoni was awarded the ODI Player of the Year award in 2008, the first Indian player to achieve this feat.He was conferred the Padma Shri , India's fourth highest civilian honour, in 2009
Personal life:
Mahendra Singh Dhoni was born in Ranchi ,Jharkhand to Pan Singh and Devaki Devi His paternal village Lvali is in the Lamgarha block of the Almora District of Uttarakhand .Dhoni's parents, moved from Uttarakhand to Ranchi where Pan Singh worked in junior management positions in MECON .Dhoni has a sister Jayanti and a brother Narendra. Dhoni had long hair which he has now shortened; he cut it because he wanted to look like his favourite film star John Abraham.Dhoni is a fan of Adam Gilchrist and his childhood idols were cricket teammate Sachin Tendulkar , Bollywood actor Amitabh Bachchan and singer Lata Mangeshkar .Dhoni studied at DAV Jawahar Vidya Mandir, Shyamali ,(now the school is known as JVM , Shyamli,Ranchi) Ranchi,Jharkahnd where he initially excelled in badminton and football and was selected at district and club level in these sports. Dhoni was a goalkeeper for his football team and was sent to play cricket for a local cricket club by his football coach. Though he had not played cricket, Dhoni impressed with his wicket-keeping skills and became the regular wicketkeeper at the Commando cricket club (1995 - 1998). Based on his performance at club cricket, he was picked for the 1997/98 season Vinoo Mankad Trophy Under-16 Championship and he performed well. Dhoni focused on cricket after his 10th standard .
Playing Style:
Dhoni is an aggressive right-handed batsman and wicket-keeper .Dhoni is one of the number of wicket-keepers who have come through the ranks of junior and India A cricket teams to represent the national team — Parthiv Patel .Ajay Ratra and Dinesh Karthik also followed this route. Dhoni, referred to as 'Mahi' by his friends, debuted in the Bihar cricket team during the 1998/99 cricket season and was selected to represent India-A for a tour to Kenya in 2004. Along with Gautam Gambhir Dhoni made multiple centuries against the Pakistan-A team in a tri-nation series and was selected in the Indian national team later in that year
Dhoni tends to play mostly from the back foot with a pronounced bottom hand grip.He has a very fast hand speed through the ball which often results in the ball racing across the ground. From this initial stance his feets do not show much movement which sometimes results in chasing balls while not coming to the pitch of the ball or inside edging a lot of balls.Dhoni scored 148 against Pakistan in his fifth ODI match in 2005 — then the highest score by an Indian wicketkeeper. Later in the year, he broke his own record as well as set the current world record for the highest score in the second innings in ODI matches as he scored 183* against Sri Lanka .Dhoni's success in the limited overs format secured him a place in the test team. Consistent performances in ODI cricket through the end of the 2005/06 season saw Dhoni briefly ranked as the No. 1 batsman in the ICC ODI ratings .
Dhoni's form dipped through 2006 as India lost matches at the ICC Champions trophy , DLF Cup , away bilateral series against West Indies and South Africa . A return to form in the home series against West Indies and SriLanka in early 2007 proved to be an inaccurate indicator of Dhoni's form as India crashed out of the first round in the 2007 Cricket World Cup . Dhoni was out for a duck in both India's losses. After the World Cup, Dhoni won the Man of the series award in the bilateral ODI tournament against Bangladesh For the tour of England , Dhoni was named the ODI team vice-captain.As a batsman, Dhoni has shown the maturity to restrain his aggressive nature and play a responsible innings when the situation requires. Apart from traditional shots, Dhoni has two very unorthodox but effective cricket strokes. Since his entry into the Indian cricket team, Dhoni's aggressive batting style, success on the field, personality, and long hair have made him one of the most marketable cricketers in India.
ODI careerODI Career of Dhoni. Brown line indicates 10 match average while the orange line indicates career average progressionThe Indian team in the 2000s saw the use of Rahul Dravid as the wicket-keeper to ensure that the wicket-keeper spot didn't lack in batting talent.The Indian cricket establishment also saw the entry of wicket-keeper/batsmen from the junior ranks with talents like Parthiv Patel and Dinesh Karthik - both India U-19 Captains in the test squads. With Dhoni making a mark in the India-A squad, he was picked in the ODI squad for the Bangladesh tour in 2004/. Dhoni did not have a great start to his ODI career, getting run out for a duck on debut.In spite of an average series against Bangladesh , Dhoni was picked for the Pakistan ODI series. In the second match of the series ,Dhoni in his fifth one-day international, scored 148 in Vishakapatnam off only 123 deliveries. Dhoni's 148 erased the earlier record for the highest score by an Indian wicketkeeper,a record that he would re-write before the end of the year.Dhoni had few batting opportunities in the first two games of the Sri Lankan bilateral ODI series (October-November 2005) and was promoted to No. 3 in the third ODI at Sawai Mansingh Stadium (Jaipur ). Sri Lanka had set India a target of 299 after a Kumar Sangakkara century and in reply. India lost Tendulkar early. Dhoni was promoted to accelerate the scoring and ended the game with an unbeaten 183 off 145 balls, winning the game for India- an innings described in Wisden Almanack (2006) as 'Uninhibited, yet anything but crude'.The innings set various records including the highest score in ODI cricket in the second innings,a record that still stands. Dhoni ended the series with the highest run aggregate (346) and was awarded the Man of the series award for his efforts. In December 2005, Dhoni was signed by BCCI to a B-grade contract, skipping the initial C-grade level due to his performance on the cricketing field.