Professional Documents
Culture Documents
Junior DBA Questions
Junior DBA Questions
Database Structures
More Questions with Practical way explained here in this blog, Please read
Oracle database is comprised of three types of files. One or more datafiles, two are more redo log files, and one or
more control files.
3. What is a tablespace?
A database is divided into Logical Storage Unit called tablespaces. A tablespace is used to grouped related logical
structures together.
Every Oracle database contains a tablespace named SYSTEM, which is automatically created when the database is
created. The SYSTEM tablespace always contains the data dictionary tables for the entire database.
Each databases logically divided into one or more tablespaces one or more data files are explicitly created for each
tablespace.
6. What is schema?
Schema objects are the logical structures that directly refer to the database’s data. Schema objects include tables,
views, sequences, synonyms, indexes, clusters, database triggers, procedures, functions packages and database
links.
Yes.
Yes.
A table is the basic unit of data storage in an Oracle database. The tables of a database hold all of the user
accessible data. Table data is stored in rows and columns.
A view is a virtual table. Every view has a query attached to it. (The query is a SELECT statement that identifies the
columns and rows of the table(s) the view uses.)
12. Do a view contain data?
Yes.
- Provide an additional level of table security, by restricting access to a predetermined set of rows and columns of a
table.
- Present the data in a different perspective from that of the base table.
A sequence generates a serial list of unique numbers for numerical columns of a database’s tables.
- Provide location transparency for tables, views or program units of a remote database.
An index is an optional structure associated with a table to have direct access to rows, which can be created to
increase the performance of data retrieval. Index can be created on one or more columns of a table.
22. How are the index updates?
Indexes are automatically maintained and used by Oracle. Changes to table data are automatically incorporated into
all relevant indexes.
Clusters are groups of one or more tables physically stores together to share common columns and are often used
together.
The related columns of the tables in a cluster are called the cluster key.
A row is stored in a hash cluster based on the result of applying a hash function to the row’s cluster key value. All
rows with the same hash key value are stores together on disk.
Hash clusters are better choice when a table is often queried with equality queries. For such queries the specified
cluster key value is hashed. The resulting hash key value points directly to the area on disk that stores the specified
rows.
A database link is a named object that describes a “path” from one database to another.
Private database link, public database link & network database link.
Private database link is created on behalf of a specific user. A private database link can be used only when the owner
of the link specifies a global object name in a SQL statement or in the definition of the owner’s views or procedures.
Public database link is created for the special user group PUBLIC. A public database link can be used when any user
in the associated database specifies a global object name in a SQL statement or object definition.
Network database link is created and managed by a network domain service. A network database link can be used
when any user of any database in the network specifies a global object name in a SQL statement or object definition.
Oracle database’s data is stored in data blocks. One data block corresponds to a specific number of bytes of physical
database space on disk.
In circumstances, all of the data for a row in a table may not be able to fit in the same data block. When this occurs,
the data for the row is stored in a chain of data block (one or more) reserved for that segment.
An extent is a specific number of contiguous data blocks, obtained in a single allocation and used to store a specific
type of information.
Each non-clustered table has a data segment. All of the table’s data is stored in the extents of its data segment. Each
cluster has a data segment. The data of every table in the cluster is stored in the cluster’s data segment.
Each index has an index segment that stores all of its data.
A database contains one or more rollback segments to temporarily store “undo” information.
To generate read-consistent database information during database recovery and to rollback uncommitted
transactions by the users.
Temporary segments are created by Oracle when a SQL statement needs a temporary work area to complete
execution. When the statement finishes execution, the temporary segment extents are released to the system for
future use.
Every Oracle database has one or more physical data files. A database’s data files contain all the database data.
The data of logical database structures such as tables and indexes is physically stored in the data files allocated for a
database.
A data file can be associated with only one database. Once created a data file can’t change size. One or more data
files form a logical unit of database storage called a tablespace.
The primary function of the redo log is to record all changes made to data.
The information in a redo log file is used only to recover the database from a system or media failure prevents
database data from being written to a database’s data files.
- Database name
When an instance of an Oracle database is started, its control file is used to identify the database and redo log files
that must be opened for database operation to proceed. It is also used in database recovery.
A database instance (Server) is a set of memory structure and background processes that access a set of database
files. The processes can be shared by all of the users.
The memory structure that is used to store the most queried data from database. This helps up to improve database
performance by decreasing the amount of I/O performed against data file.
An index is a database structure used by the server to have direct access of a row in a table. An index is
automatically created when a unique of primary key constraint clause is specified in create table command
Group of tables physically stored together because they share common columns and are often used together is
called cluster.
The related columns of the tables are called the cluster key. The cluster key is indexed using a cluster index and its
value is stored only once for multiple tables in the cluster.
multiple users/schemas
SGA (Database buffer, Dictionary Cache Buffers, Redo log buffers, Shared SQL pool)
ARCH (ARCHiver)
RECO
Dispatcher
Two processes waiting to update the rows of a table, which are locked by other processes then deadlock arises.
In a database environment this will often happen because of not issuing the proper row lock commands. Poor design
of front-end application may cause this situation and the performance of server will reduce drastically.
These locks will be released automatically when a commit/rollback operation performed or any one of this processes
being killed externally.
Memory Management
The data dictionary cache is stored in an area in SGA called the shared pool. This will allow sharing of parsed SQL
statements among concurrent users.
Data segment are the physical areas within a database block in which the data associated with tables and clusters
are stored.
63. What are the factors causing the reparsing of SQL statements in SGA?
Monitor the ratio of the reloads takes place while executing SQL statements. If the ratio is greater than 1 then
increase the SHARED_POOL_SIZE.
Database buffers are cache in the SGA used to hold the data blocks that are read from the data segments in the
database such as tables, indexes and clusters DB_BLOCK_BUFFERS parameter in INIT.ORA decides the size.
Dictionary cache is information about the database objects stored in a data dictionary table.
Number of times processes repeatedly query the dictionary table is called recursive hints. It is due to the data
dictionary cache is too small. By increasing the SHARED_POOL_SIZE parameter we can optimize the size of data
dictionary cache.
Changes made to the records are written to the on-line redo log files. So that they can be used in roll forward
operations during database recoveries. Before writing them into the redo log files, they will first brought to redo log
buffers in SGA and LGWR will write into files frequently. LOG_BUFFER parameter will decide the size.
68. How will you swap objects into a different table space for an existing database?
69. List the Optional Flexible Architecture (OFA) of Oracle database? How can we organize the tablespaces in
Oracle database to have maximum performance?
70. How will you force database to use particular rollback segment?
A free extent is a collection of continuous free blocks in tablespace. When a segment is dropped its extents are
reallocated and are marked as free.
72.Which parameter in Storage clause will reduce number of rows per block?
PCTFREE parameter
We can plan the storage for a table as how much initial extents are required, how much can be extended next, how
much % should leave free for managing row updating, etc.,
This is used to reserve certain amount of space in a block for expansion of rows.
To manage the database level transactions such as modifications of the data dictionary table that record information
about the free space usage.
- Create a database, which implicitly creates a SYSTEM rollback segment in a SYSTEM tablespace.
- Make new rollback segment available (after shutdown, modify init.ora file and start database)
- Deactivate rollback segment R0 and activate the newly created rollback segments.
79. How the space utilization takes place within rollback segments?
It will try to fit the transaction in a cyclic fashion to all existing extents. Once it found an extent is in use then it forced
to acquire a new extent (number of extents is based on the optimal size)
A single transaction may wipeout all available free space in the rollback segment tablespace. This prevents other
user using rollback segments.
PARTLY AVAILABLE – Contains data from an unresolved transaction involving a distributed database.
83. List the sequence of events when a large transaction that exceeds beyond its optimal value when an
entry wraps and causes the rollback segment to expand into another extend.
Transaction Begins.
The entry attempts to wrap into second extent. None is available, so that the RBS must extent.
RBS extents
Transaction Completes.
85. How will you estimate the space required by a non-clustered table?
Calculate the number of blocks and bytes required for the table.
After arriving the calculation, add 10 % additional space to calculate the initial extent size for a working table.
86. It is possible to use raw devices as data files and what are the advantages over file system files?
Yes.
The advantages over file system files are that I/O will be improved because Oracle is bye-passing the kernel which
writing into disk. Disk corruption will be very less.
Database’s overall physical architecture is maintained in a file called control file. It will be used to maintain internal
consistency and guide recovery operations. Multiple copies of control files are advisable.
88. How to implement the multiple control files for an existing database?
This can be achieved by creating group of log files together, so that LGWR will automatically writes them to all the
members of the current on-line redo log group. If any one group fails then database automatically switch over to next
group. It degrades performance.
Shadow set of disks save as a backup in the event of disk failure. In most operating systems if any disk failure occurs
it automatically switchover to place of failed disk.
Improved performance because most OS support volume shadowing can direct file I/O request to use the shadow set
of files instead of the main set of files. This reduces I/O load on the main set of disks.
They allow the database to maintain read consistency between multiple transactions.
It is the set of before image data blocks that contain rows that are modified by a transaction.
Each rollback segment entry must be completed within one rollback segment.
It is a measure of well the data cache buffer is handling requests for data.
Hit Ratio = (Logical Reads – Physical Reads – Hits Misses)/ Logical Reads.
The tar command cannot be used for physical file backup, instead we can use dd command, which is less flexible
and has limited recoveries.
96. List the factors that can affect the accuracy of the estimations?
- The space used transaction entries and deleted records, does not become free immediately after completion due to
delayed cleanout.
- Inserts of, updates to and deletes of rows as well as columns larger than a single data block, can cause
fragmentation a chained row pieces.
A user account is not a physical structure in database but it is having important relationship to the objects in the
database and will be having certain privileges.
Instead grant the ability to access the procedures that access the tables.
When procedure executed it will execute the privilege of procedures owner. Users cannot access tables except via
the procedure.
99. What are the dictionary tables used to monitor a database space?
DBA_FREE_SPACE
DBA_SEGMENTS
DBA_DATA_FILES.
SQL*Plus Statements
Data Definition Language: CREATE, ALTER, DROP, TRUNCATE, REVOKE, NO AUDIT & COMMIT.
Data Manipulation Language: INSERT, UPDATE, DELETE, LOCK TABLE, EXPLAIN PLAN & SELECT.
Transaction is logical unit between two commits and commit and rollback.
TRUNCATE commits after deleting entire table i.e., cannot be rolled back.
DELETE allows the filtered deletion. Deleted records can be rolled back or committed.
Join is a query, which retrieves related columns or rows from multiple tables.
Outer Join – Joining two tables in such a way that query can also retrieve rows that do not have corresponding join
value in the other table.
Sub-query is a query whose return values are used in filtering conditions of the main query.
INSTR returns the position of the m-th occurrence of the string 2 in string1. The search begins from nth position of
string1.
SUBSTR (String1 n, m)
SUBSTR returns a character string of size m in string1, starting from n-th position of string1.
UNION ALL – returns all rows selected by either query, including all duplicates.
ROWID is a pseudo column attached to each row of a table. It is 18 characters long, blockno, rownumber are the
components of ROWID.
Using ROWID.
CONSTRAINTS
Maintaining data integrity through a set of rules that restrict the values of one or more columns of the tables based
on the values of primary key or unique key of the referenced table.
SAVEPOINTS are used to subdivide a transaction into smaller parts. It enables rolling back part of a transaction.
Maximum of five save points are allowed.
When ON DELETE CASCADE is specified Oracle maintains referential integrity by automatically removing
dependent foreign key values if a referenced primary or unique key value is removed.
116. What is difference between CHAR and VARCHAR2? What is the maximum SIZE allowed for each type?
For CHAR the maximum length is 255 and 2000 for VARCHAR2.
117. How many LONG columns are allowed in a table? Is it possible to use LONG columns in WHERE clause
or ORDER BY?
Only one LONG column is allowed. It is not possible to use LONG column in WHERE or ORDER BY clause.
118. What are the pre-requisites to modify datatype of a column and to add a column with NOT NULL
constraint?
The integrity constraints can be enabled or disabled by ALTER TABLE ENABLE CONSTRAINT / DISABLE
CONSTRAINT.
121. If unique key constraint on DATE column is created, will it validate the rows that are inserted with
SYSDATE?
Database link is a named path through which a remote database can be accessed.
123. How to access the current value and next value from a sequence? Is it possible to access the current
value in a session before accessing next value?
Sequence name CURRVAL, sequence name NEXTVAL. It is not possible. Only if you access next value in the
session, current value can be accessed.
CYCLE specifies that the sequence continue to generate values after reaching either maximum or minimum value.
After pan-ascending sequence reaches its maximum value, it generates its minimum value. After a descending
sequence reaches its minimum, it generates its maximum.
NO CYCLE specifies that the sequence cannot generate more values after reaching its maximum or minimum value.
A View can be updated/deleted/inserted if it has only one base table if the view is based on columns from one or
more tables then insert, update and delete is not possible.
127. If a view on a single base table is manipulated will the changes be reflected on the base table?
If changes are made to the tables and these tables are the base tables of a view, then the changes will be reference
on the view.
1) How to set pga size, can you change it while the database is running?
Yes the pga can be changed while the database is up and running.
ISSES_MODIFIABLE VARCHAR2(5) Indicates whether the parameter can be changed with ALTER
ISSYS_MODIFIABLE VARCHAR2(9) Indicates whether the parameter can be changed with ALTER
server parameter file was used to start the instance. The change takes
6) What is an index, how many types of indexes you know? Why you need an index
Index is an oracle object which is used to retrieve the data much faster rather than scanning entire table.Typically this
is like an index page in a book which contains the links to the pages,where we can go through easily through out the
book.
If index page is not there,we have to search each and every page for our need,so we use indexes in oracle also to
Types of indexes:
Btree index: Used for searches mostly when used select statements(Ex:pincode)
bit map index: when having low cardinolity (low priority) columns used in thestatements.for example: gender column
reverse index: used mostly to increase the speed of inserts (its like btree only but the key is reverse).
7) What is synonym?
for example user ‘a’ has table ‘t’ which user ‘a’ wants to hide the name but user ‘b’ has to access it.
In this case user ‘a’ can create a synonym on table ‘t’ and give a select priviledge to user ‘b’.
View: DBA_SYNONYMS
8) What is sequence?
Sequence is a oracle object which used to create the unique and sequential numbering for a column
10) What is the difference between Locally managed tablespace and dictionary managed tablespace?
LMT: Locally Managed Table space stores all the extent mapping or allocation details in the header of the data file
DMT:Dictionary Managed Table space stores all the extent mapping or allocation details in the dictionary table called
Since everytime an allocation of extents generate some recursive sql on UET$ and FET$ this is contention in
dictionary cache, hence this is not good for performance of database, but LMT can store this outside of dictionary ,
11) What is Automatic segment space management? and how to find the tablespace in ASSM?
Oracle will allocates the extents automatically to the table or segment depending upon the size of the table.We need
SQL>desc dba_tablespaces;
dba_tablespaces;
SQL>desc dba_tablespaces;
dba_tablespaces;
14) How to find the datafiles that associated with particular tablespace? Ex: System
SQL>
‘%TEMP%';
PROPERTY_NAME
——————————
PROPERTY_VALUE
——————————————————————————–
DEFAULT_TEMP_TABLESPACE
TEMP2
17) How to see what is the default block size for a database?
Yes it is possible but we have to create multiple DB buffer pools while setting the required block size parameter.
SQL>shut immediate
Now we can create the table space using new 2k block size
example:SQL>
create tablespace test_2k datafile ‘/u01/oradata/paddu/test2k.dbf’ size 100M block size 2k;
19) What is the oracle block, can you explain?
Oracle block is the lowest level of storage structure where it contains the data(business/oracle data)
The block has divided into many sections starting from block header, row header, row directory, ITL list (Intrested
20) Can you change the blocksize once the database is created?
Absolutely no because once the Datafiles are formatted into 8k, we cannot change the database block sizes , if you
need, you have to create fresh database with new block size and restore from backup or import.
21) Can you change the database name once the database is created?
Yes we can but the database has to be shutdown and also this will change all of the headers of the files
Option 1
1) Using NID utility
a)SQL>alter database close;
b) nid target=sys as sysdba dbname=ketan(this will change the control files and headers of the datafiles with the
correction of new name)
c)cd $ORACLE_HOME/dbs
d) cp initaishu.ora initketan.ora
e)vi initketan.ora
find db_name parameter and change it to ketan
f)vi /etc/oratab
change the name aishu to ketan
g) . oraenv
set the variable ORACLE_SID=ketan
f) startup the database
SQL> startup (but the database open will error out since the datbase should open with resetlogs)
h) alter database open resetlogs;
Option 2
By changing the control file
a)alter database backup control file to trace;
22) Can you change the instance name once the database is created?
shut immediate;
cp spfilepaddu.ora spfilekarthika.ora
export ORACLE_SID=karthika
startup
23) Can you rename the tablespace once it is created?
No there is no direct command to change the user name but there is a work around.
1) export user
sqlplus / as sysdba
SQL> exit
sqlplus / as sysdba
Yes
SQL>connect aishu/aishu
(or)
SQL>rename t to t1
yes
SQL>desc t;
desc dba_data_files;
desc dba_temp_files;
desc dba_tablespaces;
DBA views are available once the database is in open mode only
30) What is the difference between a role and privilege, can you provide an example?
Providing authorization to an user such as create, alter, delete, drop, truncate, insert, update.
For roles:-desc
dba_roles can be used to know what are all the roles in a database.
role_sys_privs can used to know what are all the system privileges assigned to that role.
role_tab_privs can be used to know what are all the object privileges assigned to that role
For privileges:-
36) What are constraints? Can you list them and when will you use them?
for example a not null constraint will not allow any null value in the column
a unique constraint will not allow any duplicate value in the column
a primary key constraint will not allow any duplicate value and null in the column.
a foreign key constraint will be from the one of the primary key of the table which means data must resides in the
SQL> create table pincode (area varchar2(30), pincodenum number primary key);
37) What is Row chaining? When does it occur? where can you find it? What is the solution?
When the row is not adequate to fit in the block while inserting oracle will insert half row in one block and half in
Solutions:
Here TS is the tablespace name with bigger size, before creating tablespace it is assumed that you have created a
38) What is row migration? When does it occur? Where can you find this information?
Row migration happens when update occurs at one column and the row is not adequate to fit in the block then the
Solution:
41) How to create a database manually , can you provide steps briefly?
1) create a parameter file in /dbs directory with necessary parameters like db_name,instance_name,control file
locations,sga_max_size etc..
2)create necessary directories for datafiles,trace files,redo log files, control files according OFA
3)prepare the create db command
Different directory structures with diff files and we keeping the files (redolog,control etc) in the corresponding
described locations which keeps the files in track and we can easily manage them,Inaddition to tha I/O will be
redistributed.
system table space stores the system tables such as dbtables,oracle base tables,dictionary objects that related to
Sysaux table space: from 10g onwards oracle has segregated some of the dictionary objects to be created in sysaux
table space seperating from system table space to reduce the burden on the one table space
for example oracle session statistics,system statistics,awr data( automatic work load repository),oracle execution
statistics
44) Do you know about statistics, what is the use of it? What kind of statistics exists in database?
1)System-Statistics: statistics about the hardware like cpu speed,I/O speed,read time write time etc : select * from
aux_stats$
2)Object statistics : For a table oracle collects the information about no.of rows,no.ofblocks,avg row
for index oracle collect statistics on index column about no.of rows,no.of root blocks,no.ofbranch blocks,no.of leaf
These statistics will help the query execution engine called optimizer to determine how best the data can the
accessed
table=create segment in a tablespace, that segment contains extents and that extents contains blocks
T=100 * 8192 = 819200000
dba_segments
To resize a datafile the first most thing is the data file should be in auto extendable mode
I have 1gb
I want to 100MB,
Yes we can unless the data is not above 100MB in the datafile.
50) How to move datafiles from one location to another location? Can you provide the steps?
2.Make offline the affected tablespace with ALTER TABLESPACE <tablespace name> OFFLINE; command.
command
51) What is profile? what is the benefit of profile? Where do you see the information of profiles? Provide an
example of profile?
SQL>desc dba_profiles;
create user username identified by password default tablespace testtbs1 profile test;
ex: create user paddu identified by paddu default tablespace testtbs1 profile test;
Note: with grant option provides user to grant the privilege to other users as well, kind of admin
56) Can you delete alert log while database is up and running?
log file
Yes one can delete or move the alert log file while the database is up and running there will be no impact,oracle will
automatically creates a new alert log if it not found any in the directory
Fragmentation of a table is something when ever there is a purge or deletion of a table.Oracle will not use those
unused blocks and always try to allocate the extents above high watermark. This leads the table to grow larger than
its size.
A cursor is a handle, or pointer, to the context area. Through the cursor, a … Cursors allow you to fetch and process
PL/SQL program can control the context area and what happens to it as
the statement is processed. Two important features about the cursor are implict and explict cursors
59) Can you tell various dynamic views you know about and their purpose?
TYPE: Type is the column that shows about what kind of end queue or lock it has
ID1 :This column says about the object id that involved in lock.Match this object id dba_objects to get the object
names
6 is the least level of lock and an exclusive lock,when we update a row that row will be locked as exclusive so that no
From 1-5 the locks are different types of levels which are some shared or table level locks
Row exclusive – Any DML that happens on any row locks as exclusive so that no one can modify
Row shared – Select statement ran, during that period the rows will be in shared mode so that no modification to be
Table Lock – When an update statement ran on column , no other can moidfy the structure of table, and allow row
exclusive
v$sgastat : Displays information about sga individual pool sizes and also displays free memory in the sga
v$transaction: Displays information about the transactions that running in the database
v$sga_resize_ops : Displays information about sga resize operation when sga target is set
Display each statistics information from sysstat but for each session, so 604 statistics X each session
v$sysaux_occupants : Displays the information about objects that resides in sysaux table space
V$ views are dynamic and populated from base table like X$BH and USER$ etc etc
DBA_** views are the the views built on top of v$ views in combination. for example v$session has been built from
v$session,user$ etc
If you do not know the sid replace with any column information you know in where condition.
select sid,status,username,action,program,machine from v$session where paddr in (select addr from v$process
where spid=5046);
v$lock
62) What are locks?
locks are low level serialisation mechanism called end queues in oracle which protects the database of data changes
latches are typically a kind of locks but held for very short time to protect the memory structures of the instance
Oracle latch occurs in the memory structures i.e, in instance ex:buffer latch,redolog latch,shared pool latch
ORacle lock occurs at block level to protect the integrity of the data as the data stored in the block only ex: row
67) Explain the difference between a data block, an extent and a segment.
Data block is a lowest level storage structure, a block cannot span multiple extents
Extent is a set of block which resides inside the table space, an extent cannot span multiple segments
Segment is set of extents nothing but an object, a segment can spawn multiple datafiles
68) How to get the DDL of a table or index? i.e create statement?
DBMS_METADATA.GET_DDL(‘TABLE’,’T’,’AISHU’)
——————————————————————————–
( “X” VARCHAR2(100)
SQL> /
DBMS_METADATA.GET_DDL(‘TABLE’,’T’,’AISHU’)
——————————————————————————–
( “X” VARCHAR2(100)
TABLESPACE “TESTTBS2″
For user
DBMS_METADATA.GET_DDL(‘USER’,’AISHU’)
——————————————————————————–
DB11803941FB7B885803634D39F;F8EF185F1D85D4B3′
69) What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace?
Temporary table space for sorting and also used for temporary tables
Checkpoint which occurs whenever the redolog switch happens, during this CKPT process writes the check point
information to control file and the data file header and informs the DBWR to flush the dirty buffer from buffer cache to
disk until that check point.
71) What is log switch, when does it occurs?
Log switch occurs when the current redo log is full and the log writer has to go to next redo log group.
v$undostat
72) How to set the log archive destination? can we have multiple destinations for archivelogs?
System altered.
System altered.
System altered.
SQL>
Whenever there is recovery operation performed specifically incomplete media recovery , the database must be open
with reset logs since we dont have the archives or redo information until point of failure, hence this is required. further
show parameter control_files;(this shows the old and new location as well)
v$log or v$logfiles;
78) Can you drop the redo log groups while the database is up and running?
Yes we can drop the redolog group but the redo log should be inactive
79) Can you drop the system tablespace, if so what happened to database?
Yes we can drop the normal table spaces but the associated objects will be dropped
if you want to drop the associated datafiles also with table space we should use
81) What is the difference between Oracle home and oracle base
ORACLE_BASE is the root directory for oracle. ORACLE_HOME located beneath ORACLE_BASE is where the
SQL> dba_free_space;
83) How to kill the blocking session, how to find the blocking session?
Now check the blocking_session column for the sid that is blocking and confirm with the application team to kill
Now execute
84) Can you kill the pmon or smon or ckpt ? what happens to database?
These are all the mandatory process to run the database.if we kill any of the process the DB will be crash.
shared pool:shared_pool_size;
DB buffer cache:db_cache_size;
java pool:java_pool_size;
largepool:large_pool_size;
stream pool:stream_pool_size;
Redolog buffer:log_buffer;
alternatively sga_max_size and sga_target should set to manage this pools automatically.
86) Consider the scenario below,
largepool:large_pool_size; 100m
Redolog buffer:log_buffer; 5m
I have also kept SGA_MAX_SIZE=400M in pfile and started the database which one the Oracle consider, 410M or
400M
410M, if the sga_max_size is lesser than the all pools total if specified in pfile then sga_max_size parameter is
ignored.
86) List Process you follow to start looking into Performance issue at database level (If the application is
running very slow, at what points do you need to go about the database in order to improve the
performance?)
Answer ( Although i have never worked directly on performance issues, the below can be steps)
Run a TOP command in Unix to see CPU usage (identify CPU killer processes)
Run VMSTAT, SAR, and PRSTAT command to get more information on CPU and memory usage and possible
blocking
IF poorly written statements are culprit, run a EXPLAIN PLAN on these statements and see whether new index or use
Open:The datafiles marked as read/write and database is now ready for operation.
close:all the changes in the buffer cache will be pushed to datafiles and existed session will be disconnected and no
instance shut down:bg wil be stopped and memory pools will be cleared from OS.
89) How to know how many oracle homes or oracle instances exists in database host?
Once the oracle installation is completed the installer will update the file called /etc/oratab with new home with this file
SQL database connectivity tool to connect to the database using tns names entry
tns string is an entry to identify the database host,db port and the db name.Oracle will use oracle sqlplus will use this
Tns entry is a address to the database host and database written in the tnsnames.ora,
SQL>startup force;
95) How to set the same password to oracle user when the password is expired?
Tablespace created.
System altered.
Database closed.
Database dismounted.
SQL> startup
Database mounted.
Database opened.
SQL>
Fastest Way, since the original import will not happen only metadata creation will happen, as the
transportable import has been performed, In TTS the associated datafiles will be attached to new user ,
hence the datafiles with existing object(tables/indexex etc) will be point to new user.
2. grant … to new_user;
3. execute dbms_tts.transport_set_check(…);