Sep 28 2011

RMAN Show Commands

The SHOW command is used to display the values of current RMAN configuration settings.

RMAN> show all;

Shows all parameters.

RMAN> show archivelog backup copies;

 Shows the number of archivelog backup copies.

RMAN> show archivelog deletion policy;

Shows the archivelog deletion policy.

RMAN> show auxname;

Shows the auxiliary database information.

RMAN> show backup optimization;

Shows whether optimization is on or off.

RMAN> show  auxiliary channel;

Shows how the normal channel and auxiliary hannel are configured.

RMAN> show controlfile autobackup;

Shows whether autobackup is on or off.

RMAN> show controlfile autobackup format;

Shows the format of the autobackup control file.

RMAN> show datafile backup copies;

Shows the number of datafile backup copies being ept.

RMAN> show default device type;

Shows the default type disk or tape.

RMAN> show encryption algorithm;

Shows the encryption algorithm currently in use.

RMAN> show encryption for database;

 Shows the encryption for the database.

RMAN> show encryption for tablespace;

 Shows the encryption for the tablespace.

RMAN> show exclude;

 Shows the tablespaces excluded from the backup.

RMAN> show maxsetsize;

 Shows the maximum size for backup sets. The default value is unlimited.

RMAN> show retention policy;

 Shows the policy for datafile and control file backups and copies that RMAN marks as obsolete.

RMAN> show snapshot controlfile name;

 Shows the snapshot control filename.

Note: You can see any nondefault RMAN configured settings in the V$RMAN_CONFIGURATION database view.

Dec 25 2010

DBA Interview Questions – Part 2

1) Primary database scn is 22 and standby SCN is 24 how you will resolve this issue.

2) Archive log got deleted before shipped to standby location how you will resolve this issue.

3) 3 users running same select but one of them response time is 1hr and for other few minutes how u will diagnose this.

4) What is advantage of ASM over os storage and raw storage.

5) What is remastering in RAC

6) How you can see database version at OS level.

7) A job is running since long it was working fine earlier how you will check that

8) How you will suggest joins to developer

9) 3 databases sizes 10gb, 100gb, 1TB how which database will take more time.

10) You lost control file database is using RMAN backup with nocatalog. If you loose whole db as well same time how you recover database.

11) what is sync, and async in standby how it works.

12) Shut immediate is taking too much time how you diagnose what is the issue.

13) How you take backup of OCR.

14) What will happen if voting disk is down.

15) What will happen if virtual IP is down in RAC.

VIP – Virtual IP address in RAC

VIP is mainly used for fast connection in failover.

Until 9i RAC faileover we used physical IP address of another server. When the connection request come from a client to server, then failure of first server listener then RAC redirect the connection request to second available server using physical IP address. Hence it is physical IP address rediretion to second physical IP address is possible only after we get timeout error from First Physical IP address. So connection should wait a while for getting TCP connection timeout.

From RAC 10g we can use the VIP to save connection timeout wait, Because ONS (Oracle Notification Service) maintains communication between each nodes and listeners. Once ONS found any listener down or node down, it will notify another nodes and listeners. While new connection is trying to establish connection to failure node or listener, virtual IP of failure node automatically divert to surviving node. This Process will not wait for TCP/IP timeout event. So new connection will be faster even one listener/node failed.

Sep 11 2010

How to recover from a DROP or TRUNCATE table by using RMAN.

There are three options available:

1. Restore and recover the primary database to a point in time before the drop. This is an extreme measure for one table as the entire database goes back in time.

2. Restore and recover the tablespace to a point in time before the drop. This is a better option, but again, it takes the entire tablespace back in time.

3. Restore and recover a subset of the database as a DUMMY database to export the table data and import it into the primary database. This is the best option as only the dropped table goes back in time to before the drop.

So option 3 is best.

Steps for Option 3

1. To recover from a dropped or truncated table, a dummy database (copy of primary) will be restored and recovered to point in time so the table can be exported.

2. Once the table export is complete, the table can be imported into the primary database. This dummy database can be a subset of the primary database. However,the ‘dummy’ database must include the SYSTEM, UNDO (or ROLLBACK), and the tablespace(s) where the dropped/truncated table resides.

The simpliest method to create this ‘dummy’ database is to use the RMAN duplicate command.

RMAN Duplicate Command

CONNECT TARGET SYS/oracle@trgt
CONNECT AUXILIARY SYS/oracle@dupdb

DUPLICATE TARGET DATABASE TO dupdb
NOFILENAMECHECK UNTIL TIME ‘SYSDATE-7′;

Assuming the following

•The target database trgt and duplicate database dupdb are on different hosts but have exactly the same directory structure.

•You want to name the duplicate database files the same as the target files.

•You are not using a recovery catalog.

•You are using automatic channels for disk and sbt, which are already configured.

•You want to recover the duplicate database to one week ago in order to view the data in prod1 as it appeared at that time (and you have the required backups and logs to recover the duplicate to that poin tin time).

Sep 07 2010

Command to find files created a day before

This command will help you to find the files created one day before in the specified folder.

find . -type f -mtime 1 -exec ls -lth ‘{}’ \;

Aug 27 2010

ORA-1578: ORACLE data block corrupted

Issue:

Database is in Flashback Mode.

Enabled No logging on some db Tables

Recover the database.

Truncate those no logging Temporary tables.

Now we get error message ORA-1578: ORACLE data block corrupted

Reason:

Oracle says it is a behavior in 10g and fixed in 11g Rel1.

Cannot Reuse a Corrupt Block in Flashback Mode, ORA-1578 [ID 729433.1]

In 11g (11.1 releases) there is an optimization introduced to skip the block read if the object was dropped before the flashback retention range, and this will help with corrupt blocks on disk.

Aug 27 2010

Flashback Database disabled automatically

Issue 1:

Intially Flashback Database was enabled but noticed Flashback was disabled automatically long time ago.

Reason:

It could be because the flashback area 100%

Once Flashback Area become 100% full then oracle will log in Alert that Flashback will be disabled and it will automatically turn off Flash Back without user intervention.

Jul 28 2010

How can I check if there is anything rolling back?

It depends on how you killed the process.

If you did and alter system kill session you should be able to look at the used_ublk block in v$transaciton to get an estimate for the rollback being done.

If you killed to server process in the OS and pmon is recovering the transaction you can look at V$FAST_START_TRANSACTIONS view to get the estimate

Jul 01 2010

Explain the relationship among database, tablespace, and datafile.

The database is logically divided into one or more tablespaces.
For each tablespace we explicitly create one or more datafiles.

Jun 28 2010

How to recover if we delete a data file at OS level no backup for that?

bring the database to the mount state
sql>alter database create datafile ;
sql>recover datafile ;
sql>alter database open;

Jun 22 2010

How do you see how many instances are running?

In Linux, Unix the command: ps -ef|grep pmon
In Windows: services.msc

Alibi3col theme by Themocracy