You are on page 1of 11

1. What is Oracle?

a. An Oracle database is a collection of data treated as a unit


b. Logical Structures: Schema Objects, Data Blocks, Extents, Segments, Tablespaces
i. A schema is a collection of database objects. Schema Objects are the logical
structures that directly refer to the database’s data. Schema objects include
structures like tables, views and indexes.
ii. Oracle Data is stored in Data Blocks. One data block corresponds to a specific
number of bytes of physical space on disk. DB_BLOCK_SIZE specifies
standard block size.
iii. An extent is a specific number of contiguous data blocks, obtained in a single
allocation.
iv. A segment is a set of extents allocated for a certain logical structure. Data
Segment, Index Segment, Temporary Segment, Rollback Segment
v. A database is divided into logical storage units called tablespaces – a group of
related logical structures

vi.
c. Physical Database Structures: Datafiles, redo log files, control files
i. Data File
1. Datafiles contain all the database data.
2. A datafile can be associated with only one database
3. One or more datafiles form a logical unit of database storage called a
tablespace
ii. Redolog
1. A set of files that protect altered database data in memory that has not
been written to the datafiles. The redolog can consist of two parts: the
online redo log and archived redo log
2. Online redo log – set of two or more online redo log files that record all
changes made to the database, including both committed and
uncommitted changes. Redo entries are temporarily stored in redo log
buffers of the SGA and LGWR background process writes the redo
entries sequentially to an online redo log file
3. Archived redo log – Optionally, online redo files can be archived before
being reused, creating an archived redo log.
iii. Control File
1. A binary file that records the physical structure of a database and
contains the database name, the names and locations of associated
databases and online redo log files, the time stamp of the database
creation, the current log sequence number, and checkpoint information.
Every Oracle database should have atleast two control files, each
stored on a different disk.
2. What is SGA
a. The System Global Area is a shared memory region that contains data and control
information for one Oracle instance. Oracle allocates the SGA when an instance starts
and deallocates it when the instance shuts down.
b. Information stored in SGA is divided into
i. Database buffers use the most recently used blocks of data (less for
DataWarehousing and more for OLTP)
ii. Redo log buffer stores the redo entries – a log of changes made to the
database ((less for DataWarehousing and more for OLTP))
iii. Shared pool – contains shared memory constructs such as shared SQL areas.
A shared SQL area is required to process every unique SQL statement
submitted to a database. A shared SQL area contains information such as the
parse tree and execution plan for the corresponding statement. A single
shared SQL area is used by multiple applications that issue the same
statement, leaving more shared memory for other users.
iv. Large Pool – Optional area that provides large memory allocations for Oracle
backup and restore operations, I/O server processes and session memory for
the shared server and Oracle XA
v. Cursors – A handle for the memory associated with a specific statement –
Oracle Call Interface (OCI) refers this a statement handles
vi. Program Global Area (PGA) – Memory buffer that contains data and control
information for a server process. A PGA is created by Oracle when a server
process is started. (less for OLTP and more for DW)
vii. Oracle Process Size: The size of Oracle Process will be normally 40 MB for all
types of databases.
c. A minimum of 51% of physical memory is required to be allocated for SGA. Typical
setting will be 70%.

3. Oracle Processes
a. User Processes
b. Oracle Processes
i. Server Processes – Oracle creates server processes to handle requests from
connected user processes
ii. Background Processes – DBWn, LGWR, CKPT, SMON, PMON, ARCn, RECO,
Jnnn, Dnnn, LMS, QMNn

4. What is spfile
a. A repository for initialisation parameters that is maintained on the machine where the
database server executes. A server parameter file is initially built from a traditional text
initialisation parameter file using CREATE SPFILE statement.

5. CREATE DATABASE
a. Creates the datafiles
b. Creates the control files
c. Creates the redo log files and establishes the ARCHIVELOG mode
d. Creates the SYSTEM tablespace and the SYSTEM rollback segment
e. Creates the data dictionary
f. Sets the character set that stores data in the database
g. Sets the database time zone
h. Mounts and opens the database for use
6. What is data dictionary
a. Each Oracle database has a data dictionary
b. Oracle Data Dictionary is a set of tables and views that are used as a read-only
reference about the database. It stores information about the both the logical and
physical structure of the database. It also stores
i. The valid users of an Oracle Database
ii. Information about integrity constraints defined for tables in the database
iii. The amount of space allocated for a schema object and how much of it is in
use

7. How to increase redo log file size


