Omarsoft For IT Solutions (Java Codes ,C#.NET Codes , ASP.NET Codes ,VB.NET Codes ,Oracle Database Administration, Real Application Cluster , Remote Support, Cloud Services , Networks ,Virtualization....
  • الأنظــمــة المكتبية        Windows App Programming
  • أنظــمـةالويــب        Web based systems programming
  • تطبيقات الهواتف الذكية     smartphones programming
  • إدارة قواعــــــد البيــــــــــــــــانات        Database Administration
  • إدارة الشبكـــــــــــــــــــــــــــــــــات        Networks Administration
  • إدارة الســـيــرفرات (ويب - محلية)  Servers Administration
  • إدارة مخـــــــــــــــــازن البيــــــــــــانات     Storage Administration
  •             N Computing & 2X Application services

    Social Icons

Loading...

DBA Interview Questions

DBA Interview Questions with Answers


Can one switch to another database user without a password?
Users normally use the "CONNECT" statement to connect from one database user to another. However, DBAs can switch from one user to another without a password. Of course it is not advisable to bridge Oracle's security, but look at this example:
SQL> CONNECT / as sysdba
SQL> SELECT password FROM dba_users WHERE  username='SCOTT';
F894844C34402B67
SQL> ALTER USER scott IDENTIFIED BY anything;
SQL> CONNECT scott/anything
OK, we're in. Let's quickly change the password back before anybody notices.
SQL> ALTER USER scott IDENTIFIED BY VALUES 'F894844C34402B67';
User altered.
How do you delete duplicate rows in a table?
There is a several method to delete duplicate row from the table:
Method1:
DELETE FROM SHAAN A WHERE ROWID >
(SELECT min(rowid) FROM SHAAN B
WHERE A.EMPLOYEE_ID = B.EMPLOYEE_ID);
Method2:
delete from SHAAN t1
where  exists (select 'x' from SHAAN t2
where t2.EMPLOYEE_ID = t1.EMPLOYEE_ID
and t2.EMPLOYEE_ID = t1.EMPLOYEE_ID
and t2.rowid      > t1.rowid);
Method3:
DELETE SHAAN
WHERE  rowid IN
( SELECT LEAD(rowid) OVER
(PARTITION BY EMPLOYEE_ID ORDER BY NULL)
FROM   SHAAN );
Method4:
delete from SHAAN where rowid not in
( select min(rowid)
from SHAAN group by EMPLOYEE_ID);
Method5:
delete from SHAAN
where rowid not in ( select min(rowid)
from SHAAN group by EMPLOYEE_ID);
Method6:
SQL> create table table_name2 as select distinct * from table_name1;
SQL> drop table table_name1;
SQL> rename table_name2 to table_name1;
What is Automatic Management of Segment Space setting?
Automatic Segment Space Management (ASSM) introduced in Oracle9i is an easier way of managing space in a segment using bitmaps. It eliminates the DBA from setting the parameters pctused, freelists, and freelist groups.
ASSM can be specified only with the locally managed tablespaces (LMT). The CREATE TABLESPACE statement has a new clause SEGMENT SPACE MANAGEMENT. Oracle uses bitmaps to manage the free space. A bitmap, in this case, is a map that describes the status of each data block within a segment with respect to the amount of space in the block available for inserting rows. As more or less space becomes available in a data block, its new state is reflected in the bitmap.
CREATE TABLESPACE myts DATAFILE '/oradata/mysid/myts01.dbf' SIZE 100M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 2M
SEGMENT SPACE MANAGEMENT AUTO;

What is COMPRESS and CONSISTENT setting in EXPORT utility?
If COMPRESS=Y, the INITIAL storage parameter is set to the total size of all extents allocated for the object. The change takes effect only when the object is imported.
Setting CONSISTENT=Y exports all tables and references in a consistent state. This slows the export, as rollback space is used. If CONSISTENT=N and a record is modified during the export, the data will become inconsistent.
What is the difference between Direct Path and Convention Path loading?
When you use SQL loader by default it use conventional path to load data. This method competes equally with all other oracle processes for buffer resources. This can slow the load. A direct path load eliminates much of the Oracle database overhead by formatting Oracle data blocks and writing the data blocks directly to the database files. If load speed is most important to you, you should use direct path load because it is faster.
What is an Index Organized Table?
An index-organized table (IOT) is a type of table that stores data in a B*Tree index structure. Normal relational tables, called heap-organized tables, store rows in any order (unsorted).
CREATE TABLE my_iot (id INTEGER PRIMARY KEY, value VARCHAR2 (50)) ORGANIZATION INDEX;
What are a Global Index and Local Index?
When you create a partitioned table, you should create an index on the table. The index may be partitioned according to the same range values that were used to partition the table. Local keyword in the index partition tells oracle to create a separate index for each partition of the table. TheGlobal clause in create index command allows you to create a non-partitioned index or to specify ranges for the index values that are different from the ranges for the table partitions. Local indexes may be easier to manage than global indexes however, global indexes may perform uniqueness checks faster than local (portioned) indexes perform them.
What is difference between Multithreaded/Shared Server and Dedicated Server?
Oracle Database creates server processes to handle the requests of user processes connected to an instance.dedicated server process, which services only one user processshared server process, which can service multiple user processes
Your database is always enabled to allow dedicated server processes, but you must specifically configure and enable shared server by setting one or more initialization parameters.
Can you import objects from Oracle ver. 7.3 to 9i?
We can not import from lower version export to higher version in fact. But not sure may be now concept is changed.
How do you move tables from one tablespace to another tablespace?
Method 1:
Export the table, drop the table, create the table definition in the new tablespace, and then import the data (imp ignore=y).
Method 2:
Create a new table in the new tablespace with the "CREATE TABLE x AS SELECT * from y" command:
CREATE TABLE temp_name TABLESPACE new_tablespace AS SELECT * FROM real_table;
Then drop the original table and rename the temporary table as the original:
DROP TABLE real_table;
RENAME temp_name TO real_table;
Note: After step #1 or #2 is done, be sure to recompile any procedures that may have been
invalidated by dropping the table. Prefer method #1, but #2 is easier if there are no indexes, constraints, or triggers. If there are, you must manually recreate them.
Method 3:
If you are using Oracle 8i or above then simply use:
SQL>Alter table table_name move tablespace tablespace_name;

How do see how much space is used and free in a tablespace?
SELECT * FROM SM$TS_FREE;
SELECT TABLESPACE_NAME, SUM(BYTES) FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME;
Can view be the based on other view?
Yes, the view can be created from other view by directing a select query to use the other view data.
What happens, if you not specify Dictionary option with the start option in case of LogMinor concept?
It is recommended that you specify a dictionary option. If you do not, LogMiner cannot translate internal object identifiers and datatypes to object names and external data formats. Therefore, it would return internal object IDs and present data as hex bytes. Additionally, the MINE_VALUE andCOLUMN_PRESENT functions cannot be used without a dictionary.

What is the Benefit and draw back of Continuous Mining?

The continuous mining option is useful if you are mining in the same instance that is generating the redo logs. When you plan to use the continuous mining option, you only need to specify one archived redo log before starting LogMiner. Then, when you start LogMiner specify theDBMS_LOGMNR.CONTINUOUS_MINE option, which directs LogMiner to automatically add and mine subsequent archived redo logs and also the online catalog.
Continuous Mining is not available in Real Application Cluster.
What is LogMiner and its Benefit?
LogMiner is a recovery utility. You can use it to recover the data from oracle redo log and archive log file. The Oracle LogMiner utility enables you to query redo logs through a SQL interface. Redo logs contain information about the history of activity on a database.
Benefit of LogMiner?
1.  Pinpointing when a logical corruption to a database; suppose when a row is accidentally deleted then logMiner helps to recover the database exact time based and changed based recovery.
2.  Perform table specific undo operation to return the table to its original state. LogMiner reconstruct the SQL statement in reverse order from which they are executed.
3.  It helps in performance tuning and capacity planning. You can determine which table gets the most update and insert. That information provides a historical perspective on disk access statistics, which can be used for tuning purpose.
4.  Performing post auditing; LogMiner is used to track any DML and DDL performed on database in the order they were executed.
What is Oracle DataGuard?
Oracle DataGuard is a tools that provides data protection and ensures disaster recovery for enterprise data. It provides comprehensive set of services that create, maintain, manage, and monitor one or more standby databases to enable production Oracle databases to survive disasters and data corruption. Dataguard maintains these standsby databases as transitionally consistent copies of the production database. Then, if the production database becomes failure Data Guard can switch any standby database to the production role, minimizing the downtime associated with the outage. Data Guard can be used with traditional backup, restoration, and cluster techniques to provide a high level of data protection and data availability.
What is Standby Databases
A standby database is a transitionally consistent copy of the primary database. Using a backup copy of the primary database, you can create up to9 standby databases and incorporate them in a Data Guard configuration. Once created, Data Guard automatically maintains each standby database by transmitting redo data from the primary database and then applying the redo to the standby database.
Similar to a primary database, a standby database can be either a single-instance Oracle database or an Oracle Real Application Clusters database. A standby database can be either a physical standby database or a logical standby database:
Difference between Physical standby Logical standby databases
Provides a physically identical copy of the primary database on a block-for-block basis. The database schema, including indexes, is the same. A physical standby database is kept synchronized with the primary database, though Redo Apply, which recovers the redo data, received from the primary database and applies the redo to the physical standby database.
Logical Standby database contains the same logical information as the production database, although the physical organization and structure of the data can be different. The logical standby database is kept synchronized with the primary database though SQL Apply, which transforms the data in the redo received from the primary database into SQL statements and then executing the SQL statements on the standby database.
If you are going to setup standby database what will be your Choice Logical or Physical?
We need to keep the physical standby database in “recovery mode” in order to apply the received archive logs from the primary database. We can open “physical stand by database to “read only” and make it available to the applications users (Only select is allowed during this period). Once the database is opened in “Read only” mode then we can not apply redo logs received from primary database.
We do not see such issues with logical standby database. We can open up the database in normal mode and make it available to the users. At the same time, we can apply archived logs received from primary database.
If the primary database needed to support pretty large user community for the OLTP system and pretty large “Reporting Group” then better to uselogical standby as primary database instead of physical database.
What are the requirements needed before preparing standby database?
·   OS Architecture of primary database secondary database should be same.
·   The version of secondary database must be the same as primary database.
·   The Primary database must run in Archivelog mode.
·   Require the same hardware architecture on the primary and all standby site.
·   Does not require the same OS version and release on the primary and secondary site.
·   Each Primary and secondary database must have its own database.
What are “Failover” and “Switchover” in case of dataguard?
Failover is the operation of bringing one of the standby databases online as the new primary database when failure occurs on the primary database and there is no possibility of recover primary database in a timely manner. The switchover is a situation to handle planned maintenance on the primary database. The main difference between switchover operation and failover operation is that switchover is performed when primary database is still available or it does not require a flash back or re-installation of the original primary database. This allows the original primary database to the role of standby database almost immediately. As a result schedule maintenance can performed more easily and frequently.
When you use WHERE clause and when you use HAVING clause?
HAVING clause is used when you want to specify a condition for a group function and it is written after GROUP BY clause The WHERE clause is used when you want to specify a condition for columns, single row functions except group functions and it is written before GROUP BY clause if it is used.
What is a cursor and difference between an implicit & an explicit cursor?
A cursor is a PL/SQL block used to fetch more than one row in a Pl/SQl block. PL/SQL declares a cursor implicitly for all SQL data manipulation statements, including quries that return only one row. However, queries that return more than one row you must declare an explicit cursor or use a cursor FOR loop.
Explicit cursor is a cursor in which the cursor name is explicitly assigned to a SELECT statement via the CURSOR...IS statement. An implicit cursor is used for all SQL statements Declare, Open, Fetch, Close. An explicit cursors are used to process multirow SELECT statements An implicit cursor is used to process INSERT, UPDATE, DELETE and single row SELECT. .INTO statements.

Explain the difference between a data block, an extent and a segment.A data block is the smallest unit of logical storage for a database object. As objects grow they take chunks of additional storage that are composed of contiguous data blocks. These groupings of contiguous data blocks are called extents. All the extents that an object takes when grouped together are considered the segment of the database object.
You have just had to restore from backup and do not have any control files. How would you go about bringing up this database?I would create a text based backup control file, stipulating where on disk all the data files where and then issue the recover command with the using backup control file clause.
A table is classified as a parent table and you want to drop and re-create it. How would you do this without affecting the children tables?Disable the foreign key constraint to the parent, drop the table, re-create the table, and enable the foreign key constraint.
How to Unregister database from Rman catalog
First we start up RMAN with a connection to the catalog and the target, making a note of the DBID in the banner:
C:\>rman catalog=rman/rman@shaan target=HRMS/password@orcl3
connected to target database: W2K1 (DBID=691421794)
connected to recovery catalog database
Note the DBID from here. Next we list and delete any backupset recorded in the repository:
RMAN> LIST BACKUP SUMMARY;
RMAN> DELETE BACKUP DEVICE TYPE SBT;
RMAN> DELETE BACKUP DEVICE TYPE DISK;
Next we connect to the RMAN catalog owner using SQL*Plus and issue the following statement:
SQL> CONNECT rman/rman@shaan
SQL> SELECT db_key, db_id  FROM   db
                WHERE  db_id = 1487421514;
                DB_KEY                DB_ID
----------                   ----------
                1                              691421794
The resulting key and id can then be used to unregister the database:
SQL> EXECUTE dbms_rcvcat.unregisterdatabase(1, 691421794);
PL/SQL procedure successfully completed.

DBA Interview Questions 2

DBA Interview Questions With Answers


What are four common errors found in an alert .log?
If we are getting any issue regarding database while performing any activity we should check alert log file in dump destination.. The four common error we find in alert.log are:
Deadlock Errors (ORA-00060), Oracle Internal errors, Backup and recovery errors, Snapshot too old error (O1555)
What is PCT Free/PCT Used/PCT increase parameter in segment? What is growth factor?
PCT-FREE is a block storage it uses to mention how much space should be left in database block for future updates (updating the records eg. previously name Smith after that we will update the name as Smith Taylor). If mention PCTFREE as 10, oracle will adding the new rows to block up to 90% it allows 10% for future updates.
If the PCT used was set to 60 this means if the data inside the block is 60 it is FULL and if the data inside the block is 59 it is Empty.
This is the parameter which specify in percent that a block can only used for insert or come in the free list(list of blocks in segment ready for insert operation) when used space in a block is less than PCTUSED.
Suppose value of pctused is 40 and pctfree is 20 then data can be inserted till 80 of the block directly. And suppose the used space is 60 and some one has perform a delete operation in a row in the same block which brings the used space to 50 .Now one cannot insert any record in the same block unless the used space comes down below 40 i.e. pctused.

What is dump destination? What are bdump, cdump and udump?
The dump destination is the location where the trace files are located for all the Oracle process.
bdump-->Background processes + alert_SID.log file location
cdump--> Core Processes dump, udump--> User Processes dump, adump--> for ASM processes
These destinations contains useful information related to process failures.

UDUMP is specifying the user dump directory where all user error logs (trace files) will be placed.
BDUMP is specifying the background dump directory where all database error logs (trace files) will be placed.
CDUMP is specifying the core dump directory where all OS error logs (core dump files) will be placed.
Default location is (ORACLE_BASE/admin/<SID>) 
SQL>show parameters dump_dest;

It'll show you all the dump directories wherever it is currently located. You can change your parameters in init.ora by creating spfile from pfile.
What will you do if in any condition you do not know how to troubleshoot the error at all and there are no seniors or your co-workers around?

We need to find where in the compilation the error is occurring. We have to divide the code and check for correctness of the code part-by-part. This is called debugging. Keep checking the code until you find the code which is wrong.
Search forums for similar error codes or symptoms and make a plan then submit it to your supervising DBA if you are not authorized to carry it out yourself.

I am getting error "No Communication channel" after changing the domain name? What is the solution?
Here Question is not clear about Where the Oracle database is residing. If the Oracle Database is resides on your local machine then the domain name must be updated in the tnsnames.ora file. Change this file in ../Admin folder contained one. If you are accessing remote Database then there are no changes required to your tnsnames.ora file only check with tnsping with the database service name. Change the domain name in the sqlnet.ora file in NAMES.DEFAULT_DOMAIN parameter
You have taken import of a table in a database. You have got the Integrity constraint violation error. How you are going to resolve it.
If u wants to import the table just says constraints=n the movement table got imported then u create constraint on that tables.
What is the most important action a DBA must perform after changing the database from NOARCHIVELOG TO ARCHIVELOG?
First of all take an offline backup of whole database (including the (datafile controlfile and redolog files). It is obvious that archive log process should be started by: 
SQL>alter system Archivelog start;

Otherwise the database halts if unable to rotate redo logs
Show one instance when you encountered an error in alert log and you overcome that error. What actions you took to overcome that error.
Oracle writes error in alert log file. Depending upon the error corrective action needs to be taken.
1) Deadlock Error: Take the trace file in user dump destination and analysis it for the error.
2) ORA-01555 Snapshot error: Check the query try to fine tune and check the undo size.
3) Unable to extent segment: Check the tablespace size and if require add space in the tablespace by 'alter database datafile .... resize' or alter tablespace add datafile command.
What is Ora-1555 Snapshot too Old error? Explain in detail?
Oracle Rollback Segments (Undo more recently) hold a copy of data before it was modified and they work in a round-robin fashion. Writing and then eventually overwriting the entries as soon as the changes are committed.
They are needed to provide read consistency (a consistent set of data at a point in time) or to allow a process to abandon or rollback the changes or for database recovery.
Here’s a typical scenario:-
User A opens a query to fetch every row from a billion row table. If User B updates and commits the last row of the billion row table a Rollback entry will be created so User A can see the data as it was before the update.
Other users are busily updating rows in the database and this in turn generates rollback – which may eventually cause the entry needed for User A to be overwritten (after all User B did commit the change – so it’s OK to overwrite the rollback segment). Maybe 15 minutes later the query is still running and User A finally fetches the last row of the billion row table – but the rollback entry is gone. He gets ORA-01555: Snapshot too old rollback segment too small
I have applied the following commands: Now what will happen, will the database will give an error / it will work?
Shutdown abort;
Startup;
Definitely database will be start without error but all uncommitted data will be lost such as killed all sessions, killed all transactions, and didn't write from the buffers because shutdown abort directly shutdown instance without committing.

