Adobe Systems Most Frequently Asked Latest Oracle Interview Questions Answers
What Is A Cartesian Product? What Causes It?
A Cartesian product is the result of an unrestricted join of two or more tables. The result set of a three table Cartesian product will have x * y * z number of rows where x, y, z correspond to the number of rows in each table involved in the join. It is causes by specifying a table in the FROM clause without joining it to another table.
Why Is A Union All Faster Than A Union?
The union operation, you will recall, brings two sets of data together. It will *NOT* however produce duplicate or redundant rows. To perform this feat of magic, a SORT operation is done on both tables. This is obviously computationally intensive, and uses significant memory as well. A UNION ALL conversely just dumps collection of both sets together in random order, not worrying about duplicates.
What Are Some Advantages To Using Oracle's Create Database Statement To Create A New Database Manually?
You can script the process to include it in a set of install scripts you deliver with a product.
You can put your create database script in CVS for version control, so as you make changes or adjustments to it, you can track them like you do changes to software code.
You can log the output and review it for errors. You learn more about the process of database creation, such as what options are available and why.
What Are The Pros And Cons Of Using Triggers?
A trigger is one or more statements of SQL that are being executed in event of data modification in a table to which the trigger belongs.
Triggers enhance the security, efficiency, and standardization of databases.
Triggers can be beneficial when used:
to check or modify values before they are actually updated or inserted in the database. This is useful if you need to transform data from the way the user sees it to some internal database format.
to run other non-database operations coded in user-defined functions
to update data in other tables. This is useful for maintaining relationships between data or in keeping audit trail information.
Switch To Dos Prompt
SQL> host
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.
What Is A Database Link?
Database link is a named path through which a remote database can be accessed.
If Unique Key Constraint On Date Column Is Created, Will It Validate The Rows That Are Inserted With Sysdate?
It won’t, Because SYSDATE format contains time attached with it.
How Will You Activate/deactivate Integrity Constraints?
The integrity constraints can be enabled or disabled by ALTER TABLE ENABLE CONSTRAINT / DISABLE CONSTRAINT.
Where The Integrity Constraints Are Stored In Data Dictionary?
The integrity constraints are stored in USER_CONSTRAINTS.
What Are The Pre-requisites To Modify Datatype Of A Column And To Add A Column With Not Null Constraint?
- To modify the datatype of a column the column must be empty.
- To add a column with NOT NULL constrain, the table must be empty.
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.
What Is Difference Between Char And Varchar2? What Is The Maximum Size Allowed For Each Type?
CHAR pads blank spaces to the maximum length.
VARCHAR2 does not pad blank spaces.
For CHAR the maximum length is 255 and 2000 for VARCHAR2.
What Are The Data Types Allowed In A Table?
CHAR, VARCHAR2, NUMBER, DATE, RAW, LONG and LONG RAW.
What Is On Delete Cascade?
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.
What Is The Usage Of Savepoints?
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.
What Is Referential Integrity Constraint?
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.
What Is An Integrity Constraint?
Integrity constraint is a rule that restricts values to a column in a table.
What Is Rowid?
ROWID is a pseudo column attached to each row of a table. It is 18 characters long, blockno, rownumber are the components of ROWID.
Explain Union, Minus, Union All And Intersect?
INTERSECT - returns all distinct rows selected by both queries.
MINUS - returns all distinct rows selected by the first query but not by the second.
UNION - returns all distinct rows selected by either query
UNION ALL - returns all rows selected by either query, including all duplicates.
Difference Between Substr And Instr?
INSTR (String1, String2 (n, (m)),
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.
Explain Connect By Prior?
Retrieves rows in hierarchical order
eg: select empno, ename from emp where.
What Is Correlated Sub-query?
Correlated sub-query is a sub-query, which has reference to the main query.
What Is The Sub-query?
Sub-query is a query whose return values are used in filtering conditions of the main query.
What Is Hit Ratio?
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.
What Is A Rollback Segment Entry?
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.
A single rollback segment can have multiple rollback segment entries.
What Is Use Of Rollback Segments In Oracle Database?
They allow the database to maintain read consistency between multiple transactions.
What Is Advantage Of Having Disk Shadowing / Mirroring?
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.
What Is Redo Log File Mirroring? How Can Be Achieved?
Process of having a copy of redo log files is called mirroring.
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.
How To Implement The Multiple Control Files For An Existing Database?
Shutdown the database
Copy one of the existing controlfile to new location
Edit Config ora file by adding new control filename
Restart the database.
What Is Redo Log Buffer?
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.
What Is Meant By Recursive Hints?
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.
What Is Dictionary Cache?
Dictionary cache is information about the database objects stored in a data dictionary table.
What Is Database Buffers?
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.
What Are The Factors Causing The Reparsing Of Sql Statements In Sga?
Due to insufficient shared pool size.
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 Logical & Physical Architecture
What Is A Data Segment?
Data segment are the physical areas within a database block in which the data associated with tables and clusters are stored.
What Are Disadvantages Of Having Raw Devices?
We should depend on export/import utility for backup/recovery (fully reliable)
The tar command cannot be used for physical file backup, instead we can use dd command, which is less flexible and has limited recoveries.
When Will Be A Segment Released?
When Segment is dropped.
When Shrink (RBS only)
When truncated (TRUNCATE used with drop storage option)
How Will You Monitor The Space Allocation?
By querying DBA_SEGMENT table/view
What Are The Advantages Of Views?
Provide an additional level of table security, by restricting access to a predetermined set of rows and columns of a table.
Hide data complexity.
Simplify commands for the user.
Present the data in a different perspective from that of the base table.
Store complex queries.
Can A View Based On Another View?
Yes.
Do A View Contain Data?
Views do not contain or store data.
What Is An Oracle View?
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.)
What Is Oracle Table?
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.
Can A Tablespace Hold Objects From Different Schemes?
Yes.
Can Objects Of The Same Schema Reside In Different Tablespaces?
Yes.
What Are Schema Objects?
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.
What Is A Cartesian Product? What Causes It?
A Cartesian product is the result of an unrestricted join of two or more tables. The result set of a three table Cartesian product will have x * y * z number of rows where x, y, z correspond to the number of rows in each table involved in the join. It is causes by specifying a table in the FROM clause without joining it to another table.
Why Is A Union All Faster Than A Union?
The union operation, you will recall, brings two sets of data together. It will *NOT* however produce duplicate or redundant rows. To perform this feat of magic, a SORT operation is done on both tables. This is obviously computationally intensive, and uses significant memory as well. A UNION ALL conversely just dumps collection of both sets together in random order, not worrying about duplicates.
What Are Some Advantages To Using Oracle's Create Database Statement To Create A New Database Manually?
You can script the process to include it in a set of install scripts you deliver with a product.
You can put your create database script in CVS for version control, so as you make changes or adjustments to it, you can track them like you do changes to software code.
You can log the output and review it for errors. You learn more about the process of database creation, such as what options are available and why.
Adobe Systems Most Frequently Asked Latest Oracle Interview Questions Answers |
What Are The Pros And Cons Of Using Triggers?
A trigger is one or more statements of SQL that are being executed in event of data modification in a table to which the trigger belongs.
Triggers enhance the security, efficiency, and standardization of databases.
Triggers can be beneficial when used:
to check or modify values before they are actually updated or inserted in the database. This is useful if you need to transform data from the way the user sees it to some internal database format.
to run other non-database operations coded in user-defined functions
to update data in other tables. This is useful for maintaining relationships between data or in keeping audit trail information.
to check against other data in the table or in other tables. This is useful to ensure data integrity when referential integrity constraints aren’t appropriate, or when table check constraints limit checking to the current table only.
Switch To Dos Prompt
SQL> host
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.
What Is A Database Link?
Database link is a named path through which a remote database can be accessed.
If Unique Key Constraint On Date Column Is Created, Will It Validate The Rows That Are Inserted With Sysdate?
It won’t, Because SYSDATE format contains time attached with it.
How Will You Activate/deactivate Integrity Constraints?
The integrity constraints can be enabled or disabled by ALTER TABLE ENABLE CONSTRAINT / DISABLE CONSTRAINT.
Where The Integrity Constraints Are Stored In Data Dictionary?
The integrity constraints are stored in USER_CONSTRAINTS.
What Are The Pre-requisites To Modify Datatype Of A Column And To Add A Column With Not Null Constraint?
- To modify the datatype of a column the column must be empty.
- To add a column with NOT NULL constrain, the table must be empty.
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.
What Is Difference Between Char And Varchar2? What Is The Maximum Size Allowed For Each Type?
CHAR pads blank spaces to the maximum length.
VARCHAR2 does not pad blank spaces.
For CHAR the maximum length is 255 and 2000 for VARCHAR2.
What Are The Data Types Allowed In A Table?
CHAR, VARCHAR2, NUMBER, DATE, RAW, LONG and LONG RAW.
What Is On Delete Cascade?
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.
What Is The Usage Of Savepoints?
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.
What Is Referential Integrity Constraint?
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.
What Is An Integrity Constraint?
Integrity constraint is a rule that restricts values to a column in a table.
What Is Rowid?
ROWID is a pseudo column attached to each row of a table. It is 18 characters long, blockno, rownumber are the components of ROWID.
Explain Union, Minus, Union All And Intersect?
INTERSECT - returns all distinct rows selected by both queries.
MINUS - returns all distinct rows selected by the first query but not by the second.
UNION - returns all distinct rows selected by either query
UNION ALL - returns all rows selected by either query, including all duplicates.
Difference Between Substr And Instr?
INSTR (String1, String2 (n, (m)),
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.
Explain Connect By Prior?
Retrieves rows in hierarchical order
eg: select empno, ename from emp where.
What Is Correlated Sub-query?
Correlated sub-query is a sub-query, which has reference to the main query.
What Is The Sub-query?
Sub-query is a query whose return values are used in filtering conditions of the main query.
What Is Hit Ratio?
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.
What Is A Rollback Segment Entry?
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.
A single rollback segment can have multiple rollback segment entries.
What Is Use Of Rollback Segments In Oracle Database?
They allow the database to maintain read consistency between multiple transactions.
What Is Advantage Of Having Disk Shadowing / Mirroring?
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.
What Is Redo Log File Mirroring? How Can Be Achieved?
Process of having a copy of redo log files is called mirroring.
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.
How To Implement The Multiple Control Files For An Existing Database?
Shutdown the database
Copy one of the existing controlfile to new location
Edit Config ora file by adding new control filename
Restart the database.
What Is Redo Log Buffer?
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.
What Is Meant By Recursive Hints?
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.
What Is Dictionary Cache?
Dictionary cache is information about the database objects stored in a data dictionary table.
What Is Database Buffers?
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.
What Are The Factors Causing The Reparsing Of Sql Statements In Sga?
Due to insufficient shared pool size.
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 Logical & Physical Architecture
What Is A Data Segment?
Data segment are the physical areas within a database block in which the data associated with tables and clusters are stored.
What Are Disadvantages Of Having Raw Devices?
We should depend on export/import utility for backup/recovery (fully reliable)
The tar command cannot be used for physical file backup, instead we can use dd command, which is less flexible and has limited recoveries.
When Will Be A Segment Released?
When Segment is dropped.
When Shrink (RBS only)
When truncated (TRUNCATE used with drop storage option)
By querying DBA_SEGMENT table/view
What Are The Advantages Of Views?
Provide an additional level of table security, by restricting access to a predetermined set of rows and columns of a table.
Hide data complexity.
Simplify commands for the user.
Present the data in a different perspective from that of the base table.
Store complex queries.
Can A View Based On Another View?
Yes.
Do A View Contain Data?
Views do not contain or store data.
What Is An Oracle View?
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.)
What Is Oracle Table?
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.
Can A Tablespace Hold Objects From Different Schemes?
Yes.
Can Objects Of The Same Schema Reside In Different Tablespaces?
Yes.
What Are Schema Objects?
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.
Post a Comment