1. What are the components of the physical database structure of the Oracle database?
Components of the physical database structure are given below.
- One or more data files.
- Two or more redo log files.
- One or more control files.
2. What are the components of logical database structure in Oracle database?
Components of the logical database structure.
- Tablespaces
- Database's schema objects
Components of the logical database structure.
- Tablespaces
- Database's schema objects
3. What is a tablespace?
A database contains Logical Storage Unit called tablespaces. A tablespace is a set of
related logical structures. Actually, a tablespace group related logical structures together.
A database contains Logical Storage Unit called tablespaces. A tablespace is a set of
related logical structures. Actually, a tablespace group related logical structures together.
4. What is a SYSTEM tablespace and when it is created?
When the database is created in Oracle database system, it automatically generate a
SYSTEM named SYSTEM tablespace. The SYSTEM tablespace contains data dictionary
tables for the entire database.
When the database is created in Oracle database system, it automatically generate a
SYSTEM named SYSTEM tablespace. The SYSTEM tablespace contains data dictionary
tables for the entire database.
5. What is an Oracle table ?
A table is basic unit of data storage in Oracle
database. A table contains all the
accessible information of a user in rows and
columns.
6. What is bulk copy or BCP in Oracle?
Bulk copy or BCP in Oracle, is used to import or export data from tables and views but it does not copy structure of same data.
The main advantage of BCP is fast mechanism for coping data and you can also take the backup of data easily.
7. What is the relationship among database, tablespace and data file?
An Oracle database contains one or more logical storage units called tablespaces. These tablespaces collectively store whole data of databases and each tablespace in Oracle database consists of one or more files called datafiles. These datafiles are physical structure that confirm with the operating system in which Oracle is running.
8. What is a snapshot in the Oracle database?
A snapshot is a replica of a target master table from a single point in time. In simple words you can say, snapshot is a copy of a table on a remote database.
9. What is the difference between hot backup and cold backup in Oracle? Tell about their benefits also.
Hot backup (Online Backup): A hot backup is also known as online backup because it is done while the database is active. Some sites can not shut down their database while making a backup copy, they are used for 24 hour a day, 7 days a week.
Cold backup (Offline Backup): A cold backup is also known as an offline backup because it is done while the database has been shutdown using the SHUTDOWN normal command. If the database is suddenly shutdown with an uncertain condition, it should be restarted with RESTRICT mode and then shutdown with the NORMAL option.
For a complete cold backup, the following files must be backed up.
All data files, All control files, All online redo log files(optional) and the init.ora file (you can recreate it manually).
Hot backup (Online Backup): A hot backup is also known as online backup because it is done while the database is active. Some sites can not shut down their database while making a backup copy, they are used for 24 hour a day, 7 days a week.
Cold backup (Offline Backup): A cold backup is also known as an offline backup because it is done while the database has been shutdown using the SHUTDOWN normal command. If the database is suddenly shutdown with an uncertain condition, it should be restarted with RESTRICT mode and then shutdown with the NORMAL option.
For a complete cold backup, the following files must be backed up.
All data files, All control files, All online redo log files(optional) and the init.ora file (you can recreate it manually).
10. How many memory layers are in the Oracle shared pool?
Oracle shared pools contain two layers:
- library cache
- data dictionary cache
Oracle shared pools contain two layers:
- library cache
- data dictionary cache
11 What is a save point in the Oracle database?
Save points are used to divide a transaction into smaller parts. It allows the rolling back of a transaction. A maximum of five save points are allowed. It is used to save our data. You can roll back whenever you encounter an error from where you save your SAVEPOINT.
Save points are used to divide a transaction into smaller parts. It allows the rolling back of a transaction. A maximum of five save points are allowed. It is used to save our data. You can roll back whenever you encounter an error from where you save your SAVEPOINT.
12. What is a hash cluster in Oracle?
Hash cluster is a technique to store data in a hash table and improve the performance of data retrieval. A hash function is applied to the table row's cluster key value and stored in the hash cluster.
Hash cluster is a technique to store data in a hash table and improve the performance of data retrieval. A hash function is applied to the table row's cluster key value and stored in the hash cluster.
13. What are the various Oracle database objects?
Tables: This is a set of elements organized in a vertical and horizontal fashion.
Tablespaces: This is a logical storage unit in Oracle.
Views: It is a virtual table derived from one or more tables.
Indexes: This is a performance-tuning method to process the records.
Synonyms: This is a name for tables.
Tables: This is a set of elements organized in a vertical and horizontal fashion.
Tablespaces: This is a logical storage unit in Oracle.
Views: It is a virtual table derived from one or more tables.
Indexes: This is a performance-tuning method to process the records.
Synonyms: This is a name for tables.
14. What is the difference between pre-select and pre-query?
A pre-query trigger fire before the query executes and fire once while you try to query. With this trigger's help, you can dynamically modify the where clause part.
Pre-select query fires during the execute query and count query processing after Oracle forms construct the select statement to be issued, but before the statement is actually issued.
Pre-query trigger fires before the Pre-select trigger.
A pre-query trigger fire before the query executes and fire once while you try to query. With this trigger's help, you can dynamically modify the where clause part.
Pre-select query fires during the execute query and count query processing after Oracle forms construct the select statement to be issued, but before the statement is actually issued.
Pre-query trigger fires before the Pre-select trigger.
15. What are the different types of modules in Oracle forms?
Following are the different modules in Oracle forms:
- Form module
- Menu module
- Pl/SQL Library module
- Object Library module
16. Can you create a synonym without having a table?
Yes. We can create a synonym without having a base table.
17 What types of joins are used in writing SUBQUERIES?
- Self join
- Outer Join
- Equi-join
18. What is the usage of the control file in Oracle?
In Oracle, the control file is used for database recovery. The control file is also used to identify the database and redo log files that must be opened for database operation to go ahead whenever an instance of an ORACLE database begins.
19. What is a synonym?
A synonym is also known as an alias for a table, view, sequence or program unit.
20. What are the different types of synonyms?
There are two types of synonyms or alias:
Private: It can only be accessed by the owner.
Public: It can be accessed by any database user.
21. What is the usage of synonyms?
- Synonyms can be used to hide an object's real name and owner.
- It provides public access to an object.
- It also provides location transparency for a remote database's tables, views or program units.
- It simplifies the SQL statements for database users.
22. How do you store pictures in a database?
You can store pictures in a database using the Long Raw Data type. This data type is used to store binary data for 2 gigabytes of length. However, the table can have only one Long Raw data type.
23. What is the BLOB data type in Oracle?
BLOB data type is a data type with varying length binary string. It is used to store two gigabytes memory. For the BLOB data type, the length needs to be specified in bytes.
24. What is the difference between TRANSLATE and REPLACE in Oracle?
Translate is used to substitute a character by character while Replace is used to substitute a single character with a word.
25. What are the different types of database objects?
A list of different types of database objects:
- Tables: This is a set of elements organized vertically and horizontally.
- Tablespaces: This is a logical storage unit in Oracle.
- Views: It is a virtual table derived from one or more tables.
- Indexes: This is a performance-tuning method to process the records.
- Synonyms: This is a name for tables.
26. What is the usage of Save Points in the Oracle database?
Save Points are used to divide a transaction into smaller phases. It enables rolling back part of a transaction. There is a maximum of 5 save points allowed in the Oracle Database. Whenever an error is encountered, it is possible to roll back from where the SAVEPOINT has been saved.
27. What is the difference between a post-database commit and a post-form commit?
The post-database commit trigger is executed after Oracle forms issue the commit to the finalized transaction while the post-form commit is fired during the post-and-commit transactions process, after the database commit occurs.
28. What is Logical backup in Oracle?
Logical backup is used to read a set of database records and write them into a file. An Export utility is used to take the backup, while an Import utility is used to recover from the backup.
29. What do you understand by Redo Log file mirroring?
Mirroring is a process of having a copy of Redo log files. It is done by creating a group of log files together. This ensures that LGWR automatically writes them to all the members of the current online redo log group. If the group fails, the database automatically switches over to the next group. It diminishes the performance.
30. What is the meaning of recursive hints in Oracle?
The number of times a dictionary table is repeatedly called by various processes is known as a recursive hint. The recursive hint is occurred because of the small size of the data dictionary cache.
31. What are the limitations of the CHECK constraint?
The main limitation of the CHECK constraint is that the condition must be a Boolean expression evaluated using the values in the row being inserted or updated and can't contain sub-queries.
32. What is the use of the GRANT option in the IMP command?
GRANT is used to import object grants.
33. What is the use of the ROWS option in the IMP command?
The ROWS option indicates whether the table rows should be imported.
34. What is the use of the INDEXES option in the IMP command?
The INDEXES option is used to determine whether indexes are imported.
35. What is the use of IGNORE option in the IMP command?
The IGNORE option is used to specify how object creation errors should be handled.
36. What is the use of the SHOW option in the IMP command?
The SHOW option specifies when the value of show=y, the DDL within the export file is displayed.
37. What is the use of the FILE param in IMP command?
FILE param is used to specify the name of the export file to import. Multiple files can be listed, separated by commas.
38. What are the extensions used by Oracle reports?
Oracle reports are used to make business enable with the facility to provide information on all levels within or outside in a secure way. Oracle report uses REP files and RDF file extensions.
39. How does ROWID help in running a query faster?
ROWID is the logical address of a row, it is not a physical column. It composes of data block number, file number and row number in the data block. Thus, I/O time gets minimized retrieving the row and results in a faster query.
RowNum: RowNum is pseudo column. A pseudo column means a column which not exist the table physically, but we can use this in any select statement. Roenum is used to get the row number of the select query. if we have 10 records in the SQL query, then rownum will be 1 to 10 for this query.
40. What are database links used for?
Database links are created in order to form communication between various databases or different environments like test, development and production. The database links are read-only to access other information as well.
Different Between Oracle & SQL Server :
- Oracle supports star query optimization, while SQL server doesn’t offer query optimization.
- In oracle, values do not change before committing, whereas in SQL Server, values are changed even before committing.
- Oracle allows rollback during the transaction process, whereas SQL server doesn’t allow rollback in the transaction process.
- Oracle supports many “Schemas” with the instance, whereas SQL server offers “Schemas” within each user database.
- Oracle allows database, full, file-level, incremental & differential backups, on the other hand, SQL server allows full, partial, and incremental backups.
- Oracle uses both “after” and “before” triggers, whereas SQL server mostly uses only “after” triggers.
- Oracle allows Query optimization.
- Values do not change before committing.
- Oracle allows rollback during transactions.
- Oracle use after and before trigger, but the SQL server allows only after the trigger.
1.Before statement trigger
2.Before row trigger
3.After row trigger
4.After statement trigger
What is locking in SQL? Describe its types?
Locking prevents destructive interaction between concurrent transactions. Locks held until Commit or Rollback. Types of locking are:
- Implicit Locking: This occurs for all SQL statements except SELECT.
- Explicit Locking: This can be done by the user manually.
Further, there are two locking methods:
- Exclusive: Locks out other users
- Share: Allows other users to access
Can a primary key create a NONUNIQUE index?
1. By using ROWID we can delete duplicate rows. For defining specific rows we can use the aggregate function max or min. Example :
select * from emp where rowid not in(select max(rowid), empno, empname from emp
Regular Expression: There are five Regular Expression support Oracle.
Interview questions for SQL Developer:
2) What are the types of SQL joins, and when would you use each one?
3) what are the global temporary tables?
4) what are the constraints? what are its types?
5) Diff between union and union all?
6) Query to display an even number of records?
7) Query to display the employee whose name starts with S?
8) Query to display the name of the employee, which contains M in any position in their name?
9) How to delete duplicate records?
10) What is an index, and how can it improve query performance?
11) What is normalization? Explain the first normal form and second normal form?
12) Diff between varchar and varchar2?
13) Write a query to display the current date?
14) Refresh types in materialized view?-dbms_mview.refresh
15) Diff between a clustered and a non-clustered index in SQL?
16) Diff between delete and truncate?
17) What are views? Types of views?
18) Explain the candidate key, primary key, and super key?
19) Explain the concept of a self-join in SQL and when it might be used?
20) What is the dual table?
21) What is Explain plan?
22) What are Oracle hints?
23) Different types of SQL commands?
24) Diff between exists and in?
25) Oracle 11g, 12c, 19c features?
26) What are window functions? Explain with examples?
27) What is synonyms? Types of synonyms?
28) Diff between decode and case?
29) Diff between view and materialized view?
30) What is inline view?
31) What are the analytical functions?
32) Diff between left outer join and right outer join?
33) What are the different types of subqueries in SQL and how are they used?
34) what are the joins? types of joins?
35) what is diff between DDL and DML?
36) what are the union, unionall, intersect, minus operators?
37) how to find list of the indexes for a given table?
38) what are the benefits and drawbacks of indexes?
39) what is function based index?
40) what are partitions? explain diff types?
41) what is substr() , instr() functions?
42) query to find nth highest salary?
43) diff between nvl, nvl2 and coalsce function?
44) diff between replace and translate?
45) what is with check option clause in view? what is force view?
46) Explain on delete cascade?
47) what is pivot function?
48) what is explain plan?
49) how to update complex view?
50) how to get unique records without using distinct clause?