There is four modes to shutdown the database:
1) Shutdown immediate, 2) Shutdown normal, 3) Shutdown transactional, 4) Shutdown aborts
When the database is shutdown by first 3 methods checkpoint takes place but when is shutdown by abort option it doesn't enforces checkpoints, it simply shutdowns without waiting any users to disconnect.

What is mutated trigger? In single user mode we got mutated error, as a DBA how you will resolve it?
Mutated error will occur when same table access more than once in one state. If you are using before in trigger block then replace it with after.
Explain Dual table. Is any data internally stored in dual Table. Lot of users is accessing select sysdate from dual and they getting some millisecond differences. If we execute SELECT SYSDATE FROM EMP; what error will we get. Why?

Dual is a system owned table created during database creation. Dual table consist of a single column and a single row with value x. We will not get any error if we execute select sysdate from scott.emp instead sysdate will be treated as a pseudo column and displays the value for all the rows retrieved. For Example if there is 12 rows in emp table it will give result of date in 12 rows.
As an Oracle DBA what are the entire UNIX file you should be familiar with?
To check the process use:  ps -ef |grep pmon or ps -ef
To check the alert log file:  Tail -f alert.log 
To check the cpu usage;    Top vmstat 2 5

What is a Database instance?
A database instance also known as server is a set of memory structures and background processes that access a set of database files. It is possible for a single database to be accessed by multiple instances (this is oracle parallel server option). 
What are the Requirements of simple Database?
A simple database consists of:
One or more data files, One or more control files, Two or more redo log files, Multiple users/schemas, One or more rollback segments, One or more Tablespaces, Data dictionary tables, User objects (table, indexes, views etc.)
The server (Instance) that access the database consists of:
SGA  (Database  buffer,  Dictionary  Cache  Buffers, Redo log buffers, Shared SQL pool), SMON (System Monitor),PMON (Process Monitor), LGWR (Log  Write), DBWR (Data Base Write), ARCH (ARCHiver), CKPT  (Check Point), RECO, Dispatcher, User Process with associated PGS
Which process writes data from data files to database buffer cache?
The Background process DBWR rights data from datafile to DB cache.
How to DROP an Oracle Database?
You can do it at the OS level by deleting all the files of the database. The files to be deleted can be found using: 
1) select * from dba_data_files; 2) select * from v$logfile; 3) select * from v$controlfile; 4) archive log list 
5) initSID.ora 6) clean the UDUMP, BDUMP, scripts etc, 7) Cleanup the listener.ora and the tnsnames.ora. Make sure that the oratab entry is also removed. 

