You are on page 1of 9

Data Recovery One of my control file corrupted and I am unable start database, How can I perform recovery?

If one of your control file is missing or corrupted then we have 2 options to recover it. Check alert.log for exact name and location of corrupted control file. Delete it manually and copy from available rest of control file and rename it and start database. Another option is delete corrupted control file and remove name from parameter file/ spfile. After removing said control file from spfile, start your database.

What is incremental checkpoint? In incremental checkpoint process, CKPT process records lowest Low RBA to the control file to keep advancing the Buffer checkpoint Queue (BCQ) to make easy and fastest Active Checkpoint Queue (ACQ). Does incremental checkpoint recorded in Alert.log? How to disable it? We can enable disable recording incremental checkpoint in alert.log .We can enable/disable recording using parameter log_checkpoints_to_alert=true/false. I am working as Oracle DBA in 24/7 running large production database. Size of database is around 800 GB. We take hot backup every day night. But one day at around 4:00 PM, by mistake one table is dropped by application user. Table is very useful. How to recover that dropped table? If your database is running on Oracle 10g version then there is new feature available called Recyclebin. You can recover dropped table from user_recyclebin or dba_recyclebin.

In continuation of above scenario, No. Recyclebin doesnt enable in my database then how to I recover my table in above scenario? Then you should need to restore backup on your UAT or test database server and enable time based recovery for applying all archives before drop command execution. For an instance, apply archives up to 3:55 PM here.

In continuation of above scenario, why I should need to perform recovery in UAT or test database server? Can I restore backup in production database server? No. It is not recommended because your production database is large database and running 24/7 environment. Restoration and recovery will take downtime. It is better to perform restoration and recovery process on UAT or Test database.

What is the meaning of LGWR SYNC and LGWR ASYNC in log archive destination parameter for standby configuration? When use LGWR with SYNC, it means once network I/O initiated, LGWR has to wait for completion of network I/O before write processing. LGWR with ASYNC, means LGWR doesnt wait to finish network I/O and continuing write processing.

How can I know my require table is available in export dump file or not? Create indexfile of export dump file using import with indexfile command. A text file will be generating with all table and index object name with number of rows. You can confirm your require table object from this text file.

Archive log are being generated around 20 GB in my production large database. But one day almost double archives were generated. What is the reason behind this? How can I check it? There are lots of reason behind increasing size of archives like If more database changes were performed using batch jobs or any special task like merging 2 database or data etc. You can check it using enabling Log Minor utility. How do you recover from the loss of datafile if the DB is running in ARCHIVELOG mode? We can perform this recovery in 2 ways. One is open database mode and another is database mount mode. After taking offline lost datafile, we can bring database open and after that restore lost datafile from last backup. After restoration of datafile we can perform datafile level recovery for applying archive logs and make it online. In database mount mode, we can restore datafile from backup and perform datafile recovery using Recover datafile command. What is a Complete Recovery? During this recovery we are applying all database changes using archives log and make it to up to date. Complete recovery can be done full database level or datafile level or tablespace level. Main concept is to apply all data changes using archive logs and bring database up to recent time. Why we should need to open database using RESETLOGS after finishing incomplete recovery? When we are performing incomplete recovery it means we bring database to past time or rewind period of time using change based, cancel based or time based recovery. These all recovery make database in prior state of database. The forward sequence number already available after performing recovery, due to mismatching of this sequence numbers and prior state of database, it needs to open database with new sequence number of Redo log and archive logs. Why export backup called as logical backup? Export dump file doesnt backup or contain any physical structure of database like datafile, control file, redo log file, parameter file, password file. Instead of physical structure, export dump contains logical structure of database like definition of tablespaces, segments, schemas, data of segments etc. Due to these reasons export dump is called as logical backup. Have you faced any recovery scenario? Explain us how you resolved it? 2 months back, a potential table was dropped by an application developer on our large 24/7 running production database. Immediately he informed us. We have standby database for our production database. We checked that archives didnt apply to standby database up to dropped timing. We stopped archive applying on standby immediately and open database read only. Took export of dropped table and imported in production database. After finishing appropriate checking of table, again we started archive applying in standby database for refreshing.

