Monday, 17 December 2018

How to recover database from rman command with example


Hi DBA-Mates,
We would like give a simple demo for how to recover database from rman backup with example.

It is very simple steps. As we all know these steps but for Quick check we can check it.

Please find the below details.
Backup details:
[oracle@localhost backup]$ ls -ltr
total 816752
-rwxrwxrwx 1 oracle oracle 794894336 Dec 12 05:09 ORCL_20181212_5_1_FULL
-rwxrwxrwx 1 oracle oracle   1114112 Dec 12 05:09 ORCL_20181212_6_1_FULL
-rwxrwxrwx 1 oracle oracle   9797632 Dec 12 05:31 ORCL_20181212_7_1_CONTROL
-rwxrwxrwx 1 oracle oracle  29705728 Dec 12 05:46 ORCL_20181212_8_1_ARCHIVE

 [oracle@localhost backup]$ rman target /
Recovery Manager: Release 11.2.0.2.0 - Production on Wed Dec 12 05:58:31 2018
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL (not mounted)

1. RMAN> startup nomount;
database is already started

2. RMAN> restore controlfile from '/home/oracle/backup/ORCL_20181212_7_1_CONTROL';
Starting restore at 12-DEC-18
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/home/oracle/app/oracle/oradata/orcl/control01.ctl
output file name=/home/oracle/app/oracle/flash_recovery_area/orcl/control02.ctl
Finished restore at 12-DEC-18

3. RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1

4. RMAN> restore database;
Starting restore at 12-DEC-18
Starting implicit crosscheck backup at 12-DEC-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
Crosschecked 3 objects
Finished implicit crosscheck backup at 12-DEC-18
Starting implicit crosscheck copy at 12-DEC-18
using channel ORA_DISK_1
Finished implicit crosscheck copy at 12-DEC-18
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /home/oracle/app/oracle/flash_recovery_area/ORCL/archivelog/2018_12_12/o1_mf_1_565_g1249wpd_.arc
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /home/oracle/app/oracle/oradata/orcl/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /home/oracle/app/oracle/oradata/orcl/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /home/oracle/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /home/oracle/app/oracle/oradata/orcl/example01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /home/oracle/app/oracle/oradata/orcl/APEX_1930613455248703.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/backup/ORCL_20181212_5_1_FULL
channel ORA_DISK_1: piece handle=/home/oracle/backup/ORCL_20181212_5_1_FULL tag=DATABASE_BKP121218
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:03:37
Finished restore at 12-DEC-18

5. RMAN> recover database;
Starting recover at 12-DEC-18
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 565 is already on disk as file /home/oracle/app/oracle/flash_recovery_area/ORCL/archivelog/2018_12_12/o1_mf_1_565_g1249wpd_.arc
archived log for thread 1 with sequence 566 is already on disk as file /home/oracle/app/oracle/oradata/orcl/redo02.log
archived log file name=/home/oracle/app/oracle/flash_recovery_area/ORCL/archivelog/2018_12_12/o1_mf_1_565_g1249wpd_.arc thread=1 sequence=565
archived log file name=/home/oracle/app/oracle/oradata/orcl/redo02.log thread=1 sequence=566
media recovery complete, elapsed time: 00:00:01
Finished recover at 12-DEC-18

6. RMAN> alter database open resetlogs;
database opened
RMAN>

SQL> select name,open_mode from v$database;
NAME      OPEN_MODE
--------- --------------------
ORCL      READ WRITE
SQL>

Some more useful links:
Regards,

Wednesday, 12 December 2018

Real Time Oracle Apps DBA Interview Questions

Dear DBA-Mates,
Hope you all are doing Good!!!

We understand that finding answers of these Questions is not easy for freshers but sorry due to lack of time, we are not able to prepare the Answers for all the below Questions.But these all are the asked question's in interview.

But please do some research, you will get it all. And doing research is a DBA's main task. So, please keep reading and sharing the Answers also...

1)Let me the flow of application when user login?
2)What is the purpose of authentication to connect to database?
3)Why u need GUEST/ORACLE To connect to database?
4)What is the purpose of JSERV?
5)How to increase the performance of Apache?
6)Tell me some issues with Apache?
7)Why u need httpd.pid?why u need to clear that?

10)If One dba can launch the forms and another unable to launch
the forms?what will be the issue?
11)How to set trace at forms level?
12)If u have Concurrent request with pending -standby
how do your troubleshoot?
13)If you have long pending requests and system become slow.what you do?
14)If you lost http.conf file, without running autoconfig to create all files,I want to generate only http.conf individually?
15)How autoconfig works?

16)what Concurrent Tables that will cleanup when u run cmclean.sql?
17)PCP configuration ?What is the principal behind it? how to u
configured?
18)What is diff between distributed AD and Shared Appl_top? what happens when u apply patch and distributed AD and Shared Appl_top?
19)What happen if you Miss Pre-Req patch and apply main patch
and how to do continue?
20)How to do u skip a worker

21)How to u recover if u lost a single file.
22)Explain how Dataguard works?what is the principal behind that?
23)what are different Session waits?
24)How do you check Blocking sessions?
25)Have u common across ora-600 errors?what is the cause of errors?
26)What are the different Events?
27)What are systemstat event Stand for?
28)What is the main purpose of maintenance Mode?
29)What if Apache is up when Maintenance Mode is up?
30)What is heap size?