Otherwise, go to DBCA and click on delete database.
In Oracle 10g there is a new command to drop an entire database.
Startup restrict mount;
drop database <instance_name>;

In fact DBA should never drop a database via OS level commands rather use GUI utility DBCA to drop the database
How can be determining the size of the log files.
Select sum(bytes)/1024/1024 "size_in_MB" from v$log;
What is difference between Logical Standby Database and Physical Standby database?
A physical or logical standby database is a database replica created from a backup of a primary database. A physical standby database is physically identical to the primary database on a block-for-block basis.  It's maintained in managed recovery mode to remain current and can be set to read only; archive logs are copied and applied.
A logical standby database is logically identical to the primary database.  It is updated using SQL statements
How do you find whether the instance was started with pfile or spfile
1) SELECT name, value FROM v$parameter WHERE name = 'spfile';
This query will return NULL if you are using PFILE
2) SHOW PARAMETER spfile

This query will returns NULL in the value column if you are using pfile and not spfile
3) SELECT COUNT(*) FROM v$spparameter WHERE value IS NOT NULL;

If the count is non-zero then the instance is using a spfile, and if the count is zero then it is using a pfile:
SQL> SELECT DECODE(value, NULL, 'PFILE', 'SPFILE') "Init File Type"

           FROM sys.v_$parameter WHERE name = 'spfile';
