Wednesday, 13 April 2011

Database Structures FAQ's


Database Structures FAQ's


1. What are the components of physical database structure of Oracle database?
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.

2. What are the components of logical database structure of Oracle database?
There are tablespaces and database's schema objects.

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.

4. What is SYSTEM tablespace and when is it created?
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.

5. Explain the relationship among database, tablespace and data file.
Each databases logically divided into one or more tablespaces one or more data files are explicitly created for each tablespace.

6. What is schema?
A schema is collection of database objects of a user.

7. 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.

8. Can objects of the same schema reside in different table spaces?

Yes.

9. Can a tablespace hold objects from different schemes?
Yes.

10. 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.

11. 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.)

12. Do a view contain data?
Views do not contain or store data.

13. Can a view based on another view?
Yes.

14. 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.

15. What is an Oracle sequence?
A sequence generates a serial list of unique numbers for numerical columns of a database's tables.

16. What is a synonym?
A synonym is an alias for a table, view, sequence or program unit.

17. What are the types of synonyms?
There are two types of synonyms private and public.

18. What is a private synonym?Only its owner can access a private synonym.

19. What is a public synonym?
Any database user can access a public synonym.

20. What are synonyms used for?
- Mask the real name and owner of an object.
- Provide public access to an object
- Provide location transparency for tables, views or program units of a remote database.
- Simplify the SQL statements for database users.

21. What is an Oracle index?
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.

23. What are clusters?Clusters are groups of one or more tables physically stores together to share common columns and are often used together.

24. What is cluster key?
The related columns of the tables in a cluster are called the cluster key.

25. What is index cluster?
A cluster with an index on the cluster key.

26. What is hash cluster?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.

27. When can hash cluster used?
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.

28. What is database link?A database link is a named object that describes a "path" from one database to another.

29. What are the types of database links? 
Private database link, public database link & network database link.

30. What is private 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.

31. What is public database link?
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.

32. What is network database link?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.

33. What is data block?
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.

34. How to define data block size?
A data block size is specified for each Oracle database when the database is created. A database users and allocated free database space in Oracle data blocks. Block size is specified in init.ora file and cannot be changed latter.

35. What is row chaining?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.

36. What is an extent?An extent is a specific number of contiguous data blocks, obtained in a single allocation and used to store a specific type of information.

37. What is a segment?
A segment is a set of extents allocated for a certain logical structure.

38. What are the different types of segments?
Data segment, index segment, rollback segment and temporary segment.

39. What is a data segment?
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.

40. What is an index segment?
Each index has an index segment that stores all of its data.

41. What is rollback segment?
A database contains one or more rollback segments to temporarily store "undo" information.

42. What are the uses of rollback segment?
To generate read-consistent database information during database recovery and to rollback uncommitted transactions by the users.

43. What is a temporary segment?
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.

44. What is a datafile?
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.

45. What are the characteristics of data files?
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.

46. What is a redo log?
The set of redo log files for a database is collectively known as the database redo log.

47. What is the function of redo log?The primary function of the redo log is to record all changes made to data.

48. What is the use of redo log information?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.

49. What does a control file contains?
- Database name
- Names and locations of a database's files and redolog files.
- Time stamp of database creation.

50. What is the use of control file?
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.

