DBAM Solved.
DBAM Solved.
Table of Contents
Short Questions .............................................................................................................................. 3
M.Sc.IT 2016 (1) .......................................................................................................................... 3
M.Sc.IT 2016 (2) .......................................................................................................................... 7
M.Sc.IT 2015.............................................................................................................................. 13
BSIT 5th 2017 ............................................................................................................................. 16
BSIT 5th 2016 ............................................................................................................................. 18
BSIT 6th 2015 ............................................................................................................................. 20
Long Questions ............................................................................................................................. 22
M.Sc.IT 2016 (1) ........................................................................................................................ 22
M.Sc.IT 2016 (2) ........................................................................................................................ 35
M.Sc.IT 2015.............................................................................................................................. 47
Short Questions
M.Sc.IT 2016 (1)
1. Role
Ans: create the Oracle role using the create role command. You then grant the Oracle role all
of the common privileges that users will require to do their work, like the ability to select,
insert, update and delete data from various tables.Once the Oracle role is all setup, you only
need grant the Oracle role to users and all the privileges will be transferred along with that
grant.
2. Backup
Ans: A backup is a copy of data. This copy can include important parts of the database, such as
the control file and datafiles. A backup is a safeguard against unexpected data loss and
application errors. If you lose the original data, then you can reconstruct it by using a backup.
Recovery Manager (RMAN) is an Oracle utility that can back up, restore, and recover database
files. It is a feature of the Oracle database server and does not require separate installation.
3. Import Utility
Ans: Export and Import are the Oracle utilities that allow us to make exports & imports of the
data objects, and transfer the data across databases that reside on different hardware
platforms on different Oracle versions.
Export (exp) and import (imp) utilities are used to perform logical database backup and
recovery. When exporting, database objects are dumped to a binary file which can then be
imported into another Oracle database.
catexp.sql (in $ORACLE_HOME/rdbms/admin) will create EXP_FULL_DATABASE &
IMP_FULL_DATABASE roles (no need to run this, if you ran catalog.sql at the time of database
creation).
4. Offline Backups
Ans: Full backups include all datafiles, tablespaces, and the Oracle database control file (SP file
of pfile). Offline backups do not include the archived log files.
A cold backup, also called an offline backup, is a database backup during which the database is
offline and not accessible to update. This is the safest way to back up because it avoids the risk
of copying data that may be in the process of being updated.
5. Database Triggers
Ans: Oracle allows you to define procedures that are implicitly executed when an INSERT,
UPDATE, or DELETE statement is issued against the associated table. These procedures are
called database triggers
7. Online backups
Ans: As the name implies, an online backup allows you to backup the database while users are
working. For a large number of shops online backups are the only backups they ever make.
Once you setup the database and RMAN to support hot backups, doing the backup is insanely
easy. In fact, it takes fewer RMAN commands than an offline
8. RMAN
Ans: Oracle RMAN (Oracle Recovery Manager) is a utility built into Oracle databases to
automate backup and recovery; it includes features not available in third-party backup tools. ...
Block-level corruption detection is provided during backup and restore. An Oracle database
client, RMAN automates administration of backup strategies and ensures database integrity.
Block-level corruption detection is provided during backup and restore.
9. Security Capabilities
Ans:
Security Description
Capability
10. Privileges
Ans: When multiple users can access database objects, authorization can be controlled to these
objects with privileges. Every object has an owner. Privileges control if a user can modify an
object owned by another user. Privileges are granted or revoked either by the instance
administrator, a user with the ADMIN privilege or, for privileges to a certain object, by the
owner of the object.
• System privileges
• Object privileges
• Privilege hierarchy
• The PUBLIC role
11. Auditing
Ans: Auditing is the monitoring and recording of selected user database actions. It can be based
on individual actions, such as the type of SQL statement executed, or on combinations of
factors that can include user name, application, time, and so on. Security policies can trigger
auditing when specified elements in an Oracle database are accessed or altered, including the
contents within a specified object.
Ans: Oracle RAC enables you to cluster Oracle databases. Oracle RAC uses Oracle Clusterware
for the infrastructure to bind multiple servers so they operate as a single system.
Oracle Clusterware is a portable cluster management solution that is integrated with Oracle
Database. Oracle Clusterware is also a required component for using Oracle RAC. In addition,
Oracle Clusterware enables both single-instance Oracle databases and Oracle RAC databases to
use the Oracle high-availability infrastructure. Oracle Clusterware enables you to create a
clustered pool of storage to be used by any combination of single-instance and Oracle RAC
databases.
Ans: A database server is the key to solving the problems of information management. In
general, a server reliably manages a large amount of data in a multiuser environment so that
many users can concurrently access the same data. All this is accomplished while delivering
high performance. A database server also prevents unauthorized access and provides efficient
solutions for failure recovery.
• buffer cache:
• dictionary cache:
• redo log buffer:
• uncommitted
• shared pool:
• Java pool:
• large pool:
• stream pool
Ans: To maximize performance and accommodate many users, a multi-process Oracle system
uses some additional Oracle processes called background processes.
An Oracle instance can have many background processes; not all are always present. There are
numerous background processes. See the V$BGPROCESS view for more information on the
background processes. The background processes in an Oracle instance can include the
following:
• (DBWn)
• (LGWR)
• (CKPT)
• (SMON)
• (PMON)
• RMAN backups
• control file
• logs
o online redo log copies
Ans: The main purpose of RMAN validation is to check for corrupt blocks and missing files. You
can also use RMAN to determine whether backups can be restored. You can use the following
RMAN commands to perform validation:
• VALIDATE
• BACKUP ... VALIDATE
• RESTORE ... VALIDATE
Ans: Recovery in general refers to the various operations involved in restoring, rolling forward,
and rolling back a backup. Backup and recovery in general refers to the various strategies and
operations involved in protecting your database against data loss and reconstructing the data
should that loss occur.
Ans: Block media recovery recovers an individual corrupt datablock or set of datablocks within
a datafile. In cases when a small number of blocks require media recovery, you can selectively
restore and recover damaged blocks rather than whole datafiles.
Block media recovery provides several advantages over datafile media recovery. For example,
block media recovery
• Lowers the Mean Time to Recovery (MTTR) because only blocks needing recovery are
restored and only necessary corrupt blocks undergo recovery. Block media recovery
minimizes redo application time and avoids I/O overhead during recovery.
• Allows affected datafiles to remain online during recovery of the blocks. Without block-
level recovery, if even a single block is corrupt, then you must restore a backup of the
entire datafile and apply all redo generated for that file after the backup was created.
Ans: restoring and recovering your database after the loss of one or more data files, but you
still have a usable server parameter file and control file. You can also use RMAN to restore a
lost server parameter file or control file.
3. SHUTDOWN IMMEDIATE;
4. STARTUP MOUNT;
6. RESTORE DATABASE;
The data files from the RMAN backup are restored to their default locations.
8. RECOVER DATABASE;
Ans: Database point-in-time recovery (DBPITR) restores the database from backups prior to
the target time for recovery, then uses incremental backups and redo to roll the database
forward to the target time.DBPITR is sometimes called incomplete recovery because it does not
use all of the available redo or completely recover all changes to your database.The
requirements for database point-in-time recovery are as follows:
• Create a Failure
• Relevant RMAN Functionality
o LIST FAILURE
o ADVISE FAILURE
o REPAIR FAILURE
o CHANGE FAILURE
o VALIDATE
• Health Monitor (DBMS_HM)
• Oracle Enterprise Manager
M.Sc.IT 2015
⚫ Striping
⚫ Mirroring
⚫ Online storage reconfiguration and dynamic rebalancing
⚫ Managed file creation and deletion
Ans: Logical Storage Structures. Oracle Database allocates logical space for all data in the
database. ...
38. Tablespaces
Ans:An Oracle database consists of one or more logical storage units called tablespaces,
which collectively store all of the database's data. Each tablespace in an Oracle database
consists of one or more files called datafiles, which are physical structures that conform
to the operating system in which Oracle is running.
A parameter has a name and a value.When the Oracle database is started, one of the first
things it needs to do is read the database initialization parameter file. The parameter file
(init.ora) is created by the DBA and defines the overall instance configuration, such as how
much memory should be allocated to the instance
Ans:
Recovery Manager, a tool (with command-line client and Enterprise Manager GUI
interfaces) that integrates with sessions running on the Oracle server to perform a range
of backup and recovery activities.
The traditional user-managed backup and recovery, SQL*Plus backup and recovery-
related capabilities
Ans: Oracle Fine Grained Auditing (FGA) enables you to create policies that define specific
conditions that must be met in order for an audit to occur. It provides granular auditing of
queries, and INSERT, UPDATE, and DELETE operations.
BS 5th 2017
49. What is dynamic SGA
ANS: This ability to dynamically grow and shrink different areas within the Oracle SGA
offers some exciting new possibilities for the Oracle database administrator. Database
activity within each region of the SGA can be monitored individually, and resources can
be allocated and deleted according the usage patterns within the Oracle database.
ANS: The shared pool portion of the SGA contains the library cache, the dictionary cache,
buffers for parallel execution messages, and control structures.The total size of the
shared pool is determined by the initialization parameter SHARED_POOL_SIZE. The
default value of this parameter is 8MB on 32-bit platforms and 64MB on 64-bit
platforms. Increasing the value of this parameter increases the amount of memory
reserved for the shared pool
You can access the Undo Advisor through Oracle Enterprise Manager (EM) or through
53. AMM
ANS: With automatic memory management, the Oracle instance dynamically tunes
all memory components to optimize performance as the workload changes. To
enable automatic memory management: Start SQL*Plus and connect to the database
as SYSDBA .
Data Pump Export (hereinafter referred to as Export for ease of reading) is a utility for
unloading data and metadata into a set of operating system files called a dump file set.
The dump file set can be imported only by the Data Pump Import utility. The dump file
set can be imported on the same system or it can be moved to another system and
loaded there.
ANS: The dump file set is made up of one or more disk files that contain table data,
database object metadata, and control information. The files are written in a
proprietary, binary format. During an import operation, the Data Pump Import utility
uses these files to locate each database object in the dump file set.
Data Pump Import (hereinafter referred to as Import for ease of reading) is a utility for
loading an export dump file set into a target system. The dump file set is made up of one
or more disk files that contain table data, database object metadata, and control
information.
ANS: Most databases should only need to have the database basic initialization parameters
set to run properly and efficiently.Oracle advises you to become familiar with the basic
parameters and only use other parameters when directed to by feature documentation or
in special circumstances. The following is a list of the database basic initialization
parameters:
CLUSTER_DATABASE
COMPATIBLE
CONTROL_FILES
DB_BLOCK_SIZE
DB_CREATE_FILE_DEST
DB_CREATE_ONLINE_LOG_DEST_n
DB_DOMAIN
DB_NAME
A server parameter file enables you to change initialization parameters with ALTER SYSTEM
commands and to persist the changes across a shutdown and startup. It also provides a basis
for self-tuning by Oracle Database.
ANS:
68. SGA
ANS: In the database management systems developed by the Oracle Corporation, the System
Global Area (SGA) forms the part of the system memory (RAM) shared by all the processes
belonging to a single Oracle database instance. The SGA contains all information necessary for
the instance operation.
73. Host-based
ANS:
74. Sequences
ANS: In Oracle, you can create an autonumber field by using sequences. A sequence is
an object in Oracle that is used to generate a number sequence. This can be useful
when you need to create a unique number to act as a primary key.
75. Synonyms
ANS: A synonym is an alternative name for objects such as tables, views, sequences,
stored procedures, and other database objects. You generally use synonyms when you
are granting access to an object from another schema and you don't want the users to
have to worry about knowing which schema owns the object.
76. PL/SQL
ANS: database management, PL/SQL is a procedural language extension to Structured Query
Language (SQL). The purpose of PL/SQL is to combine database language and procedural
programming language. The basic unit in PL/SQL is called a block and is made up of three parts:
a declarative part, an executable part and an exception-building part
Long Questions
M.Sc.IT 2016 (1)
• Program code
• Information about each connected session, even if it is not currently active
• Information needed during program execution, for example, the current state of a query from which
rows are being fetched
• Information such as lock data that is shared and communicated among processes
• Cached data, such as data blocks and redo records, that also exists on disk
The SGA is a group of shared memory structures, known as SGA components, that contain data and
control information for one Oracle Database instance. The SGA is shared by all server and
background processes. Examples of data stored in the SGA include cached data blocks and shared
SQL areas.
A PGA is a nonshared memory region that contains data and control information exclusively for use
by an Oracle process. The PGA is created by Oracle Database when an Oracle process is started.
One PGA exists for each server process and background process. The collection of individual PGAs is
the total instance PGA, or instance PGA. Database initialization parameters set the size of the
instance PGA, not individual PGAs.Ans: Figure 14-1 Oracle Database Memory Structures
If any one of these 6 mandatory background processes is killed/not running, the instance will be
aborted.
Whenever a log switch is occurring as redolog file is becoming CURRENT to ACTIVE stage, oracle
calls DBWn and synchronizes all the dirty blocks in database buffer cache to the respective
datafiles, scattered or randomly.
Database writer (or Dirty Buffer Writer) process does multi-block writing to disk
asynchronously. One DBWn process is adequate for most systems. Multiple database writers
can be configured by initialization parameter DB_WRITER_PROCESSES, depends on the number
of CPUs allocated to the instance. To have more than one DBWn only make sense if each DBWn
has been allocated its own list of blocks to write to disk. This is done through the initialization
parameter DB_BLOCK_LRU_LATCHES. If this parameter is not set correctly, multiple DB writers
can end up contending for the same block list.
The possible multiple DBWR processes in RAC must be coordinated through the locking and
global cache processes to ensure efficient processing is accomplished.
• When the dirty blocks in SGA reaches to a threshold value, oracle calls DBWn.
• When the database is shutting down with some dirty blocks in the SGA, then oracle calls
DBWn.
• DBWn has a time out value (3 seconds by default) and it wakes up whether there are
any dirty blocks or not.
• When a checkpoint is issued.
• When a server process cannot find a clean reusable buffer after scanning a threshold
number of buffers.
• When a huge table wants to enter into SGA and oracle could not find enough free space
where it decides to flush out LRU blocks and which happens to be dirty blocks. Before
flushing out the dirty blocks, oracle calls DBWn.
• Oracle RAC ping request is made.
• When Table DROPped or TRUNCATEed.
LGWR writes redo data from redolog buffers to (online) redolog files, sequentially.
Redolog file contains changes to any datafile. The content of the redolog file is file id, block id
and new content.
LGWR will be invoked more often than DBWn as log files are really small when compared to
datafiles (KB vs GB). For every small update we don’t want to open huge gigabytes of datafiles,
instead write to the log file.
Redolog file has three stages CURRENT, ACTIVE, INACTIVE and this is a cyclic process. Newly
created redolog file will be in UNUSED state.
When the LGWR is writing to a particular redolog file, that file is said to be in CURRENT status. If
the file is filled up completely then a log switch takes place and the LGWR starts writing to the
second file (this is the reason every database requires a minimum of 2 redolog groups). The file
which is filled up now becomes from CURRENT to ACTIVE.
Log writer will write synchronously to the redolog groups in a circular fashion. If any damage is
identified with a redolog file, the log writer will log an error in the LGWR trace file and the alert
log. Sometimes, when additional redolog buffer space is required, the LGWR will even write
uncommitted redolog entries to release the held buffers. LGWR can also use group commits
(multiple committed transaction's redo entries taken together) to write to redologs when a
database is undergoing heavy write operations.
In RAC, each RAC instance has its own LGWR process that maintains that instance’s thread of
redo logs.
While writing dirty buffers, if the DBWn process finds that some redo information has
not been written, it signals the LGWR to write the information and waits until the
control is returned.
Checkpoint is a background process which triggers the checkpoint event, to synchronize all
database files with the checkpoint information. It ensures data consistency and faster database
recovery in case of a crash.
When checkpoint occurred it will invoke the DBWn and updates the SCN block of the all
datafiles and the control file with the current SCN. This is done by LGWR. This SCN is called
checkpoint SCN.
• Checkpoint event can be occurred in following conditions:
o Whenever database buffer cache filled up.
o Whenever times out (3seconds until 9i, 1second from 10g).
o Log switch occurred.
o Whenever manual log switch is done.
SQL> ALTER SYSTEM SWITCH LOGFILE;
o Manual checkpoint.
SQL> ALTER SYSTEM CHECKPOINT;
o Graceful shutdown of the database.
o Whenever BEGIN BACKUP command is issued.
INSTANCE CRASH RECOVERY. When performing the crash recovery before the database is completely open, if it
finds any transaction committed but not found in the datafiles, will now be applied from redolog files to datafiles.
▪ If SMON observes some uncommitted transaction which has already updated the table in the datafile, is
going to be treated as a in doubt transaction and will be rolled back with the help of before image available
in rollback segments.
▪ SMON also cleans up temporary segments that are no longer in use.
▪ It also coalesces contiguous free extents in dictionary managed tablespaces that have PCTINCREASE set to
a non-zero value.
▪ In RAC environment, the SMON process of one instance can perform instance recovery for other instances
that have failed.
▪ SMON wakes up about every 5 minutes to perform housekeeping activities.
If a client has an open transaction which is no longer active (client session is closed) then PMON comes into the
picture and that transaction becomes in doubt transaction which will be rolled back.
PMON is responsible for performing recovery if a user process fails. It will rollback uncommitted transactions. If the
old session locked any resources that will be unlocked by PMON.
PMON is responsible for cleaning up the database buffer cache and freeing resources that were allocated to a
process.
PMON also registers information about the instance and dispatcher processes with Oracle (network) listener.
PMON also checks the dispatcher & server processes and restarts them if they have failed.
This process is intended for recovery in distributed databases. The distributed transaction recovery process finds
pending distributed transactions and resolves them. All in-doubt transactions are recovered by this process in the
distributed database setup. RECO will connect to the remote database to resolve pending transactions.
Pending distributed transactions are two-phase commit transactions involving multiple databases. The database
that the transaction started is normally the coordinator. It will send request to other databases involved in two-
phase commit if they are ready to commit. If a negative request is received from one of the other sites, the entire
transaction will be rolled back. Otherwise, the distributed transaction will be committed on all sites. However,
there is a chance that an error (network related or otherwise) causes the two-phase commit transaction to be left
in pending state (i.e. not committed or rolled back). It's the role of the RECO process to liaise with the coordinator
to resolve the pending two-phase commit transaction. RECO will either commit or rollback this transaction.
Oracle Instance
The Oracle instance allows you to access the Oracle database ( opening only one database).
The Oracle instance consists of:
• Background process : manage and implement the relationships between physical structures
and memory structures. There are two categories
• Mandatory background processes: DBWN, PMON, CKPT, LGWR, SMON
• Optional background process: ARCn, LMDn, RECO, CJQ0, LMON, Snnn, Dnnn, Pnnn,
LCKn, QMNn
• Memory structures consisting of essentially of two memory areas:
• Memory area allocated to the SGA (System Global Area) : allocated to start the instance
and represents a fundamental component of an Oracle instance. It consists of several
memory areas:
• The shared memory area
• The buffer cache of the database
• Buffer logging and other structures for the management of internal and external locks,
statistical data, etc ...
• The LARGE POOL memory area
• The Java memory area
• Memory allocated for the PGA (Program Global Area) is allocated at the start of the process
server. It is reserved for each user process that connects to the Oracle database and is
released at the end of the process.
Process Servers
Represents the program that interact directly with the Oracle server. It responds to all requests
and return results. It can be dedicated to a client or a server shared by many.
Oracle database
The Oracle database is a collection of data treated as a single entity and consists of three types
of files including:
• Control files
• Data Files
• Log files
4. What is recovery, write steps for recovering instance, data file and control file.
Ans: Recovery Manager (RMAN) is an Oracle utility that can back up, restore,
and recover database files. It is a feature of the Oracle database server and does not require
separate installation.
• The database opens for the first time after the failure of a single-instance database or all instances of
an Oracle RAC database. This form of instance recovery is also called crash recovery. Oracle
Database recovers the online redo threads of the terminated instances together.
• Some but not all instances of an Oracle RAC database fail. Instance recovery is performed
automatically by a surviving instance in the configuration.
1. With the instance shut down, use an operating system command to overwrite the bad control file
with a good copy:
2. % cp /u03/oracle/prod/control03.ctl /u02/oracle/prod/control02.ctl
3.
1. With the instance shut down, use an operating system command to copy the current copy of the
control file to a new, accessible location:
2. % cp /u01/oracle/prod/control01.ctl /u04/oracle/prod/control03.ctl
3.
4. Edit the CONTROL_FILES parameter in the initialization parameter file to replace the bad location with
the new location:
5. CONTROL_FILES = (/u01/oracle/prod/control01.ctl,
6. /u02/oracle/prod/control02.ctl,
7. /u04/oracle/prod/control03.ctl)
8.
11.
If you have multiplexed control files, you can get the database started up quickly by editing
the CONTROL_FILES initialization parameter. Remove the bad control file from CONTROL_FILES setting and you
can restart the database immediately. Then you can perform the reconstruction of the bad control file and at
some later time shut down and restart the database after editing the CONTROL_FILES initialization parameter
to include the recovered control file.
Backup Type
Types of Backups
• Full Backups
• Incremental Backups
• Hot vs Cold Backups
Full backup
As the name implies, a full backup is when every single file and folder in the system is backed
up. A full backup takes longer and requires more space than other types of backups but the
process of restoring lost data from backup is much faster.
Incremental backup
With incremental backup, only the initial backup is a full one. Subsequent backups only stores
changes that were made since the previous backup. The process of restoring lost data from
backup is longer but the backup process is much quicker.
Cold backup:
A cold backup is done when there is no user activity going on with the system. Also called as
offline backup, is taken when the database is not running and no users are logged in. all files of
the database are copied and no changes during the copy are made.
Hot backup:
A hot backup is taken when the database needs to run all the time. It is an online backup. All
files of the database are copied and there may be changes to the database during the copy.
Terminology:
Backup sets:
RMAN backs up the datafiles, control file, archived log files, and server parameter files in a
RMAN specific format called a backup piece. In a nutshell, a backup set is a bundle of dbf, ctl
and redo file that can restore a database. A set of one or more such backup pieces makes up
a backup set.
Backup Strategies
Before you create an Oracle database, decide how to protect the database against
potential media failures. If you do not develop a backup strategy before creating
your database, then you may not be able to perform recovery if a disk failure
damages the datafiles, online redo log files, or control files.
This section describes general guidelines that can help you decide when to perform
database backups and which parts of a database you should back up. Of course, the
specifics of your strategy depend on the constraints under which you are operating.
If a media failure damages all members of an online redo log group, then different scenarios
can occur depending on the type of online redo log group affected by the failure and the
archiving mode of the database.
If the damaged log group is active, then it is needed for crash recovery; otherwise, it is not.
If the
group
is . . . Then . . . And you should . . .
Inactive It is not needed for Clear the archived or unarchived group.
crash recovery
Active It is needed for crash Attempt to issue a checkpoint and clear the log; if
recovery impossible, then you must restore a backup and perform
incomplete recovery up to the most recent available redo
log.
Current It is the log that the Attempt to clear the log; if impossible, then you must
database is currently restore a backup and perform incomplete recovery up to
writing to the most recent available redo log.
Your first task is to determine whether the damaged group is active or inactive.
1. Locate the filename of the lost redo log in V$LOGFILE and then look for the group number
corresponding to it. For example, enter:
If all members of an online redo log group with INACTIVE status are damaged, then the procedure
depends on whether you can fix the media problem that damaged the inactive redo log group.
The following are some products, tools, and utilities you can use to achieve your goals as a database
administrator:
Oracle Universal Installer (OUI) is a utility that installs your Oracle software and options. It can
automatically start Oracle Database Configuration Assistant to install a database.
Oracle Database Configuration Assistant (DBCA) is a utility that creates a database from templates
that are supplied by Oracle, or you can create your own. It enables you to copy a preconfigured seed
database, thus saving the time and effort of generating and customizing a new database.
The Database Upgrade Assistant is a tool that guides you through the upgrade of your existing
database to a new Oracle Database release.
Net Configuration Assistant (NETCA) is a utility that enables you to configure listeners and naming
methods, which are critical components of the Oracle Database network.
The primary product for managing your database is Oracle Enterprise Manager Database Control
(Database Control), a Web-based interface. After you have installed the Oracle Database software,
created or upgraded a database, and configured the network, you can use Database Control to
manage your database. Database Control also provides an interface for performance advisors and for
Oracle utilities such as SQL*Loader and Recovery Manager (RMAN).
Oracle also offers separately licensed Oracle Enterprise Manager management packs, management
plug-ins, and other products you can purchase to enhance the capabilities of Oracle Enterprise
Manager in specific environments.
• help eliminate fragmentation of free space in the data dictionary, isolate other
fragmentation, and minimize resource contention
• Table B-2 Optimal Flexible Architecture Hierarchical File Path Examples
Directory Description
Root directory
/u01/
/u01/app/
Directory Description
Oracle base directory for user grid. The Oracle home (Grid
home) for Oracle Grid Infrastructure for a cluster
/u01/app/grid installation is located outside of the Grid user. There can be
only one Grid home on a server, and only one Grid software
installation owner.
/u01/app/oracle/admin/
/u01/app/oracle/admin/TAR
/u01/app/oracle/admin/db_sales/
/u01/app/oracle/admin/db_dwh/
/u01/app/oracle/fast_recovery_area/
Directory Description
/u01/app/oracle/fast_recovery_area/db_sales
/u01/app/oracle/fast_recovery_area/db_dwh
/u02/app/oracle/oradata
/u03/app/oracle/oradata
/u04/app/oracle/oradata
Directory Description
ASM groups the disks in your storage system into one or more disk groups. You manage a small
set of disk groups and ASM automates the placement of the database files within those disk
groups.
• Striping—ASM spreads data evenly across all disks in a disk group to optimize
performance and utilization. This even distribution of database files eliminates the need
for regular monitoring and I/O performance tuning.
For example, if there are six disks in a disk group, pieces of each ASM file are written to
all six disks. These pieces come in 1 MB chunks known as extents. When a database file
is created, it is striped (divided into extents and distributed) across the six disks, and
allocated disk space on all six disks grows evenly. When reading the file, file extents are
read from all six disks in parallel, greatly increasing performance.
• Mirroring—ASM can increase availability by optionally mirroring any file. ASM mirrors at
the file level, unlike operating system mirroring, which mirrors at the disk level.
Mirroring means keeping redundant copies, or mirrored copies, of each extent of the
file, to help avoid data loss caused by disk failures. The mirrored copy of each file extent
is always kept on a different disk from the original copy. If a disk fails, ASM can continue
to access affected files by accessing mirrored copies on the surviving disks in the disk
group.
ASM supports 2-way mirroring, where each file extent gets one mirrored copy, and 3-
way mirroring, where each file extent gets two mirrored copies.
Figure 12-1 is an entity-relationship diagram for physical and logical storage. The crow's foot notation
represents a one-to-many relationship.
11. What are initialization parameters? Diff. b/w static and dynamic
parameters with example of each.
Creating SPFILE
• Server Parameter Files are binary files that exist only on server and a
called from client location to start-up database.
• Can be created using the CREATE SPFILE statement.
• Connect SQL PLUS as SYSDBA then:
• Syntax: create SPFILE from PFILE;
• Example : CREATE SPFILE
FROM PFILE = ‘$ORACLE_HOME/dbs/init.ora’;
CREATE SPFILE = ‘mySPFILE.ora’
Start-up Database
• Starting an instance without Mounting a Database:
3. STARTUP NOMOUNT
(Typically used only during database creation)
• Restricting access to an instance at startup:
4. STARTUP RESTRICT
(To start instance and optionally mount it and open a database but restrict
access only to administrative personnel.
Can be used in combination with mount, no mount and open modes.
Generally used to import or export data.
To temporarily prevent users from using data.
To perform migration or upgrade operations)
Start-up Database
• Forcing an instance to start:
5. STARTUP FORCE
(rarely used; when experiencing problems to startup or unable to
shutdown properly)
4. SHUTDOWN TRANSACTIONAL
• (No new connections are allowed.
• No new transactions are allowed.
• Waits for all ongoing transactions to get completed.
• Any connected users are disconnected right after completing ongoing
transactions.)
• Shutting Down a database instantaneously:
5. SHUTDOWN ABORT
• (No new connections or transactions are allowed.
• Current SQL statements being processed are terminated.
• Uncommitted transactions are not rolled back.
• Does not wait for users to disconnect themselves. Disconnects them all
M.Sc.IT 2015
Ans:Repeate
14. Write steps for creating database from template with Database
Configuration Assistant.
Ans:Repeate
15. Diff. b/w system privileges and object privilege with example of
each.
Ans: What is the difference between system and object privileges?
First off, let’s define what a privilege is in a database. In a database, every user account can be granted a number of privileges,
which are also known as permissions. These privileges allow a particular user account to do certain things, like DELETE and
UPDATE certain tables, CREATE a database, SELECT from a certain table, and many other things.
In Oracle, Microsoft’s SQL Server, and in Sybase Adaptive Server privileges are further divided into two different categories: 1.
system privileges and 2. object privileges. What’s the difference between system and object privileges? Well, lets go through an
explanation of each one, and then we’ll discuss the differences between the two.
System privileges
System privileges are privileges given to users to allow them to perform certain functions that deal with managing the database
and the server . Most of the different types of permissions supported by the database vendors fall under the system privilege
category. Let’s go through some examples of system privileges in Oracle and SQL Server.
• CREATE USER. The CREATE USER permission, when granted to a database user, allows that database user to create
new users in the database.
• CREATE TABLE. The CREATE TABLE permission, when granted to a database user, allows that database user to create
tables in their own schema. This type of privilege is also available for other object types – like stored procedures and
indexes.
• CREATE SESSION. The CREATE SESSION permission, when granted to a database user, allows that database user to
connect to the database.
• BACKUP DATABASE. The BACKUP DATABASE permission, when granted to a database user, allows that database user
to create backups of the databases on the server.
• CREATE DATABASE. The CREATE DATABASE permission, when granted to a database user, allows that database user
to create new databases on the server.
• SHUTDOWN. The SHUTDOWN permission, when granted to a database user, allows that database user to issue a
command to shutdown the server.
Object privileges
Object privileges are privileges given to users so that they can perform certain actions upon certain database objects –
where database objects are things like tables, stored procedures, indexes, etc. Some examples of object privileges include
granting a particular database user the right to DELETE and/or SELECT from a particular table. This is done using the GRANT
clause, which you can read more about here: SQL GRANT.
Schema Objects
This chapter discusses the different types of database objects contained in a user's
schema. It includes:
• Tables
• Views
• Materialized Views
• Dimensions
• The Sequence Generator
• Synonyms
• Indexes
• Index-Organized Tables
• Application Domain Indexes
• Clusters
• Hash Clusters
Each user owns a single schema. Schema objects can be created and manipulated
with SQL and include the following types of objects:
• Clusters
• Database links
• Database triggers
• Dimensions
• External procedure libraries
Tables
Tables are the basic unit of data storage in an Oracle database. Data is stored
in rows and columns. You define a table with a table name (such as employees) and set
of columns. You give each column a column name (such as employee_id, last_name,
and job_id), a datatype (such as VARCHAR2, DATE, or NUMBER), and a width. The width can
be predetermined by the datatype, as in DATE. If columns are of the NUMBER datatype,
define precision and scale instead of width. A row is a collection of column
information corresponding to a single record.
You can specify rules for each column of a table. These rules are called integrity
constraints. One example is a NOT NULL integrity constraint. This constraint forces the
column to contain a value in every row.
After you create a table, insert rows of data using SQL statements. Table data can
then be queried, deleted, or updated using SQL.
Views
A view is a tailored presentation of the data contained in one or more tables or other
views. A view takes the output of a query and treats it as a table. Therefore, a view
can be thought of as a stored query or a virtual table. You can use views in most
places where a table can be used.
For example, the employees table has several columns and numerous rows of
information. If you want users to see only five of these columns or only specific rows,
then you can create a view of that table for other users to access.
Figure 10-5 shows an example of a view called STAFF derived from the base
table employees. Notice that the view shows only five of the columns in the base table.
Dimensions
Synonyms
A synonym is an alias for any table, view, materialized view, sequence, procedure,
function, or package. Because a synonym is simply an alias, it requires no storage
other than its definition in the data dictionary.
Synonyms are often used for security and convenience. For example, they can do the
following:
Indexes
Indexes are optional structures associated with tables and clusters. You can create
indexes on one or more columns of a table to speed SQL statement execution on
that table. Just as the index in this manual helps you locate information faster than if
there were no index, an Oracle index provides a faster access path to table data.
Indexes are the primary means of reducing disk I/O when properly used.
You can create many indexes for a table as long as the combination of columns
differs for each index. You can create more than one index using the same columns if
you specify distinctly different combinations of the columns. For example, the
following statements specify valid combinations:
17. What is recovery, write steps for recovering instance, data file and
control file.
Ans: Repeated
18. What is database backup? Elaborate diff. types and strategy of
backup.
Ans: Repeated