What is full backup?
A full backup is an operating system backup of all data files, on-line redo log files and control file that constitute oracle database and the parameter.If you are using the Rman for backup then in Rman full backup means Incremental backup on 0 level.
While taking hot backup (begin end backup) what will happens back end?
When we r taking hot backup (begin backup - end backup) the datafile header associated with the datafiles in the corresponding Tablespace is frozen. So Oracle will stop updating the datafile header but will continue to write data into datafiles. In hot backup oracle will generate more redos this is because oracle will write out complete changed blocks to the redo log files.
Which is the best option used to move database from one server to another serve on same network and Why?
Import – Export, Backup-Restore, Detach-Attach

Import-Export is the best option used to move database from one server to another serve on same network. It reduces the network traffic.Import/Export works well if you’re dealing with very small databases. If we have few million rows its takes minutes to copy when compared to seconds using backup and restore.

What is Different Type of RMAN Backup?
Full backup: During a Full backup (Level 0) all of the block ever used in datafile are backed up. The only difference between a level 0 incremental backup and a full backup is that a full backup is never included in an incremental strategy.
Comulative Backup: During a cumulative (Level 0) the entire block used since last full backup are backed up.
RMAN> BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE; # blocks changed since level 0
Differential Backup: During incremental backup only those blocks that have changed since last cumulative (Level 1) or full backup (Level 0) are backed up. Incremental backup are differential by default.
RMAN> BACKUP INCREMENTAL LEVEL 1 DATABASE
Give one method for transferring a table from one schema to another:
There are several possible methods: Export-Import, CREATE TABLE... AS SELECT or COPY.
What is the purpose of the IMPORT option IGNORE? What is its default setting?
The IMPORT IGNORE option tells import to ignore "already exists" errors. If it is not specified the tables that already exist will be skipped. If it is specified, the error is ignored and the table’s data will be inserted. The default value is N.
What happens when the DEFAULT and TEMP tablespace clauses are left out from CREATE USER statements?
The user is assigned the SYSTEM tablespace as a default and temporary tablespace. This is bad because it causes user objects and temporary segments to be placed into the SYSTEM tablespace resulting in fragmentation and improper table placement (only data dictionary objects and the system rollback segment should be in SYSTEM).
What happens if the constraint name is left out of a constraint clause?
The Oracle system will use the default name of SYS_Cxxxx where xxxx is a system generated number. This is bad since it makes tracking which table the constraint belongs to or what the constraint does harder.
What happens if a Tablespace clause is left off of a primary key constraint clause?
This result in the index that is automatically generated being placed in then USERS default tablespace. Since this will usually be the same tablespace as the table is being created in, this can cause serious performance problems.
What happens if a primary key constraint is disabled and then enabled without fully specifying the index clause?
The index is created in the user’s default tablespace and all sizing information is lost. Oracle doesn’t store this information as a part of the constraint definition, but only as part of the index definition, when the constraint was disabled the index was dropped and the information is gone.
Using hot backup without being in archive log mode, can you recover in the event of a failure? Why or why not?
You can't recover the data because in archive log mode it take the backup of redo log files if it in Active mode, If it in inactive mode then it is not possible to take the backup of redolog files once the size is full, so in that case it is impossible to take hot backup
What causes the "snapshot too old" error? How can this be prevented or mitigated?
This is caused by large or long running transactions that have either wrapped onto their own rollback space or have had another transaction write on part of their rollback space. This can be prevented or mitigated by breaking the transaction into a set of smaller transactions or increasing the size of the rollback segments and their extents.
How can you tell if a database object is invalid?