a. To create a new group of online redo log files, use ALTER DATABASE with ADD
LOGFILE clause
b. To create new online redo log member for an existing group user ALTER DATABASE
with ADD LOGFILE MEMBER and TO GROUP clause

8. How to increase data file size


a. ALTER TABLESPACE <tsname> ADD DATAFILE
b. ALTER DATABASE DATAFILE <datafile> parameters
c. ALTER DATABASE DATAFILE <datafile> RESIZE size
d. ALTER DATABASE DATAFILE <datafile> ONLINE / OFFLINE

9. How to view tablespace status


a. V$TABLESPACE, DBA_/ USER_TABLESPACES, DBA_/ USER_SEGMENTS, DBA_ /
USER_EXTENTS, DBA_ / USER_FREESPACE, DBA_TS_QUOTAS

10. How to create standby database


a. Prepare Primary Database
i. Enable forced logging – Alter Database force logging;
ii. Enable archiving and define a local archiving destination – Primary Database
should be in ARCHIVELOG mode –
alter system set log_archive_dest_1 = ’location=…’ scope=
b. Creating Physical Standby Database
i. Identify Primary Database Datafiles using v$datafile
ii. Make a copy of the Primary Database
iii. Create control file for Standby Database –
alter database create standby controlfile as ‘….ctl’
iv. Create pfile=’….ora’ from spfile
v. Copy files from primary to standby system
vi. Set initialisation parameters
vii. Create windows service – oradim –NEW –SID sid STARTMODE manual
viii. Configure Listeners using Oracle Net Manager
ix. Enable Dead Connection Detection on the standby system – SQLNET.ORA –
SQLNET.EXPIRE_TIME=2
x. Create Oracle Net Service Names using Oracle Net Manager
xi. Create spfile from pfile=’*.ora’
xii. Start physical standby database
c. Verifying Physical Standby Database
i. Identify the existing archived redo logs – v$archived_log
ii. Archive current log
iii. Verify the new archived log was applied
11. What are the stages in starting database? What will happen in each stage
a. When Oracle starts an instance, it reads the initialisation parameter file. Then it
allocates as SGA. At this point no database is associated with these memory
structures and processes.
b. The instance mounts a database to associate the database with that instance. To
mount the database, the instance finds the control files and opens them. At this point,
database is closed and is accessible only to the DBA.
c. Opening a mounted database makes it available for normal database operations.
When you open the database, Oracle opens the online datafiles and online redolog
files. If any of the datafiles or redolog files are not present while opening, Oracle
returns an error and recovery to be performed.

12. When both pfile & spfile are present what is accessed by oracle to start database
a. At system startup, the default behaviour is to read a spfile to obtain initialisation
parameter settings.

13. How to start database through pfile when both pfile & spfile are present
a. Specify the PFILE clause when issuing the STARTUP command. STARTUP command
with no PFILE clause reads the spfile from an OS specific location

14. How to deal with corrupt CTL file


a. Initial Control files are created when CREATE DATABASE statement is issued using
CONTROL_FILES initialisation parameter
b. To multiplex, shutdown database, copy the CTL file to different location, edit
CONTROL_FILES parameter to add new control file and restart database
c. New control files are created when all the control files have been permanently
damaged and we have no backup or we need to change the permanent database
parameter settings. – CREATE CONTROL FILE
i. Make a list of all datafiles and online redolog files – v$logfile, v$datafile,
v$parameter
ii. Shutdown the database
iii. Backup all datafiles and online redo log files
iv. Startup nomount
v. Create controlfile
vi. Store a backup of controlfile
vii. Edit CONTROL_FILES initialisation parameter – if database is renamed, edit
DB_NAME parameter
viii. Recover database, if necessary
ix. Open database

15. Logical Backups


a. Logical Backups are exports of scheme objects into a binary file. Import and Export are
utilities used to move Oracle data in and out of Oracle schema. Export writes data from
an Oracle database to binary operating system files. Import is a utility that reads export
files and restores the corresponding data into an existing database.

16. Export Utility