Which command I should need to execute to take backup of database which is running on NOARCHIVELOG mode? Shutdown immediate. Because without shutdown, we cant perform online backup of database, which running on NOARCHIVELOG mode. We should need to take cold backup of database. What are the steps involved in Instance Recovery ? instance recovery or crash recovery .when the database is shutdown by shut abort or due to power failure then this type of recovery happens .it is done by the oracle itself only by the help of smon bg process.when the db is open then it checks the scn of online redologs and controlfile and datafiles . it synchronizes all the 3 scn numbers by getting the values from undo before image and redo data What is Log Switch ? The point at which ORACLE ends writing to one online redo log file and begins writing to another is called a log switch. A log switch occurs when one online redo log has been filled and the next online redo log is going to be filled. A log switch always triggers a checkpoint. We can switch the log file using: SQL>ALTER SYSTEM SWITCH logfile; What are the advantages of operating a database in ARCHIVELOG mode over operating it in NO ARCHIVELOG mode ? Complete database recovery from disk failure is possible only in ARCHIVELOG mode. Online database backup is possible only in ARCHIVELOG mode. If the database in NOARCHIVELOG mode, you disable the archiving of the redo log.NOARCHIVELOG mode protects a database from instance failure but not from media failure. Only the most recent changes made to the database, which are stored in the online redo log groups, are available for instance recovery. If a media failure occurs while the database is in NOARCHIVELOG mode, you can only restore the database to the point of the most recent full database backup. You cannot recover transactions subsequent to that backup. In NOARCHIVELOG mode you cannot perform online tablespace backups, nor can you use online tablespace backups taken earlier while the database was in ARCHIVELOG mode. To restore a database operating in NOARCHIVELOG mode, you can use only whole database backups taken while the database is closed. Therefore, if you decide to operate a database in NOARCHIVELOG mode, take whole database backups at regular, frequent intervals. If the database in ARCHIVELOG mode, you enable the archiving of the redo log. -- A database backup, together with online and archived redo log files, guarantees that you can recover all committed transactions in the event of an operating system or disk failure. -- If you keep an archived log, you can use a backup taken while the database is open and in normal system use. -- You can keep a standby database current with its original database by continuously applying the original archived redo logs to the standby

What is Archived Redo Log ? The log writer process (LGWR) writes the online redo logs from the log buffer. The online redo logs are a set of files that will be repeatedly written into by LGWR. To prevent loss of data, these online redo logs are written to a permanent location by the archiver process (ARCH) before the online redo log is overwritten. The permanent copy is the archived redo log. There are 4 types of redo logs are present in the database. 1.New 2.Active 3.Current 4.Inactive when lgrw is writer is writing the redo log is current stage, when it completes to switch to another one, current will become Inactive. To Prevent the loss of current redo log data, ARCH background process will start writing the data in one file, that is called archive log. after that, redo will start writing in other one. What is Mirrored on-line Redo Log ? A mirrored on-line redo log consists of copies of on-line redo log files physically located on separate disks, changes made to one member of the group are made to all members.

What is On-line Redo Log? The On-line Redo Log is a set of tow or more on-line redo files that record all committed changes made to the database. Whenever a transaction is committed, the corresponding redo entries temporarily stores in redo log buffers of the SGA are written to an on-line redo log file by the background process LGWR. The on-line redo log files are used in cyclical fashion. What is Partial Backup ? A Partial Backup is any operating system backup short of a full backup, taken while the database is open or shut down. Can Full Backup be performed when the database is open ? yes it is possible. it is possible in hot mode. if we are using the user managed backup than some step r following 1 begin backup 2 copy data 3 end backup. When the db in archive log mode we can perform Online Backup (HOT BACKUP).Because we have All archived log to re-cover option. Yes, using RMAN we can able to take the full backup, but DB must be in archivelog mode for it.