Oracle Interview Questions and Answers on SQL Queries and Database Theory




Frequently asked basic and advanced Oracle Database Interview Questions and Answers on Database theory and SQL Queries with Examples for Freshers and Experienced DBA, Java, PHP, .Net Developers. 
1) What is oracle database ?
Oracle Database is a relational database management system (RDBMS) which is used to store and retrieve the large amounts of data. Oracle Database had physical and logical structures. Logical structures and physical structures are separated from each other
2) What is schema?
A user account and its associated data including tables, views, indexes, clusters, sequences,procedures, functions, triggers,packages and database links is known as Oracle schema. System, SCOTT etc are default schema's. We can create a new Schema/User. But we can't drop default database schema's.
3) What is a Tablespace?
Oracle use Tablespace for logical data Storage. Physically, data will get stored in Datafiles. Datafiles will be connected to tablespace. A tablespace can have multiple datafiles. A tablespace can have objects from different schema's and a schema can have multiple tablespace's. Database creates "SYSTEM tablespace" by default during database creation. It contains read only data dictionary tables which contains the information about the database.

Also Read Basic to Advanced Oracle SQL Query Interview Question and Answers
4) What is a Control File ?
Control file is a binary file which stores Database name, associated data files, redo files, DB creation time and current log sequence number. Without control file database cannot be started and can hamper data recovery.
5) Define data blocks ?
Data Blocks are the base unit of logical database space. Each data block represents a specific number of bytes of database space on a disk

6) What is an Extent ?
Extent is a collection of Continuous data blocks, which is used for storing a specific type of information.

Are you looking for frequently asked Database Interview Questions and Answers? Click here

7) What is a Segment ?
A segment is a collection of extends which is used for storing a specific data structure and resides in the same tablespace.

8) What is Rollback Segment ?
Database contain one or more Rollback Segments to roll back transactions and data recovery.
9) What are the different type of Segments ?
Data Segment(for storing User Data), Index Segment (for storing index), Rollback Segment and Temporary Segment.
10) What is a Redo Log ?
Redo Log files is a collection of 2 or more pre-allocated files, which is used in data recovery. When ever a change is made to the database, change info gets stored in redo files. In case of a database crash, we can used redo files for data recovery.

Sana'a Yemen - 50th st.

+967 738166685

omar.soft2000@gmail.com

للاتصال بنا CONTACT US

الاسم Name

بريد إلكتروني Email *

رسالة Message *

2015-2023 © All Rights Reserved Omarsoft
Back To Top