Random Questions From Apps(FAQ'S)


Random Questions From Apps

1. What is overlay in payables
Ans: Over lay is used in payable open interface where we would like to pass and overwrite certain value which is set to appear by default when data is inserted into the production tables.
2. What is rollup group
Ans: rollup group we define and attached with the parent segment in the accounting flexfield for summary total for which summary template is defined. This identify at what level and how the summing up should be computed for the level.
3. What way payment batch is different from other module batches.
Ans: It identifies the invoices for the payment automatically based on the criteria we specify in payment batch for the payments. 
4. What is balancing segment in AR.Ans: The Account Generator ensures that Receivables substitutes the correct balancing segment values during various accounting activities against transactions and receipts.
Receivables uses the Account Generator to update the balancing segment values during various accounting activities against transactions and receipts. By matching the balancing segments for different accounting activities back to the original transaction or receipt, the Account Generator ensures that Receivables uses the correct balancing segment values during this substitution process. For example, if an invoice’s balancing segment that you assess finance charges for has a value of ’01’ and the balancing segment of your finance charges account is ’02’, when Receivables accrues finance charges for this invoice, the Account Generator automatically changes the balancing segment of the finance charges account to ’01’. The Account Generator in Receivables utilizes Oracle Workflow
5.What is deposit in AR? Have you used it?
Ans: It is a commitment type of transaction where in we take deposit from the customer and get into the agreement that we will make supply of certain goods and services for certain period of time. 

7.What is flexfield qualifier in accounting flexfield.
Ans: Balancing Segment, Cost Center Segment, Natural Account Segment & Inter-company segment.

8.Which SRS is used for AR To GL Interface.
ANS: General ledger option is given in the menu option interfaces in AR.

9.What are required setup for AP.
Ans: Required setup in AP is as under
1. Install or upgrade payables
2. Select primary set of books
3. Use the system administrator responsibility to assign your set of books to a responsibility. (Profile Option)
4. Define financials options.
5. Define payables options.
6. Define payment terms.
7. Define banks, bank transmission details and bank accounts
8. Open payable accounting period
9. Set up Print Styles and Drivers for the supplier Mailing labels report
10.What are required setup for GL.
Ans: Required setup in GL is as under
1. Source (Required step with defaults)
2. Category (Required step with defaults)
3. System Control (Required step with defaults)
4. Profile Options (required)
5. Open Close Accounting Periods (required)
Before that set of books setup needs following:
1. Chart of Accounts (Accounting Flexfields) - (Required)
2. Define Period Types (Required step with defaults)
3. Define Calendar (Required)
4. Currency (Required step with defaults)
5. Set Of Book (Required)
6. Assign set of books to a Responsibility in Profile Option(Required)
7. Daily Conversion Rate Type (Required step with defaults)
11.How you will print user name of the person logged on to see the report.
ANS: SELECT FND_GLOBAL.USER_ID FROM DUAL; STORE IT IN A VARIABLE AND FIND IT IN THE FND_USER
select user_name from fnd_user where user_id = (select fnd_global.user_id from dual)
12.What is the table name for GL Interface. From here data goes to which tables.
ANS: GL_INTERFACE Table Updates GL_JE_BATCHES, GL_JE_HEADERS, GL_JE_LINES.
13.Can we insert journal name in the GL Interface table
Ans: There is no such column in GL interface table hence we cannot enter it.
14.Where Reference fields are found in GL production tables. What is its use.
Ans: Reference fields are found in GL_JE_LINES it is used to store reference of sub-ledger enables us to drill down from gl to subledger.
15.Where journal name will be stored in GL_INTERFACE TABLE, Name the column.
ANS: REFERENCE4 (Journal Entry name will go in this field)
16.How to set dependent and independent value set and how you will insert values for the segments having these value sets.
ANS: First define independent value set and then while defining dependent value set give reference of independent value set along with default value and description. At time of entering values, enter values for independent first and then while entering values for dependent it will first force you to select value of independent segment.
17.SRS Name for AP TO GL.
ANS: Payable Transfer to General Ledger.
18.Can you delete the records after the interface has uploaded the records in the GL interface table?
ANS: Yes we can delete and correct the records from the front end after importing data into GL_INTERFACE Table. Sub menu options as correct and delete are given under import menu option. We have to specify source name. Menu option is import under journal in GL.
19.Required parameter for PL/SQL Procedure registered in Oracle. What will happen if these are not included?
ANS: Retcode and Errbuf are two out parameters having varchar2 datatype that are required. Use errbuf to return any error messages, and retcode to return completion status. The parameter retcode returns 0 for success, 1 for success with warnings, and 2 for error. After your concurrent program runs, the concurrent manager writes the contents of both errbuf and retcode to the log file associated with your concurrent request. If we do not include these two parameters, it will give run time error.
20.How to judge the number of descriptive fields defined from the front end itself.
ANS: In front end we will find [] open close square bracket which indicate the presence of descriptive flexfield. In other words, dff appears on form as a single-character, unnamed field enclosed in brackets
21.What is context field is all about.ANS: Context field is used to make descriptive flexfield segments context sensitive, so that segment that may or may not appear depending upon what other information is present in your form
22.What is use of custom.pll what triggers are fired to support the customization you do using custom.pll
Ans: WHEN-FORM-NAVIGATE
WHEN-NEW-FORM-INSTANCE
WHEN-NEW-BLOCK-INSTANCE
WHEN-NEW-RECORD-INSTANCE
WHEN-NEW-ITEM-INSTANCE
WHEN-VALIDATE-RECORD
SPECIALn (1 to 45)
ZOOM
EXPORT
KEY-fn (1 to 8)
23.What are various customer interface tables?
ANS: RA_CUSTOMERS_INTERFACE_ALL
RA_CUSTOMER_PROFILE_INT_ALL
RA_CUSTOMER_BANKS_INT_ALL
RA_CUST_PAY_METHOD_INT_ALL
RA_CONTACT_PHONES_INT_ALL
24.Where invoices gets stored in payables
ANS: AP_INVOICES_ALL
AP_PAYMENT_SCHEDULES_ALL
AP_TERMS_LINES
AP_BANK_ACCOUNTS_ALL
AP_BANK_BRANCHES
AP_INVOICE_PAYMENTS_ALL
25.What will happen if you will type select * from ap_invoices in the multi org setup.
Ans: No row selected because it is a view having where condition for ord_id to match with operating unit context that are extracted from client_info global variable at application run time. From sql prompt run Fnd_client_info.setup.org_context(org_id). It will set the operating unit context or run fnd_clinet_info.setup_client_info(resp_appl_id,resp_id,user_id, security_group_id)
26.Why it does not show records and show records for ap_invoices_all where as both the table has got org_id columns.Ans: Because operating unit context is not set that is why ord_id can not retrieved to meet the where condition specified in the view. Set it up with followings,
Fnd_client_info.setup_client_info(resp_appl_id,appl_id,user_id) or
Fnd_client_info.set_org_context(org_id)
27.What mechanism or logic oracle apps have applied to drill down the records in AP from the GL module after the records are transferred from AP to GL.
ANS: Uses reference column (1-8) to store information about sub-ledger.
28. What is auto accounting?
ANS: It is a required setup before to enter any transaction in AR. We have to define code combinations for different transaction type such as revenue, receivables, bills receivables, charge back, deposit and guarantee to default
29. What is major risk you find in Project? How to mitigate it.
ANS: Resource is a major risk in oracle apps projects. To mitigate it we need to have resource in reserve right from the beginning of the project.
30. What are CR.010 all about?ANS: It is a Project Management Plan Document.
31. How you maintain time sheet.
ANS: Time sheet is maintained in WM.020 In MS Project format.

API to Convert UOM(INVENTORY)

API to Convert UOM

Simple API to covert Qty from 'From UOM' to 'To UOM' , there are many API available in apps for same purpose, I used this one .

declare
l number;
l_from_uom VARCHAR2(100):='&Enter_from_
uom';
l_to_uom VARCHAR2(100):='&Enter_to_uom';
l_primary_qty NUMBER := &Enetr_qty_in_pri_uom;
l_inv_item_id NUMBER := &Enter_item_id;
begin
--l:=INV_RCV_CACHE.convert_qty(149,120,'EA','DOZ',NULL,NULL,NULL);
l:=INV_RCV_CACHE.convert_qty(l_inv_item_id,l_primary_qty,l_from_uom,l_to_uom,NULL,NULL,NULL);
dbms_output.put_line('l = '||l);
end;