What is Full Backup ? A full backup is an operating system backup of all data files, on-line redo log files and control file that constitute ORACLE database and the parameter. A full backup means a cold shutdown of the database.and copying all datafiles,online redolof files and control file sql->shutdown normal Full backup is performed as an admin task on every week end, which is carried out in non production hours to ensure all the data is backed up What are the different modes of mounting a Database with the Parallel Server ? Exclusive Mode If the first instance that mounts a database does so in exclusive mode, only that Instance can mount the database. Parallel Mode If the first instance that mounts a database is started in parallel mode, other instances that are started in parallel mode can also mount the database. Exclusive Mode If the first instance that mounts a database does so in exclusive mode, only that Instance can mount the database. Parallel Mode If the first instance that mounts a database is started in parallel mode, other instances that are started in parallel mode can also mount the database. What is Restricted Mode of Instance Startup ? An instance can be started in (or later altered to be in) restricted mode so that when the database is open connections are limited only to those whose user accounts have been granted the RESTRICTED SESSION system privilege. If we start the instance in restricted mode then only sysdba has an access with the database.no other user have an to the database. In restrict mode if we want to drop the database we can do being in restrict mode. SYS>STARTUP MOUNT RESTRICT; SYS>DROP DATABASE; It will drop all the binary files of the database in Operating system level. What are the steps involved in Database Shutdown ? Close the Database, Dismount the Database and Shutdown the Instance. Normal (default) - waits for all on going transactions and sessions to complete. This could take hours to complete -- Immediate - terminates all sessions and does a rollback on all uncommitted transactions. -- Abort - aborts all sessions, leaving current DML in need of rollback, de-allocates the SGA and terminates the background processes. Note that a shutdown abort is NOT evil or dangerous. The "abort" simply means that Oracle will terminate all active work, which is what most people want

during a shutdown!(while startup it may take some more time for instance recovery which will be done by SMON) When Shutdown cmd given No new sessions allowed. There are 4 types Abort,Immediate,Transactional,Normal. In abort:-Doestnt wait for current sessions,and also for current transactions.Not make checkpoint to close file. In Immediate:-Make checkpoit and close file In Transactional:-Wait for current transactions,Make checkpoit and close file In Normal-Wait for current session,Wait for current transactions,finally make chckpoints and close files. What are the steps involved in Database Startup ? Start Instance, Mount database and open for user access Step1 :: Read parameter file and verify parameters(Memory Initialization & Background Process started) Step 2 :: Mount the database and Read the control file information but No verification against this data will be done at this stage. Step 3:: Open database and before opening verify Control file Contents and synchronize Redo files and data files with the respect to Transactions and then open the database. What is the steps for recovery with missing online redo logs? SQL> connect / as sysdba Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 2885681152 bytes Fixed Size 2086736 bytes Variable Size 1610614960 bytes Database Buffers 1258291200 bytes Redo Buffers 14688256 bytes Database mounted. ORA-00313: open failed for members of log group 3 of thread 1 ORA-00312: online log 3 thread 1: ?/u03/oradata/redo02b.rdo? Missing redo log, it was the online one so I can?t switch logfiles. Time for recovery, this will only get your SCN matched up on all the data files, no real recovery takes place. SQL> recover database until cancel; Media recovery complete. SQL> alter database open resetlogs; SQL> / Database altered. Or