a. Buffer: Determines maximum number of rows in an array fetched by export. Buffer size
can be calculated using
buffer_size = rows_in_array * maximum_row_size
b. Compress: ‘y’ causes Export to flag table data for consolidation into one initial extent
upon import. ‘n’ – Export uses the current storage parameters including the values of
initial extent size and next extent size.
c. Consistent: To ensure that the data seen by Export is consistent to a single point in
time and does not change during the execution.
d. Rows: Whether or not the rows of table data is exported
e. Constraints, Direct, feedback, file, filesize, flashback_scn, flashback_time, full, grants,
help, log, object_consistent, owner, parfile, query (exp scott/tiger TABLES=emp
QUERY=\"WHERE job=\'SALESMAN\' and sal \<1600\") recordlength, resumable,
resumable_name, resumable_timeout, statistics, tables, tablespaces, transportable
tablespaces, triggers, tts_full_check, volsize

17. CREATE DATABASE


CREATE DATABASE mynewdb
USER SYS IDENTIFIED BY pz6r58
USER SYSTEM IDENTIFIED BY y1tz5p
LOGFILE GROUP 1 ('/vobs/oracle/oradata/mynewdb/redo01.log') SIZE 100M,
GROUP 2 ('/vobs/oracle/oradata/mynewdb/redo02.log') SIZE 100M,
GROUP 3 ('/vobs/oracle/oradata/mynewdb/redo03.log') SIZE 100M
MAXLOGFILES 5 MAXLOGMEMBERS 5 MAXLOGHISTORY 1 MAXDATAFILES 100 MAXINSTANCES 1
CHARACTER SET US7ASCII NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/vobs/oracle/oradata/mynewdb/system01.dbf' SIZE 325M REUSE
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE tempts1 DATAFILE '/vobs/oracle/oradata/mynewdb/temp01.dbf' SIZE
20M REUSE
UNDO TABLESPACE undotbs DATAFILE '/vobs/oracle/oradata/mynewdb/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED;

18. CREATE DATABASE PARAMETERS


a. MAXLOGFILES
i. Determines the maximum number of groups of online redo log files for each
database. Group values can range from 1 to MAXLOGFILES. The only way to
override this upper limit is to re-create the database or its control file. If not
specified, OS specific default value is used.
b. MAXLOGMEMBERS
i. Determines the maximum number of members for each group.
c. MAXDATAFILES
i. Specifies the maximum number of Datafiles that can be open in the database.
If it is set, Oracle allocates enough space in the control file to store
MAXDATAFILES filenames, even if the database has only one file initially.
d. MAXINSTANCES
i. Specified the maximum number of instances can have this database mounted
and open.

19. Whether more than one table can reside in one


segment
a. Oracle stores data in data blocks. Next
level of logical database space is an
extent. The level of logical database
storage above an extent is called a
segment.
b. Each table’s data is stored in its own
segment. If the table is partitioned, each
partition is stored in its own segment.
c. A segment and all its extents are stored
in one tablespace. Within a tablespace,
a segment can include extents from
more than one file; that is, the segment can span datafiles. However, each extent can
contain data from only one datafile.

20. Locks
a. Oracle uses locks to control concurrent access to data.
b. Automatic Locking
i. Requires no user action. Implicit locking occurs for SQL statements as
necessary, depending on the action requested
ii. Exclusive lock and share lock
c. Manual Locking
i. A user might want to override default locking. Oracle allows manual override of
automatic locking features at both the row level and the table level

21. Security
a. Oracle server provides discretionary access control – restricting access to information
based on privileges and privileged users can grant other users privileges at their
discretion. Oracle manages database security using several different facilities:
i. Database Users and Schemas
1. Users are identified by Username and password
2. Each user is associated with a default tablespace
ii. Privileges: A privilege is a right to run a particular type of SQL statement.
1. System Privileges allow users to perform a particular systemwide
action or a particular action on a particular type of schema object.
2. Schema Object Privileges allow users to perform a particular action on
a specific schema object.
3. Privileges are granted to users
iii. Roles: Roles are named groups of related privileges that you grant to users

22. Re-creating Datafiles when Backups are Unavailable


a. If a datafile is damaged and no backup of the file is available, then you can still recover
the datafile if, all archived log files written after the creation of the original datafile are
available and the control file contains the name of the damaged file
b. Create a new empty datafile of same size as the lost file using
Alter Database create datafile ‘<damaged file name>’ as ‘<new file name>’;
c. Perform media recovery on the empty file using
recover datafile ‘<new file name>’

23. Database Copy


a. Identify the datafiles
select name from v$datafile union select member from v$logfile union select
name from v$controlfile;
b. Select name, value from v$parameter where name like ‘log_archive_dest%’ and
value is not NULL;
c. To determine which datafiles require recovery
select * from v$recover_file;
d. Copy all the files to the new location.
e. Modify the init.ora file for incorporating the new locations of datafiles
f. Create Windows Service
oradim –new sid <new SID> -startmode manual
g. Configure Listener & Service Name using Oracle Net Manager
h. Create Server Parameter File from the init.ora
create spfile from pfile =’<path>’;
i. Startup nomount
j. Create controlfile
k. Alter database mount;
l. Alter database open resetlogs;
24. Hot Backup – Concepts
a. A backup of online datafiles is called an online backup
b. Database should run in archivelog mode
c. Fractured Block: When OS utility or RMAN reads the entire block while database writer
is in the middle of updating the block. In this case, RMAN or the copy utility may read
the old data in the top half of the block and the new data in the bottom half of the
block. Data contained in this block is not consistent.
d. RMAN – Oracle Server Session reads the datafiles, and determines whether the block
is fractured by comparing the header and footer of each block. If the session detects a
fractured block, then it rereads the block.
e. OS Utility
i. Place the online tablespace in the backup mode
ALTER TABLESPACE BEGIN BACKUP;
As a result, Oracle stops recording checkpoints to the tablespace’s datafiles.
ii. Copy the datafiles using OS utility
iii. Take tablespace out of backup mode
ALTER TABLESPACE END BACKUP;
Oracle advances the file header to the current database checkpoint.

25. Checkpoints
a. At specific times, all modified database buffers in the SGA are written to the datafiles
by DBWn. This event is called a checkpoint. The CKPT process is responsible for
signalling DBWn at checkpoints and updating all the datafiles and control files of the
database to indicate the most recent checkpoint.
b. When a checkpoint occurs, Oracle must update the headers of all datafiles to record
the details of the checkpoint. This is done by CKPT process. The CKPT process does
not write blocks to disk; DBWn always performs the work.
c. Control files record information about checkpoints. Every 3 secs, the CKPT process
records information in the control file about the checkpoint position in the online redo
log.

26. Transportable Tablespaces


a. The transportable tablespace feature enables you to move a set of tablespaces from
One Oracle database to another.
b. To move or copy a set of tablespaces, make the tablespaces read-only, copy the
datafiles, and use Export and Import to move the database information stored in the
data dictionary.

27. Trace / Alert Files


a. Each server and background process can write to an associated tracefile. When an
internal error is detected by a process, it dumps information about the error to its trace
file. Some of the information is for DBA, while other is for Oracle Support Services.
Trace file information is also used to tune applications and instances.
b. An alert file of a database, is a special trace file, is a chronological log of messages
and errors, which include the following:
i. All internal errors (ORA-600), block corruption errors (ORA-1578) and deadlock
errors (ORA-60) that occur.
ii. Administrative operations, such as CREATE, ALTER & DROP statements and
STARTUP, SHUTDOWN, & ARCHIVELOG statements
iii. Several messages and errors relating to the functions of the shared server and
dispatcher process.
iv. Errors occurring during the automatic refresh of a materialised view
v. The values of all initialisation parameters at the time the database and instance
start
28. Complete User Managed Media Recovery
a. When you perform complete recovery, you recover the backups to the current SCN.
You can either recover the whole database at once or recover individual tablespaces
or datafiles.
b. Performing Closed Database Recovery
i. Preparing for Closed Database Recovery
1. SHUTDOWN ABORT
2. If media failure was temporary and if the data was undamaged then no
media recovery is required
ii. Restoring Backups of the Damaged or Missing Files
1. Determine which Datafile require recovery using v$recover_file. Find
the FILE#, using FILE#, get the datafile name and tablespace name
using V$DATAFILE & V$TABLESPACE
2. If the files are permanently damaged, identify the most recent backup
and restore only the damaged datafiles. If no backup, then create empty
replacement file that can be recovered
3. If the hardware problem is repaired then restore the datafiles to their
default locations and begin media recovery. If not then restore to
another location, indicate the new location to the control file
iii. Recovering the Database
1. STARTUP MOUNT
2. SELECT NAME, STATUS FROM V$DATAFILE;
3. RECOVER DATABASE – To recover all damaged files in one step
RECOVER TABLESPACE – To recover an individual TS
RECOVER DATAFILE - To recover an individual damaged datafile
c. It is possible for a media failure to occur while the database remains open. Oracle
automatically takes the damaged datafiles offline, if the database writer is unable to
write to them (not the tablespaces that contain them). Oracle does not take the files
offline because of failed queries. If the media failure damages any of the SYSTEM
tablespace, then Oracle automatically shuts down the database.
d. Performing Datafile recovery in an Open Database
i. Preparing for Open Database Recovery
1. ALTER TABLESPACE <TS name> OFFLINE TEMPORARY;
ii. Restoring Backups of the Damaged or Missing Files
1. Restore only the damaged datafiles – not undamaged datafiles
2. If files are restored in another location use
ALTER DATABASE RENAME FILE ‘old file name’ TO ‘new name’;
iii. Recovering Offline Tablespaces in an Open Database
1. Connect to the database with administrator privileges
2. RECOVER TABLESPACE <TS names separated by ‘,’>
3. Oracle begins the roll forward phase of media recovery by applying the
necessary redo log files. Unless the applying of files is automated with
RECOVER AUTOMATIC or SET AUTORECOVERY ON, Oracle
prompts for each required redo log. Once all archived logs are applied,
Online redo log files are automatically applied.
4. ALTER TABLESPACE <TSname> ONLINE;

29. Incomplete User Managed Media Recovery


a. Preparing for Incomplete Recovery
i. Take backup of all datafiles, control files, and the parameter files
ii. SHUTDOWN ABORT
b. Restoring Datafiles Before Performing Incomplete Recovery
i. If the current control files do not match the physical structure of the database at
the intended time of recovery, then restore a backup control file. The restored
control file should reflect the database’s physical file structure at the point at
which Incomplete Media recovery should finish.
ii. Restore backups of all the datafiles of the database
iii. If you do not have a backup of a datafile, then create an empty replacement file
that can be recovered.
iv. If a datafile was added after the intended time of recovery, then do not restore
a backup of this file because it will no longer be used for the database
v. If hardware problem is solved, then restore the datafiles to the original location,
otherwise restore the datafiles to alternate location.
vi. Connect to Oracle with administrator privileges
vii. STARTUP MOUNT
viii. ALTER DATABASE RENAME FILE ‘old file name’ TO ‘new file name’;
c. Performing Cancel Based Incomplete Recovery
i. Sqlplus ‘/ AS SYSDBA’
ii. STARTUP MOUNT
iii. RECOVER DATABASE UNTIL CANCEL
iv. If you are using a backup control file with incomplete recovery, then
RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE
v. CANCEL
vi. Open the database in RESETLOGS mode
d. Performing Time Based Incomplete Recovery
i. RECOVER DATABASE UNTIL TIME ‘2000-12-31:12:47:30’
ii. RECOVER DATABASE UNTIL TIME ‘2000-12-31:12:47:30’ USING BACKUP
CONTROLFILE
iii. ALTER DATABASE OPEN RESETLOGS;
e. Performing Change Based Incomplete Recovery
i. RECOVER DATABASE UNTIL CHANGE 10034;
The SCN is specified as a decimal number without quotation marks
ii. ALTER DATABASE OPEN RESETLOGS;

30. Recovering a Database in NOARCHIVELOG mode


a. If the database is open, then shutdown the database
b. Restore the most recent whole database backup with OS commands. Restore all of
the datafiles and control files of the whole database backup.
c. If possible restore all files to the default location. Otherwise, restore them to alternate
location and rename the file names using ALTER DATABASE RENAME FILE
d. Because Online redo logs are not backed up, you cannot restore them with the data
files and control files. In order to allow Oracle to reset the Online redo logs, you must
first mimic incomplete recovery
RECOVER DATABASE UNTIL CANCEL;
CANCEL;
e. ALTER DATABASE OPEN RESETLOGS;

31. RESETLOGS Operation


a. Whenever you open the database with the RESETLOGS option, all data files get a
new RESETLOGS SCN and time stamp, and the log sequence number is reset to 1.
Archived redo logs also have these two values in their file header. Because Oracle will
not apply an archived redo log to a data file unless the RESETLOGS SCN and time
stamps match, the RESETLOGS operations prevents you from corrupting your data
files with old archived logs.
32. Restoring & Re-creating Control Files
a. If a media failure has affected the control files of a database, then the database
continues to run until the first time that an Oracle background process needs to access
the control files. At this point, the database and instance are automatically shutdown.
b. Losing a Member of a Multiplexed Control File
i. SHUTDOWN ABORT
ii. If the disk and file system containing the lost control file are intact, then copy
one of the intact control files to the required location.
iii. Otherwise, copy the intact control file to alternative location. Change the
CONTROL_FILES parameter in the initialisation parameter file.
iv. STARTUP
c. Losing all members of a Multiplexed Control File when a backup is available
i. When a control file is inaccessible, instance can be started but database
cannot be mounted. If mounting is attempted we get ORA-205 error.
ii. SHUTDOWN ABORT
iii. Restore the backup control file to all locations specified in the
CONTROL_FILES parameter. If files are restored in another location then
modify the parameter suitably.
iv. STARTUP MOUNT
v. RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;
vi. Apply the prompted logs. If you receive message saying that the required
archived log is missing, it probably means that a necessary redo record is
located in the online redo logs. This situation can occur when unarchived
changes were located in the online logs when the instance crashed. Specify
the name of an online redo log and ENTER. Try this a few times until you find
the correct log.
vii. If for some reason the online logs are not accessible, then cancel recovery
without applying the online logs. Note that if all datafiles are current, and redo
is located in the online logs that are required for recovery, then database
cannot be opened without applying the online logs. If the online logs are
inaccessible then recreate the control file.
d. Losing all Current and Backup Control Files
i. If all control files have been lost but all online redo log files remain intact, then
you can recover the database after creating a new control file. Database need
not be opened with RESETLOGS option.
ii. CREATE CONTROLFILE
33. Loss of Online Redo Log Files
a. Recovering after losing a member of a multiplexed Online Redo Log Group
i. Oracle will allow the database to continue functioning as normal
ii. If the hardware problem is temporary, then correct it. LGWR accesses the
previously unavailable online redo log file as if the problem never existed.
iii. If the problem is permanent, then drop the damaged member and add a new
member as following:
1. Locate the damaged member
SELECT GROUP#, STATUS, MEMBER FROM V$LOGFILE WHERE
STATUS=’INVALID’;
2. ALTER DATABASE DROP LOGFILE MEMBER ‘<member name>’;
3. ALTER DATABASE ADD LOGFILE MEMBER ‘<member name>’ TO
GROUP #;
4. If the file we want to add already exists, then it must be the same size
as the other group members. We must specify REUSE
ALTER DATABASE ADD LOGFILE MEMBER ‘<member name>’
REUSE TO GROUP #’;
b. Recovering after the loss of all members of an online redo log group
i. If the damaged group is inactive, then crash recovery is not needed.
ii. SELECT GROUP#, STATUS MEMBER FROM V$LOGFILE;
Look for ‘INVALID’ status.
iii. Determine which groups are active
SELECT GROUP#, MEMBERS, STATUS ARCHIVED FROM V$LOG;
iv. Losing an Inactive Online Redo Log Group
1. If the problem is temporary, after fixing the problem, LGWR can reuse
the redo log group when required
2. If the problem is permanent, the damaged inactive online redo log
group eventually halts normal database operation. The damaged group
has to be reinitialised manually
3. To clear an inactive online redo log group that has been archived
a. STARTUP MOUNT
b. ALTER DATABASE CLEAR LOGFILE GROUP 2;
4. To clear an inactive, online redo log group that has not been archived
a. STARTUP MOUNT
b. ALTER DATABASE CLEAR LOGFILE UNARCHIVED GROUP 2
c. If there is an offline datafile that requires the cleared unarchived
log to bring it online, then
ALTER DATABASE CLEAR LOGFILE UNARCHIVED GROUP 2
UNRECOVERABLE DATAFILE;
The datafile and its entire tablespace have to be dropped
because the redo necessary to being it online is being cleared.
v. Losing an Active Online Redo Log Group
1. If the database is still running and the lost active log is not current log,
then issue ALTER SYSTEM CHECKPOINT; statement. If successful
then the active log is rendered inactive and follow the above process.
2. Note that the current log is the one LGWR is currently writing to. If a
LGWR I/O fails, then LGWR terminated and the instance crashes.
3. NOARCHIVELOG MODE:
a. If the media failure is temporary, fix the problem Oracle will
reuse the group
b. Restore the database from a consistent, whole database backup
c. STARTUP MOUNT
d. RECOVER DATABASE UNTIL CANCEL;
CANCEL;
e. ALTER DATABASE OPEN RESETLOGS;
f. SHUTDOWN IMMEDIATE and take a backup
4. ARCHIVEDLOG MODE
a. If media failure is permanent then use the following procedure
b. Begin incomplete media recovery recovering up through the log
before the damaged log
c. Ensure that the current name of the lost redo log can be used for
a newly created file. If not, then rename the members of the
damaged online redo log group to a new location.
d. ALTER DATABASE OPEN RESETLOGS;
vi. If you have lost multiple log groups of the online redo log, then use the
recovery method for the most difficult log to recover. The order of difficulty,
from most difficult to least difficult, follows:
1. The current online redo log
2. An active online redo log
3. An unarchived online redo log
4. An inactive online redo log

You might also like