31)Issues u faced with concurrent Managers?
32)What is the script u used to clean the FND_NODES of the
production Entries on non-Prod Entries.
33)How you mount the production Snap to target without putting the prod in begin backup mode?
34)How to check port Availability?
35)How do you Save time while doing patching?

36)What is the purpose of Defaults File?
37)Where do your increase processes for a concurrent Manager?
38)Wait Events? Different Wait events u have come across and what all the solution u have given to them?
39)How to check Port Availability?
40)How do you save time while doing patching?
41)Have u worked on workflow issues?
42)In Rac How do you do patching?
43)How do you check for conflicts with database patching?
44)What is the purpose of APPS,APPLSYS,APPLSYSPUB,At the login?
45)What happens when u put in database in begin backup mode?
46)why more redo's are generated?

47)Is the Datafile Will update when headers are freeze?
48)what actions can perform on datafiles when headers are freeze?
49)If you have 10 archive logs, How to find how many archives are required to complete the recovery?
50)Have u come across any ora-600 errors?

Hope this may useful and helpful.
Regards,

Friday, 7 December 2018

Real time Oracle DBA Interview Questions and Answers

Dear DBA-Mates,
Hope you all are doing Good!!! As per time constraint, not able to provide all the Answers but these are the some important Questions which are asked in Ci... MNC company... We will try to close all the answers slowly-slowly...
But for this time please go through the Questions and test yourself...

1) Rac Complete Configuration with prereq steps?
2)What is Voting disk and OCR File?
3) How u will take ocr Backup if u lost?
4)How to check the node connectivity? what is the script used for?
5)What are the advantages of ASM?
6)Why we use raw devices in ASM? can we use any other storage?
7)How to add redo logs in ASM?
8) How many Undo required in RAC?
9)Benefits of RMAN Backups
10)Have u clone RAC to Non RAC?

11)Clone of RAC to RAC..Tell me the difference?
12)Patching on Distributed AD?
13) Tell me some workflow background process?
14)How to generate DBC file?
15)For Discoverer What is required to set the profile?
16)SSO,OID ..u know?
17)U know Weblogic?
18)U know SOA, Application server?
19)what all the ad utilities u used ?
20)What are the different Status of Worker?

21)U know about events?
22)Let me different Ad options?
23)Flow of apps when u login ?
24)What is the use of DBC File and Tnsnames.ora
what is the difference here...both used for connectivity?
25)PCP Concepts ..how to implement?
26)where do you increase the process for a concurrent Manager
for standard manager?
27)Let the Major difference for 11i and R12?
28)Upgrade process 11.5.9 to R12?
29)How to you licence a product? what is the purpose of adsplice? what is the difference of the both?
30)Have u applied HRMS or Legislative Patches?

31)RAC node ,How do you patch?
32)RAC to Non RAC Clone? Explain and what are the major difference?
33)What exactly happens when any user connect to database?
34)How many undo's required in RAC?
35)What is $TWO_TASK
36)You do Rman Clones?
37)How to do save customizations, What u run autoconfig?
38)How to configure JVM?
39)What is JVM?
40)Have u faced any performance issues After upgrade?

41)what are the services running in R12(1st node - CM and DB
and 2nd node - web and forms
42)Custom_code Creation Steps
43) What are the things that can be done on OAM?
44) Mention some Workflow Tables?
45)why u rebuild workflow tables ?and How?
46)10g Discoverer can be configured on 11?
Hope this may useful...
Regards,

Monday, 3 December 2018

How to Restore DR database from RMAN

Dear DBA-Mates,
We would like to share some rough work for "How to Restore DR database" which can be helpful here for quick reference.

First we need to set the value for log_archive_dest_state_2 paramater as shown below in Primary Node.

In Primary Seerver:
SQL>alter system set log_archive_dest_state_2=DEFER sid='*';

Now, we should Physically check all the archive, once the full backup completed, as is available either in primary or in standby.

Then disable the archive purge cronjob in standby.
Also, Stop if any 3rd party snapsync jobs is running. In our case we don't have any.
Now, we will login to Standby and will start restore:

1. We will restore controlfile from production backup controlfile.
Login rman as:
$rman target /

rman>
restore standby controlfile from  '/rmanbk01/ora-data/backup/PRD_20180621_1919_1_CONTROL';
rman>

2. Start database in mount stage:
rman>alter database mount;

3. Start recovering from catalogs.
rman>catalog start with '/rmanbk01/PRD/backup/';

4. Restore the database.
rman>RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE disk;
ALLOCATE CHANNEL c2 DEVICE TYPE disk;
ALLOCATE CHANNEL c3 DEVICE TYPE disk;
ALLOCATE CHANNEL c4 DEVICE TYPE disk;
ALLOCATE CHANNEL c5 DEVICE TYPE disk;
ALLOCATE CHANNEL c6 DEVICE TYPE disk;
ALLOCATE CHANNEL c7 DEVICE TYPE disk;
restore database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
}

5. Once restore completed, we can check archive and start the catalog.
rman>catalog start with  'path/archivelog';

6. Now, we can start the MRP process as shown below:
rman>alter database recover managed standby database disconnect;

7. From below Query, we can monitor the restore process.

select SID,OPEN_TIME, (sysdate-open_time)*24*60 ela_time,close_time,filename,
(TOTAL_BYTES/1024/1024/1024) GBTOBEREAD,(bytes)/1024/1024/1024 GB_sofar  from V$BACKUP_ASYNC_IO where filename like '/path/datafile%';

Some more useful links: