Oracle Questions

Q:

What is locking ? what are the advantages of locking?

Answer

Locking is a mechanism to ensure data integrity while allowing maximum concurrent access to data. It is used to implement concurrency control when multiple users access table to manipulate its data at the same time.


Advantages :


- Avoids deadlock conditions


- Avoids clashes in capturing the resources

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 2968
Q:

What are aggregate functions in SQL? What are those functions?

Answer

Aggregate functions in SQL are used to perform calculation on data. These functions are inbuilt in SQL and return a single value.

SUM( )



SUM function returns the sum or addition of all NOT NULL values of a column. For e.g. I have a Table employee with the fields id, name, salary and I want the sum of all salaries, I can use SUM function as shown
SELECT SUM(emp_salary) from employee;
Hence, if my column emp_salary has values 20,000, 22,000, 21,000; the output will be 63,000

AVG( )


 
AVG function returns the average of all NOT NULL values of a column. For e.g. I have a Table employee with the fields id, name, salary and I want the average of all salaries, I can use AVG function as shown
SELECT AVG(emp_salary) from employee;
Hence, if my column emp_salary has values 20,000, 22,000, 21,000; the output will be 21,000

COUNT( )



COUNT function returns the number of rows or values of a table. For e.g. I have a Table employee with the fields id, name, salary and I want the count of all rows, I can use COUNT function as shown
SELECT COUNT(*) from employee;

Max ( ) and Min ( )



MAX function returns the largest value of a column in a table. For e.g. I have a Table employee with the fields id, name, salary and I want the maximum salary of an employee, I can use MAX function as shown
SELECT MAX(emp_salary) from employee;
Hence, if my column emp_salary has values 20,000, 22,000, 21,000; the output will be 22,000



MIN function returns the smallest value of a column in a table. For e.g. I have a Table employee with the fields id, name, salary and I want the minimun salary of an employee, I can use MIN function as shown
SELECT MIN(emp_salary) from employee;
Hence, if my column emp_salary has values 20,000, 22,000, 21,000; the output will be 20,000

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 2901
Q:

Explain how to lock and unlock a user account in Oracle.

Answer

SQL> ALTER USER user_name ACCOUNT LOCK;


SQL> ALTER USER user_name ACCOUNT UNLOCK;

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 2860
Q:

List the various Oracle database objects.

Answer

- TABLES
- VIEWS
- INDEXES
- SYNONYMS
- SEQUENCES
- TABLESPACES

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 2730
Q:

How does the PeopleSoft database interact with the Oracle?

Answer

A Peoplesoft database is expression which point out a database containing Peoplesoft objects. For Oracle and only for Oracle, Peoplesoft consists in 3 schemas namely:


- PS (PSDBOWNER table owner),


- PEOPLE (for connection checking) and


- SYSADM (by default), the last one contains all the objects/data.


One of the database objects is connected with single Oracle schema, and all processes that connect to the database use the standard PSFT login procedure. PSFT login is used because to refer to the collection of tables in the administrative schema within an Oracle database. Every process that makes a 2-tier connection to the database identifies itself with a PSFT user or operator ID. Hence the interaction goes.

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 2674
Q:

What do you mean by Redo Log file mirroring ?

Answer

-  The process of having a copy of redo log files is called mirroring.
-  It is done by creating group of log files together. This ensures that LGWR automatically writes them to all the members of the current on-line redo log group.
-  In case a group fails, the database automatically switches over to the next group. It diminishes the performance.

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 2652
Q:

What is ODBC SQLPASSTHROUGH option?

Answer

We use SQLPASSTHROUGH options when we need applications to access data both in the front-end and back-end data servers with a single connection. SQL statements that cannot be executed in the solidDB front-end server are passed over to the back end. 


SQLPASSTHROUGH mode can be set as per session or per transaction. The connection between the front end and back end is made with a back-end compatible ODBC driver which is loaded dynamically in solidDB server.

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 2589
Q:

Explain Check constraint.

Answer

Oracle check constraint is used to ensure that before inserting the data in the database, it is validated and checked for the condition.
Example:
Below, the constraint is that the id has to be between 0 and 1000.
create table employee ( id number check (id between 0 and 1000), Name varchar(200) );

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

0 2576