1) create pfile from spfile 2) shu abort 3)edit pfile with _allow_resetlog_currpuation=true 4)startup mount 5)recover database until canecl 6)alter database open resetlogs What is the steps for recovery of missing data file? and the steps for physical stand by database creation? If any data file is missing, make datafile offline with the commond 'alter tablespace tablespace_name offline; And Restore the relivent datafile from the backup, recover the datafile 'recover datafile path of datafile or datafile no# online; it will apply all archive logs and redo logs and it will recover and open for normal use. Or if it is non system datafile steps 1 offline of datafile 2 Restore the datafile 3 Recover the datafile 4 Online the datafile If it is system or active undo datafile 1 Mount the database 2 restore the datafile 3 recover the datafile 4 open the database What are the advantages of operating a database in ARCHIVE LOG mode over operating it in NO ARCHIVE LOG mode ? Complete database recovery from disk failure is possible only in ARCHIVE LOG mode. Online database backup is possible only in ARCHIVE LOG mode. Archive log mode that you can put database in for creating a backup of all tranaction that have been occured in a data base so you can recover at any point in time Non Archive log mode is a basically absence of archive log mode and it is not recover at any point. What is the difference between oracle media recovery and crash recovery? Media recovery is a process to recover database from backup when physical disk failure occurred. Crash recovery is a automated process take care by oracle when instance failure occurred.

What is db_recovery_file_dest in oracle? When do you need to set this value? Give me the steps to perform the point in time recovery with a backup which is taken before the reset logs of the db? Tell me about the steps required to enable the RMAN backup for a target database? In oracle db_recovery_file_dest specifies a default location of flash recovery area which contains multiplexed current control files, online redo logs as well as archived logs, Rman backups,flash back logs. db_recovery_file_dest_size should be specified as well. What is Restricted Mode of Instance Startup in Oracle? To Enable Restricted Session Alter system enable restricted session; To Disable Restricted Session Alter system disable restricted session; To Start the Database in Restricted Mode STARTUP RESTRICT By starting Instance in restricted mode it will not allow all users to access and only users with restriction privilege will be allowed to access. This will be done time of make some data changes so that no users should be allowed to access data on time of changes happening

What is the difference between recovery and restoring of the oracle database? Here is a scenario to understand Restore & Recovery Sunday 10pm: Database is backed up. and is running fine. Monday 11am: Went down / crashed due to some reason. To bring up the database, we have 2 options: 1. Simple Restore: copying files from backup taken sunday night and open the database. Here, we loose all the changes that are done since sunday night. 2. Restore and Recovery: Copying files from backup taken sunday night and applying all the archivelog and redo log files to bring up the database to the point of failure. Here you dont loose the changes done until monday 11 am. Restore: copying files from the backup overwriting the existing database files Recovery: applying the changes to the database till point of failure. these changes are recorded in online redolog and archivelog (which are the backups of redolog) files.

What are the different tools available for hot backups in Oracle? Is it preferable to take it manually all the time or it depends on the size of the database? A hot backup can be done by either RMAN,User Managed Backups by puting tablespace in backup mode my OEM which does the same as the user managed backup.But the Backup depends upon the size of the database you are using . if the database size in TB the RMAN backup will take more than 10 hours to complete and if the database is critical you can' wait for long to go for so long in this case their are special backup techniques which are given by vendors like TIVOLI and Netbackup they provide BC Vol backup called Business content Volumn Sync which copies a snapshot of the primary data to another place and backsup the database from one SAN to another with in 15 min for 2 TB of database and is the preferable method for big companies. What is the disk migration? what is the steps involved in oracle disk migration? Disk migration is nothing but, migration of data from one OS dependent database to another Dependent database. The steps involved in this are first go to your target database and export all your data into flat files next in the destination database during the installation of the database, it asks for data source ,instead of giving the data of the oracle provided , give the path of the flat file you exported previously. What are the advantages of operating a database in ARCHIVELOG mode over operating it in NO ARCHIVELOG mode in Oracle? Database in archivelog mode chance to take hot backup and no data loss in recovery. you can use RMAN for backup and recovery .disadvantage is poor ferformance, and more chance to crash disc Why more redos are generated when the oracle database is in begin backup mode? During begin backup mode datafile headers get freezed and as a result row information cannot be retrieved as a result the entire block is copied to redo logs as a result more redo generated and more log switch and in turn more archive logs.