262
1. What are the scripts do you use while Apps Cloning? adpreclone.pl prepares the source system to be cloned by collecting information about the database and creating generic templates of files containing source specific hardcoded values. Its location is $COMMON_TOP/ admin/scripts/contextname/ adcfgclone.pl creates the new context file used to configure the target system. 2. What is Patch? Patch is a program which fixes the bug. 3. Apps11i Post-Installation steps? 1) Shutdown all Oracle Application Processes 2) Apply Inter-Operability Patch(3830807) 3) Apply Discoverer Patch(3170128) 4) Relink all Oracle Appications executables 5) Restart Oracle Application Processes 4. Apps11i Post Cloning steps? 1)Update the profile options 2)Update the printer settings 3)Update workflow configuration settings 4)Verify APPLCSF variable 5)Update session_cookie_ domain in icx_parameter table 5. Types of Patches? One-off patch: This is the simplest type of patch. It is created to resolve a specific bug. Minipack patch: This is a collection of one-off patches and enhancements related to a particular module. Alphabetic characters denote the Minipack version for the module; for example, the product code for the Application DBA utilities is AD, and version Minipack I of this product would be called AD.I Family Pack patch: This is a collection of Minipack patches for a particular family group of application modules. Alphabetic characters denote the Family Pack version; for example, the J version of the Human Resources Suite Product Family would be HR_PF.J Maintenance Pack patch: This is a collection of Family Packs that serves as a point-level release upgrade; Oracle Applications Release 11.5.10 is an example of a Maintenance Pack. 6. Contents of a Patch? Readme files Driver files

Interview_Q1

Embed Size (px)

Citation preview

Page 1: Interview_Q1

1. What are the scripts do you use while Apps Cloning?

adpreclone.pl prepares the source system to be cloned by collecting information about the database and creating generic templates of files containing   source specific hardcoded values.                                                                                      Its location is $COMMON_TOP/ admin/scripts/contextname/adcfgclone.pl creates the new context file used to configure the target system.

2. What is Patch?      Patch is a program which fixes the bug.

3. Apps11i Post-Installation steps?     1) Shutdown all Oracle Application Processes   2) Apply Inter-Operability Patch(3830807)   3) Apply Discoverer Patch(3170128)    4) Relink all Oracle Appications executables    5) Restart Oracle Application Processes

4. Apps11i Post Cloning steps?          1)Update the profile options           2)Update the printer settings            3)Update workflow configuration settings              4)Verify APPLCSF variable            5)Update session_cookie_ domain in icx_parameter table        

5. Types of Patches? One-off patch: This is the simplest type of patch. It is created

to resolve a specific bug. Minipack patch: This is a collection of one-off patches and

enhancements related to a particular module. Alphabetic characters denote the Minipack version for the module; for example, the product code for the Application DBA utilities is AD, and version Minipack I of this product would be called AD.I

Family Pack patch: This is a collection of Minipack patches for a particular family group of application modules. Alphabetic characters denote the Family Pack version; for example, the J version of the Human Resources Suite Product Family would be HR_PF.J

Maintenance Pack patch: This is a collection of Family Packs that serves as a point-level release upgrade; Oracle Applications Release 11.5.10 is an example of a Maintenance Pack.

6. Contents of a Patch?      Readme files      Driver files       Metadata files       Replacement files

7. Modes of Patching?         Test mode            (apply=n),  With the Test mode, we can see the effects applying the patch will have on your system before applying the patch.    Pre-install mode   (preinstall= y), Pre-install mode of Autopatch is used when the version of Oracle Applications AutoPatch works with is different than the version of Oracle Applications in the database. We use this mode during upgrade process.    Non-interactive mode   (adpatch defaultsfile= $APPL_TOP/ admin/<SID>/log)

8. What are the drivers present in patching?         C driver copies the files and links executables   

Page 2: Interview_Q1

    D driver runs the SQL scripts and programs that updates the  database         G driver generates the forms, reports and message files    U driver is a consolidated driver containing all copy, database, and generate actions

9. Options of adpatch?    

Novalidate Prevents adpatch from validating all schema connectionsNoprereq Prevents adpatch from checking the existence of prerequisite

patchesNocompiledb Prevents adpatch from compiling database objectsNocompilejsp Prevents adpatch from compiling JSP objectsNoautoconfig Prevents adpatch from running autoconfig after the patch has been

completedNogenerateportion

Prevents adpatch from compiling forms, menus, and plls

Hidepw Prevents passwords from being displayed in log filesHotpatch Allows adpatch to be run when the instance is not in maintenance

mode10. Minipack naming convention? 

   11i.<prod>.A, 11i.<prod>.B   For example: 11i.AD.G,  11i.AD.H 11. Maintenance pack naming convention?

   11.5.1, 11.5.2, 11.5.3 12. Family pack naming convention?

   11i.<prod family name>.<letter>  For example: 11i.HR_PF.C 13. Difference between adpatch and Opatch?

   adpatch is utility to apply Oracle Application Patches      opatch is utility to apply Database Patches

14. What is the prerequisite to apply Opatch?              Database should be down

15. What do you do if patch fails?       Review log file(s) to determine the cause of the error    Fix the cause of the error      Restart adpatch      Answer 'Yes' when adpatch asks if you want to continue the previous session     Adpatch will skip already completed jobs, and pick up from where it left off.

16. How to apply a pre-requisite patch when adpatch is running?        Shut down the workers using adctrl          Backup FND_INSTALL_ PROCESSES, AD_DEFERRED_ JOBS, restart files(.rf9)        Then, drop the above tables, restart files and apply the pre-requisite patch.         Restore the two tables and restart files from backup & run the adpatch.

17. If you know that the patch has been applied previously but patch is asking you to apply the existing patch as a pre-requisite?     adpatch options=noprereq

18. While applying Apps patch using adpatch, if you want to hide the apps password, how will that be possible ?     Use adpatch flags=hidepw while applying patches in apps to hide apps or system password being displayed on Users Screen.

19. How do you reduce patch timings?     Merging patches via admrgpch      Use various adpatch options like nocompiledb or nocompilejsp    Use defaults file 

Page 3: Interview_Q1

20. How you put Applications 11i in Maintenance mode ?      Use adadmin to change Maintenance mode in Oracle Apps. With AD.I you need to enable maintenance mode in order to apply apps patch via            adpatch utility. If you don't want to put apps in maintenance mode you can use adpatch options=hotpatch feature.

21. How do you know that a patch has been applied?     Navigate to sitemap > patches  patchhistory                            (or)     Query AD_BUGS or AD_APPLIED_PATCHES

22. How do you find out which drivers have been applied?    Query the ad_patch_drivers;

23. How do you find out what patches have been applied on database?     $ opatch lsinventory

24. How to rollback the opatch?      opatch rollback

25. How to apply the patch?      opatch apply

26. How to go for the help on Opatch?                opatch help

27. Location of Patch History files?        $APPL_TOP/admin/ SID/javaupdates<timestamp>.txt(for java related files)       $APPL_TOP/admin/ SID/adpsv<timestamp>.txt(non-java related files )

28. Where do you find adpatch log files ?Patch log files will be in directory $APPL_TOP/admin/ SID/log like adpatchXXX.log ( file name you mentioned while patching ), adworkXXX.log for worker log files

29. Location of Adpatch default logfile location?                     $APPL_TOP/install/ log

30. Location of APPS password?       $IAS_ORACLE_ HOME/Apache/ modplsql/ cfg/wdbsvr. app                                       (or)         $8.0.6 ORACLE_HOME/ report60/ server/CGIcmd. dat

31. How do you know whether ur system is autoconfing enabled or not?    Run adcfginfo.sh contextfile= $APPL_TOP/ admin/contextnam e.xml

32. How do you determine whether your system is Rapid Clone enabled?    First, verify that your system is AutoConfig enabled. Then, Verify that the latest Rapid Clone Patch has been applied or not

33. If I have 5 databases, is it possible to point only to 1 bdump?        Keep the same location in 'background_ dump_dest' parameter for 5 databases in pfiles

34. How to retrieve recent files?       ls -ltr

35. How do you know the kernel version?      uname -r

36. Contents of pfile?        db_name    background_dump_ dest     user_dump_dest    core_dump_dest     control_files    undo_management    compatible    db_block_size     db_cache_size

Page 4: Interview_Q1

   db_domain    global_names    instance_name     max_dump_file_ size     remote_login_ passwordfile     service_names      shared_pool_ size

37. Contents of controlfile?     Database name & Identifier      Timestamp of database creation     Tablespace names    Names & locations of datafiles and redolog files     Current redolog file sequence number      Checkpoint information     Begin & end of undo segments     Redo log archive information     Backup information

38. Why do you set Kernel parameters?      Oracle uses UNIX resources such as shared memory, swap space and semaphores for interprocess communication.     So we modify the Kernel parameters in /proc/sys/kernel. To setup these parameters permanently is use /etc/sysctl. conf file.    If your Kernel parameter settings are insufficient for Oracle, you will experience problems during installation and/or instance startup.

39. What is the purpose of find?         if you are in present directory, how do you find?  f ind .-name<filename>       if you are not in present directory, how do you find? find -name<filename>   

40. How to enable a new language?      Through License Manager

41. How do you take backup in LINUX?        By using tar or cp or cpio

42. What is Generic Service Management(GSM) ?       GSM is an extension of concurrent processing which provides a powerful framework for managing processes on multiple host machines.

43. How to find out the version of a FORM?    f60gen------ --------- ---for FORM version

44. How do you find out if Form Server is running or not?      ps -ef |grep f60webmx

45. What is the Forms Server executable name?       f60srvm

46. What if the Form Server is slow?     Bounce the server

47. How to confirm if Report Server is Up & Running ?     ps -ef | grep rwmts60

48. What are Materialized views?     Materialized views are schema objects that can be used to summarize and distribute data.

49. What is deadlock?   When two processes waiting to update the rows of a table which are locked by an other process, then deadlock arises.

50. How do you create the user?    Navigate to  Security-->user-->define

51. How do you delete an existing user in the applications?   Applications users cannot be deleted since records belonging to users are

Page 5: Interview_Q1

kept for security and monitoring purposes. The only thing to do is to invalidate the user by assigning an end date to the effective period for the user. Navigating path: Security -> User -> Define

52. How do you delete a responsibility from Oracle Applications?   Responsibilities cannot be deleted since those records are kept for security and monitoring purposes. However, responsibilities can be disabled by assigning an end date to the effective period

53. How do you tell what products are installed within Applications?   This information can be accessed within Applications from the Alert Manager Responsibility.                                                                                           Navigation Path: System--> Installations

54. What is Concurrent Manager?  Concurrent Manager is a program or process manager on application db server, that coordinates the concurrent processes generated by user’s concurrent requests.

55. What is Standard manager?  Standard manager is the default manager which accepts all kinds of requests. It has no predefined specialization rules and is active all the time.

56. What is Transaction manager?  A Transaction manager is started on concurrent processing server and periodically reads the pipe (concatenation of Application tier and Database tier)  for incoming transactions. It occurs only in 11i RAC configuration.

57. What is ICM?     ICM is the manager which controls other managers. If it finds other managers down , it checks & try to restart them.

58. What is Confict Resolution Manager?     CRM resolves conflicts such as request incompatabilities.

59. What is incompatability with Concurrent request?    When a concurrent request is being processed and another concurrent manager is trying to process same type of request, there is an incompatability with concurrent request and is resolved by Conflict Resolution Manager.

60. How to start/stop the Concurrent Manager?         adcmctl.sh start/stop                (or)         $FND_TOP/bin/ startmgr

61. How do you define a Concurrent Manager?     Navigate to Manager --> Define

62. How do you check the current status of manager processes at OS level?      $FND_TOP/sql/ afcmstat. sql

63. How do you know whether Concurrent Manager is running or not?   ps -ef |grep FNDLIBR

64. Where do you see the requests?   Query the FND_CONCURRENT_ REQUESTS

65. How do you know whether Listener is up or not?   ps -ef |grep FNDFS

66. If Concurrent manager is not getting up, what might be the problem?          Apps Listener is not up 

67. How do you determine whether the standard managers are up?         ps -ef |grep FNDLIBR (or)$FND_TOP/ sql/afimchk. sql

68. What happens, if Conflict Resolution Manager is down?     ICM will take over the jobs of CRM

69. If ICM is down, what happens?     All the other managers will keep working. ICM takes care of the queue

Page 6: Interview_Q1

control requests, which means starting up and shutting down other concurrent managers.

70. What happens if user kills ICM?     Applications will be down

71. What is PMON cycle?                                                                                         This is the number of sleep cycles that the ICM waits between the time it checks for concurrent managers failures, which defaults to 20. You should change the PMON cycle to a number lower than 20 if your concurrent managers are having problems with abnormal terminations.

72. What is Queue Size?                 The queue size is the number of PMON cycles that the ICM waits between checking= for disabled or new concurrent managers. The default for queue size of one PMON cycle should be used.

73. What is Sleep Time?                                                                                                   The sleep time parameter indicates the seconds that the ICM should wait between checking for requests that are waiting to run. The default sleep time is 60, but you can lower this number if you see you have a lot of request waiting (Pending/Normal) . However, reducing this number to a very low value many cause excessive cpu utilization.

74. Location of AutoConfig template files and its use?AutoConfig uses template files to determine the basic settings that are needed.   Its location is  prod_top/admin/ template   

75. What is Auto Config? How does AutoConfig know which value from the XML file needs to be put in which file?Auto Config is a configuration tool that supports automated configuration of an Oracle Application file system.  All of the information required for configuring an Applications file system is collected into a central repository, called the Applications Context; there is one Applications Context for each application tier, and one for the database tier. When you run AutoConfig, it reads the XML files and creates all the AutoConfig managed configuration files. For each configuration file maintained by AutoConfig, there exists a template file which determines which values to pick from the XML file.

76. How do you change the port values? Port values can be changed in the context file with the help of ContextEditor and running AutoConfig.      Navigate to Sitemap > Context Editor

77. What is Snapshot?  Snapshot gives a picture of selected Application related files in a given APPL_TOP

78. Location of Snapshot Information?                                             $APPL_TOP/admin/ SID/out/snapdnld .txt  AD_SNAPSHOT, AD_SNAPSHOT_ FILES,  AD_SNAPSHOT_ BUGFIXES

79. What is the runaway process in CPU?  The process to which the memory assigned is not released is known as runaway process.

80. What is dbclone?     Creating same structure of existing database.

81. How do you know that you are in DbTier or AppsTier?         Through XML file,  If DbTier=yes, you are in DbTier

82. How do you know the database has invalid objects?         Select * from dba_objects where status like 'invalid';

83. How do you compile invalid objects?      By running 'Validate APPS Schema' task in adadmin                    (or)      Run utlrp.sql. Its location is $ORACLE_HOME/ rdbms/admin

Page 7: Interview_Q1

84. Location of Apache logs?     $IAS_ORACLE_ HOME/Apache/ Apache/log

85. Why do you run catalog.sql, catproc.sql, pupbld.sql?   catalog.sql creates views and synonyms on data dictionary   Its location is $ORACLE_HOME/ rdbms/admin    catproc.sql creates the PL/SQL procedures and packages   Its location is $ORACLE_HOME/ rdbms/admin   pupbld.sql creates the product and user profile tables   Its location is $ORACLE_HOME/ sqlplus/admin

86. How do you drop the user including contents?      Drop user XXX cascade;

87. What is use InterOperability Patch?   We apply this patch for the compatability between OS and Oracle

88.     How do you know the database growth?   Query dba_free_space              dba_segments               dba_extents

89. In which mode do you up the database after creating control file?      startup mount

90. What happens when you give ALTER tablespace begin backup?      Datafile headers will be freezed.       Undo information will be written into redo log files.

91. What if the database got crashed after giving ALTER tablespace xxx begin backup?       Startup the database in mount mode and give the command ALTER tablespace  xxx end backup 

92. When you kill a particular process id, it is again restarted. How to solve it?        Kill the parent process by this command             pkill  pid

93. How do you findout the installation is single-node or multi-node?      adconfig.txt- --------- --------- ->$APPL_TOP/admin                                  (or)                   Query FND_NODES

94. How to find Apache (web server) is running or not?     ps -ef | grep httpd.conf

95. If Apache is getting problems, which files do you look for to trouble shoot?     $IAS_ORACLE_ HOME/Apache/ Apache/conf/httpd.conf     $ IAS_ORACLE_HOME/ Apache/Jserv/ etc/jserv.properties

96. Location of  HTML Cache in Oracle Applications?     $OA_HTML/_pages

97. Location of PL/SQL Cache in Oracle Applications?     $IAS_ORACLE_ HOME/Apache/ modplsql/ cache

98. How do you restart the Discoverer in Oracle Applications 11i?       addisctl.sh start               (or)        $ORACLE_HOME/ discwb4/util/ startall. sh

99. Location of audit traces?     $ORACLE_HOME/ rdbms/audit

100. What is the use of adutconf.sql?     adutconf.sql reports standard information about the installed configuration of Oracle Applications

101. How do you know the Jinitiator version?      Under $COMMON_TOP/ html/bin/ appsweb_SID_ HOSTNAME. cfg,           

Page 8: Interview_Q1

search for entry like jinit_ver_name                                     (or)        Under $FND-TOP/resource/ appsweb_SID_ HOSTNAME. cfg,                   search for entry like jinit_ver_name

102. How to find opatch Version ?     $ORACLE_HOME/ OPatch/opatch version

103. How to find out database version?     select * from v$version;

104. How do you know the OUI version?                 $IAS_ORACLE_ HOME/appsoui/ oui/oraparam. ini                                  (or)      grep -i version oraparam.ini

105. How do you the Apache version?      Type sqlplus after connecting to $IAS_ORACLE_ HOME

106. How do you find out the status and process id of the adworkers?    ps –ef |grep  adworker

107. How do you connect to RMAN?       rman target system/manager@ SID-----To connect remotely       rman target /  ------------ --------- -------To connect globally

108. When you run the convert character set, adadmin creates 3 files in the APPL_TOP/admin/ SID/out. What are they?           admanifest_excp. lst           admanifest.lst           admanifest_lossy. lst

109. Location of Non-OAM context editor wizard?       COMMON_TOP/util/ editcontext- --------- --------- -----Application Tier        RDBMS_ORACLE_ HOME/appsutil/ editcontext- ----Database Tier

110. How to lock/unlock the scott/tiger account?              alter user scott account lock/unlock

111. Diff. between sys and system?               Sys owns data dictionary views               System owns the objects owned by oracle utilities

112. Diff. between sys and sysoper?               Sysoper  can take backup of controlfile               Sys can take full backup of database

113. How to create a user through command prompt?      useradd -g groupname -d directory -p password username

114. What is softlink or hardlink?       A softlink is a file that points to another file.                                              Syntax: ln -s filename linkname       A hardlink is a pathname that references an inode                                   Syntax: ln filename linkname

115. How do you maintain multiple databases with single instance?       By sourcing the environment variables

116. What happens when you give commit statement?   Server process records the SCN & commit record in the redo log buffer   LGWR writes the redo log buffer entries & the SCN to redo log files  Oracle notifies the user that the commit is completed  Server process records that the transaction is completed & that the resource lock can be released

117. Multiplexing the controlfile using SPfile          Alter system set control_files= location          Shutdown the database        Create additional controlfiles        Startup the database

Page 9: Interview_Q1

118. Multiplexing the controlfile using Pfile           Shutdown the database          Copy the existing controlfiles to a newname and location          Add the new controlfile name to pfile           Startup the database

119. Multiplexing the Redo log files?         If the log file is current, perform logswitch by using ALTER SYSTEM SWITCH LOGFILE        Copy the redolog file to the new location           Use ALTER DATABASE RENAME FILE xxx TO xxx  to make the change in control files.

120. What are the storage clauses do you specify?        local, uniform, autoextend, dictionary

121. How to find out the file version?      adident Header <filename> 

122. How do you mount the directories through NFS?     mount -t nfs  hostname:source destination

123. How to recover clone data?        Recover database until cancel

124. What is the utility to upgrade from one version to another version?       dbua

125. Contents of APPL_TOP?      environment files and products

126. What does APPLCSF mean?      $COMMON_TOP/ admin

127. How to change the APPLTMP, APPLPTMP?     utl_file_dir should be edited in pfile

128. How do you know the product versions, patchset levels?      $AD_TOP/sql/ adutconf. lst                     (or)      Query PRODUCT_COMPONENT_ VERSION table.

129. Location of JAR files?                      $PROD_TOP/java/ jar------ --------- --------- --------- ----APPL_ TOP                      $JAVA_TOP/oracle/ apps/<prod>/jar-------- --------- -JAVA_TOP

130. Location of US directory?                      $APPL_TOP/au/ 11.5.0/reports/ us

131. What happens when you give open resetlogs?     log sequence no. will be reset

132. How do you know that the particular datafile belongs to particular tablespace?                   Query v$tablespace,   v$datafile

133. If .dbc file is corrupted, what happens? and What should you do?                autoconfig should be run

134. What are AutoPatch Restart files?   Restart files store information about completed processing in the event of a patch or system failure. They allow AutoPatch, AutoUpgrade, and AD Administration to continue processing at the point where they stopped. Its location is  $APPL_TOP/admin/<SID>/restart

135. How to check whether all the processes are running or not?       ps -ef |grep smon

136. How do you know which user has which privileges?                $DBA_SYS_PRIVS

137. How do you create Applications Context file?  

Page 10: Interview_Q1

Run $AD_TOP/bin/ adbldxml. sh,  after sourcing APPL_TOP & ORACLE_HOME environment files. 

Then, the following values will be prompted for                              ORACLE_SID used to connect to database                               Full path to the Rapid Install Configuration file                               Full path to the JDK 1.3.1 installation

138. What is OraInventory?   The OraInventory stores information about  all oracle software products installed in all ORACLE_HOMES and other non-oracle products such as the Java Runtime Environment( JRE).  The location of the OraInventory is /etc/oraInst. loc which points the location of Global Inventory.

139. What is XML oraInventory?   Starting with OUI 2.x and 11.5.8, the informatio in the inventory is stored in Extensible Markup Language(XML) format. The XML format allows for easier diagnosis of problems and faster loading of  data.                                                                                                                            The inventory is XML if the following file exists  $ORACLE_HOME/ inventory/ ContextXML/ comps.xml                                          Unlike the binary OraInventory, the XML inventory is divided into 2 distinct components.       

Global Inventory or Central Inventory                                                                             Local Inventory or Home Inventory

140. What is Global Inventory?The Global Inventory is the part of the XML inventory that contains the high level list of all Oracle products installed on a machine. The Global Inventory records the physical location of Oracle products installed on the machine, such as ORACLE_HOME( RDBMS and IAS) or JRE. It does not have any information about the detail of patches applied to each ORACLE_HOMEs. The Global Inventory gets updated everytime you install or de-install an ORACLE_HOME.  Note: If you need to delete and ORACLE_HOME, you should always do it through the OUI de-installer in order to keep the Global Inventory synchronized.     

141. What is Local Inventory?                                                                           There is one Local Inventory per ORACLE_HOME. It is physically located inside the ORACLE_HOME at $ORACLE_HOME/ inventory and contains the detail of the patch level for that ORACLE_HOME. The Local Inventory gets updated whenever a patch is applied to the ORACLE_HOME, using OUI.    

142. What does OUISetup.pl do?                                                                     OUISetup.pl is included with the OUI patch, listed as a pre-requisite to Rapid Clone. It should be run as part of the OUI Patch installation and performs the following tasks:                                    Register the OUI program in the Global Inventory                            Register the JRE in the Global Inventory                           Ensures that the ORACLE_HOME in which the patch is installed is properly registered in the Global Inventory.

143. How do you determine if your system is autoconfig enabled or not?        Run adcfginfo.sh contextfile= context

144. How do you determine if your system is Rapid Clone enabled or not?  First, verify that your system is AutoConfig enabled. Then, verify if latest Rapid Clone Patch has been applied.

Page 11: Interview_Q1

145. Can you clone a multinode system to a singlenode system?   You can use Rapid Clone to merge multiple APPL_TOP and COMMON_TOP file systems into a single APPL_TOP and COMMON_TOP file system.

146. How does adcfgclone.pl know the target system values?   adcfgclone.pl will prompt for the values required to create the new context file used to configure the target system.   PROMPTS: Database SID    Domain name    Prompts specific to the DBTier Target system database name    RDBMS ORACLE_HOME directory    DATA_TOP path     Prompts specific to the AppsTier  Database server node   Does the target system have more than one applications tier server node(Y/N)?   Is the target system APPL_TOP divided into multiple mount points(Y/N)?   APPL_TOP mountpoint   COMMON_TOP directory   8.0.6 ORACLE_HOME directory   IAS ORACLE HOME directory  Location of JDK1.3.1    Prompts common to DB and AppsTier   Port Pool Number [0-99]

147. What is Port Pool?   The Port Pool provides a way to use a set of predefined server ports. There are 100 port pools.  Port Name                                                Default port numubers Web Listener Port                                          8000    Database Port                                                1521    RPC Port                                                       1626   Reports Port                                                  7000  Metric Server Data Port                                 9100  JTF Fulfillment Server Port                           9300

148. What is .dbc file? and its contents?  How do applications know the name of the dbc file? dbc stands for database connect descriptor file used to connect to database.  Whenever java or any other program like forms want to connect to database, its uses dbc file.  The application knows the name of the DBC file by using profile option "Applications Database Id" Contents of dbc file:                                 GUEST_USER_PWD                                      DB_NAME                                DB_HOST                                                                             DB_PORT                                                                                    Location: $FND_TOP/secure                                                  

149. How to compile JSP in Oracle Applications?   Run ojspCompile. pl script    Location: $JTF_TOP/admin/ scripts

150. What is Web Listener?   Web Listener is web server listener which is listening for web services (HTTP) request. This listener is started by adapcctl.sh

151. What are the development technologies?  Java,  D2K,  HTML

Page 12: Interview_Q1

152. How do you restart the installation?    rapidwiz  -restart

153. Documents to be referred for installation?         Installation guide         Update Release notes

154. How do you set the path of /etc/oraInst. loc when it is not present and you dont have root access?    run ./rapidwiz -inventory_loc= 'location'

155. How to verify whether java is installed or not?    which java

156. How to findout the java version?     java -version

157. How to check whether the packages are available or not?       rpm -qa |grep ar/make/qa

158. Do you have to install JDK on all systems, when you are doing multinode installation?    Yes, mandatory

159. Location of installation log files?     $ORACLE_HOME/ appsutil/ log/contextname- --------- ---> on database   $APPL_TOP/admin/ contextname/ log------ --------- --------- -->on application

160. By using FNDCPASS, whose passwords can be changed?       Oracle------ ---Database tier      System------ --Application tier       User-------- ---Oracle user

161. How do  you switch the logfile?      alter system switch logfile

162. How to force the checkpoint?       By setting FAST_START_MTTR_ TARGET parameter                                    (or)      alter system checkpoint

163. What is the purpose of adcfginfo.sh?     It shows whether the system is autoconfig enabled or not.     Location: $AD_TOP/bin

164. What is the difference between apps schema, applsys schema, applsyspub schema?      Apps schema contains only synonyms for other modules     Applsys schema contains all the fnd tables, administration schema      Applsyspub is the gateway to login to the application

165. Parameters regarding the performance tuning?     audit_trail= true      timed_statistics= true    max_dump_file_ size=10240

166. Why do you use scope=spfile, memory and both?       MEMORY: Set for the current instance only. This is the default behaviour if a PFILE was used at STARTUP     SPFILE: update the SPFILE, the parameter will take effect with next database startup     BOTH: affect the current instance and persist to the SPFILE. This is the default behaviour if an SPFILE was used at STARTUP

167. Steps to apply Patchset?    Patchset includes bugfixes for 9.2.0.4 – 9.2.0.6 1)Unzip the patchset in /stage directory and run the runInstaller   2)Select the 10G OUI and again run the runInstaller  3)Select patchset  

Page 13: Interview_Q1

 4)Startup migrate    5)Run the script catpatch.sql

168. What is Shared Server?    In Shared Server environment, the server process handles the request of several user processes.

169. How to enable Shared Server?    Two parameters should be set in pfile.               shared_server= no. of predefined server processes                 dispatchers= protocol of dispatcher and no. of dispatchers    Then, tnsnames.ora should be modified

170. What is Cost based optimization?   Cost based optimization is used to identify the shortest way to execute and retrieve data from an object

171. How do you change the database name?     Change SID in controlfile and parameterfile    In controlfile, set dbname=xxx, reuse=xxx

172. Difference between 8i and 9i?    In Oracle9i, DB_CACHE_SIZE or SHARED_POOL_ SIZE can be resized when the database is up and running.  It is not possible with Oracle8i.    Time stamp facility is available in 9i whereas it is not available in 8i     You can drop a column in oracle 9i using alter table command where as this is not available in oracle 8i     In 9i, we call undo segments whereas rollback segments in 8i

173. What is Explain Plan?     Explain Plan parses a query and records the "plan" that Oracle devises to execute it. By examining this plan, you can findout if Oracle is picking the    right indexes and joining your tables in the most efficient manner.      @?/rdbms/admin/ utlxplan. sql script will create the PLAN_TABLE

174. What is the use of utlrp.sql?      This script compiles the invalid PL/SQL modules. Its locations is $ORACLE_HOME/ rdbms/admin

175. Which initialization parameters do you set to effect the SGA size?    shared _pool_size     db_block_size      db_cache_size      log_buffer

176. Which parameters in pfile effect the database?      db_name     db_block_size    control_files

177. Tasks of Adadmin?   1. Generating Applications files    2. Maintaining the Applications database objects   3. Maintaing Applications files

178. AD Administration Prompts?       Is this the correct APPL_TOP [Yes]?        Logfile name [adadmin.log]       Email feature [No]       Batch size [1000]        Is this the correct database [Yes]?       Enter the password for 'SYSTEM' ORACLE schema:        Enter the password for  APPLSYS schema

179. Ad Administration  Preliminary Tasks?     Run the environment file      Verify the ORACLE_HOME is set properly 

Page 14: Interview_Q1

    Verify the TWO_TASK identifies the correct database      Ensure that ORACLE_HOME/ bin and AD_TOP/bin are in path      Shutdown the concurrent managers when relinking     Ensure sufficient temporary disk space       Note:  The temporary directories APPLTMP, APPLPTMP, REPORT60_TMP   and the OS temporary directories, /tmp, /usr/tmp must each have atlease 50MB of free space

180. When do you run Relink Application Programs task in AdAdmin?      Run the Relink Application Programs after               Installing a new version of the database or a technology stack component              Installing another underlying technology component that Oracle  Applications rely on                Applying a patch to the Applications technology stack             Applying a patch to the OS               Including a new or changed third party or custom code into Applications programs

181. What is the pre-requisite before running the 'Convert to Multiple Reporting Currencies' task in Ad Administration?       Always run the 'Validate APPS Schema' task before running the convert to MRC task

182. How do you know database version?                                                        Select * from v$sys.version

183. What is Password file?     Password file is created on a server side to store valid users and password. It is used for validating users and their passwords.

184. Purpose of Undo segments? Undo segment is used to save the old value when a process changes data in a database.

185. How many undo tablespaces should be there?  We can have any no. of tablespaces but only one should be active.

186. Where does redo log information store?      In memory area

187. Explain the difference between a hot backup and a cold backup?       We take hot backup when database is up and running and it must be in archivelog mode. We take cold backup while database is shutdown and it doesnt need to be in archive log mode.

188. What is admrgpch?     It merges multiple patches into a single, integrated patch.

189. What is adadmin?                                                                                     It performs maitenance tasks on the Oracle Applications file system and database

190. What is adpatch?                                                                                     It applies patches and adds new languages and products.

191. What is adaimgr?       It upgrades to the latest version of Oracle Applications

192. What is adctrl?      It manages parellel workers in Autoupgrade, ADAdministration and AutoPatch

193. What is adrelink?     It relinks Oracle Applications executable programs with the Oracle Server Product Libraries

194. What is adsplice?   It registers off-cycle products

195. How do you determine howmuch virtual memory is being utilized?      Run the vmstat command

Page 15: Interview_Q1

196. How to know which process is consuming more CPU resources?      Run the top command

197. How do you determine the blocklevel utilisation?      Run the iostat command

198. What for do you use the 'netstat' command?      Netstat reports on the contents of network data structures

199. How do you increase the datafile size?     By using ALTER DATABASE DATAFILE xxx RESIZE n

200. How do you bring datafile offline?     By using ALTER DATABASE DATAFILE xxx OFFLINE

201. Do we need to close the window after installing Jinitiator?    No need, if Internet Explorer is used     Need to be closed, if Netscape is used

202. Whats is difference between two env files in <CONTEXT>.env and APPS<CONTEXT>.env under $APPL_TOP ?   APPS<CONTEXT>.env is main environment file which inturn calls other environment files like <CONTEXT>.env under $APPL_TOP, <CONTEXT>.env under 806 ORACLE_HOME and custom<CONTEXT>.env for any Customized environment files.

203. What are main configuration files in Web Server (Apache)?       httpd.conf, jserv.conf, wdbsvr.app

204. What are various components in Application/ Middle Tier?      Web Server, Forms Server , Reports Server, Concurrent Manager, Admin Server & Discoverer Server.

205. What is Maintenance Mode?     Maintenance Mode is a new mode of operation introduced with Release 11.5.10, in which the Oracle Applications system is made                                accessible only for patching activities. This provides optimal performance for AutoPatch sessions, and minimizes downtime needed. Maintenance        mode is only needed for AutoPatch sessions. 

206. Difference between delete and truncate?                                                 If you delete a table, you can rollback but if you truncate a table you cannot rollback         Delete is a DML command whereas Truncate is a DDL command

207. What does OUI do?       OUI(Oracle Universal Installer) is used to install, upgrade or remove software components, and create database

208. Application Scripts?        adfrmctl.sh -------Form Server      adfmsctl.sh- ------Forms Metric Server           adfmcctl.sh- ------Forms Metric Client      adalnctl.sh- -------Listener       adrepctl.sh- -------Report Server        adcmctl.sh-- ------Concurrent Manager       adapcctl.sh- ------Web Server       addisctl.sh- -------Discovere r Server       adtcfctl.sh- -------TCF Socket Server       jtffmctl.sh- --------Fulfillm ent Server

209. Database Scripts?       addlnctl.sh- -------DB Listener Process       addbctl.sh-- -------DB Process

210. Difference between du and df?     du shows the used space for each and every directory and file      df shows the used and available space with mount points

Page 16: Interview_Q1

211. In which mode the recovery is done?      mount mode

212. How do you increase the tablespace size?    By adding datafile to the tablespace or by resizing the datafile     ALTER TABLESPACE xxx ADD DATAFILE xxx RESIZE n     ALTER DATABASE DATAFILE xxx RESIZE n

213. Where does undo memory information store?         Redo log buffer cache

214. What happens when you use alter system archive log start?      To enable the automatic archiving

215. What happens when you use alter database archive log?       To keep the database in archivelog mode

216. How do you maintain security?      By creating users and assigning them roles and profiles

217. Why do you use Resetlogs, Set, Reuse?      If  you reset the logs, log sequence number will be set 0     Set is for new SID      Reuse is for reusing the existing controlfiles

218. How to check the free space and used space in OS level?     df -h, du -h

219. How to check the top directories used space in OS level?     du -h --max-depth= 1

220. Which parameters effect the undo?      undo_management     undo_retention      undo_suppress_ errors       undo_tablespace

221. What is the purpose of cmclean.sql? and its location?       It will purge the concurrent manager logs and tables  

222. What is JInitiator?      JInitiator provides the JVM on which Forms client Applet will run.

223. What for do we use shared, exclusive, none in password file?     shared is to allow the remote users     exclusive is only for particular database      If none is set, remote login is not allowed

224. What is datagroup?       Datagroup is the pairing of Oracle user and Application user.

225. What happens when the environment is sourced?     All the product top directories and necessary executables such as adadmin, adpatch are set into path.

226. Contents of COMMON_TOP?      admin/scripts, java, html, rgf, temp/txkValidateRol lup.html, util/jinitiator

227. Contents of ORA directory?      IAS_ORACLE_HOME and 806 ORACLE_HOME

228. What is checkpoint?    Checkpoint signals the DBWR to write the dirty buffers to datafiles     Updates the datafile headers and controlfiles with checkpoint information

229. What is there in httpd.conf?     This is a server configuration file which typically contains directives that affect how the server runs, such as user and group IDs it should use, and location of other files. Because the server configuration file is the main file that the server starts with, Oracle HTTP Server does not include any directive that says where to locate it. The location is passed on command line when the server starts.

Page 17: Interview_Q1

230. What is RRA/FNDFS ?                                                                               Report Review Agent(RRA) also referred by executable FNDFS is default text viewer in Oracle Apps 11i for viewing output files & log files

231. Where to check log files after autoconfig is executed ?   On database tier its under $ORACLE_HOME/ appsutil/ log/contextname/ mmddhhmm/ adconfig. log                   On Application tier its under $APPL_TOP/admincont extname/log/ mmddhhmm/ adconfig. log

232. What is location of Contexts file in 11i ?                                                   Database Context file is under Database $ORACLE_HOME/ appsutil                   Application Context file is under $APPL_TOP/admin

233. What is a responsibility?                                                                           Responsibility is a collection of menus, request security groups and data groups.   Menu is a collection of forms                                                                 Request security group is a collection of programs                                             Data group is a group of modules to be made accessible by the user through  Responsibility  

  System admin-->security-->define                                                                          Security-->user-->define

234.   How do you troubleshoot self-service login problems? Which profile options and files do you check?  

     Check guest user/password in DBC file, profile option guest user/password.            Check whether apache/jserv is up                                                                                   Run FND_WEB.PING, aoljtest etc

235. What could be wrong if you are unable to view concurrent manager log and output files?  

       Most likely listener is down. Look at the FND_CONCURRENT_ REQUESTS, FND_NODES table and FNDFS_entry in tnsname.ora

236. How do you change the apps password?                                                  Use FNDCPASS to change APPS password and modify manually wdbsvr.app/cgiCMD. dat

237. How do I check if Multi-org is installed?                                                    Select multi_org_flag from fnd_product_ groups;

238. How do I check the currently installed release of applications?                Select realease_name from fnd_product_ groups;

239. How to find the name of a form?                                                              Navigate Help-->About Oracle Applications

240. How do you cancel a running concurrent request?      Navigate Concurrent Request Summary form, select a request. In character, do a Quickpick on the Status column. You can select Cancel or Hold

241. Why does Help-->Tools-->Examine ask for a password?      This profile option controls whether users can use the Examine utility      The password should be the APPS password

242. What are .lgi files?       It contains informational messages, such as files that were not applied      Its location is $APPL_TOP/admin/ SID/log

243. What is location of .cfg? and its purpose?       This file is defined by environment variable FORMS60_WEB_ CONFIG_FILE.   This is usually in directory $OA_HTML/bin on forms tier. This 

Page 18: Interview_Q1

file is used by any forms client session. When a user tries to access forms , f60webmx picks up this file and based on this configuration file creates a forms session to user/client. 

244. Where would i find .rf9 file, and what exactly it does?     These files are used during restart of patch in case of patch failure.      Location is $APPL_TOP/admin/ SID

245. Whats US directory in $AD_TOP or under various product TOP's ?     US directory is default language directory in Oracle Applications. If you have multiple languages installed in your Applications then you will see other languages directories besides US, that directory will contain reports, fmx and other code in that respective directory like FR for France, AR for arabic, simplifies chinese or spanish.

246. How to find Version of Apache used with oracle apps 11i ?    Go to location $IAS_ORACLE_ HOME/Apache/ Apache/bin and run this command  ./httpd -version

247. How do you work with multiple oracle homes?       Whatever oracle home you want to work, Source that environment file

248. What is concurrent request?      When a user runs a report, a request will be generated. The command to run that report is called Concurrent request

249. How do you rebuild the oraInventory?        1) If inventory_loc is not there in oraInst.loc, create it manually       2) Rename the corrupted globale inventory with a different name         3) Apply OUI patch(5035661)      4) Run the OUISetup.pl script on both IAS_ORACLE_HOME & RDBMS_ORACLE_ HOME       5) Change the permissions of new OraInventory        6) Run the runInstaller. sh command on $ORACLE_HOME/ appsoui/oui/ install

250. What are .fmb and .fmx files?     When you execute .fmb files, these files will be converted into .fmx

251. What is the use of restore.sh?      When you run restore.sh, it will come to previous stage like how it was.        Location: $ORACLE_HOME/ appsutil/ out/contextname/ MMDDhhmm/

252. What is Pasta?     Pasta is the utility to install the printers.

253. How do you kill group processes?        By using awk command

254. What is yellow bar? How to solve?     Whenever the clients are accessing the forms, due to the security problems, we get yellow bar warning.       To solve this problem, copy identitydb.obj from production to test system and run Jinitiator.

255. What is the use of SYSAUX tablespace?     SYSAUX  tablespace contains  statistical data.(It reduces the  burden of system)

256. What is PCTFREE & PCTUSED?                                                                  PCTFREE: The percentage of space reserved for future update of existing data. PCTUSED: The percentage of minimum space used for insertion of new row data. This value determines when the block gets back into Free List table.      

257. What does data block header contain?                                                     The header contains general information about the data; i.e. block address and type of segments (table, index, etc.). The header also contains information about the table and the actual row (address) that holds the data.

Page 19: Interview_Q1

258. What is Row Migration?                                                                           Oracle will try to shift the entire row from the current block to another block having 25 (10+15) units of free space.

259. What is Row Chaining?                                                                             When a row is so large that it cannot fit into one free block, Oracle will span the data into a number of blocks so that it can hold all of the data. The existence of such data results in "Row Chaining".  Row Chaining is the storage of data in a chain of blocks.

260. What is listener.ora & tnsnames.ora?                                                       listener.ora:  To connect to database, clients first contact a listener process that typically resides on database server.                                                                         It consists of listener, port, SID name, hostname.                                                             The listener logs will be $ORACLE_HOME/ network/log                                         tnsnames.ora: It is located at the client side and it stores net service names. It contains description, host, port, protocol, servicename, address. The location of these two configuration files is $ORACLE_HOME/ network/admin

261. Types of checkpoints?                                                                              Full checkpoint, Incremental checkpoint, Partial checkpoint

262.  Why do we get snapshot too old error?                                                  If undo tablespace is having insufficient space, we get this error.

263. What is profile?                                                                                        Profile controls the behaviour of applications

264.   What is the use of 3 Oracle Homes?                                                       There are three $ORACLE_HOME in Oracle Apps, Two for Application Tier (Middle Tier) and One in Database tier.                                                               8.0.6 ORACLE_HOME : On Application Tier used to store 8.0.6 techstack software. This is used by forms, reports & discoverer. ORACLE_HOME should point to this ORACLE_HOME which applying Apps Patch.                                    

IAS_ORACLE_HOME:  On Application Tier used by iAS (Web Server) techstack software. This is used by Web Listener & contains Apache.     RDBMS ORACLE_HOME: On Database Tier used by  Database Software usually 8i,9i or 10g database.

265. What is RDA?

RDA is a set of command line diagnostic scripts that are executed by an engine written in the Perl programming language. RDA is used to gather detailed information about an Oracle environment; the data gathered is in turn used to aid in problem diagnosis. The output is also useful for seeing the overall system configuration. Oracle Support encourages the use of RDA because it provides a comprehensive picture of the customer's environment. This can greatly reduce service request resolution time by minimizing the number of requests from Oracle Customer Support for more information. RDA is designed to be as unobtrusive as possible; it does not modify systems in any way, it only collects useful data for Oracle Customer Support.

266.  How to manually change the APPLSYS, APPS and APPLSYSPUB passwords for Applications? 

        All users should be log out of application.

        Shutdown the concurrent managers

Page 20: Interview_Q1

        Login as Sys Admin

        Navigate to SecurityOracleRegister

        At the same time, login as the SYSTEM user 

        In the applications session, enter the new password for APPLSYS

        Save the changes

        ALTER USER <APPLSYS USERNAME> IDENTIFIED BY <NEW PASSWORD>

        In the same applications session, change the APPS and APPLSYSPUB password

        Save the change

        ALTER USER APPLSYS IDENTIFIED BY XXX;                             ALTER USER APPS IDENTIFIED BY XXX;                       ALTER USER APPLSYS IDENTIFIED BY XXX;

        Open a new session in applications, without closing the previous session, and login

        Restart the concurrent managers                                                       

267. In a Multi Node Installation, how will you find which node is running what Services? 

Query the table FND_NODES and check for the columns                                   SUPPORT_CP for Concurrent Manager                                           SUPPORT_FORMS for Forms server                                                                      SUPPORT_WEB for Web Server                                                                          SUPPORT_ADMIN for Admin Server                                  SUPPORT_DB for database tier 

268.  Can FNDLIBR be restored if it is deleted?

Yes, you can restore FNDLIBR executables run adadmin on concurrent manager nodeselect option 2. Maintain Applications Files menu then select 1. Relink Applications programs when prompts for Enter list of products to link ('all' for all products) [all] select FND when prompt for Generate specific executables for each selected product [No] ? YES select YES & from list of executables select FNDLIBR This will create new FNDLIBR executables.

269.  What are .odf file in apps patch?

Page 21: Interview_Q1

  odf stands for Object Description Files used to create tables & other database objects

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

1 What is the adutilities ?2 When applying the patch if you get an error worker1 is failed then what utility is used toexamine the adutility ? and where the log files whill be stored ?3 What is adrelink ?4 If a library file libar.a contains raacet.o and oracle supports asks u to remove the raacet.ofile then how do you remove it from libar.a ?5 How does autopatch works ??6 What is adodfcmp?7 What is ADUNLOAD ?8 What is the use if FNDXLOAD ?9 when applying the patch if you get an error FND_INSTALL_ PROCESSES table alredyexists ? Then what do you do?

10 How do you clone the oracle applications ? What does adclone do ?11 How do you find out patch set level of applications ?12 patch history database ??13 what os commnad is used to find the version of a file ? and what is the oracle applications utility?14 What you do if your temp table space getting full frequently ?15 When do you rebuild Indexes ??16 How do you change the apps password ??17 How do you restrict the SQL access based on IP address ??18 What does the gather schema does ? how frequently you run this program ??19 If you try to run netca/netmgr on unix and you get an error unable to configurenetca,netmgr even though the files present in $OH/bin What could be the problem ?20 What do you do you do if records struck in the interface tables ????21 Oracle Applications has APPLSYSD,APPLSYSX ARE NOT LOCALLY MANAGEDTABLESPACE, HOW DO YOU REORGANIZE THESE TABLESPACE ?22 CAN I CONVERT SYSTM TABLESPACE FROM DICTIONARY TO LOCALLYMANAGED TABLESPACE IN 8I ???23 How to convert dictionary managable tablespact to locally managable tablespace ?24 Why is the table extending with the next extent that is specified even though it is a locallymanaged tablespace.

25 How to Resize a Datafile ??26 How to 'DROP' a Datafile from a Tablespace??27 How do you Determining the Source of Invalid Objects ???28 What is core fiel ? how do you examine the core file ??29 What command is used to find size of a process ???30 How do you find out what shared memorysegments are assigedn to different os users ??

Page 22: Interview_Q1

31 Some cases if you down the database even though shared memory is not released whatcommand is used to clear the shared memory ??32 How big i create the data file size ??

33 when do i go for multiple dbwr processes ???what parameters are considered ???34 When you run a report you got snapshot tool old error? what do you do ???35 How do i see what is there in redolog files ??36 How do you get the free space, used space for a tablesapce ??37 What is the difference between row migration and row chaining??38 How to Turn Archiving ON and OFF ???39 CAN ARCHIVING BE TURNED OFF/ON WITHOUT BOUNCING THE DATABASE?40 ALTER SYSTEM ARCHIVE LOG STOP DOES NOT TURN OFF ARCHIVELOG MODEThen what do you do ??41 How do you estimate the amount of redo per day??42 What you do if you get an error CANNOT ALLOCATE LOG, ARCHIVAL REQUIRED43 what is responsibility ??44 what is the use of responsibility key defining the responsibility ??45 what is a adata group ?46 what is Request Security group ?47 what is menu in oracle applications ??48 What is the profile option is used to set the window help ??49 Unable to login to personal home page after upgrade the database from 9.0.1.3 to 9.2.0.2 ??50 Cannot view Workflow Monitor Diagrams ??51 Unable to see online help ??52 while applying the patch if you get an error on database tire ??53 How to remove yello worning bar??54 How to communicate clients to the applications ?

55 How to release the space below high water mark ?56 What should be the size of redolog members ?57 How do i set optimal parameter for rollback segments ?58 Unable to allocate log sequence number ?59 How to find the paging space in AIX system ??60 how to find out the physical memory on AIX ??61 How to find out what divesies are defined to the system ??62 How to find the number of processor in a system ??63 How to estimate of the percentage of cpu and memory utilized by each process currentlyrunning ??64 how to determining how much paging activity is taking place on the system. Also givesuseful cpu usage info.65 How to determining disk utilization for each hard drive?66 How do I find out the operating system version?67 How do I found out the process memory space usage?68 How to find which instance owns which shared memory and semaphores On a Unix machinegive the following commands69 How do you generate Apps Forms menu modules or MMB files?70 How do you generate Apps Forms modules or FMB files?71 How do you generate Apps Forms library modules or PLL files?72 When do you have to regenerate your Apps Forms modules?73 What is compile_all= special?

Page 23: Interview_Q1

74 How do you get the latest package release?75 How can you affect the look and feel of your Apps forms?76 How do you disable direct Forms access through the http://host: port/dev60cgi/ f60cgi URL?77 How is Forms load balancing accomplished?78 How is Forms load balancing accomplished with Forms listener servlet?79 How to set up Forms to work through a firewall?80 Note down some important profile options in sysadmin point of view ???81 What is f60webmx?82 How can you recreate the f60webmx executable?83 How do you enable Forms Runtime Diagnostics (FRD) in Apps?84 Are there any changes to the Forms product components when in Forms listener servlet?85 How do you change the background color of a required item in Apps?86 How can you affect the look and feel of your Apps forms?87 How to create a custom event alert to fire against a custom table ??88 How to integrate custom applications with oracle applications? ??89 What are the actual executables called?90 What are some of the related Forms/Apps files?91 List most usefull profile options for concurrent managers ??92 How to find the files which contain the string MTL_SYSTEM_ITEMS_ KFV ?

93 Why do I have invalid objects? What causes them?94 Why does Oracle Support always tell me to recompile my invalid objects?95 Are invalid objects ever acceptable? How many is too many?96 Are invalid objects ever acceptable? How many is too many?97 If we do not use the application with the invalid objects, can we delete them?98 Which OBJECTS table is best to use for queries? ALL, USER or DBA?99 How can I recompile all my invalid objects using ADCOMPSC.pls?100 What Oracle Applications DBA has useful collection of SQL scripts.101 How to cancel the request which is submited by other user??102 How to bounce the http server for maximo ???103 Finding the maximum number of processes defined per user104 How to determine os file system block size in AIX??105 Is it posible to create a Database link without alias in tnsnames.ora ?106 How to determine size of a oracle process on Unix ?107 How do you create a database link with out changing tnsnames.ora file ??108 Grant privs to access v$ views ?109 What command is used to find the zombi processes /dead process in unix?110 How to kill all the processes under perticulat file system ?111 How to find what are the products installed in your database ?112 Create a directory with the user privaliges from root113 Exporting a database from 9i and Importing on 8.1.7 database114 How to find the file size greater than 2Gb ?115 How to determine the size of a Table ?116 How do I restrict or allow a few client machines to connect to Server ?117 Export file Greater than 2GB is not a problem in 8I ?118 How to eliminate migrated or chained rows ?119 Performance Measurement of PLSQL code by DBMS_PROFILER120 When to rebuid an index ?121 Explain the analytical functions with examples

• ROLLUP AND CUBE AGGREGATE FUNCTIONS• RANKED FUNCTION• CASE

Page 24: Interview_Q1

• LAG AND LEAD FUNCTION• RATIO_TO_REPORT

122 What is High Water Mark ?

123. what is the utility used to licence a product ? Is it possible to delicence a product which isfully licenced ?

124 How to find the version of iAS ?125 How to generate a report on Unix ?126 How to generate a report on NT ?127 Running SQL*Trace on an Applications Report ?128 How to find ojsp version ?

1 What is the adutilities ?

A: AD Utilities are a group of tools designed to install, upgrade, maintain, and patch a specific set of products contained in a given release of Oracle Applications.

2 When applying the patch if you get an error worker1 is failed then what utility is used toexamine the adutility ? and where the log files whill be stored ?

A: adctrl, $APPL_TOP/admin/ <SID>/log

3 What is adrelink ?

AD Relink (or adrelink) allows you to relink Oracle Applications executable programs with the Oracle Server product libraries. You can run the adrelink utility manually to relink individual executable programs, or use the relink option in the AD Administration utility to relink all executable programs.

adrelink force=y ranlib=y "ar RAXTRX"$adrelink force=y ranlib=y "fnd all"

3 If a library file libar.a contains raacet.o and oracle supports asks u to remove the raacet.ofile then how do you remove it from libar.a ?

ar -d libar.a raacet.o

5 How does autopatch works ??

The following steps summarize the way autopatch works:

1. You log in as applmgr and run your applications environment file.

2. Unload the new software into a patch directory and start the autopatch utility under a Bourne or Korn shell.

3. After you answer some questions, Autopatch identifies the Oracle Applications products that need to be updated.

Page 25: Interview_Q1

4. Autopatch extracts the appropriate files from each product's C library. (adlibout,adlibout. log)

5. Autopatch compares the extracted object modules (C libraries) with their corresponding files in the patch directory. It also makes this type of comparison with files such as forms, reports, and SQL scripts. (admvcode, admvcode.log)

6. If a file in the patch directory is a more recent version than the product's current file, autopatch backs up the product's current file by appending "O" to it's filename. (Every file in $APPL_TOP has version information inside it)

7. Autopatch then replaces each product_s outdated files with newer files from the patch directory.

8. Autopatch loads the new object modules into the C libraries. (adlibin, adlibin.log)

9. Autopatch backs up any files you listed in adlinkbk.txt. (this occurs in Rel 11.X only)

10. Autopatch relinks the Oracle Applications products with the Oracle Database. (adrelink, aderlink.log)

11. Autopatch runs sql scripts and exec commands, which change Oracle Applications database objects. By default, autopatch does this in parallel.

12. Autopatch copies any specified PL/SQL, Java, HTML, or media files to their respective destinations.

13. Autopatch generates Oracle Forms files.

14. Autopatch generates Oracle Reports files.

15. Autopatch appends a record of how it changed your system to applptch.txt inthe $APPLT_TOP directory.

6 What is adodfcmp?

adodfcmp is an object comparisan utility.$adodfcmp <parameter>= <value> [<parameter> =<value> ]

7 What is ADUNLOAD ?

This utility is used to unload Oracle Applications product files from CD-ROM. The unload utility is provided in case you need to unload a small number of files after you have installed or upgraded your system

$adunload product=gl

$adunload product=gl directory=forms/ US filename=GLSTUOM. fmb

8 What is the use if FNDXLOAD ?

FNDXLOAD is a concurrent program that can move Oracle Applications seed data between

Page 26: Interview_Q1

database and text file representations. The loader reads a configuration file to determinewhat data to access. For information on specific configuration files consult the Open Interfaces Guide for your product group. The following sections describe the operation of the Generic Data Loader.

FNDXLOAD <username/password> 0 YUPLOAD | DOWNLOAD <config_file> <data_file><entity> [<parameters> ]where<username/password> is the APPLSYS account<config_file> is the configuration file<data_file> is the file that will be read or written<entity> dentifies the entity to upload or download<paramaters> is a list of optional parameters of the formAME=VALUE. Parameters vary for eachonfiguration file. Review the documentation forour configuration file for a list of parameters thatan be set.

9 when applying the patch if you get an error FND_INSTALL_ PROCESSES table alredyexists ? Then what do you do?

If previous patch is not applied successfully then this table will not drop, You have to login to sql as applsys/apps then drop this table and reapply the patch.

10 How do you clone the oracle applications ? What does adclone do ?adcloneautoconfgmanual cloning(not supported)11 How do you find out patch set level of applications ?patches.sh, adutconf.sql

12 patch history database ??

applptch.txt or ad_applied_patches( table)

13 what os commnad is used to find the version of a file ? and what is the oracle applications utility?

strings -s <file name> | grep "Header" or adident <file name>

14 What you do if your temp table space getting full frequently ?

Create new temp tablespace,assign all users temp tablespace newone.drop old temp tablespad >

or

increase the temp tablespace size

1) Create the new temporary tablespace temp_local;

Ex: create temporary tablespace temp_local

Page 27: Interview_Q1

tempfile '/testdata/testdata /temp_local. dbf' size 1500Mextent management local uniform size 150K

2) Change the users temporary tablespace to new one.

select 'alter user ' || username|| ' temporary tablespace temp_local;'from dba_userswhere temporary_tablespac e='TEMP'

run the spool file created above

3) You cannot drop the temp tablespace directoly check the default temporary tablespacefor this instance

select * from database_propertieswhere property_name = 'DEFAULT_TEMP_ TABLESPACE' ;

the above query will show the old temp tablespace as default temporary tablespac.

4) Assign the default temporary tablespace to new one

alter database default temporary tablespace temp_local;

5) Drop the old temporary tablespace

drop tablespace temp including contents;

drop tablespace TEMP2 including contents and datafiles;

15 When do you rebuild Indexes ??Please review articles 77574.1 and 108573.1

16 How do you change the apps password ??

FNDCPASS

Usage: FNDCPASS logon 0 Y system/password mode username new_passwordwhere logon is username/password[ @connect]system/password is password of the system account of that databasemode is SYSTEM/USER/ ORACLEusername is the username where you want to change its passwordnew_password is the new password in unencrypted formatexample FNDCPASS apps/apps 0 Y system/manager SYSTEM APPLSYS WELCOMEFNDCPASS apps/apps 0 Y system/manager ORACLE GL GL1FNDCPASS apps/apps 0 Y system/manager USER VISION WELCOME

Some you may need to change the password even after using the above utility the file name isas wdbsvr.app

17 How do you restrict the SQL access based on IP address ??

SQLNET.ora

Page 28: Interview_Q1

tcp.validnode_ checking= yestcp.invited_ nodes=(10. 190.0.21, 10.190.0. 25)#tcp.exclude_ nodes

18 What does the gather schema does ? how frequently you run this program ??

Collect the statistics for the schemas/specified schema which will increase the performance

19 If you try to run netca/netmgr on unix and you get an error unable to configurenetca,netmgr even though the files present in $OH/bin What could be the problem ?

A: note set $ORACLE_HOME/ lib33 for LD_LIBRARY_PATH

20 What do you do you do if records struck in the interface tables ????

A: Fine out the error in enterface table, rectifie the error by updateing the records in interface tablles. Re submit the import.

21 Oracle Applications has APPLSYSD,APPLSYSX ARE NOT LOCALLY MANAGEDTABLESPACE, HOW DO YOU REORGANIZE THESE TABLESPACE ?

EXPORT /IMPORT

22 CAN I CONVERT SYSTM TABLESPACE FROM DICTIONARY TO LOCALLYMANAGED TABLESPACE IN 8I ???

NO, BUT POSIBLE IN 9i(2)

23 How to convert dictionary managable tablespact to locally managable tablespace ?You migrate a locally managed tablespace and get the following error message:

1 - There is no data in the tablespace : ORA-03214

SQL> create tablespace MIGTOLOC2 datafile '/ora/ora901/ oradata/V901/ migtoloc01. dbf'3 size 10K EXTENT MANAGEMENT DICTIONARY;

Tablespace created.

SQL> execute sys.dbms_space_ admin.tablespace _migrate_ to_local( -> tablespace_name= >'MIGTOLOC' ,-> rfno=>9);BEGIN sys.dbms_space_ admin.tablespace _migrate_ to_local( tablespace_ name=>'MIGTOLOC' ,rfno=>9) ; END;

*ERROR at line 1:ORA-03214: File Size specified is smaller than minimum requiredORA-06512: at "SYS.DBMS_SPACE_ ADMIN", line 0ORA-06512: at line 1

2 - There are some data in the tablespace : ORA-03244

Page 29: Interview_Q1

SQL> create tablespace MIGTOLOC2 datafile '/ora/ora901/ oradata/V901/ migtoloc01. dbf'3 size 20K EXTENT MANAGEMENT DICTIONARY;Tablespace created.

SQL> create table TMIG (c number) tablespace MIGTOLOC;Table created.

SQL> execute sys.dbms_space_ admin.tablespace _migrate_ to_local( -> tablespace_name= >'MIGTOLOC' ,-> rfno=>9);BEGIN sys.dbms_space_ admin.tablespace _migrate_ to_local( tablespace_ name=>'MIGTOLOC' ,rfno=>9) ; END;

*ERROR at line 1:ORA-03244: No free space found to place the control informationORA-06512: at "SYS.DBMS_SPACE_ ADMIN", line 0ORA-06512: at line 1

Solution Description:------------ ---------

Increase the size for the datafile :

SQL> alter database datafile '/ora/ora901/ oradata/V901/ migtoloc01. dbf'2 resize 100K;Database altered.

SQL> execute sys.dbms_space_ admin.tablespace _migrate_ to_local( -> tablespace_name= >'MIGTOLOC' ,-> rfno=>9);PL/SQL procedure successfully completed.

Explanation:------------When converting a tablespace from dictionary management to local management, Oracle creates bitmaps in the datafile. Therefore the required space needs to be available in the datafile.

Next Extent Size After Migrating Tablespace from Dictionary to Locally Managed

MIGRATED TABLESPACES------------ --------After migrating a dictionary managed tablespace to locally managed tablespace, the tables are still extending with the next extent specified even though it is now a locally managed tablespace.

Example:============ ========= ========= ========= ========= ==

Page 30: Interview_Q1

MIGRATE FROM DICTIONARY MANAGED TO LOCALLY MANAGED============ ========= ========= ========= ========= ==

SQL> begin2 dbms_space_admin. tablespace_ migrate_to_ local3 (tablespace_ name=> 'USERS', rfno=>5);4 end;5 /PL/SQL procedure successfully completed.

============ ========= ========= ========= ========Verify that tablespace is now locally-managed:============ ========= ========= ========= ========

SQL> select TABLESPACE_NAME, EXTENT_MANAGEMENT2 FROM DBA_TABLESPACES3 where tablespace_name = 'USERS';TABLESPACE_NAME EXTENT_MAN------------ --------- --------- ----------USERS LOCAL============ ========= ========= ========= ========= =CREATE TABLE with the storage segments;============ ========= ========= ========= ========= =SQL> create table DW_GSO_COLLN_ NEW2 tablespace USERS3 storage (initial 500M next 500M pctincrease 0)4 as select * from cdwadm.dw_gso_ colln5 where rownum < 10000000;Table created.SQL> select segment_name, extent_id, bytes2 from dba_extents3 where segment_name= 'DW_GSO_COLLN_ NEW';SEGMENT_NAME EXTENT_ID BYTES------------ --------- --------- ---------- ----------DW_GSO_COLLN_ NEW 0 524288000DW_GSO_COLLN_ NEW 1 524288000DW_GSO_COLLN_ NEW 2 524288000QUESTION:

24Why is the table extending with the next extent that is specified even though it is a locallymanaged tablespace.

ANSWER:Migrated tablespaces are not subject to the UNIFORM/SYSTEM policy of newly created locally managed tablespaces. This would be too difficult to implement, since the tablespace is likely to contain the existing objects which already aviolate new policy. For this reason, migrated tablespace only support the sameallocation policy as the dictionary tablespaces. If you select from DBA_TABLESPACES, you should see "USER" value in the ALLOCATION_TYPE column for migrated tablespaces, and UNIFORM or SYSTEM value for tablespaces which were created as locally managed. Therefore, the user does not get the policy benefits from migration, but can still get performance benefits - no ST enqueue contention and more efficient extent operations.

Page 31: Interview_Q1

SQL> select TABLESPACE_NAME, EXTENT_MANAGEMENT, ALLOCATION_TYPE, PLUGGED_IN2 from DBA_TABLESPACES;

25 How to Resize a Datafile??

How to Resize a Datafile:============ ========= ====

Datafile management has two sides to it: not enough room for existingdatafiles, or not enough room IN existing datafiles. Typical solutions are to drop and recreate the tablespace with different sized datafiles, or to add more datafiles to a tablespace.

RESIZE. This option allows you to change the physical size of a datafile from what was specified during its creation.

I. Increase Datafile SizeII. Decrease Datafile SizeIII. Cautions and Warnings

Attempting to use the RESIZE command on versions prior to 7.2 will receive the following error:

ORA-00923: FROM keyword not found where expected

I. INCREASE DATAFILE SIZE

To increase the size of a datafile, you would use the command:

ALTER DATABASE DATAFILE '<full_path_ name>' RESIZE <integer> [K|M];

where the size specified is larger than the existing file size. CheckV$DATAFILE for current settings. The BYTES column shows the current size of the datafile, and the CREATE_BYTES column shows what the size was specified when the file was created. The size of the datafile will also be changed at the operating system level.

For example:

FILE# STATUS ENABLED CHECKPOINT BYTES CREATE_BYT NAME------ ------- ---------- ---------- -------- ---------- ------------ ----5 ONLINE READ WRITE 7450 2097152 102400 /databases/oracle/ test.dbf

As you can see, the file was created with a size of 100K (CREATE_BYTES) and was increased to a size of 2MB (BYTES) with the RESIZE command.

II. DECREASE DATAFILE SIZE

Page 32: Interview_Q1

To decrease the size of a datafile, you use the same command, but specify a size smaller than the existing datafile. For example, we could reduce the file above back to 1MB with the command:

ALTER DATABASE DATAFILE '/databases/ oracle/test. dbf' RESIZE 1MB;

Downsizing a datafile is more complicated than increasing the size of adatafile. You cannot deallocate space from a datafile that is currently being used by database objects. To remove space from a datafile, you have to have contiguous space at the END of the datafile.Check the view

DBA_FREE_SPACE to see how much space is not being used in a datafile. For the above file we get:

SELECT * FROM DBA_FREE_SPACEWHERE TABLESPACE_NAME= 'TEMP'ORDER BY BLOCK_ID;

TABLESPACE_NAME FILE_ID BLOCK_ID BYTES BLOCKS------------ ------ ---------- ---------- ---------- ----------TEMP 4 2 102400 50TEMP 4 55 96256 47TEMP 4 102 1890304 923

As you can see, there are two large extents at the high end of the datafile (BLOCK_ID = 55 and contains 47 blocks, BLOCK_ID=102 and contains 923 blocks). This means there are 1986560 unused bytes at the end of our datafile, almost 2MB. We want to leave some room for growth in our datafile, and depending on how the objects in that datafile allocate new extents, we could remove easily up to 1.89MB of disk space from the datafile without damaging any objects in the tablespace.

If you have a large extent in the middle of a datafile, and some object taking up room at the end of the datafile, you can use the query FINDEXT.SQL to find this object. If you export this object, then drop it, you should then free up contiguous space at the end of your datafile so you will be able to resize it smaller. Make sure you leave enough room in the datafile for importing the object back into the tablespace.

FINDEXT.SQLScript to find database object locations for a given datafile.

REM findext.sqlREM This script prompts user for a datafile ID number, andREM then lists all the segments contained in that datafile,REM the blockid where it starts, and how many blocks theREM segment contains. It shows the owner, segment name, andREM segment type

SET ECHO OFFttitle - center 'Segment Extent Summary' skip 2col ownr format a8 heading 'Owner' justify ccol type format a8 heading 'Type' justify c trunccol name format a28 heading 'Segment Name' justify ccol exid format 990 heading 'Extent#' justify ccol fiid format 9990 heading 'File#' justify ccol blid format 99990 heading 'Block#' justify c

Page 33: Interview_Q1

col blks format 999,990 heading 'Blocks' justify cselectowner ownr,segment_name name,segment_type type,extent_id exid,file_id fiid,block_id blid,blocks blksfromdba_extentswhere file_id = &file_id order by block_id/

Example Output:

SQL> @findext.sqlEnter value for file_id: 5old 12: file_id = &file_idnew 12: file_id = 5

Segment Extent Summary

Owner Segment Name Type Extent# File# Block# Blocks-------- ------------ -------- ------- ------ ------- --------USER EMP TABLE 0 5 2 5USER TAB3 TABLE 0 5 108 5USER TEST TABLE 0 5 348 5USER PK_EMP INDEX 0 5 483 5USER EMP TABLE 1 5 433 5USER EMP TABLE 2 5 438 10USER PK_EMP INDEX 1 5 488 10

III. CAUTIONS AND WARNINGS

For safety reasons, you should take a backup of your database whenever you change its structure, which includes altering the size of datafiles.

If you try to resize a datafile to a size smaller than is needed to contain all the database objects in that datafile, you will get an error:

ORA-03297: file contains <number> blocks of data beyond requested RESIZE value

The resize operation will fail at this point.

If you try to resize a datafile larger than can be created, you will also get an error. For instance, in trying to create a file of 2GIG, without 2GIG of available disk space you will get something similar to:ORA-01237: cannot extend datafile <number>ORA-01110: data file <number>: '<full_path_ name>'ORA-09971: sfsfs: write error, unable to write header block.

If you check V$DATAFILE, you will see that the file size does not change unless the operation is successful.

Page 34: Interview_Q1

Finally, if using multiple database writers (db_writers > 1), you might run into [BUG:311905] . This appears as ORA-7374 errors when accessing the datafile after it has been resized. The workaround is to shutdown and restart the database after resizing a datafile (a convenient time to take a backup). This will cause the new datafile size information to be refreshed to all the dbwr slave processes. This bug is fixed in RDBMS version 7.3.3.

MANUAL versus AUTOMATIC extension:

Be careful giving datafiles the AUTOEXTEND attribute, certainly specify the NEXT and MAXSIZE parameters, set appropriate values for the default storage parameters on tablespace level and MAXEXTENTS; for objects in these tablespaces specify explicitly INITIAL and NEXT extent size as well as MAXEXTENTS; avoid UNLIMITED sizes and extents to prevent objects with a very high number of extents will be created; this causes not only

a huge number of records in the dictionary tables, but dropping them will take a very long time while smon is consuming all cpu resources it can get.

26 How to 'DROP' a Datafile from a Tablespace?

How to 'DROP' a Datafile from a Tablespace:============ ========= ========= ========= ====

Before we start with detailed explanations of the process involved, please note that Oracle does not provide an interface for dropping datafiles in the same way that you could drop a schema object such as a table, a view, a user, etc. Once you make a datafile part of a tablespace, the datafile CANNOT be removed, although we can use some workarounds. Before performing certain operations such as taking tablespaces/ datafiles offline, and trying to drop them, ensure you have a full backup. If the datafile you wish to remove is the only datafile in that tablespace, simply drop the entire tablespace using:

DROP TABLESPACE <tablespace name> INCLUDING CONTENTS;

You can confirm how many datafiles make up a tablespace by running thefollowing query:

select file_name, tablespace_namefrom dba_data_fileswhere tablespace_name ='<name of tablespace>' ;

The DROP TABLESPACE command removes the tablespace, the datafile, and the tablespace's contents from the data dictionary. Oracle will no longer have access to ANY object that was contained in this tablespace. The physical datafile must then be removed using an operating system command (Oracle NEVER physically removes any datafiles). Depending on which platform you try this on, you may not be able to physically delete the datafile until Oracle is completely shut down. (For example, on Windows NT, you may have to shutdown Oracle AND stop the associated service before the operating system will allow you to delete the file - in some cases, file locks are still held by Oracle.)

Page 35: Interview_Q1

If you have more than one datafile in the tablespace, and you do NOT need the information contained in that tablespace, or if you can easily recreate the information in this tablespace, then use the same command as above:

DROP TABLESPACE <tablespace name> INCLUDING CONTENTS;

Again, this will remove the tablespace, the datafiles, and the tablespace's contents from the data dictionary. Oracle will no longer have access to ANY object that was contained in this tablespace. You can then use CREATE TABLESPACE and re-import the appropriate objects back into the tablespace. If you have more than one datafile in the tablespace and you wish to keep the objects that reside in the other datafile(s) which are part of this tablespace, then you must export all the objects inside the affected tablespace. Gather information on the current datafiles within the tablespace by running this query:

select file_name, tablespace_namefrom dba_data_fileswhere tablespace_name ='<name of tablespace>' ;

Make sure you specify the tablespace name in capital letters. In order to allow you to identify which objects are inside the affected tablespace for the purposes of running your export, use the following query:

select owner,segment_ name,segment_ typefrom dba_segmentswhere tablespace_name= '<name of tablespace>'

Now, export all the objects that you wish to keep. Once the export is done, issue the DROP TABLESPACE tablespace INCLUDING CONTENTS.Note that this PERMANENTLY removes all objects in this tablespace. Delete the datafiles belonging to this tablespace using the operating system. (See the comment above about possible problems in doing this.) Recreate the tablespace with the datafile(s) desired, then import the objects into that tablespace. (This may have to be done at the table level, depending on how the tablespace was organized.)

NOTE:The ALTER DATABASE DATAFILE <datafile name> OFFLINE DROP command, is not meant to allow you to remove a datafile. What the command really means is that you are offlining the datafile with the intention of dropping the tablespace. If you are running in archivelog mode, you can also use:

ALTER DATABASE DATAFILE <datafile name> OFFLINE;

instead of OFFLINE DROP. Once the datafile is offline, Oracle no longerattempts to access it, but it is still considered part of that tablespace. This datafile is marked only as offline in the controlfile and there is no SCN comparison done between the controlfile and the datafile during startup (This also allows you to startup a database with a non-critical datafile missing). The entry for that datafile is not deleted from the controlfile to give us the opportunity to recover that datafile. If you do not wish to follow any of these procedures, there are other things that can be done besides dropping the tablespace.- If the reason you wanted to drop the file is because you mistakenly created the file of the wrong size, then consider using the RESIZE command.See 'Related Documents' below.

Page 36: Interview_Q1

- If you really added the datafile by mistake, and Oracle has not yet allocated any space within this datafile, then you can useALTER DATABASE DATAFILE <filename> RESIZE;

command to make the file smaller than 5 Oracle blocks. If the datafile is resized to smaller than 5 oracle blocks, then it will never be considered for extent allocation. At some later date, the tablespace can be rebuilt to exclude the incorrect datafile.

27 How do you Determining the Source of Invalid Objects ???

Identifying Problem Object(s)------------ --------- -------

The following SQL*Plus query may be used to identify the object which isthe source of the problem:

sql> SELECT owner, object_type, object_nameFROM dba_objectsWHERE status = 'INVALID'AND object_name IN (SELECT referenced_nameFROM dba_dependenciesWHERE name = '<INVALID_OBJECT_ NAME>');

For this query to work, select privilege to the dba_dependencies anddba_objects is required. The actual invalid object name must besubstituted for the <INVALID_OBJECT_ NAME> as indicated above.

The subquery finds all the objects that the invalid object depends on.The outer query brings up the owner, type, and name for any invalid objectson which the INVALID_OBJECT depends. This identifies the source package(s)and eliminates wasted time attempting to compile the wrong objects.

This query should be run interactively, replacing the value ofINVALID_OBJECT_ NAME until zero rows are returned.

Validating Objects------------ ------

When the above query on an object returns zero rows, attempt to validate thatobject name using the following command:

ALTER PACKAGE invalid_pkg_ name COMPILE;

If it compiles, then try recompiling those objects that were dependent onthat object. If it doesn't compile, issue the following command from withinSQL*Plus.

sql>SHOW ERRORS

Or use the following SQL command and search the dba_errors table:

sql> SELECT NAME,TEXT FROM DBA_ERRORS WHERE NAME ='<INVALID_OBJECT_ NAME>';

Page 37: Interview_Q1

Use the results from that query to further diagnose the problem(s).

EXAMPLE:

Suppose we have the following object dependencies:

Pkg1 (Invalid)||_______|____ ___| |Pkg2 (Invalid) Pkg3 (Valid)|_______|____ ____| |Pkg4 (Valid) Pkg5 (Invalid)

Use the following SELECT statement:

sql> SELECT owner, object_type, object_nameFROM dba_objectsWHERE status = 'INVALID'AND object_name IN (SELECT referenced_nameFROM dba_dependenciesWHERE name = 'PKG1');

The following information is returned:

OWNER OBJECT_TYPE OBJECT_NAMEAPPS PACKAGE PKG2

Run the query again for PKG2 instead of PKG1; PKG5 will be returned.Run the query once more for PKG5 which then returns zero rows.

This indicates that because PKG5 is invalid, it is preventingthe proper compilation of packages PKG2 and PKG1.

Therefore, it is necessary to either rebuild, or determine the problemsassociated with PKG5 before the other two packages will compile.

28 What is core fiel ? how do you examine the core file ??

A: system resource(memory leak etc) dbx utility to examine the same.

Introduction~~~~~~~~~~~~This short article aims explain how to get a stack trace from acore dump produced by any of the Oracle products. By followingthe steps below you can provide Oracle Support with vitalinformation to help identify the cause of a problem.

Please note that it is important to include information about

Page 38: Interview_Q1

the tool being used, any code involved, the operation beingperformed, environment etc.. in addition to the details below.

What is a 'core dump' ?~~~~~~~~~~~~ ~~~~~~~~~ ~~A core dump is an image copy of a processes state at theinstant it 'aborted'. It is produced in the form of a filecalled 'core' usually located in the current directory.

What causes a core dump ?~~~~~~~~~~~~ ~~~~~~~~~ ~~~~There are many situations which can cause a core dump to beproduced, but it is usually because the process has attemptedto do something which the operating system does not like. Themost common causes of this are:

The program tried to access memory outside its allowed range.

The program tried to obtain a resource which was eitherexhausted or unavailable.

An attempt was made to execute illegal instructions.

An attempt was made to read unaligned data

In Unix systems the offending process is sent one of a numberof signals which force a core dump to be produced. It is alsopossible for a user to produce a core dump by sending one ofthese signals to a process manually.

What should I do if I get a core dump ?~~~~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~As with any problem you should first note down the FULL versionnumbers of the product, the RDBMS, PL/SQL (if used) and anyrelated products.

You should also note the EXACT command you were running whenthis occurred. Eg: If it was a SQL*Forms problem and you wereusing 'mrunform30' , write this down. This command will bereferred to as 'program' below.

Now follow the instructions below in order:

1) Check you have a 'core' file, it should be in the directorywhere the command was issued, or in $ORACLE_HOME/ dbs OR$ORACLE_HOME/ dbs/core_ NNNNN if it is the 'oracle' executable.

2) Log in as ORACLE and change in to the $ORACLE_HOME/ bindirectory. Enter the command:

file program

and write the result down letter for letter. If the word'dynamic' or 'dynamically linked' appears in the output of this

Page 39: Interview_Q1

command then please make a note of this as there are a fewplatforms on which Oracle does NOT support dynamic linking andthis may be the cause of your problem.

3) Now enter:

chmod +r program

to add read permission to the program.

4) Log out , then log in as the user who encountered the error.The next step will vary slightly depending on which versionof Unix you are using. One of the following commands shouldexist on your machine - try each in order until you find onethat exists:

Command NB Exit command Stack Trace command------- -- ------------ ------------ -------dbx quit wherexdb (HPUX 10) quit tgdb (HPUX 11) q btdde (HPUX 11) q btsdb q tadb $q (or Ctrl-D) $cdebug (PTX only) quit stackgdb (Linux) quit bt

Change to the directory where the core dump is located andenter the commands as in the relevant example below. If youare not sure which program produced the 'core' file then onsome Unix platforms the command 'file core' will tell youthe executable name that the core file is from (this doesnot work on ALL Unix platforms, see note below.).Example commands:

DBX: $ script /tmp/mystack$ dbx $ORACLE_HOME/ bin/<program> core(dbx) where... << Stack should appear here(dbx) quit$ exit

XDB: $ script /tmp/mystack$ xdb $ORACLE_HOME/ bin/<program> core(xdb) t... << Stack should appear here(xdb) quit$ exit

SDB: $ script /tmp/mystack$ sdb $ORACLE_HOME/ bin/<program> core(sdb) t... << Stack should appear here

Page 40: Interview_Q1

(sdb) q$ exit

(NOTE: In the 'adb' commands below literally type the $c& $q)ADB: $ script /tmp/mystack$ adb $ORACLE_HOME/ bin/<program> core$c << NB: adb has no prompt so justenter $c...$q$ exit

DEBUG: $ script /tmp/mystack$ debug -c core $ORACLE_HOME/ bin/<program>debug> stack... << Stack should appear heredebug> quit$ exit

GDB: $ script /tmp/mystack$ gdb $ORACLE_HOME/ bin/<program> core(gdb) bt... << Stack should appear here(gdb) quit$ exit

DDE: $ script /tmp/mystack$ dde -ui line core$ORACLE_HOME/ bin/<program>dde> bt...dde> q$exit

Assuming this worked then the stack trace should be shown inthe file '/tmp/mystack' . Upload this to Oracle Support.

5) If the debug command failed to give a stack trace then tryusing a different debugger from the list above (ifavailable). If all debuggers fail then there is probably aproblem with either the permissions or the file type - seethe section below and then contact Oracle Support with allthe details you have so far.

Common reasons for not getting a sensible stack~~~~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~Filesize Limits:Note that on some machines there may be a kernel parameteroruser limit which controls the maximum size of core file thatcan be produced - you can usually check this by typing:

limit in the C shellOR ulimit -a in the Bourne / Korn shells.

Page 41: Interview_Q1

If this limit is too small the core file will be useless -raise the limit and reproduce the problem.

Stripped ExecutableSome program executables are stripped of symbol information.This makes the stack trace useless. If 'file program' showsthe word 'stripped' or 'nm program' shows no output then itis likely that the executable is stripped of symbolicinformation.

In this case the problem tool must be relinked without beingstripped - on most Unix platforms this involves ensuringthere is no '-s' option on the link line. Contact OracleSupport with details of the link line used to link the tool.

HP UnixSome platforms like HP Unix need a special object filelinking in at link time to ensure symbols in shared objectscan be reported by the debug tool. Typically this involvesrelinking the tool including /usr/lib/end. o on the linkline. The location of this special file may be differentdepending on your HPUX version. 'xdb' generally tells youthe location of this file if it was not linked into theexecutable.

If 'file core' does not return the executable name:~~~~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~Try using the 'strings' command:csh> setenv LANG Corksh> LANG=C;export LANG ...to get rid of non-ASCIIcharacters return by 'strings'> strings -a core | moreThe first part of the output may reveal the executable name.

29 What command is used to find size of a process ???

ps -aefl

30 How do you find out what shared memorysegments are assigedn to different os users ??

ipcs -s

31 Some cases if you down the database even though shared memory is not released whatcommand is used to clear the shared memory ??

ipcrm

32 How big i create the data file size ??

Identifying the Oracle database datafile maxsize on a given platform

Page 42: Interview_Q1

There are always some ambiguity on the datafile size limit on a given platform and version of the database. Here is a simple way of identifying to what size a datafile can grow maximum and then switch to the next datafile. To identify the same lets create a tablespace with some default value and set the autoextend on without the MAXSIZE specified.

SVRMGR>Create tablespace WORK_SPACE_DATA datafile'/keg4/oradata/ fpdev1/work_ space_data01. dbf' size 400M AUTOEXTEND ONEXTENT MANAGEMENT LOCAL UNIFORM SIZE 4M NOLOGGING;

Lets get the file id of the datafile created for the WORK_SPACE_DATA tablespace.

SVRMGR>select file_id,file_ name,autoextensi ble from dba_data_fileswhere tablespace_name like 'WORK_SPACE_ DATA';

FILE_ID AUT FILE_NAME---------- --- -------31 YES /keg4/oradata/ fpdev1/work_ space_data01. dbf

Querying the filext$ table we can get the value of the maximum size in database blocks the datafile can grow before switching to the next file. So technically this must be the maximum filesize that oracle can presumably understand for a database datafile.

SVRMGR> select * from filext$where file# = 31;

FILE# MAXEXTEND INC---------- ---------- ----------31 4194302 1

Setting the default would give you a maximum value of 4194302 blocks with increments of 1block when the datafile extends.

On a database of 8K block size this would work out to be,

SVRMGR> select (4194302*8192) /1024/1024/ 1024 Max from dual;Max----------31.9999847

So, the database datafile can have a maximum size of 32Gb on a 8k database block size and Sun Solaris8 platform. The above shows that the dependency is on the database block size for a given platform. Also if we do not set the MAXSIZE for the datafile , then the first datafile would grow to the MAXEXTEND value and only then would shift to the next datafile for a given tablespace with multiple datafiles. So it is imperative to set the MAXSIZE value when turning on the AUTOEXTEND option.

33 when do i go for multiple dbwr processes ???what parameters are considered ???

34 When you run a report you got snapshot tool old error? what do you do ???

Page 43: Interview_Q1

Shrink the rollback segment and then re-run the report or assign private rollback segment to report

35 How do i see what is there in redolog files ??

logminor.

36 How do you get the free space, used space for a tablesapce ??

SELECT SUBSTR(FILE_ NAME,1,30) file_name, a.file_id file#,A.TABLESPACE_ NAME,A.BYTES/ (1024*1024) totsize,(A.BYTES/(1024* 1024)- round(nvl(SUM( B.BYTES/( 1024*1024) ),0),2)) used,nvl(round(SUM( B.BYTES/( 1024*1024) ),2),0) "FREE"FROM DBA_DATA_FILES A,DBA_FREE_SPACE BWHERE A.TABLESPACE_ NAME =B.TABLESPACE_ NAME(+)AND A.FILE_ID =B.FILE_ID(+ )AND A.TABLESPACE_ NAME='SYSTEM'GROUP BY SUBSTR(FILE_ NAME,1,30) , A.TABLESPACE_ NAME,A.BYTES/ (1024*1024) ,a.file_idorder by 2

37 What is the difference between row migration and row chaining??

Concepts--------There are two circumstances when this can occur, the data for a row in a table may be too large to fit into a single data block. This can be caused by either row chaining or row migration.

Chaining---------Occurs when the row is too large to fit into one data block when it is first inserted. In this case, Oracle stores the data for the row in a chain of data blocks (one or more) reserved for that segment. Row chaining most often occurs with large rows, such as rows that contain a column of datatype LONG, LONG RAW, LOB, etc. Row chaining in these cases is unavoidable.

Migration----------Occurs when a row that originally fitted into one data block is updated so that the overall row length increases, and the block's free space is already completely filled. In this case, Oracle migrates the data for the entire row to a new data block, assuming the entire row can fit in a new block. Oracle preserves the original row piece of a migrated row to point to the new blockcontaining the migrated row: the rowid of a migrated row does not change. When a row is chained or migrated, performance associated with this row decreases because Oracle must scan more than one data block to retrieve the information for that row.o INSERT and UPDATE statements that cause migration and chaining perform poorly,because they perform additional processing.o SELECTs that use an index to select migrated or chained rows must perform additional I/Os.

Detection---------

Page 44: Interview_Q1

Migrated and chained rows in a table or cluster can be identified by using the ANALYZE command with the LIST CHAINED ROWS option. This command collects information about each migrated or chained row and places this information into a specified output table. To create the table that holds the chained rows, execute script UTLCHAIN.SQL.

SQL> ANALYZE TABLE scott.emp LIST CHAINED ROWS;SQL> SELECT * FROM chained_rows;You can also detect migrated and chained rows by checking the 'table fetch continued row' statistic in the v$sysstat view.

SQL> SELECT name, value FROM v$sysstat WHERE name = 'table fetch continued row';NAME VALUE------------ --------- --------- --------- --------- --------- - ---------table fetch continued row 308

Although migration and chaining are two different things, internally they are represented by Oracle as one. When detecting migration and chaining of rows you should analyze carrefully what you are dealing with.

Resolving---------o In most cases chaining is unavoidable, especially when this involves tables with large columns such as LONGS, LOBs, etc. When you have a lot of chained rows in different tables and the average row length of these tables is not that large, then you might consider rebuilding the database with a larger blocksize.

e.g.: You have a database with a 2K block size. Different tables have multiple large varchar columns with an average row length of more than 2K. Then this means that you will have a lot of chained rows because you block size is too small. Rebuilding the database with a larger block size can give you a significant performance benefit.

o Migration is caused by PCTFREE being set too low, there is not enough room in the block for updates. To avoid migration, all tables that are updated should have their PCTFREE set so that there is enough space within the block for updates. You need to increase PCTFREE to avoid migrated rows. If you leave more free space available in the block for updates, then the row will have more room to grow.

SQL Script to eliminate row migration :-- Get the name of the table with migrated rows:ACCEPT table_name PROMPT 'Enter the name of the table with migrated rows: '-- Clean up from last executionset echo offDROP TABLE migrated_rows;DROP TABLE chained_rows;-- Create the CHAINED_ROWS table@.../rdbms/admin/ utlchain. sqlset echo onspool fix_mig-- List the chained and migrated rowsANALYZE TABLE &table_name LIST CHAINED ROWS;-- Copy the chained/migrated rows to another tablecreate table migrated_rows asSELECT orig.*

Page 45: Interview_Q1

FROM &table_name orig, chained_rows crWHERE orig.rowid = cr.head_rowidAND cr.table_name = upper('&table_ name');-- Delete the chained/migrated rows from the original tableDELETE FROM &table_name WHERE rowid IN (SELECT head_rowid FROM chained_rows) ;-- Copy the chained/migrated rows back into the original tableINSERT INTO &table_name SELECT * FROM migrated_rows;spool offNote----When you run the script in the document to clean up the chained rows if the table contains long raw columns, the script will fail with ORA-997: Illegal use of LONG datatype. This error is normal as you cannot do a CTAS when you have long raws. Also, by the nature of the long raw datatype, chaining is unavoidable.

38 How to Turn Archiving ON and OFF ???Turning Archiving On and Off============ ========= =======

This section describes the aspect of archiving and includes thefollowing topics:

- Setting the Initial Database Archiving Mode

- Enabling Automatic Archiving* Enabling Automatic Archiving at Instance Startup* Enabling Automatic Archiving After Instance Startup

- Changing the Database Archiving Mode

- Disabling Automatic Archiving* Disabling Automatic Archiving at Instance Startup* Disabling Automatic Archiving after Instance Startup

- Performing Manual Archiving

You set a database's initial archiving mode as part of database creation.Usually, you can use the default of NOARCHIVELOG mode at database creationbecause there is no need to archive the redo information generated at thattime. After creating the database, decide whether to change from the initialarchiving mode.

After a database has been created, you can switch the database's archiving modeon demand. However, you should generally not switch the database betweenarchiving modes.

NOTE: If a database is automatically created during Oracle installation,the initial archiving mode of the database is operating system specific.See your operating system-specific Oracle documentation.

NOTE:ARCHIVELOG mode is necessary for creating on-line backups and for certaintypes of database recovery. Configuring the database to operate in

Page 46: Interview_Q1

ARCHIVELOG mode allows the user to perform complete and point-in-timerecovery from media (disk) failures using off-line or on-line backups. IfARCHIVELOG mode is disabled, the database can be restored from a backupin case of failure, but it cannot be rolled forward from that to a pointwhen failure occured.

Setting the Initial Database Archiving Mode============ ========= ========= ========= ====

When you create the database, you set the initial archiving mode of the redolog in the CREATE DATABASE statement. If you do not specify either ARCHIVELOGor NOARCHIVELOG, NOARCHIVELOG is the default. To verify database mode, executefollowing statement:

SVRMGR> Select * from V$DATABASE

NAME CREATED LOG_MODE CHECKPOINT ARCHIVE_CH---- ------------ ----- ------------ ---------- ----------ORCL 05/21/97 17:55:06 NOARCHIVELOG 172185 170808

Enabling Automatic Archiving at Instance Startup============ ========= ========= ========= =========

To enable automatic archiving of filled groups each time an instance isstarted, include the "LOG_ARCHIVE_ START" parameter, set to TRUE, in thedatabase's parameter file:

LOG_ARCHIVE_ START=TRUE

The new value takes effect the next time you start the database.

Enabling Automatic Archiving After Instance Startup============ ========= ========= ========= ========= ====

To enable automatic archiving of filled online redo log groups without shuttingdown the current instance, use the SQL command ALTER SYSTEM with the ARCHIVELOG START parameter.

The following statement enables archiving:

SVRMGRL> ALTER SYSTEM ARCHIVE LOG START;

When using this option, the instance does not have to be shut down to enableautomatic archiving.

However, if an instance is shutdown and restarted after automatic archiving isenabled using this option, the instance is reinitialized using the settings ofthe parameter file ("LOG_ARCHIVE_ START"), which may or may not enable automaticarchiving.

Page 47: Interview_Q1

Changing the Database Archiving Mode============ ========= ========= ======

There are "init.ora" parameters you need to modify in order to properly handleyour database being in archive log mode. They are:

LOG_ARCHIVE_ STARTLOG_ARCHIVE_ DESTLOG_ARCHIVE_ FORMAT

LOG_ARCHIVE_ START:Enables automatic archiving of filled groups each time an instance is started.Set this parameter to TRUE if you do NOT wish to have to MANUALLY archive yourredo log files when in ARCHIVELOG mode.

LOG_ARCHIVE_ DEST:This parameter specifies the directory where your archive logs will be placed.

LOG_ARCHIVE_ FORMAT:This parameter names the archive logs in this format. For example, if yourformat is: arch%s.arc

Your log files will be called: arch1.arc, arch2.arc, arch3.arc where the '1','2', '3', etc is the sequence number.

To Prepare to Switch Database Archiving Mode============ ========= ========= ========= =====

1. Shut down the database instance.

SVRMGRL> shutdown

An open database must be closed and dismounted and any associatedinstances shut down before the database's archiving mode can be switched.Archiving cannot be disabled if any datafiles need media recovery.

2. Backup the database.

This backup can be used with the archive logs that you will generate.

3. Perform any operating system specific steps (optional).

4. Start up a new instance and mount, but do not open the database.

SVRMGRL> startup mount

NOTE: If you are using the Oracle Parallel Server, you must mount thedatabase exclusively using one instance to switch the database'sarchiving mode.

5. Switch the database's archiving mode.

Page 48: Interview_Q1

SVRMGRL> alter database archivelog;

6. Open the database.

SVRMGRL> alter database open;

7. Verify your database is now in archivelog mode.

SVRMGRL> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination for example: $ORACLE_HOME/ dbs/archOldest on-line log sequence 275Next log sequence 277Current log sequence 278

8. Archive all your redo logs at this point.

SVRMGRL> archive log all;

9. Ensure these newly created Archive log files are added to the backupprocess.

See the Oracle7 Parallel Server Concepts & Administration guide for moreinformation about switching the archiving mode when using the Oracle ParallelServer.

Disabling Automatic Archiving============ ========= ========

You can disable automatic archiving of the online redo log groups at any time.However, once automatic archiving is disabled, you must manually archive groupsof online redo log files in a timely fashion.

If a database is operated in ARCHIVELOG mode, automatic archiving is disabled,and all groups of online redo log files are filled but not archived.

LGWR cannot reuse any inactive groups of online redo log groups to continuewriting redo log entries. Therefore, database operation is temporarilysuspended until the necessary archiving is performed.

To disable automatic archiving after instance startup, you must be connectedwith administrator privileges and have the ALTER SYSTEM privilege.

Automatic archiving can be disabled at or after instance startup.

Disabling Automatic Archiving at Instance Startup============ ========= ========= ========= ========= =

To disable the automatic archiving of filled online redo log groups each time adatabase instance is started, set the "LOG_ARCHIVE_ START" parameter of adatabase's parameter file to FALSE:

Page 49: Interview_Q1

LOG_ARCHIVE_ START=FALSE

The new value takes effect the next time the database is started. And, archivelog list; command executed from SVRMGRL will show:

Automatic archival Disabled

Disabling Automatic Archiving after Instance Startup============ ========= ========= ========= ========= ====

To disable the automatic archiving of filled online redo log groups withoutshutting down the current instance, use the SQL command ALTER SYSTEMwith the ARCHIVE LOG STOP parameter.

The following statement stops archiving:

SVRMGRL> ALTER SYSTEM ARCHIVE LOG STOP;

If ARCH is archiving a redo log group when you attempt to disable automaticarchiving, ARCH finishes archiving the current group, but does not beginarchiving the next filled online redo log group.

The instance does not have to be shut down to disable automatic archiving.However, if an instance is shut down and restarted after automatic archiving isdisabled, the instance is reinitialized using the settings of the parameterfile ("LOG_ARCHIVE_ START"), which may or may not enable automatic archiving.

NOTE: If you choose to disable automatic archiving and have notdisabled archiving altogether, you are responsible to archiveall filled redo log groups or else database operation istemporarily suspended (you will experience a database hang)until the necessary archiving is performed.

Performing Manual Archiving============ ========= ======

If a database is operating in ARCHIVELOG mode, inactive groups of filled onlineredo log files must be archived. You can manually archive groups of the onlineredo log whether or not automatic archiving is enabled.

If automatic archiving is not enabled, you must manually archive groups offilled online redo log files in a timely fashion. If all online redo log groupsare filled but not archived, LGWR cannot reuse any inactive groups of onlineredo log members to continue writing redo log entries. Therefore, databaseoperation is temporarily suspended until the necessary archiving is performed.You can exercise this scenario by executing alter system switch logfile commandwhen automatic archival is disabled. Attempting to repeat that command with alast redo log group will show hang, and it won’t be completed with ‘statementprocessed’ message until archiving is done.

If automatic archiving is enabled, but you want to rearchive an inactive groupof filled online redo log members to another location, you can use manual

Page 50: Interview_Q1

archiving. (However, the instance can decide to reuse the redo log group beforeyou have finished manually archiving, thereby overwriting the files. If thishappens, Oracle will display an error message in the ALERT file.)

To manually archive a filled online redo log group, you must be connected withadministrator privileges.

Manually archive inactive groups of filled online redo log members using theSQL command:

SVRMGRL> ALTER SYSTEM ARCHIVE LOG ALL;

archives all unarchived log files.

Resources=========

See your Administrators Guide for other ALTER SYSTEM ARCHIVE options.

39 CAN ARCHIVING BE TURNED OFF/ON WITHOUT BOUNCING THE DATABASE?

Problem Description:============ ========

Your database is in ARCHIVELOG mode. You want to turn archiving offfor a period of time and then turn it on to continue archiving withoutbouncing your database. You believe the following commands will work:

SVRMGR> alter system archive log stopSVRMGR> alter system archive log start

You want to know if the commands will allow archiving to be turned off and onwithout bouncing the database.

Solution Description:============ =========

You must bounce the database to turn archiving off and on. These commands onlyalternate the archiving mode from AUTOMATIC to MANUAL. They do not turnarchiving off or on.

The following test shows that the database will eventually hang if you issuethis command.

SVRMGR> alter system archive log stop;

Example:

Database mounted.Database opened.SVRMGR> archive log list;

Database log mode Archive Mode

Page 51: Interview_Q1

Automatic archival EnabledArchive destination /u02/app/oracle/ product/7. 3.2/dbs/arch

Oldest online log sequence 90Next log sequence to archive 93Current log sequence 93

SVRMGR> alter system switch logfile;Statement processed.

SVRMGR> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination /u02/app/oracle/ product/7. 3.2/dbs/archOldest online log sequence 91Next log sequence to archive 94Current log sequence 94

SVRMGR> alter system archive log stop;Statement processed.

SVRMGR> archive log list;Database log mode Archive ModeAutomatic archival DisabledArchive destination /u02/app/oracle/ product/7. 3.2/dbs/arch

SVRMGR> alter system switch logfile;Statement processed.

SVRMGR> archive log list;Database log mode Archive ModeAutomatic archival DisabledArchive destination /u02/app/oracle/ product/7. 3.2/dbs/archOldest online log sequence 92Next log sequence to archive 94Current log sequence 95

*** log files until all the log files need archiving. ***

SVRMGR> alter system switch logfile;Statement processed.

SVRMGR> alter system switch logfile;Statement processed.

SVRMGR> alter system switch logfile;.... ........

At this point the DB hangs because automatic archiving is disabled. Whenall redo logs are full (this was simulated by switching logs), another log fileswitch will not occur until the log files are MANUALLY archived, or automaticarchiving is enabled.

*** automatic archiving. ***

Page 52: Interview_Q1

Open another Server Manager session and issue the following command:

SVRMGR> alter system archive log start;Statement processed.

After issuing this command the full redo logs are archived, the log switchoccurs, the database is no longer hung, and the first session returns to theServer Manager prompt.

Explanation:============

You had to bounce the database to turn archiving off or on. The commandsyou attempted to use to do this only alternate the archiving mode fromAUTOMATIC to MANUAL.

40 ALTER SYSTEM ARCHIVE LOG STOP DOES NOT TURN OFF ARCHIVELOG MODEThen what do you do ??Problem Description:============ ========

You have attempted to turn off archiving using the command:

SVRMGRL> alter system archive log stop;

but, the database is still running in archivelog mode.

Solution Description:============ ========

To turn off archiving, alter the database to run in noarchivelog mode asfollows:

Before issuing alter database noarchivelog, youfirst need to be in mount mode.

So...To turn off archiving,startup mountSVRMGRL> alter database noarchivelog;alter database open;

Then, do the following:

SVRMGRL> alter database noarchivelog;

If you intend this to be a permanent change, you should also set the init.oraparameter LOG_ARCHIVE_ START = false.

To ensure archiving has been disabled run:

Page 53: Interview_Q1

SVRMGR> archive log listDatabase log mode No Archive ModeAutomatic archival DisabledArchive destination ?/dbs/archOldest online log sequence 481Current log sequence 483

Solution Explanation:============ ========

'Alter system archive log stop' will disable the automatic archiving of redolog file groups, but it will not change the database from archivelog mode tonoarchivelog mode.

Changing the database to run in noarchivelog mode will turn off archiving.41 How do you estimate the amount of redo per day??

Problem Description============ =======

How do we find out how much redo is generated per day?

Solution Description:============ =========

Multiply (Redo per Day) by (Redo File Size).

Issuing the command "ARCHIVE LOG LIST"

SVRMGR> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination /u05/home/usupport/ kbahadur/ database/ archiveOldest online log sequence 20Next log sequence to archive 25Current log sequence 25

command on two consecutive days at the same time and taking the differencebetween the 'current log sequence' will give us the number ofredo logs generated during a 24 hour period.

Explanation:============

In NOARCHIVE Log mode, taking the Number of Redo Logs created in 24 hoursand multiplying that by the redo log file size will give usthe general estimate of redo generated in bytes per day.

In ARCHIVE Log mode, we can estimate the value even better, sincewe have the archived log files with the date/time stamp andthe varying byte size for each log. So adding the archive filesizes during a 24-hour period will give us the amount of redogenerated.

Page 54: Interview_Q1

osupport dba 2048 Oct 30 11:57 _0000000016. logosupport dba 6048 Oct 30 12:11 _0000000017. logosupport dba 10240 Oct 30 14:00 _0000000018. logosupport dba 26624 Nov 3 09:44 _0000000019. logosupport dba 14336 Nov 3 09:47 _0000000020. logosupport dba 12288 Nov 3 09:48 _0000000021. logosupport dba 3072 Nov 3 09:48 _0000000022. logosupport dba 2048 Nov 3 09:48 _0000000023. logosupport dba 79872 Nov 3 09:48 _0000000024. logosupport dba 5035 Nov 3 10:11 _0000000025. log

42 What you do if you get an error CANNOT ALLOCATE LOG, ARCHIVAL REQUIREDProblem Description:============ ========

Oracle starts up and users connect, but nothing happens. Oracle just hangs.

The Windows NT Event Viewer has a message from Oracle7.PROD:

Event ID: 20Source: Oracle7.PRODDescription:

Archive Process Error: Cannot allocate Log, Archival Required.

Solution Description:============ =========

The database was recently put in Archivelog mode by doing a 'startup mountexclusive' and then an 'alter database archivelog';

Database was then shutdown and restarted.

Doing an 'Archive log list;' when connected as SYS or INTERNAL shows thefollowing:

Database log mode Archive ModeAutomatic archival Disabled

Explanation:============

This problem occurs because automatic archiving is disabled.

The cause of the problem is automatic archiving is disabled. When thedatabse is in archive log mode and the redo logs fill up, no activity willbe allowed until the log files are archived. If the database is not archivingautomatically, activity will cease until the redo logs are manually archived.Redo logs can be manually archived by issuing the command

ALTER SYSTEM ARCHIVE LOG ALL;

Page 55: Interview_Q1

or you can specify individual log files. See Oracle7 ServerSQL Reference for syntax of the ALTER SYSTEM command and the ARCHIVE LOGclause.

A better option is to modify the init.ora and set the parameter'LOG_ARCHIVE_ START=TRUE' . This parameter enables automatic archiving andprevents you from needing to manually archive redo logs every time they fillup.

43 what is responsibility ??

A responsibility is a level of authority in Oracle Applications that lets users access only those Oracle Applications functions and data appropriate to their roles in an organization.

44 what is the use of responsibility key defining the responsibility ??

This is a unique name for a responsibility that is used by loader programs. Loaders are concurrent programs used to load such information as messages, user profiles and user profile values into your Oracle Applications tables. To help ensure that your responsibility key is unique throughout your system, begin each Responsibility Key name with the application short name associated with this responsibility.

45 what is a adata group ?

A Data Group defines the mapping between Oracle Applications products and ORACLE IDs. A DataGroup determines which Oracledatabase accounts a responsibility’s forms, concurrent programs, and reports connect to.

46 what is Request Security group ?

A request security group defines the concurrent programs, including requests and request sets, that may be run by an application user under a particular responsibility.

47 what is menu in oracle applications ??

A menu is a hierarchical arrangement of application functions (forms) that displays in the Navigate window. Menus can also point to non form functions (subfunctions) that do not display in the Navigate window, but that define the range of application functionality available for a responsibility. Each responsibility is associated with a menu.

48 What is the profile option is used to set the window help ??

Applications Help Web Agent :http://apps01. hil.com:8005/ pls/CRP/fnd_ help.launch? lang=US

49 Unable to login to personal home page after upgrade the database from 9.0.1.3 to 9.2.0.2 ??

Run the following scripts as sys user

jvmsec3.sql

Page 56: Interview_Q1

jvmsec5.sql

50 Cannot view Workflow Monitor Diagrams ??

1.Check that the jinitiator version and the classid in use on your system bylooking at the following entries in the $OA_HTML/bin/ appsweb.cfg

jinit_ver_name= Version=1, 1,8,16jinit_mimetype= application/ x-jinit-applet; version=1. 1.8.16jinit_classid= clsid:9b935470- ad4a-11d5- b63e-00c04faedb1 8

2.Verify which userid the WF_ADMIN_ROLE is assigned to:The following SQL should reveal the Workflow Adminstrator ROLE,which is either a specific:- USER, or- RESPONSIBILITY, or- An Asterisk '*' which indicates Everyone.

select text from wf_resourceswhere name = 'WF_ADMIN_ROLE'

TEXT------------ --------- --SYSADMIN

3.If the above sql returns a Responsibility, (like FND_RESP1:20420) then usethe following sql to find the Responsibility Name from the ID, which is the #after the colon :i.e. FND_RESP1:20420 = ID = 20420

select RESPONSIBILITY_ NAMEfrom FND_RESPONSIBILITY_ TLwhere RESPONSIBILITY_ ID = '20420'

RESPONSIBILITY_ NAME------------ --------- --------- -System Administrator

4.Login to Core (forms based) Applications as the user determined in step 2,Or as a user that has the responsibility determined in step 3 assigned tothem.(If step 2 returned '*', then any user login will work).

5.Select Global Preferences from the Workflow Menu

6.Verify the settings match the ones from the $OA_HTML/bin/ appsweb.cfg file instep 1i.e. from the example above

Jinitiator Classid = 9b935470-ad4a- 11d5-b63e- 00c04faedb18Jinitiator Version = 1.1.8.16

7.Similarly, verify the values in $FND_TOP/resource/ wfcfg.msg file

WFTKN WF_WEB_AGENT 0 http://<host> .<domain> :<port>

Page 57: Interview_Q1

/pls/<SID>WFTKN WF_ADMIN_ROLE 0 SYSADMINWFTKN WF_CLASSID 0 9b935470-ad4a- 11d5-b63e- 00c04faedb18WFTKN WF_PLUGIN_VERSION 0 1.1.8.16

8. Finally, verify the settings in the database with the following SQL:

select substr(name, 0,18) Name, substr(text, 0,55) Valuefrom wf_resourceswhere name in('WF_WEB_AGENT' ,'WF_ADMIN_ROLE' ,'WF_VERSION' ,'WF_CLASSID' ,'WF_PLUGIN_DOWNLOAD ','WF_PLUGIN_VERSION' );

9. If the values in the database are incorrect you can upload the values fromthe wfcfg.msg (from step 7) using the following command:

WFRESGEN APPS/<APPS Password> 0 Y $FND_TOP/resource/ wfcfg.msg

51 Unable to see online help ??

Added the following line in jserv.properties file for online help this has to done on applicationservers

For online Help on 11.5.7wrapper.bin. parameters= -Djava.compiler= NONE

52 while applying the patch if you get an error on database tire ??adogjf() Unable to generate jar files under APPL_TOP

AutoPatch error:Failed to generate the product JAR files

AutoPatch error:Error updating apps.zip

A: copy the directory form BOM_TOP/java/ make todatabase tire then reapply the patch.

Unable to start the express instance ??add the following entry in express.prm file#Added from SupportAIXTHREAD_STK= ${AIXTHREAD_ STK:="320000" } ; export AIXTHREAD_STK

53 How to remove yello worning bar??

over write identitydb.obj on clint machine from where there is no yello warrning barorrun adjkey and adjbuild.sh to create new certification on client side.

54 How to communicate clients to the applications ?

Page 58: Interview_Q1

For Windows 98 machines:1) open a note pad2) put the following entries in the notepad10.190.0.25 apps01.hil.com10.190.0.26 apps02.hil.com10.190.0.24 hiltrn.hil.com

3) save as "hosts" in c:\windows4) restart the browser and give the URl like as below

http://apps02. hil.com:8003/ OA_HTML/US/ ICXINDEX. htm5) install jinitiator then connect to apps.

6)If it is taking lot of time then ftp the file from the server at following locationthen install

$COMMON_TOP/ util/jinitiator/ Ex: /devl/viscomn/ util/jinitiator/ jinit11816. exe

What if you get an error FRM-9200 when connecting to applications ??

start the jinitiator control panel 1.1.8.16change network access to unrestricted then restart the browser and then relogin even if u getthe same message clear a jcache and temporary internet files from the browser propertiesthen restart the machine and connect.

55 How to release the space below high water mark ?

alter index index_name deallocate unused;( to release the space below high water mark)

56 What should be the size of redolog members ?

Redo logs should be sized based upon 2 factors:

1) Are you archiving2) How often are your logs switching

If you are archiving

You need to size the logs such that log switches occur no LESS than every 5 minutes

You also need to make sure that logs are not switching too infrequently ... sometimes this is notpossible as there are gaps in work ... but I personally recommend a window of 5-30 minutesbetween switches when the system is under load. The reason we recommend this is in case theonline redo log becomes corrupt and the DB has to be recovered point in time to the last logswitch ... you dont want to loose more than say 30 minutes of work

If you are not archiving

Page 59: Interview_Q1

You need to size the logs such that log switches occur no LESS than every 30 seconds. Sincerecovery is not possible when not archiving a long time between switches really becomesirrelivant

Bottom line you are trying to hit a happy medium between requiring use of a stale log before itis finished switching (switching logs too fast) and having too long of a time between switches

If you need further assistance on this issue. Please feel free to post a reply and we will behappy to assist you

It is better to make the redo logs much bigger and then run a cron script to force a log switchevery so often (during the slow periods). This way the heavy periods do not bog down due to abunch of log switches and the light periods are broken up by the forced switches. On our systemswe force a log switch every 15 minutes.

<< It is better to make the redo logs much bigger and then run a cron script to force a logswitch every so often (during the slow periods). This way the heavy periods do not bog down dueto a bunch of log switches and the light periods are broken up by the forced switches. On oursystems we force a log switch every 15 minutes. >>

You can do that ... I personally would use a stored procedure and an EXECUTE IMMEDIATE ... thisway I can control exactly when the logs get forced ...

Example:

from 8am to 5pm force a switch every 15 minfrom 5pm to midnight force a swithc every hourfrom midnight to 8am dont force a switch

I dont know if this can be done with CRON ... but I know it can be done with a stored procedure

57 How do i set optimal parameter for rollback segments ?OPTIMAL= initial+next

CREATE ROLLBACK SEGMENT r01 TABLESPACE rbs STORAGE (INITIAL 512000 NEXT 512000 MINEXTENTS 2MAXEXTENTS 2147483645 OPTIMAL NULL)

CREATE ROLLBACK SEGMENT r02 TABLESPACE rbs STORAGE (INITIAL 512000 NEXT 512000 MINEXTENTS 2MAXEXTENTS 2147483645 OPTIMAL NULL)

Page 60: Interview_Q1

<< How do i set optimal parameter for the rollback segments ? >>

Please see the SQL Reference under CREATE / ALTER ROLLBACK SEGMENT

<< I am explicitily saying

alter rollback segment <rbs name> shrink;

is there any problem if i issue this command when transactions are happening.>>

There is no problem issuing this command while transactions are happening.

<< What will be the effect of this statement? >>

Please see the SQL Reference under ALTER ROLLBACK SEGMENT for an explanation

<<On what basis i should set the optimal parameter for the rollback segments? >>

This is a tuning question that is outside the scope of support ... there are several documents onsetting the optimal parameter ... Please search Metalink on : OPTIMAL

58 Unable to allocate log sequence number ?

Most likely this is due to your logs switching too quickly

If archiving you want to switch no less than ever 5 min (ie adjust the size of your redo logs)

If not archiving you want to make sure that you have sufficiently sized or sufficient number ofredo log groups such that when a log switch occurs that you are not trying to switch into a'stale' log

59 How to find the paging space in AIX system ??

lsps -a Lists the status of defined paging spaces.

60 how to find out the physical memory on AIX ??

lsattr -E -lsys0 | grep realmem

or

lsdev -C | grep Memory

61 How to find out what divesies are defined to the system ??

lsdev -Cc disk

62 How to find the number of processor in a system ??

Lsdev -Cc processor

Page 61: Interview_Q1

63 How to estimate of the percentage of cpu and memory utilized by each process currentlyrunning

ps av

64 how to determining how much paging activity is taking place on the system. Also givesuseful cpu usage info.

vmstat 3 20 or (topas)

65 How to determining disk utilization for each hard drive.

iostat 3 20 or topas (topas)

66 How do I find out the operating system version?

oslevel or oslevel -r [for maintenance level]

67 How do I found out the process memory space usage?

svmon -P <process id#>

68 How to find which instance owns which shared memory and semaphoresOn a Unix machine give the following commands

$ ipcs -b

69 How do you generate Apps Forms menu modules or MMB files?

f60gen module=FNDMENU. mmb userid=apps/ apps output_file= FNDMENU.mmx module_type= menu batch=yes compile_all= special

70 How do you generate Apps Forms modules or FMB files?Oftentimes as part of upgrading Forms or modifying a Form module or applying a patch modifying a Form module, you would encounter an issue that would necessitate manually regenerating the Forms module executable or FMX file. To do this you issue the following command:f60gen module=form_ name.fmb userid=apps/ apps output_file= form_name. fmx module_type= form batch=yes compile_all= special

71 How do you generate Apps Forms library modules or PLL files?

To do this you issue the following command:f60gen module=library_ name.pll userid=apps/ apps module_type= library batch=yes compile_all= special

72 When do you have to regenerate your Apps Forms modules?

Apps forms are regenerated, some are true some are not:

After an operating system upgrade? FalseAfter a database upgrade? FalseAfter applying a Developer patch? False.

Page 62: Interview_Q1

After applying an I/O patch? True.After applying an Apps patch? True, but only if there is a g driver involved.

73 What is compile_all= special?

For standalone Forms the only valid values for compile_all are ?yes? and ?no?. compile_all= special is similar except that it doesn't attempt to update the source files.

74 How do you get the latest package release?SQL> select name,type,text from user_source where name ='FND_REQUEST' and line < 3NAME TYPE TEXT------------ --- ------------ ------------ --------- --------- --------- --------- --------FND_REQUEST PACKAGE package FND_REQUEST AUTHID CURRENT_USER asND_REQUEST PACKAGE /* $Header: AFCPREQS.pls 115.4 2000/02/29 11:51:08 $ */ FND_REQUEST PACKAGE BODY package body FND_REQUEST asFND_REQUEST PACKAGE BODY /* $Header: AFCPREQB.pls 115.27 2001/07/28 09:35:16 $ */What we?re looking for is the name and version number (AFCPREQS.pls 115.4 and AFCPREQB.pls 115.27) of the files that create the package. Support will then determine if it?s advisable to apply the latest release of those files.75 How can you affect the look and feel of your Apps forms?

You can alter the interface look and feel of Apps forms by changing the values of the following variables in the appsweb.cfg file:lookAndFeel= Oracle (or generic)colorScheme= blue or (teal, titanium, red, khaki, blue, olive, purple)background=noreadonlyBackground= automaticThe FND.D patch will allow control of some of these settings through the system profile:Java Look and Feel=Oracle (or generic)Java Color Scheme=blue (or teal, titanium, red, khaki, blue, olive, purple)

76 How do you disable direct Forms access through the http://host: port/dev60cgi/ f60cgi URL?

You can do this by using the mod_rewrite (the Swiss Army Knife of URL manipulation :) engine of the Apache server. In your httpd.conf file add the following lines at the end:RewriteEngine onRewriteCond %{QUERY_STRING} !NLS_LANGRewriteRule ^/dev60cgi/f60cgi$ http://hiltrn. hil.comYou'll have to tighten up the code somewhat but here I am taking advantage of the fact that the URL for accessing Apps directly and through the personal home page are not exactly the same i.e. if the URL does not have certain parameters in it then I redirect the user to a different web page of my choice.

77 How is Forms load balancing accomplished?

Currently Forms load balancing is done through proprietary programs called Metric Server and Metric Clients. The Metric clients are setup on machines with a corresponding Forms server and they constantly report to a Metric Server their load situation. The Metric Server then uses this information to decide which machine to

Page 63: Interview_Q1

pass a request to run a web form. Metalink Note# 111270.1 and Metalink Note# 148516.1 are good sources for more info.

78 How is Forms load balancing accomplished with Forms listener servlet?

Once Forms servlet is supported in Apps, load balancing will no longer be done via Metrics Servers and Metric Clients. The built-in load balancing capability of the HTTP server (Oracle HTTP powered by Apache) along with its jserv mod will be used instead.

79 How to set up Forms to work through a firewall?

In the current Form Services architecture a firewall needs be configured to allow traffic on 2 ports. The listener port of the Oracle HTTP server (usually port 80 or 8002) and the Forms Listener/Server (usually 9000). The Oracle HTTP server handles the initial request, authentication to the server, and presents a list of responsibilities for the end user to choose from. Self Service applications will continue to use only this listener, but if a core application is invoked, the client makes a request to the Forms Listener that then creates a new Forms Server Runtime process. The Oracle HTTP server port will allow http traffic e.g. requests for help files, requests to the TCF servlet, etc. The Forms Listener/Server port will allow socket or https traffic. In the new Forms Servlet architecture the only port that needs to be open is the Oracle HTTP

80 Note down some important profile options in sysadmin point of view ???

APPS_WEB_AGENTATTACHMENT_FILE_ DIRECTORYCZ_UIMGR_URLHELP_WEB_AGENTICX_FORMS_LAUNCHERICX_REPORT_CACHEICX_REPORT_IMAGESICX_REPORT_LAUNCHERICX_REPORT_LINKICX_REQ_SERVERMRP_I2_P_FP_ NET_DIRMRP_I2_P_LOG_ DIRMRP_I2_P_RL_ DATA_DIROE_CONC_LOG_ DIRECTORYTCF:HOSTAMS_IMP_DATA_ PATHOE_DEBUG_LOG_ DIRECTORY /USR/TMPOE_DEBUG_LOG_ DIRECTORY /tmp/JTF_BIS_OA_HTML http://ap804sun. us.oracle. com:778/OA_ HTMLHZ_DNB_URL https://globalacces s.dnb.com/ access/scripts

81 What is f60webmx?

The f60webmx is your web forms runtime executable, similar to f60webm except that it has Apps specific user exits linked into

82 How can you recreate the f60webmx executable?To do this you issue the following command:

Page 64: Interview_Q1

$ad_relink.sh force=y ?fnd f60webmx?Note that there might be times when you you need to generate a stack trace from the f60webmx process. For the trace to have meaninful info the executable needs to have been created with debugging symbols. To do this you issue the following command:$ad_relink.sh force=y debug=y "fnd f60webmx"

83 How do you enable Forms Runtime Diagnostics (FRD) in Apps?

To enable Forms Runtime Diagnostics (FRD):- login to Apps as sysadmin- click on Profile/System- query ICX%FORMS%LAUNCHER (set for user level)- add the following to the end of its value "&record=collect& log=" without the quotesEx:http://apps02. hil.com:8003/ dev60cgi/ f60cgi?config= test115&play= &record=collect& log=/usr/ tmp/sysadmin_ frd.logNote that like any Apps profiles you can do this on various levels e.g. site, user, etc. so that you target your FRD accordingly. Also be aware that FRD incurs significant overhead to Apps processing so disable it when not in use.

84 Are there any changes to the Forms product components when in Forms listener servlet?

Yes. With Forms Listener Servlet certain Forms components are replaced:Forms CGI - Forms Servlet (FormsServlet. class)Forms Server - Forms Listener Servlet (ListenerServlet. class)

85 How do you change the background color of a required item in Apps?

Change the $OA_JAVA/oracle/ apps/fnd/ formsClient/ OracleApplicatio ns.dat file and change the RGB value for app.ui.requiredFiel dVABGColor. To turn off the color of the required item you can either change the value of app.ui.requiredFiel dVA from true to false (note that this is what the OracleApplications2 .dat is for, a requirement for the ADA). You have to restart Jinitiator for this to take effect.

86 How can you affect the look and feel of your Apps forms?

You can alter the interface look and feel of Apps forms by changing the values of the following variables in the appsweb.cfg file:lookAndFeel= Oracle (or generic)colorScheme= blue or (teal, titanium, red, khaki, blue, olive, purple)background=noreadonlyBackground= automaticThe FND.D patch will allow control of some of these settings through the system profile:Java Look and Feel=Oracle (or generic)Java Color Scheme=blue (or teal, titanium, red, khaki, blue, olive, purple)

87 How to create a custom event alert to fire against a custom table ??Purpose-------The article should provide you with a step-by-step guide on howto create a custom event alert, which will fire when a row in a

Page 65: Interview_Q1

custom table is updated. The update can be the result of aninsert or update DML statement. The article assumes a noviceor beginner level.Overview of Event Alerts------------ --------- ---An event alert is a database trigger that tells you when datain an object within the database has been changed. Event alertscan be configured to trigger an action, like sending an emailto a user. You may use event alerts to audit changes tostandard Oracle Applications objects or custom objects in userdefined database schemas. However, you should note that thewhen you use Oracle Alerts to define database triggers, theevent alert will only work from within the context of theOracle Applications. For example, any database event thataffects the objects made from within a form accessed by a menufrom within an Oracle Application Responsibility is within thecontext of Oracle Applications. Likewise, any registereedconcurrent manager process or report, whether executed fromwithin the Oracle Application form or executed from thecommand line is within the context of Oracle Applications.However, if you manually update or insert data from theSQL*Plus environment without setting the Oracle Applicationcontext, you will not trigger the event alert.If you want to build an alert to fire against a custom table,then you will need the following information. Unfortunately,it is not found in the Oracle Alert User's Guide. The articleprovides the following information:a. How to create and register a customer schema in theOracle Applications.b. How to register the Oracle Alert against the customtable.Create a Custom Schema, Table and Responsibility------------ --------- --------- --------- ---------You may find additional reference to setting up a custom schemain [NOTE:70276. 1] and [NOTE:73492. 1]. The following providesa step-by-step approach to creating a customer application andregistering it within Oracle Applications.1. First, you must create the schema within the database. Thiscan be done from any user/schema account with the DBA Roleprivileges. Please remember that you must grant to the newlycreated schema a minimum of "CONNECT" and "RESOURCES" to theschema for it to be accessed. (Please refer to the Oracle SQLReference Guide for your release of the database to securemore information. ) If you would like to follow the OracleApplication guidelines for naming conventions, please nameyour schema with a three character name, like "CUS" - Customer.Then, prepend it with an "XX" so that you have an user/schema"XXCUS" name.Create the user/schema in the database by using SQL*Plusunder any account with DBA Role privileges:Unix Prompt-----------$ sqlplus system/managerSQL*Plus Prompt------------ ---

Page 66: Interview_Q1

SQL> create user XXCUS identified by XXCUS;SQL> grant connect to XXCUS;SQL> grant resource to XXCUS;2. When you register your custom application within theApplication Object Library. It is recommended that you prependan "XX" to the custom schema short name so it will not conflictwith any future Oracle Application short names.Log into Applications as the System Administrator and navigate to:Application --> Register.For example:Application Short Name Basepath Description------------ --------- --------- --------- --------- --------- -Custom Application XXCUS XXCUS_TOP Custom ApplicationYou may refer to your Oracle Applications Developers Guide foradditional information, for example the Oracle ApplicationsDevelopers Guide Release 11 contains this information on pages2-6.3. You register your custom user/schema as an Oracle user withinthe context of Oracle Applications. When you put the user/schemawithin the context of Oracle Applications, you are storing theinformation within the Application Object Library tables. TheApplication Object Library is a repository of Oracle Applicationspecific metadata, which is data that defines data, or data thatlets you extend the functionality of standard Oracle ApplicationSystem Administration to your customized extensions.You can register the user with the Application ObjectLibrary. Log into Oracle Applications as the SystemAdministrator and navigate:Security --> ORACLE --> Register.The following is an example row for your user registration:DatabaseUsername Password Privilege Install Group Description------------ --------- --------- --------- --------- --------- -XXCUS XXCUS Enabled 0 Custom ApplicationYou may refer to th Oracle Applications Release 11 SystemAdministrator' s Guide on page 9-5 for more detail.4. You need to add the custom user/schema to a data group. You cando this by logging into Oracle Applications as the SystemAdministrator and navigate:Security --> ORACLE --> DataGroup.The following is an example row for your user registration:Data Group: StandardDescription: Standard Data GroupApplication Oracle ID Description------------ --------- --------- --------- --------- --------- -Custom Application APPS Custom Application5. You can now build an object, in the example the object will bea table with a single column, and a local stored database object,which will be a stored procedure in this example. You can loginto SQL*Plus as the custom schema owner, XXCUS, and create thefollowing database objects:Create a Repository Object------------ --------- -----You can create a simple one column table as notedbelow in the sample DDL statement.

Page 67: Interview_Q1

CREATE TABLE my_event_test (v1 NUMBER);Create a Stored Object Code Module------------ --------- --------- ----1. You can create a stored code module like the oneshown below.CREATE OR REPLACE PROCEDURE ins_my_event_ test( value IN OUT NUMBER, errbuf IN OUT VARCHAR2, retcode IN OUT NUMBER ) ASBEGININSERTINTO my_event_testVALUES (value);COMMIT;END;/2. You can test your created procedure by writing a smallPL/SQL program that passes variables into the "errbuf"and "retcode" variables above, which is requiredbecause they are passed by reference. Then, you canwrite a sample query to ensure that a row was insertedbased on the example PL/SQL program.DECLAREvar1 VARCHAR2(1) := 'A';var2 VARCHAR2(1) := 'B';BEGINins_my_event( '1', var1, var2);END;/SELECT v1FROM my_event_test;6. Based on the preceeding example, you should create your custom tables,indexes, views and sequences. The Oracle Coding standards suggest thatyou add the WHO audit columns to the definition of the tables and views.If you are unfamiliar with the concept of WHO audit columns, they arethe defined here for your convenience:General Who-Audit Columns------------ --------- ----a. CREATED_BY NUMBER(15)b. CREATION_DATE DATEc. LAST_UPDATED_ BY NUMBER(15)d. LAST_UPDATE_ DATE DATESpecial Who-Audit Columns for Concurrent Manager Programs------------ --------- --------- --------- --------- ---------e. REQUEST_ID NUMBER(15)f. PROGRAM_ID NUMBER(15)g. PROGRAM_APPLICATION _ID NUMBER(15)h. PROGRAM_UPDATE_ DATE DATE7. You can register your custom user/schema' s tables or views and anyflexfields with the PL/SQL package AD_DD, which is defined below.After the specification declarations, you will find examples forregistering the tables and columns from SQL*Plus.Definition of the AD_DD Specification------------ --------- --------- -------PROCEDURE DELETE_COLUMN

Page 68: Interview_Q1

Argument Name Type In/Out Default?------------ --------- --------- ------------ --------- -- ------ --------P_APPL_SHORT_ NAME VARCHAR2 INP_TAB_NAME VARCHAR2 INP_COL_NAME VARCHAR2 INPROCEDURE DELETE_PRIMARY_ KEY_COLUMNArgument Name Type In/Out Default?------------ --------- --------- ------------ --------- -- ------ --------P_APPL_SHORT_ NAME VARCHAR2 INP_KEY_NAME VARCHAR2 INP_TAB_NAME VARCHAR2 INP_COL_NAME VARCHAR2 IN DEFAULTPROCEDURE DELETE_TABLEArgument Name Type In/Out Default?------------ --------- --------- ------------ --------- -- ------ --------P_APPL_SHORT_ NAME VARCHAR2 INP_TAB_NAME VARCHAR2 INPROCEDURE REGISTER_COLUMNArgument Name Type In/Out Default?------------ --------- --------- ------------ --------- -- ------ --------P_APPL_SHORT_ NAME VARCHAR2 INP_TAB_NAME VARCHAR2 INP_COL_NAME VARCHAR2 INP_COL_SEQ NUMBER INP_COL_TYPE VARCHAR2 INP_COL_WIDTH NUMBER INP_NULLABLE VARCHAR2 INP_TRANSLATE VARCHAR2 INP_PRECISION NUMBER IN DEFAULTP_SCALE NUMBER IN DEFAULTPROCEDURE REGISTER_PRIMARY_ KEYArgument Name Type In/Out Default?------------ --------- --------- ------------ --------- -- ------ --------P_APPL_SHORT_ NAME VARCHAR2 INP_KEY_NAME VARCHAR2 INP_TAB_NAME VARCHAR2 INP_DESCRIPTION VARCHAR2 INP_KEY_TYPE VARCHAR2 IN DEFAULTP_AUDIT_FLAG VARCHAR2 IN DEFAULTP_ENABLED_FLAG VARCHAR2 IN DEFAULTPROCEDURE REGISTER_PRIMARY_ KEY_COLUMNArgument Name Type In/Out Default?------------ --------- --------- ------------ --------- -- ------ --------P_APPL_SHORT_ NAME VARCHAR2 INP_KEY_NAME VARCHAR2 INP_TAB_NAME VARCHAR2 INP_COL_NAME VARCHAR2 INP_COL_SEQUENCE NUMBER INPROCEDURE REGISTER_TABLEArgument Name Type In/Out Default?------------ --------- --------- ------------ --------- -- ------ --------P_APPL_SHORT_ NAME VARCHAR2 INP_TAB_NAME VARCHAR2 INP_TAB_TYPE VARCHAR2 INP_NEXT_EXTENT NUMBER IN DEFAULT

Page 69: Interview_Q1

P_PCT_FREE NUMBER IN DEFAULTP_PCT_USED NUMBER IN DEFAULTPROCEDURE UPDATE_PRIMARY_ KEYArgument Name Type In/Out Default?------------ --------- --------- ------------ --------- -- ------ --------P_APPL_SHORT_ NAME VARCHAR2 INP_KEY_NAME VARCHAR2 INP_TAB_NAME VARCHAR2 INP_DESCRIPTION VARCHAR2 INP_KEY_TYPE VARCHAR2 IN DEFAULTP_AUDIT_FLAG VARCHAR2 IN DEFAULTP_ENABLED_FLAG VARCHAR2 IN DEFAULTExample Use of the AD_DD.REGISTER_ TABLE & AD_DD.REGISTER_ COLUMN------------ --------- --------- --------- --------- --------- -You may use the AD_DD.REGISTER_ TABLE and AD_DD.REGISTER_ COLUMNto seed the Oracle Applications Object Library with knowledgeabout your custom objects. The general form and examplesyntax is noted below. For convenience, the general formillustrates only the mandatory parameters. You will need toexecute these calls to the packages from your "APPS" user/schema.General Syntax Form------------ -------EXECUTE ad_dd.register_ table( P_APPL_SHORT_ NAME, P_TAB_NAME, P_TAB_TYPE );EXECUTE ad_dd.register_ column( P_APPL_SHORT_ NAME, P_TAB_NAME, P_COL_NAME, P_COL_SEQ, P_COL_TYPE, P_COL_WIDTH, P_NULLABLE, P_TRANSLATE );Example Syntax Form------------ -------EXECUTE ad_dd.register_ table('XXCUS','MY_EVENT_TEST','T');EXECUTE ad_dd.register_ column('XXCUS','MY_EVENT_TEST','V1', 1,'NUMBER', 38,'N','N');You can find supplemental material in the Oracle Applications DevelopersGuide Release 11 on page 3-2.8. After creating and registering your objects and schema, you need to runthe APPS_DDL and APPS_ARRAY_DDL packages against your user/schema. Youmust run the scripts from the $AD_TOP/admin/ sql directory in the order

Page 70: Interview_Q1

noted below. The general form for executing the command is noted belowand then examples based on the "XXCUS" user/schema and "XXCUS" passwordfrom above. Please remember that you must run these scripts from the"APPS" user/schema account.1. adaddls.pls2. adaaddls.pls3. adaddlb.pls4. adaaddlb.plsGeneral Syntax Form------------ -------SQL> @$AD_TOP/admin/ sql/adaddls. pls <SYSTEM_PW> <SCHEMA_NAME> <SCHEMA_PW>SQL> @$AD_TOP/admin/ sql/adaaddls. pls <SYSTEM_PW> <SCHEMA_NAME> <SCHEMA_PW>SQL> @$AD_TOP/admin/ sql/adaddlb. pls <SYSTEM_PW> <SCHEMA_NAME> <SCHEMA_PW>SQL> @$AD_TOP/admin/ sql/adaaddlb. pls <SYSTEM_PW> <SCHEMA_NAME> <SCHEMA_PW>Example Syntax Form------------ -------SQL> @$AD_TOP/admin/ sql/adaddls. pls MANAGER XXCUS XXCUSSQL> @$AD_TOP/admin/ sql/adaaddls. pls MANAGER XXCUS XXCUSSQL> @$AD_TOP/admin/ sql/adaddlb. pls MANAGER XXCUS XXCUSSQL> @$AD_TOP/admin/ sql/adaaddlb. pls MANAGER XXCUS XXCUS9. Based on the examples provided in step #5 above, you should connect toSQL*Plus and create the appropriate grants and synonyms. Below you willfind the necessary grants and synonyms required for the sample objectsto be accessible by the Oracle Applications.Grant Priviledges from the Customer Schema to the APPS Schema------------ --------- --------- --------- --------- --------- -SQL> GRANT all ON my_event_test TO apps;SQL> GRANT execute ON ins_my_event_ test TO apps;Create Synonyms from the APPS Schema to the Custom Schema------------ --------- --------- --------- --------- ---------SQL> CREATE SYNONYM my_event_test FOR xxcus.my_event_ test;SQL> CREATE SYNONYM ins_my_event_ test FOR xxcus.ins_my_ event_test;You may refer to the Oracle Applications Release 11 OracleApplications Installation manual, page A-7, or to the OracleSQL Reference manual.10. You need to create a custom request group that will hold yourcustom and/or standard requests within a custom responsibility.You can do this by logging into Oracle Applications as SystemAdministrator and navigate:Security --> Responsibility --> Request.Example Custom Request Group:------------ --------- -------Group: XXCustomApplication: Custom ApplicationCode:Description: Custom Application11. After creating your custom request group, you need to create acustom responsibility for your custom user/schema. You can dothis by logging into Oracle Applications as System Administratorand navigate:Security --> Responsibility --> Define

Page 71: Interview_Q1

Example Custom Responsibility:------------ --------- -------- +----------- ------+------------ -----Responsibility Name: XXCustom | Effective Dates |Application: Custom Application +----------- ------+Responsibility Key: From: 05-JAN-1999Description: Custom Responsibility To:+----------- --------- ----+ +----------- --------- ----+| Available From | | Data Group |+----------- --------- ----+ +----------- --------- ----+x Oracle Application Name: StandardOracle Self Service Web Applications Application: Custom Application+----------- --------- ----+Menu: Requests Menu | Request Group |- Other Responsibilities +----------- --------- ----+Web Host Name: Name: XXCustomWeb Agent Name: Application: Custom Application+----------- --------- --------- --+| Function and Menu Exclusions |+----------- --------- --------- --+Type Name DescriptionYou may refer to the Oracle Applications Release 11 SystemAdministrator' s Guide on page 2-9 for more information.12. You can now register your test program as a concurrent programunder SQL*Plus execution method. Do register the program, youneed to ensure that the program is located in the $XXCUS_TOP/sqldirectory. Then, as System Administrator you should do thefollowing steps.a) First, you setup the executable program, which can be done bynavigating:Concurrent --> Program --> ExecutableExecutable = xxcus_insShort Name = xxcus_insApplication = PLSQL TestDescription = XXCUS insert into event testExecution Method = SQL*PlusExecution File Name = xxcus.sqlb) Second, you define the concurrent program, which can be doneby navigating:Concurrent --> Program --> DefineProgram = xxcus_insShort name = xxcus_insApplication = PLSQL TestDescription = XXCUS insert into event testExecutable Name = xxcus_insNOTE: You should leave all other settings as they are set as defaults.c) Third, you add the concurrent program to the concurrentrequest group, which can be done by navigating:Security --> Responsibility --> RequestGroup = XXCustomApplication = Custom ApplicationCode = <not entered>Description = xxcus_insRequests Type = ProgramRequests Name = xxcus_ins

Page 72: Interview_Q1

Requests Application = XXCustomYou have now completed the steps on how to create and register a customerschema in the Oracle Applications. The next section discusses how you cancreate the alert in Oracle Alerts.Create the Custom Event Alert------------ --------- --------This section will guide you through creating your test event alert basedon the example in the first section above.1. You log into the Oracle Applications, choose the Alert ManagerResponsibility and then navigate:Alert --> DefineYou can create a new alert as follows:a. You enter the appropriate general information for your alert:Application = xxcusName = xxcus_event_ alertDescription = My event alert testType = Eventb. You enter the Event Alert Details section for your alert andthen check the "After Insert" and "After Update" boxes:Application = XXCustomTable = my_event_testc. You enter the select statement, example is based on the testcomponents provided above:SELECT 'Insert into my_event_test table'INTO &V_OUTPUT1FROM SYS.DUAL;2. You can now click on the Action Button and create the detail actionfor your event alert, by the following steps:a. You can set the general action parameters:Action Name = xxcus_event_ actionAction Description = xxcus event detail actionAction Level = Detailb. You can click on action details:At this point, you can choose an action type, like a message andcomplete the message detail.NOTE: The article assumes that the integration between OracleApplications and an operating system mail server isalready configured correctly.3. You can navigate back to the main Alert Definition form, and click onthe Action Set button, which will allow you to enter a new action set.Below is a basic example consistent with the example code in thisentry.Seq = 1Action Set Name = xxcus_event_ actionsetThen, you need to check the "Enabled" check box so that your eventalert is enabled to run. You should set members as follows:Seq = 1Action = xxcus_event_ actionType = Action: MessageSeq = 2Action = Exit Action Set SuccessfullyType = Exit from Action Set successfullyRun and View the Custom Alert------------ --------- --------1. You should sign-on to the Oracle Application and navigate to the

Page 73: Interview_Q1

submit Concurrent Request form.2. You should make the request a single request, click the "OK" button,choose the "xxcust_ins" Concurrent Manager Program and then submitthe job.3. After submitting the Concurrent Request, you should close theConcurrent Request form, click on "View My Requests" and check thatthe request completed without error.4. If the Concurrent Request completed without error, you should beable to sign on to SQL*Plus and view an new row in your test table;you should also receive an email message based on the event alert.

88 How to integrate custom applications with oracle applications? ??

Overview--------

This article contains information on how to integrate custom Applications with the APPS schema. It is not meant to fix and/or solve all issues, but it is a good guideline. If custom Applications are not integrated properly, problems can occur with alerts, reports, requests, programs, etc...

It is recommended that you develop the custom applications code by followingthe standards exactly as described in the Oracle Applications Developers Guide and the Oracle Applications User Interface Standards manual. Deviations from these standards can have unpredictable results.

Oracle Applications Release 11i is a multi-tier architecture that allowsfunctions to be distributed among multiple tiers of servers (desktop client,forms server and the database server).

Procedure---------1. Register your custom application with the Application Object Library. It is recommended to use an XX as the preface to the custom schema short name so that it does not conflict with any future Oracle Application short names.

Log into Applications as the System Administrator and navigate to:Application --> Register.

For example:

Application Short Name Basepath Description------------ --------- --------- --------- --------- --------- -Custom Application XXCUS XXCUS_TOP Custom Application

2. Create a custom directory tree for your custom schema as the APPLMGR user.Use the basepath parameter from the Application registration for the top level directory. This top level directory will reside just under APPL_TOP. The subdirectories under the custom directory may vary depending on the server type (forms server, concurrent processing server, etc...). Make sure that the rights/protections are open for the world (rwx).

For example:APPL_TOP (/d01/visappl)|

Page 74: Interview_Q1

XXCUS_TOP (/d01/visappl/ XXCUS/11. 5.0)--> other productdirectories|------------ --------- --------- --------- ---------| | | | | | | |bin forms html lib log mesg out reports| |US US

3. Modify the applications environmental file (example: VIS.env) to include the custom schema basepath as the APPLMGR user.

For example:

XXCUS_TOP="/ d01/visappl/ XXCUS"export XXCUS_TOP

4. Register the custom schema as an Oracle user.

a. Create the user in the RDBMS database using SQL*Plus under the systemaccount. Give the user a default and temporary tablespace with quotas andthen grant the CONNECT role.

For example:

$ sqlplus system/managerSQL> create user XXCUS identified by CUST default tablespace USER_DATAtemporary tablespace TEMP quota unlimited on USER_DATA quota unlimitedon TEMP;SQL> grant connect to XXCUS identified by CUST;

Note: XXCUS is the product short name, CUST is the password for the customschema, USER_DATA and TEMP are existing tablespaces.

b. Register the user with the Application Object Library. Log intoApplications as the System Administrator and navigate to:Security --> ORACLE --> Register.

For example:

DatabaseUsername Password Privilege Install Group Description------------ --------- --------- --------- --------- --------- -XXCUS CUST Enabled 0 Custom Application

5. Add the custom schema to a data group. Log into Applications as the SystemAdministrator and navigate to: Security --> ORACLE --> DataGroup.

For example:

Data Group: StandardDescription: Standard Data Group

Application Oracle ID Description------------ --------- --------- --------- --------- --------- -

Page 75: Interview_Q1

Custom Application APPS Custom Application

It is recommend that you use the STANDARD datagroup and pair the custom schema with APPS or you can add a new data group. This depends upon your ownrequirements.

6. Create your custom tables, indexes, views and sequences. It is suggestedthat you add WHO columns to your custom tables so that Oracle Applications can keep track of customizations.

Register your custom schema's tables (including flexfields) with the PL/SQLpackage AD_DD. You use the procedure AD_DD.register_ table for the custom schema tables and AD_DD.register_ column for the custom schema table columns.

execute ad_dd.register_ table(appl short name, table name, table type,next extent, % free, % used)

Procedures in the AD_DD Packageprocedure register_table ( p_appl_short_ name in varchar2,p_tab_name in varchar2,p_tab_type in varchar2,p_next_extent in number default 512,p_pct_free in number default 10,p_pct_used in number default 70);

procedure register_column (p_appl_short_ name in varchar2,p_tab_name in varchar2,p_col_name in varchar2,p_col_seq in number,p_col_type in varchar2,p_col_width in number,p_nullable in varchar2,p_translate in varchar2,p_precision in number default null,p_scale in number default null);

procedure delete_table ( p_appl_short_ name in varchar2,p_tab_name in varchar2);

procedure delete_column ( p_appl_short_ name in varchar2,p_tab_name in varchar2,p_col_name in varchar2);

p_appl_short_ name The application short name of the application that owns the table (usually yourcustom application) .

p_tab_name The name of the table (in uppercase letters).

p_tab_type Use ’T’ if it is a transaction table (almost all application tables), or ’S’ for aâ€seed data†table (used only by Oracle Applications products).� �

p_pct_free The percentage of space in each of the table’s blocks reserved for future updates

Page 76: Interview_Q1

to the table (1–99). The sum of p_pct_free and p_pct_used must be less than 100.

p_pct_used Minimum percentage of used space in each data block of the table (1–99). Thesum of p_pct_free and p_pct_used must be less than 100.

p_col_name The name of the column (in uppercase letters).

p_col_seq The sequence number of the column in the table (the order in which the columnappears in the table definition).

p_col_type The column type (’NUMBER’, ’VARCHAR2’, ’DATE’, etc.).

p_col_width The column size (a number). Use 9 for DATE columns, 38 for NUMBERcolumns (unless it has a specific width).

p_nullable Use ’N’ if the column is mandatory or ’Y’ if the column allows null values.

p_translate Use ’Y’ if the column values will be translated for an Oracle Applicationsproduct release (used only by Oracle Applications products) or ’N’ if thevalues are not translated (most application columns).

p_next_extent The next extent size, in kilobytes. Do not include the ’K’.

p_precision The total number of digits in a number.

p_scale The number of digits to the right of the decimal point in a number.

Example of Using the AD_DD PackageHere is an example of using the AD_DD package to register a flexfieldtable and its columns:EXECUTE ad_dd.register_ table(’FND’, ’CUST_FLEX_TEST’, ’T’,8, 10, 90);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’APPLICATION_ ID’, 1, ’NUMBER’, 38, ’N’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’ID_FLEX_CODE’, 2, ’VARCHAR2’, 30, ’N’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’LAST_UPDATE_ DATE’, 3, ’DATE’, 9, ’N’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’LAST_UPDATED_ BY’, 4, ’NUMBER’, 38, ’N’, ’N’);

Page 77: Interview_Q1

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’UNIQUE_ID_COLUMN’, 5, ’NUMBER’, 38, ’N’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’UNIQUE_ID_COLUMN2’, 6, ’NUMBER’, 38, ’N’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’SET_DEFINING_ COLUMN’, 7, ’NUMBER’, 38, ’N’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’SUMMARY_FLAG’, 8, ’VARCHAR2’, 1, ’N’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’ENABLED_FLAG’, 9, ’VARCHAR2’, 1, ’N’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’START_DATE_ACTIVE’, 10, ’DATE’, 9, ’N’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’END_DATE_ACTIVE’, 11, ’DATE’, 9, ’N’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’SEGMENT1’, 12, ’VARCHAR2’, 60, ’Y’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’SEGMENT2’, 13, ’VARCHAR2’, 60, ’Y’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’SEGMENT3’, 14, ’VARCHAR2’, 60, ’Y’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’SEGMENT4’, 15, ’VARCHAR2’, 60, ’Y’, ’N’);

EXECUTE ad_dd.register_ column(’FND’, ’CUST_FLEX_TEST’,’SEGMENT5’, 16, ’VARCHAR2’, 60, ’Y’, ’N’);

For example:

$ sqlplus apps/appsSQL> execute ad_dd.register_ table ('XXCUS', 'CUST_TABLE' , 'T',8, 10, 90)

where appl short name='XXCUS' , table name='CUST_TABLE' ,table type='T', next extent=8, % free=10, % used=90

Page 78: Interview_Q1

execute ad_dd.register_ column (appl short name, table name, column name,column seq, column type, column width,null, translate)For example:

$ sqlplus apps/appsSQL> execute ad_dd.register_ column ('XXCUS', 'CUST_TABLE' , 'CUST_NO',1,'NUMBER',5,' N', 'N')

where appl short name='XXCUS' , table name='CUST_TABLE' ,column name='CUST_NO' , column seq=1, column type='NUMBER' ,column width=5, null='N', translate='N'

7. Run the custom schema against the APPS_DDL and APPS_ARRAY_DDL packages. Run the scripts $AD_TOP/admin/ sql/adaddls. pls, adaaddls.pls, adaddlb.pls and then adaaddlb.pls (in this order) under SQL*Plus:

$ sqlplus apps/appsSQL> @$AD_TOP/admin/ sql/adaddls. pls system_pword custom_schemacustom_schema_ pwordSQL> @$AD_TOP/admin/ sql/adaaddls. pls system_pword custom_schemacustom_schema_ pwordSQL> @$AD_TOP/admin/ sql/adaddlb. pls system_pword custom_schemacustom_schema_ pwordSQL> @$AD_TOP/admin/ sql/adaaddlb. pls system_pword custom_schemacustom_schema_ pword

8. Integrate your database objects with the APPS schema by granting APPS theaccess to your custom schema's objects.

a) Grant all privileges from each custom data object to APPS.

For example:

$ sqlplus xxcus/custSQL> grant all on CUST_TABLE to APPS

b) Create a synonym in APPS to each custom data object.

For example:

$ sqlplus apps/appsSQL> create synonym APPS.CUST_TABLE for XXCUS.CUST_TABLE

c) Create custom code objects in APPS

For example:

$ sqlplus apps/appsSQL> create function CUST_FUNCTION…

9. Build your custom forms, menus and libraries as the APPLMGR user. Use theTEMPLATE form located in $AU_TOP/forms/ US directory as the required startingpoint for your development work for your custom forms. Follow the form

Page 79: Interview_Q1

development steps (which incorporate the development standards) that aredescribed in the Oracle Application Developers Guide. You will modify the form as needed, move the generated form to its proper directory, register the form with the Oracle Application Object Library and then add it to a menu.

The following examples assume you are developing on the forms server.If theforms are being developed on a Windows client refer to Note:73880.1

a. Make a copy of the TEMPLATE form and then rename it as the APPLMGRuser.

For example:

$ cd $AU_TOP/forms/ US$ cp TEMPLATE.frm test.frm

b. In the forms designer attach any additional libraries to your customform. The TEMPLATE form already has the APPCORE, APPDAYPK, FNDSQF, GLOBEand CUSTOM libraries attached. The only Oracle Applications library thatyou should modify is the CUSTOM library. All the libraries need to residein directory $AU_TOP/resource/ plsql and make sure that your FORM45_PATHincludes $AU_TOP/resource so that your form can find the libraries.

c. Modify the form as desired following the development standards. Youwill be setting the properties of container and widget objects, creatingwindow layout, coding table handler, item handler, event handler and codelogic, enabling querying behavior, coding messaging, adding flexfieldlogic and coding any other appropriate logic.

d. Generate the form on the forms server as the APPLMGR user. Make sure that the $FORMS45_PATH is set and that the current directory is$AU_TOP/forms/ us.

f45gen userid=apps/ appspwd module=<form name>.fmboutput_file= <schema_top> /forms/<language >/<form name>.fmxmodule_type= form batch=no compile_all= special

For example:

$ f45gen userid=apps/ apps module=TEMP. fmboutput_file= /d01/visappl/ XXCUS/11. 5.0/forms/ US/TEMP.fmxmodule_type= form batch=no compile_all= special

where form name=TEMP,schema_ top=/d01/ visappl/XXCUS/ 11.5.0 andlanguage=US

e. Test the form by itself. Create either a static html file that callsyour form directly (instead of the usual signon form) or create a dynamichtml file and cartridge.

f. Register your form. Log into Applications as the Application Developerresponsibility and navigate to: Application --> Form.

For example:

Page 80: Interview_Q1

Form Application User Form Name Description------------ --------- --------- --------- --------- --------- -TEST Custom Application TEST Custom Form

g. Register the form as a function. If needed, register subfunctions perthe functionality that you require. Log into Applications as theApplication Developer responsibility andnavigate to: Application --> Function. Click on "Description" in thepopup list.

For example:------------ -| Description |------------ -

Form Application User Form Name Description------------ --------- --------- --------- --------- --------- -TEST Custom Application TEST Custom Form

Now click on "Form" in the popup list.

------| Form |------

Function Form Application Parameters------------ --------- --------- --------- --------- --------- -TEST TEST Custom Application

Note: the Application field will be grayed out. It will automatically befilled in when you enter the form name in the Form field.

h. Add your custom functions (forms and subfunctions) to an existing menuor create a new one. The menu will be tied to a responsibility. Log intoApplications as the Application Developer responsibility andnavigate to: Application --> Menu.

For example:

Menu: XXCUS_MAINUser Menu Name: XXCUS_MAINDescription: Main Custom Menu

NavigatorSeq Prompt Submenu Function Description------------ --------- --------- --------- --------- --------- -1 Custom TEST Custom Form2 Requests Standard Request Submi Administer Requests

i. Create a custom request group that will hold your custom and/orstandard requests for your custom responsibility. Log into Applicationsas the System Administrator andnavigate to: Security --> Responsibility --> Request.

For example:

Page 81: Interview_Q1

Group: XXCustomApplication: Custom ApplicationCode:Description: Custom Application

Requests--------Type Name Application------------ --------- --------- --------- --------- --------- -Program Custom Report 1 Custom ApplicationProgram Custom Report 2 Custom Application

j) Create a custom responsibility for your custom schema. Log intoApplications as the System Administrator and navigate to:Security --> Responsibility --> Define. Be sure to add the responsibilityto a user.

For example:------------ -----Responsibility Name: XXCustom | Effective Dates |Application: Custom Application ------------ -----Responsibility Key: From: 05-JAN-1999Description: Custom Responsibility To:

------------ ----- ------------| Available From | | Data Group |------------ ----- ------------ -x Oracle Application Name: StandardOracle Self Service Web Applications Application: Custom Application

------------ ---Menu: XXCUS_MAIN | Request Group |------------ ---Web Host Name: Name: XXCUSWeb Agent Name: Application: Custom Application

------------ --------- --------- -| Function and Menu Exclusions |------------ --------- --------- -Type Name Description

k. Test the form from within Applications.

10. Build online help for your custom applications as the APPLMGR user.

a. Make sure that your custom form refers to your custom application shortname in the call to the FND_STANDARD. FORM_INFO routine in the PRE-FORMtrigger.

For example, in the forms designer open your custom form and navigate to:Triggers --> PRE-FORM. XXCUS is the custom application short name andBLOCKNAME is the name of the window:

begin

Page 82: Interview_Q1

FND_STANDARD. FORM_INFO( '$Revision: 99 $', 'Template Form', 'XXCUS''$Date: 99/05/25 12:01:01 $', '$Author: John Doe $');app_standard. event('PRE_ FORM');app_window.set_ window_position( 'BLOCKNAME' ,'FIRST_WINDOW' );end;

b. Create a subdirectory for your help files using the application shortname. This subdirectory will reside under the directory path specified bythe profile HELP_BASE_URL plus the language that you are working under.

c. Create a subdirectory under your help files subdirectory to hold thelinks files. The links allow Oracle Applications to find the correct helpfiles.

d. Create your online help html files. Include the html target tags of theform near the beginning of the file. The target name is comprised of theform name and the window name.

d. Create your online help html files. Include the html target tags of theform near the beginning of the file. The target name is comprised of theform name and the window name.

For example, create a file called $OA_DOC/US/XXCUS/ custom.htm using anhtml editor. The target tag with form name=CUSTOM and windowname=BLOCKNAME would be custom.BLOCKNAME:

<!doctype html public "-//w3c//dtd html 4.0 transitional/ /en"><html><head><meta http-equiv=" Content-Type" content="text/ html; charset=iso- 8859-1"><meta name="GENERATOR" content="Mozilla/ 4.51 [en] (WinNT; I) [Netscape]"><title>Custom Application Help </title></head><body bgcolor="#F8F8F8" ><a NAME="toc_"> </a> <a NAME="custom. BLOCKNAME" ></a>

e. Create your links file. The links file stores the connection betweenthe target and target in the destination html file. You will have onelinks file for each form and it will be named after the form. Copy anexisting Oracle Applications links file to your links subdirectory andmodify it.For example, copy an existing links file to your custom links subdirectory,modify $OA_DOC/US/XXCUS/ links/custom. htm using an html editor. The targetis CUSTOM_BLOCKNAME (form name=CUSTOM and window name=BLOCKNAME) , the htmlhelp file is custom.htm with a target tag of custom.BLOCKNAME:

<!doctype html public "-//w3c//dtd html 4.0 transitional/ /en"><html> <head><meta http-equiv=" Content-Type" content="text/ html; charset=iso- 8859-1"><meta name="GENERATOR" content="Mozilla/ 4.51 [en] (WinNT; I [Netscape]"></head> <body> <script LANGUAGE='JavaScrip t'>

function onerror(msg, URL, lineNum) {var newloc = '../../notfound. htm?' + queryString

Page 83: Interview_Q1

location.replace( newloc)return true}

var CUSTOM_BLOCKNAME = 'custom.htm# custom.BLOCKNAME '

var queryStringlocation.href. substring( location. href.indexOf( '?')+1,location. href.length)var newloc = '../' + eval(queryString)location.replace( newloc)

</script></body> </html>

f. If desired, a link to your custom application can be added to theOracle Applications online help file, library.htm

11. Create your message dictionary.

a. Make sure you have a message (mesg) subdirectory under your customapplications basepath.

b. Define your messages following the message standards. Login as theApplication Developer and navigate to: Application --> Messages.

For example:

Name Language Application Number------------ --------- --------- --------- --------- --------- -XXCUS_UPDATE US Custom Application 1

Current Message Text------------ --------- --------- --------- --------- --------- -Custom Applications update message

c. Create the message files. From the operating system run the MessageDictionary Generator program (FNDMDGEN) as the APPLMGR user.

FNDMDGEN apps/appspword 0 Y <Language> <Application Short Name>DB_TO_RUNTIME

For example:

$ FNDMDGEN apps/apps 0 Y US XXCUS DB_TO_RUNTIME

where Language=US and Application Short Name=XXCUS

The FNDMDGEN program will generate a message file named <Language>.msb inplace it in the custom applications basepath mesg directory.

d. If needed make a copy of the generated file (located on the server) andtransfer the copy to the appropriate mesg directory for the customapplication on the client system.

e. Code the logic to set up messages. You will use calls to theFND_MESSAGE package to retrieve and set up messages for display.

Page 84: Interview_Q1

f. Code the logic to display messages. You will either display the messageto a user on the client or write it to a file on the server. You will usecalls to the FND_MESSAGE package to display messages.

12. Set up your concurrent processing for your Custom Schema.

a. Write the concurrent program execution file and place it in theappropriate directory. You can use a variety of methods such as C, Pro*C,SQL*Plus, PL/SQL, Oracle Reports or a host language program (a shellscript).

b. Define the concurrent program executable with the Oracle ApplicationObject Library. This links the execution file and the method used to executeit with a defined concurrent program. Log into Applications as the SystemAdministrator and navigate to: Concurrent --> Program --> Executable.

For example:

Executable: XXCUSShort Name: XXCUSApplication: Custom ApplicationDescription: Custom Program for UpdatesExecution Method: SpawnedExecution File Name: XXCUSUPTSubroutine Name:

c. Define the concurrent program with the Oracle Application ObjectLibrary along with any program parameters or any incompatibilities. Loginto Applications as the System Administrator and navigate to:Concurrent --> Program --> Executable.

For example:

Program: Custom Update x EnabledShort Name: XXCUSApplication: Custom ApplicationDescription: Custom Program for Updates

Executable----------Name: XXCUS OptionsMethod: Spawned Priority

Request Output------- ------Type: Format: TextUse in SRS x SaveAllow Disabled Values x PrintEnable Trace Columns:x Restart on System Failure Rows:NLS Compliant style Style:Style RequiredPrinter:

Page 85: Interview_Q1

d. Add the request functionality for your concurrent program. The programcan be called from the run reports form, from a trigger within anapplication form or from a Pro*C program. To use the run reports form,just add the submit request window to your custom menu so that you haveaccess to the Standard Request Submission interface (SRS).

89 What are the actual executables called?

1. These are the various Forms component names on Unix and Windows:

Unix WindowsForms Builder f60desm ifbld60.exeForms Compiler/Generator f60gen/f60genm ifcmp60.exeForms Runtime f60run/f60runm ifrun60.exeForms Metric Server d2ls60 d2ls60.exeForms Metric Client d2lc60 d2lc60.exeForms CGI f60cgi ifcgi60.exeForms Server f60srvm ifsrv60.exeForms Web Runtime f60webm ifweb60.exe

90 What are some of the related Forms/Apps files?

adfmcctl.sh - located in $COMMON_TOP/ admin/scripts, this script starts and stops the Forms Metric Client for your Apps instance; it uses the Forms d2lc60 executable to accomplish this.

adfmsctl.sh - located in $COMMON_TOP/ admin/scripts, this script starts and stop the Forms Metric Server for our Apps instance; it uses the Forms d2ls60 executable to accomplish this.

adfrmctl.sh - located in $COMMON_TOP/ admin/scripts, this script starts and stops the Forms Server Listener; similar to and actually calls the f60ctl found in $ORACLE_HOME/ 6iserver/ bin of IAS.

appsweb.cfg - located in $OA_HTML/html/ bin, this file defines parameter values used by the Forms Web CGI, similar to formsweb.cfg found in $ORACLE_HOME/ 6iserver/ forms60/server of IAS.

appsbase.html - located in $OA_HTML/<language> , this is the default HTML file for starting an applet using Jinitiator, similar to basejini.htm found in $ORACLE_HOME/ forms60/server of IAS.

d2lc60.txt - located in $COMMON_TOP/ admin/install, this is the Forms metric client log file.d2ls60.txt - located in $COMMON_TOP/ admin/install, this is the Forms metric server log file.f60svrm.txt - located in $COMMON_TOP/ admin/install, this is the adfrmctl.sh log file. This is not the same as the Forms server log file which not only logs startup and shutdown info but also client connectivity (which client IP is associated with which f60webm process) and debug stack trace info.OracleApplications. dat - located in $JAVA_TOP/oracle/ apps/fnd/ formsClient, among other things this file determines the path Apps uses to find their icons; its similar to and supplements registry.dat found in $ORACLE_HOME/ forms60/server of IAS.

91 List most usefull profile options for concurrent managers ??

Page 86: Interview_Q1

Profile Options Concurrent Manager

1. Concurrent: Active Request LimitValue: Numeric

This profile options will restrict the number of concurrent requests that may be run simultaneously by each user. If you do not specify a limit, then no limit is imposed.

2. Concurrent: Attach URLValues: YES/NOIf you set this option to YES, then this causes a URL to be attached to requestcompletion notifications. For example, when a user submits a request and usesthe 'Defining Completion Options' region to specify people to be notified,a notification is sent each of the people designated.

3. Concurrent: Collect Request StatisticsValues: YES/NOIf you set this option to YES, this causes applications to collect statisticson your run-time concurrent processes.

4. Concurrent: Conflicts DomainValues: LOV (list of values: domains)This option identifies the domain within which all the incompatibilitiesbetween programs has to be resolved

5. Concurrent: Debug FlagsThis option is used to debug the transactions managers.You should only use this option at the request of Oracle Support.

6. Concurrent: Directory for CopyYou can identify a directory on your operating system to store copies ofyour report output or log files. This directory is used when a copyoperation is requested in character mode of the applications.

7. Concurrent: Enable Request Submission in View ModeValues: YES/NOSetting this option to YES will enable the 'Submit a New Request' buttonwhen users invoke the form FNDRSRUN (Find Requests Form). Navigationpath is either: (1) Menu: Help > View My Requests, or (2) navigate(with system administrator responsibility) to, Requests > View.

8. Concurrent: Hold RequestsValues: YES/NOThis option enables you to automatically place requests on hold aftersubmission

9. Concurrent: Multiple Time ZonesValues: YES/NOWhen the client's session and the concurrent manager are running in differenttimes zones, use this option to ensure that the request is scheduled immediatelyregardless of you client session's time zone.

10. Concurrent: PMON MethodThis option is presented for documentation purposes only. Users cannot see or

Page 87: Interview_Q1

alter this profile option. This option is not visible or cannot be updated from theSystem Profile Option (FNDPOMPV) form. The PMON method refers to the processmonitor. The Internal Concurrent Manager (ICM) monitors the individualconcurrent managers' processes to verify the managers are running. Normally,the PMON method must be set to LOCK. To change the profile option setting,you must execute the SQL script "afimpmon.sql" which resides in directory"$FND_TOP/sql/ ".

11. Concurrent: Report Access LevelValues: RESPONSIBILITY/ USERThis option determines access privileges to report output filesand log files generated by a concurrent program. This option can beset by a system administrator or by the user.

12. Concurrent: Report CopiesValues: NumericThis option determines the number of default copies that print for eachsubmitted concurrent request.

13. Concurrent: Request PriorityValues: NumericConcurrent requests in Oracle Applications are queued. Requests normallyrun according to a start time on a first submitted, first run basis. Priorityoverrides this request start time. A higher priority request starts before anearlier request. This option displays the default priority for you concurrentrequests. Only a system administrator can change your request priority.

14. Concurrent: Request Start TimeValues: Numeric (Date/Time)With this profile option, you can set the date and time that yourrequests are available to start running* If the start time is at or before the current date and time,requests are available to run immediately* Start a request in the future, for example, at 6:00 PM onDecember 31, 2000, enter the following value,31-DEC-2000 18:00* This profile option requires the date and time,for example, 31-DEC-2000 18:00* Changing values does not affect request already submitted

15. Concurrent: Save OutputValues: YES/NOSetting this option to YES will save the output from a concurrentrequest to a file.

16. Concurrent: Sequential RequestsValues: YES/NOSetting this option to YES will force concurrent requests to run sequentiallyin the order in which they were submitted.

17. Concurrent: Show Requests Set StagesValues: YES/NOSet this option to YES to show request set stages in the concurrentrequest screens.

Page 88: Interview_Q1

18. Concurrent: Show Requests Summary After Each Request SubmissionValues: YES/NOBy default the Request Summary (FNDRSRUN) form appearsafter every request submission. Set this option to NO if you havemultiple requests to submit and do not wish to see the Request Summaryform after each submission.

19. Concurrent: URL LifetimeValue: NumericIf the profile option 'Concurrent: Attach URL' has been set to YES, a URLis associated the output of an execution and is passed to anyone flaggedfor notification during the request submission. This optionspecifies how long (in minutes) the URL is to be kept active.

20. Concurrent: Use ICMValues: YES/NOICM (Internal Concurrent Manager)Set this option to YES to use the Internal Concurrent Manager to resolverequest conflicts (result from programs that are defined to be incompatible)instead of using the Conflict Resolution Manager (CRM).

21. Concurrent: Wait for Available TMValue: NumericTM (Transaction Manager)Use this option to specify the number of minutes that a client will waitfor a given transaction manager to become available before trying adifferent transaction manager.

92 How to find the files which contain the string MTL_SYSTEM_ITEMS_ KFV ?

$grep -i MTL_SYSTEM_ITEMS_ KFV `find . -depth -print | grep -v log`The above command provide a list of the files that contain the string "MTL_SYSTEM_ ITEMS_KFV" and display the line on which it occurrs.

93 Why do I have invalid objects? What causes them?

Invalid objects can and will occur for many reasons. You will usually find invalid objects after running (or failing to run) adprepdb, doing an export/import, upgrading, or applying patches. Invalid objects are usually caused by missing grants, synonyms, views, tables or packages, but can also be caused by corrupted packages.

94 Why does Oracle Support always tell me to recompile my invalid objects?

Compiling invalid objects on your database is almost the equivalent of running scandisk on a PC hard drive. This should be one of the first things you check if you start experiencing problems with your Oracle database. It is also a good idea to schedule regular checks for invalid objects.

When you call in to Oracle Support with a database or installation issue, one of the first questions they will probably ask is whether you have checked for and resolved any invalid objects.

96 Are invalid objects ever acceptable? How many is too many?

Page 89: Interview_Q1

If the invalid objects exist for a product or application that is not installed, it may be ok to have some, but it is preferable to have no invalid objects existing at all. If invalid objects exist for a product or application that you do have installed and are using, then it should be considered unacceptable and any existing invalid objects should be resolved before further issues can occur.

There is no set number of invalid objects that could be considered'acceptable' as each situation will vary widely from one databaseto the next. You could just have a few invalid objects or they could number in the hundreds or even thousands, but every effort should be made to resolve them one way or another.

97 If we do not use the application with the invalid objects, can wedelete them?

There are times when invalid objects have occurred where you may opt tosimply delete them, but you must ensure that they are in a product or application that is not used.

98 Which OBJECTS table is best to use for queries? ALL, USER or DBA?

You should normally use DBA_OBJECTS, but there may be occasions when you will want to use USER_OBJECTS. It is not recommended to use ALL_OBJECTS.

USER_OBJECTS - returns objects owned by the user (schema) you areconnected as.DBA_OBJECTS - returns every object in the Database.

99 How can I recompile all my invalid objects using ADCOMPSC.pls?Within Applications, there is a script to compile INVALID objects - calledADCOMPSC.pls

Arguments for ADCOMPSC.pls:1 - Schema to run in2 - Password for schema3 - Check errors for objects starting with #3

NOTE: The order in which to compile Invalid Objects in schemas isSYS, SYSTEM, APPS and then all others. APPS_DDL and APPS_ARRAY_DDLshould exist in all schema's. If you encounter an ORA-1555 errorwhile running adcompsc.pls, just restart the script.

The script can be run as follows:

cd $AD_TOP/sqlsqlplus @adcompsc.pls SCHEMA_NAME SCHEMA_PASSWORD %

Example: SQL> @adcompsc.pls apps apps %

After the script completes, check for invalid objects again. If the numberhas decreased, but you still have invalid objects, you should runadcompsc.pls again. Keep running adcompsc.pls until number of invalidobjects stops decreasing.

100 What Oracle Applications DBA has useful collection of SQL scripts.

Page 90: Interview_Q1

Script11.0.x 10.7NCA 10.7SC/16.1 Descriptionadcompsc.pls x x x Compile objects in a given schemaadcpresp.sql x The script duplicates rows in FND_RESPONSIBILITY in the following way:Find data_group_id dg_id for the given data_group_name.For each row with data_group_id 0 in FND_RESPONSIBILITY, look for a corresponding row with data_group_id dg_id, with the same application_ id, and responsibility_ name that only differs in the given suffix string suffix_string. If such a row does not exist for the data_group_id dg_id, insert it.aderrch2.sql x x x Reports all compilation errors for a given schema.aderrchk.sql x x x Same as aderrch2.sql plus it fails if there are any errorsadtresp.sql x A fix for customers who have more than one set of books and they installed languages other than AMERICAN English. The symptom of the bug is that responsibility names are not translated properly for non-Standard data groups.adutcobj.sql x x x Count objects by object type in schemaadutconf.sql x x x Utility script to display configuration of Applicationsadutfip.sql x x x Utility script to display worker informationadutfpd.sql x x x Utility script to display product dependency informationADXANLYZ.sql x x x Analyze all tables in an ORACLE ID with estimate sample 20%ADXCKPIN.sql x x x Query the shared_pool area to determine space used by PL/SQL objects and whether they have been pinned.ADXGNPIN.sql x x x Creates and runs a "pin" script for all packages and functions in a give schemaADXGNPNS.sql x x x Creates and runs a "pin" script for all sequences in a give schemaADXINMAI.sql x x x Install tables and views used by the Applications* DBA sql scripts.adxirc.sql x x x AD - index - report columnsadxirn.sql x x x Drops and recreates an index as nonunique.ADXLMCBC.sql x x x Live Monitor, Categorize Block ContentionADXLMLSO.sql x x x Live Monitor, List Session ObjectsADXLMQMS.sql x x x Live Monitor, Query Monitor StatisticsADXLPFLS.sql x x x Lock Problem, Find Lock SourceADXLPSLU.sql x x x Lock Problem, Show Lock Usersadxpriv7.sql x x x grant privileges to a userADXRCSDC.sql x x x Report Configuration, Show Database Configuration formerly, config.sql (rollback, tablespace, data files)ADXRCSTG.sql x x x Report Configuration, Select Table Grantsadxrfmi.sql x x x report installed modules from fnd_module_installa tionsadxrfpi.sql x x x report rows from fnd_product_ installations and related tablesADXRSEBH.sql x x x Estimate the effect of a bigger SGA cache on cache hit rate.ADXRSESH.sql x x x Estimate the effect of a smaller SGA cache on cache hit rate.ADXRSFIS.sql x x x Find the size (blocks, extents, extpct) of the given index.ADXRSFTS.sql x x x Find the size (blocks, extents, extpct) of the given table.ADXRSFUA.sql x x x Report the number of blocks used and the number of extents used for every table or index in every user in the database.ADXRSLFS.sql x x x Report free extents in each tablespace.ADXRSQDP.sql x x x Check for cache effectiveness for dc_xxxxx parameters' values.ADXRSRTS.sql x x x Produce a brief database used space report.ADXRSSIE.sql x x x Generate a list of tables and indexes whose next extent to be grabbed would be too large to be allocated in their corresponding tablespaces.ADXRSSMF.sql X x x List tables and indexes with a number of allocated extents close to their max_extents.ADXRSSMS.sql X x x Find space used for one's own segments.

Page 91: Interview_Q1

ADXRSSRS.sql X x x Show v$rollstat statistics.ADXRSSSU.sql X x x For a username, report the number of blocks used and the number of extents used for every table or index in that username.ADXRSSTF.sql X x x Produce a brief report of database fragmentation by tablespace.ADXRSSUS.sql X x x Report how much space each user has.ADXUPLUP.sql X x x Generate a list of processes which the given user (NOT the database account's username) owns.ADXUPSRU.sql X x x Show all users that have active transactions per Rollback Segment that they are writing to.applcrt.sql x x Modified CRT definitions for Applications Environment

Regular Activities:

1) Check the alert_SID.log file and check the errors

2) What steps to be performed if problem accours like database hangs or listener downs

a) Check the file systemb) If the file system full then increase the file system for database for otherspurge the logs

3) Purge the conncurrent request manager logs select the parameters asentity : allmode : agemode value: 7

You may get the error snapshot too old some times then you need to shrink the rollbacksegments and then re-run the program.this program will not remove the logfiles from the os levl, you have to remove it manually.

find /var/tmp -user testora -mtime +7 -exec rm -f {} \; 2>/dev/nullfind /testfm/testcomn/ admin/log -user testappl -mtime +7 -exec rm -f {} \; 2>/dev/nullfind /testfm/testcomn/ admin/out -user testappl -mtime +7 -exec rm -f {} \; 2>/dev/null

Note: You can modify above commands accordingly for other instances.

find /testdata/testdb/ 8.1.7/admin/ TEST/bdump -user testora -mtime +7 -exec rm -f {} \;2>/dev/nullfind /testdata/testdb/ 8.1.7/admin/ TEST/cdump -user testora -mtime +7 -exec rm -f {} \;2>/dev/nullfind /testdata/testdb/ 8.1.7/admin/ TEST/udump -user testora -mtime +7 -exec rm -f {} \;2>/dev/null

What files can be removed for OS ?

The following files can be removed to the respective directory, If you sure then only remove this

Page 92: Interview_Q1

files

OS Related

/var/adm/wtmp/var/spool/* /*$HOME/smit.log$HOME/smit.script$HOME/websm. log$HOME/websm. script/etc/security/ failedlogin/var/adm/sulog

1)rm /var/adm/wtmptouch /var/adm/wtmpchown adm:adm /var/adm/wtmpchmod 544 /var/adm/wtmp

2)rm /var/adm/sulogtouch /var/adm/sulogchown root:system /var/adm/sulogchmod u+rw /var/adm/sulog

3)rm $HOME/smit*

How to remove shared memory segments in UNIX after killing processes ?

A: There must be some flag in ipcs command which gives NATTCH(which is the number ofprocesses attached to it,refer to the man pages of ipcs command).

PS:You have to login as ORACLE_HOME owner to remove the segment

for eg In our AIX 4.3.3

flags a,o gives NATTCH (for a flag $9 gives NATTCH,for o flag $7 gives NATTCHipcs -map|awk '$9==0'

T ID KEY MODE OWNER GROUP CREATOR CGROUP NATTCH SEGSZ CPID LPID ATIME DTIME CTIME

m 7 0x00000790 --rw-rw-rw- root system root system 0 4008 27606 27606 0:30:08 0:30:090:30:08

ipcs -map|awk '$9==0 {print $2}'

gives the shared memory ID that is 7

you can use "ipcrm -m 7" to kill the shared memory segment

106 How to cancel the request which is submited by other user ???

Page 93: Interview_Q1

Login as sysadmin user with system administrator responsibility and go toConcurrent ïƒ Requestïƒ Specific Request(give the request id) ïƒ find and then cancel

107 How to bounce the http server for maximo ???Login as root on hiltrn then goto/ust/HTTPServer/ bin

#./apachectl stop

#./apachectl start

108 Finding the maximum number of processes defined per user ??

The procedures are valid for AIX version 4.3.0.0

1. Start up the SMIT utility.2. Select 'System Environments' .3. Select 'Change / Show Characteristics of Operating System'.4. The number shown in 'Maximum number of PROCESSES allowed per user' will show the maximum limit the user has defined.

104 How to determine os file system block size in AIX??As the root user startup the 'smitty fs' o/s utility

Go toAdd / Change / Show / Delete File Systems=> Journaled File Systems=> Change / Show Characteristics of a Journaled File System=> Select the file system you want to see

You can see this outputSIZE of file system (in 512-byte blocks) [16384]

Alternate Method

Create a test directory and determine its size using ls -l

mkdir test

ls -l test

105 Is it posible to create a Database link without alias in tnsnames.ora

Yes It's possible to create a database link without having a alias in your tnsnames.ora file. This is beneficial when you use a remote database only for one time or when your tnsnames.ora is shared on a fileserver and you don't have the privileges to update the file.

Create database link <db link name>connect to <username>identified by <password>using '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)

Page 94: Interview_Q1

(HOST = <your host>)(PORT = 1521)))(CONNECT_DATA = (SID = <your sid> )))'

106 How to determine size of a oracle process on Unix

Purpose~~~~~~~DBAs are often alarmed by the percieved size of an Oracle process.This note describes the various aspects of measuring the actual size.Scope & Application~~~~~~~~~~~~ ~~~~~~~It is intended to clarify the various measurements that can be obtained, andhow to proceed further.Determining the Size of an Oracle Process:~~~~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~INTRODUCTIONOn UNIX platforms, the size of a process is often measured using operatingsystem utilities such as 'ps' or 'top'. Such utilities can imply alarminglylarge process sizes.WHY CAN PROCESS SIZES BE REPORTED INCORRECTLY?============ ========= ========= ========= =======The two main reason for incorrect reporting of process memory usage are:inclusion of non-private (i.e. shared) memory in the process memory figure,and the operating system not reclaiming freed memory. These topics arecovered in more detail below.Inclusion of non-private memory~~~~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~A process in memory is composed of several parts:shared memory (the SGA)shared libraries (both public, and private)private data (referred to as DATA, or heap)the executable (referred to as TEXT)N.B. The SGA and TEXT regions are shared by all Oracle processes. These aremapped only once into memory, and not once per process. As such, these are notpart of the incremental cost of spawning a new Oracle process.Unfortunately, commands such as 'ps' and 'top' include TEXT sizes whenmeasuring private data. Further, the SGA size can also be included, giving awildly inaccurate figure for the private data of a server process.Some operating systems provide better tools for measuring process sizes. Forexample, Solaris has /usr/proc/bin/ pmap, and HP has glance (view the process'virtual memory map) or the kernel debugger q4 (see the following note:[NOTE:66637. 1] "Virtual Memory on HP-UX 10.X").Here is an example of using 'ps', 'top' and 'pmap' on Solaris, against anOracle server process (pid 3254):% ps -eafl | grep 3254F S UID PID PPID C PRI NI ADDR SZ .... CMD8 S usupport 3254 3253 0 55 20 62f4a0b8 18985 .... oracleV817% topPID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND3254 usupport 1 59 0 148M 124M sleep 0:00 0.05% oracle% /usr/proc/bin/ pmap -x 32543254: oracleV817 (DESCRIPTION= (LOCAL=YES) (ADDRESS= (PROTOCOL= beq)))Address Kbytes Resident Shared Private Permissions Mapped File00010000 26744 9368 8416 952 read/exec oracle <--TEXT

Page 95: Interview_Q1

01A3C000 272 272 208 64 read/write/exec oracle <--TEXT01A80000 152 144 - 144 read/write/exec [ heap ] <--private DATA80000000 114928 114928 - 114928 read/write/exec/ shared [shmid=0x191] <--SGA...<deleted some output here>....-------- ------ ------ ------ ------total Kb 148024 127424 10896 116528From the above,'ps' shows the SZ value as 18985 or approaching 19MB.'top' shows the size as approx 148MB.'pmap' shows the total size to be 148MB, but gives a breakdown by region:The TEXT size is approx 28MBDATA area is 150kBSGA is approx 115MB. The shared memory ID is given as [shmid=0x191]The shared memory segment identifier is 0x191=401.This correlates with ipcs:%ipcs -mT ID KEY MODE OWNER GROUPm 401 0xe265699 c --rw-r----- usupport dba^^^This highlights that the private data area of approx 150kB cannot be measuredaccurately from standard operating system utilities such as 'ps' and 'top'whereas 'pmap' allows a more accurate figure to be determined.Operating system not reclaiming memory~~~~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~In general, after a process has freed some memory, it is not returnedimmediately to the operating system's free pool. Instead, this memory is stillassociated with the process, until such time that the operating system runs lowon free memory, and starts to take freed pages back. Consequently, operatingsystem utilities can report process sizes to be larger than they really are.HOW MUCH MEMORY IS ORACLE ACTUALLY USING?============ ========= ========= ========= ==From an Oracle perspective, a server process' private memory is composed ofseveral Oracle 'heaps'. In Oracle terminology, a heap is a managed area ofmemory. To the operating system, this is just another piece of memory allocatedto an application. The heap names of interest are PGA and UGA. The purpose ofthese heaps is unimportant in the context of this note.The amount of memory that Oracle currently has, and has ever had in these heapsis obtained from the following statistics:select statistic#, namefrom v$statnamewhere name like '%ga memory%';15 session uga memory16 session uga memory max20 session pga memory21 session pga memory maxTo check the heap sizes for all sessions:select value, n.name|| '('||s.statistic# ||')' , sidfrom v$sesstat s , v$statname nwhere s.statistic# = n.statistic#and n.name like '%ga memory%'order by value;A large PGA/UGA does not necessarily indicate a problem. For example, thefollowing init.ora parameters affect the size:Parameter:SORT_ AREA_SIZEParameter:SORT_ AREA_RETAINED_ SIZE

Page 96: Interview_Q1

Parameter:HASH_ AREA_SIZEIS THERE A PROBLEM?============ =======Firstly, standard operating system utilities such as 'ps' and 'top' should notbe used to get absolute figures, but used instead to observe trends (forexample, is a process size increasing or decreasing), for the reasonspreviously stated. A specialist utility such as 'pmap' should be used to get amore accurate figure. Even this may be misleading, as the operating system maynot have reclaimed previously freed memory.Always query the database, using a query similar to the v$sesstat SQL givenabove, to determine how much memory Oracle thinks it is using.If such a query shows a session's memory usage constantly increasing over time,without levelling off, then there may be a memory leak of some description.For example, a process may be allocating memory for a particular repeatedoperation, but not freeing it in between. A memory leak would typically resultin a large process size that cannot be explained by the related init.oraparameter settings.If a process size keeps growing, then it may eventually fail with an ORA-4030"out of process memory when trying to allocate %s bytes" error if the operatingsystem is exhausted of memory, or the memory size hits some operating systemdefined limit (such as maxdsiz on HP-UX).To start diagnosing a problem with the process size, such as a suspected memoryleak, a heapdump of the offending process is required:$ svrmgrlSVRMGR> connect internalSVRMGR> oradebug setospid <pid>SVRMGR> oradebug unlimitSVRMGR> oradebug dump heapdump 5 <--this dumps PGA and UGA heapsThe following information should be provided to Oracle Support Services:1. Identify the problem session2. Run the following to demonstrate the memory growth:select to_char(sysdate, 'dd-mon-yyyy hh24:mi:ss') from dual;select value, n.name|| '('||s.statistic# ||')'from v$sesstat s , v$statname nwhere s.statistic# = n.statistic#and n.name like '%ga memory%'and sid= <sid of problem session>;These should be run periodically, from near the start of the session, andmust show the increase in memory.3. Once the memory usage starts to increase, get multiple heapdumps (say amaximum of five), separated by a time period that will highlight theincrease. Note that all heapdumps will write to the same trace file inthe user_dump_dest (for non-background processes). This will potentiallylead to a large trace file, so be aware of this when deciding when to dumpthe heaps, and how often.4. An indication of what the client process is doing.For example, Pro*Lang codePL/SQL procedure

107 How do you create a database link with out changing tnsnames.ora file ??

create database link EDW_APPS_TO_ WH connect to APPS identified by <pwd> using '(DESCRIPTION= (ADDRESS= (PROTOCOL= TCP)(HOST= ibm1)(PORT=1524)) (CONNECT_ DATA=(SID= TEST)))'

Page 97: Interview_Q1

With entry in tnsnames.ora file

create public database link HILVIS connect to SAMPLEOLAP identified by <pwd> using 'VIS'

108 Grant privs to access v$ views ?

SQL>grant select on v_$instance to gitesh;

Than gitesh will be able to access v$instance.It is needed to quary for database name that which database he or she is access

109 What command is used to find the zombi processes /dead process in unix?

ps -aef | grep defunct

110 How to kill all the processes under perticulat file system ?

fuser –xkuc /uatfm -ïƒ to kill the processes under /uatfm file system

111 How to find what are the products installed in your database ?

Select Application_ id, PATCH_LEVEL from fnd_product_ installations wherePATCH_LEVEL LIKE '%FND%'

112 Create a directory with the user privaliges from root

Su uatcappl –c “mkdir –p /uatfm/uatappl†�

113 Exporting a database from 9i and Importing on 8.1.7 database

114 Sharing Tablespace Data Between Different Databases

Importing a database from Oracle 9i to Oracle 8.1.7 is a problem. Oracle document says that it can be done for a table or user by user. But usually this gives an error. More specially if you are using Policy. I am listing a way to achieve this for the whole database.

Source database on Oracle 9i------------ --------- -------

1. cd $ORACLE_HOME/ rdbms/admincp catexp.sql catexp92.sql2. Ftp the catexp.sql file for Oracle 8.1.7 installation to Oracle 9i installation.3. Apply the Oracle 8i catexp.sql file to Oracle 9i database as sys to rebuild the export catalog on Oracle 9i database similar to Oracle 8.1.7.4. Now take an export of oracle 9i database and ftp to oracle 8i installation.

Target database on Oracle 8i------------ --------- -------

Import the export file into Oracle 8i database. It will export successfully.

Reason for error: There are some export catalog views in Oracle 9i which are not compitable with Oracle 8i.

Page 98: Interview_Q1

I have used process successfully.

114 Sharing Tablespace Data Between Different Databases

Last day of every month once inventory is closed from all over the country, production database is cloned to another server. Using some of tools data for current month are loaded into a reporting database which holds the historical as well as current month end data Corporate Reporting . Different groups/Teams use the same reporting databases using db-link to process the report . Processing the data via database link sometimes cause a performance problem. Also we were storing the duplicate data for reference only . To avoid db-link performance , duplicating data etc.. I came with idea to implement which is supported by oracle of "Sharing Tablespace Data Between Different Databases" and it works.

Requirements for implementationsThe tablespace(s) that are to be shared must have the same oracle block size and must always be in READ ONLY status for both databases. Also both databases should be on same server and their versions should be same .

PROCEDURE TO SHARE TABLESPACEThe To test these functionalities I used 2 databases namely DB1 ( source ) and DB2 target . DB1 is databases which holds the data and it should be shared with DB2 databases . Assuming that tablespace ARJD to be shared between DB1 and DB2 , perform the following steps :

On database DB1SQL> create tablespace ARJD datafile '/u03/gsbaseddata/ ARJD01.dbf' size 10M;Tablespace created.SQL> create user arjun identified by arjun default tablespace ARJD temporary tablespace temp;User created.SQL> grant connect , resource to arjun ;Grant succeeded.SQL> create table share_arjun (id number);Table created.Insert few records .....SQL> select * from share_arjun;ID----------1020

SQL> alter tablespace ARJD read only;Tablespace altered.Export useridexp userid=\"sys/ change_on_ install as sysdba\" file=arjd.dmp transport_tablespac e=y tablespaces= ARJD

SQL> alter tablespace ARJD offline;

Tablespace altered.

On database DB2

Page 99: Interview_Q1

SQL> create user arjun identified by arjun default tablespace users temporary tablespace temp;User created.SQL> grant connect , resource to arjun;imp userid=\"sys/ change_on_ install as sysdba\" file=arjd.dmp transport_tablespac e=y datafiles=/u03/ gsbaseddata/ ARJD01.dbf

Take tablespace on line from DB1.You can access the data from both database;

113 How to find the file size greater than 2Gb ?

Find /-xdev –size +2048 –ls |sort –r +6

115 How to determine the size of a Table ?

Analyze table <<Table>> compute statistics( for the table you're interested in )followed by:select blocks from user_tables where table_name ='<<desired table>>'then calculate:blocks * block_sizeResult :- correct size

116 How do I restrict or allow a few client machines to connect to Server ?

(In 9I implement the same in sqlnet.ora in 8I .protocol.ora /protocol.ora

The step are very simple , you need the following things1) You must know the IP-address or host name of the client machine.2) You have to create a file named protocol.ora in a your favorite editor say notepad or vi and add the following lines in it.# Add the following lines if you want to invite only the following client machine to connectTCP.INVITED_ NODES =(<Client IP-ADDRESS 1>, <Client IP-ADDRESS 2>)# Add the following lines if you want to invite all the client machine except the followingTCP.EXCLUDED_ NODES=(<Client IP-ADDRESS 1>, <Client IP-ADDRESS 2>)# The following is the required parameter.TCP.VALIDNODE_ CHECKING= yesHere is the simple example, to allows the user to connect to the oracle database with IP-ADDRESS 192.168.11.20 or 192.168.10.12 only , configure the protocol.ora as follows :-tcp.invited_ nodes=(192. 168.11.20 ,192.168.10. 12 )tcp.validnode_ checking= yes3)The destination of this file should be same as of sqlnet.ora and tnsnames.ora on the server.4)Stop and restart the listener to make this effect.

117 Export file Greater than 2GB is not a problem in 8I ?

Filesize greater than 2Gb is always been a problem at most of OS. This new feature of oracle 8i split the output dump file according to your size of wish by using FILESIZE OPTION .

Page 100: Interview_Q1

Syntaxexp <username/password> tables=<exportTable Name> file=<fil1.dmp, file2.dmp. ..> filesize=<FLSZ>FILESIZE=0 (default) Causes one file.FILESIZE=1024 Causes 1K files to be generated.FILESIZE=1K Same as above.FILESIZE=1M Causes 1Meg files to be generated.FILESIZE=1G Causes 1Gig files to be generatedFor exampleHere I am trying to create a dump file each of size 1000M.C:\>exp sam/dba_pass tables=EMPTEST file=(exp1.dmp, exp2.dmp, exp3.dmp) filesize=1000MExport: Release 8.1.6.3.0 - Production on Thu May 3 13:09:05 2001(c) Copyright 1999 Oracle Corporation. All rights reserved.Connected to: Oracle8i Enterprise Edition Release 8.1.6.3.0 - ProductionWith the Partitioning optionJServer Release 8.1.6.3.0 - ProductionExport done in WE8ISO8859P1 character set and WE8ISO8859P1 NCHAR character setAbout to export specified tables via Conventional Path .... . exporting table EMPTESTcontinuing export into file exp2.dmpcontinuing export into file exp3.dmp13333426 rows exportedExport terminated successfully without warnings.Observation : I observer file exp1.dmp, exp2.dmp and exp3.dmp in filesystem . exp1.dmp and exp2.dmp is of size 1000M and exp3.dmp is a last dump file of size 700K.Now you have three export files exp1.dmp,exp2. dmp and exp3.dmp , so to import these dump files , you also have to use FILESIZE option of import utility.IMPORT from more then one dump fileSyntaximp <username/password> tables=<tablename> file=(file1. dmp ,file2.dmp.. .) filesize=<FLSZ>Caution : FILESIZE value in imp should match with FILESIZE value of Export eg in our case 1000Mfor exampleC:\>imp sam/dba_pass tables=EMPTEST file=(exp1.dmp, exp2.dmp, exp3.dmp) filesize=1000M ignore=YImport: Release 8.1.6.3.0 - Production on Thu May 3 13:10:58 2001(c) Copyright 1999 Oracle Corporation. All rights reserved.Connected to: Oracle8i Enterprise Edition Release 8.1.6.3.0 - ProductionWith the Partitioning optionJServer Release 8.1.6.3.0 - ProductionExport file created by EXPORT:V08.01. 06 via conventional pathimport done in WE8ISO8859P1 character set and WE8ISO8859P1 NCHAR character set. importing NGUV50's objects into NGUV50. . importing table "EMPTEST" 13333426 rows importedAbout to enable constraints. ..Import terminated successfully without warnings.

Prior to 8I

# create a named pipe

Page 101: Interview_Q1

mknod exp.pipe p# read the pipe – output to zip file in the backgroundgzip < exp.pipe > scott.exp.gz &# feed the pipeexp userid=scott/ tiger file=exp.pipe ...

118 How to eliminate migrated or chained rows ?

To eliminate migrated or chained rows

You have to

(i) Create chained rows table;(ii) Analyze table < table_name> list chained rows;(iii) Eliminate the migrated or chained rows either by export/import or insert/delete method.

Pratical example.

Let us consider a table samtest in scott user. Now we will determine rowchaining in it and the way to eliminiate it.

SQL> connet scott/tiger

Let us consider your oracle home is e:\ora816

SQL> @ e:\ora816\rdbms\ admin\utlchain. sql

Above will create a chained_rows table in scott user.

SQL> analyze table samtest list chained rows;

Above will create populate a chained_rows table in case of chaining.

SQL > select owner_name,table_ name,head_ rowid from chained_rows;

Above will displays the rowid of migrated or chained rows ,if any.

If you found chaining eliminate is by export/import or insert/delete method.I am discussing here insert delete method.

SQL > Prompt create a intermediate table firstSQL > create table samtest_tab2asselect * from samtestwhere rowid in (select head_rowid from chained_rowswhere table_name = 'samtest');

Above will create a table samtest_tab2 with all the chained rows.

SQL> Prompt Delete the chained rows from the original tableSQL> delete from samtestwhere rowid in (select head_rowid from chained_rowswhere table_name=' samtest') ;

Page 102: Interview_Q1

SQL> Prompt insert the rows from the intermediate table samtest_tab2 to samtestSQL> insert into samtest select * from samtest_tab2;

SQL> prompt drop the intermediate tableSQL> drop table samtest_tab2;SQL> DELETE * from chained_rows where table_name=' samtest';SQL>Commit;

This way you can eliminate row chaining . To avoid row-chaining set pctfree and pctusedcorrectly. The row moves to another block when it is not able to fit in the same block. If you have more update on the table set pctfree more to make room in the block for increase in the size of the row after updation.

119 Performance Measurement of PLSQL code by DBMS_PROFILER

If you are not already configured DBMS_PROFILE package look the following script in Oracle Home->rdbms- >adminSCRIPT : PROFLOAD.SQL and PROFTAB.SQLSETUP :U:\>sqlplus /nologSQL*Plus: Release 9.2.0.1.0 - Production on Mon Apr 14 13:26:03 2003Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.SQL> connect sys/***** as sysdbaConnected.SQL> @D:\oracle\rdbms\ admin\profload. sqlPackage created.Grant succeeded.Synonym created.Library created.Package body created.Testing for correct installationSYS.DBMS_PROFILER successfully loaded.PL/SQL procedure successfully completed.Create the profiler tablesSQL> connect hr/hrConnected.SQL> @D:\oracle\rdbms\ admin\proftab. sqldrop table plsql_profiler_ data cascade constraints *ERROR at line 1:ORA-00942: table or view does not existdrop table plsql_profiler_ units cascade constraints *ERROR at line 1:ORA-00942: table or view does not existdrop table plsql_profiler_ runs cascade constraints *ERROR at line 1:ORA-00942: table or view does not existdrop sequence plsql_profiler_ runnumber *ERROR at line 1:ORA-02289: sequence does not existTable created.Comment created.Table created.Comment created.Table created.

Page 103: Interview_Q1

Comment created.Sequence created.The above script will create the following tablePLSQL_PROFILER_ DATA TABLEPLSQL_PROFILER_ RUNS TABLEPLSQL_PROFILER_ UNITS TABLELet us create a sample table and a procedure for demonstrationSQL> create table testemp(emp number);Table created.CREATE OR REPLACE PROCEDURE hr.testprocISi NUMBER := 0;vempno NUMBER;BEGINWHILE i < 100000LOOPINSERT INTO hr.testemp(emp)VALUES (i);COMMIT;i := i + 1;END LOOP;SELECT COUNT (*)INTO vempnoFROM hr.testemp;DBMS_OUTPUT. put_line ('No of record' || vempno);DELETE FROM hr.testemp;COMMIT;FOR i IN 1 .. 100000LOOPINSERT INTO hr.testemp(emp)VALUES (i);COMMIT;END LOOP;END testproc;/The following PL/SQL will call the profileSQL> Set serveroutput on;SQL>SQLDECLAREvrun NUMBER;BEGINvrun := SYS.DBMS_PROFILER. start_profiler ('TESTRUN1') ;DBMS_OUTPUT. put_line ('START PROFILER STATUS ' || vrun);hr.testproc; -- calling procedurevrun := SYS.DBMS_PROFILER. stop_profiler;DBMS_OUTPUT. put_line ('STOP PROFILER STATUS ' || vrun);DBMS_OUTPUT. put_line ('0 successful') ;DBMS_OUTPUT. put_line ('1 incorrect parameter');DBMS_OUTPUT. put_line ('2 data flush operation failed');

Page 104: Interview_Q1

DBMS_OUTPUT. put_line ('-1 version mismatch between package and tables');END;/Expected OutputSTART PROFILER STATUS 0No of record100000STOP PROFILER STATUS 00 successful1 incorrect parameter2 data flush operation failed-1 version mismatch between package and tablesPL/SQL procedure successfully completed.Now run the sql to find out the most extensive part of the plsqlSET linesize 132COL unit format a20COL tc format 9999999 heading "Exection"COL stext format a40SELECT u.unit_owner || '.' || u.unit_name unit, line#,ROUND (d.total_time / 1000000000) total_time_s, d.total_occur tc,SUBSTR (s.text, 1, 40) stextFROM plsql_profiler_ runs r,plsql_profiler_ units u,plsql_profiler_ data d,all_source sWHERE r.run_comment = 'TESTRUN1'AND r.runid = u.runidAND d.runid = u.runidAND u.unit_number = d.unit_numberAND s.owner = u.unit_ownerAND s.TYPE = u.unit_typeAND s.NAME = u.unit_nameAND s.line = d.line#ORDER BY line#/Expected OutputUNIT LINE# TIME[s] Exection STEXT------------ --- ---------- ------------ -------- ------------ --------- --------- --------- -HR.TEST 3 0.000 1 i number := 0;HR.TESTPROC 6 58.000 100001 while i < 100000HR.TESTPROC 8 4,951.000 100000 insert into hr.testemp(emp ) values (i);HR.TESTPROC 9 2,901.000 100000 commit;HR.TESTPROC 10 131.000 100000 i := i + 1;HR.TESTPROC 12 6.000 1 select count(*) into vempno from hr.testHR.TESTPROC 13 0.000 2 dbms_output. put_line( 'No of record'||vemHR.TESTPROC 14 1,461.000 1 delete from hr.testemp;HR.TESTPROC 15 0.000 1 commit;HR.TESTPROC 16 70.000 100001 for i in 1..100000HR.TESTPROC 18 5,371.000 100000 insert into hr.testemp(emp ) values (i);HR.TESTPROC 19 2,955.000 100000 commit;

120 When to rebuid an index ?

Observation 1.Observe height in index_stats view after analyzing the particular index. If it is >= 4 , it is good to rebuild index as it indicate a skewed tree structure. Although there is

Page 105: Interview_Q1

always been an exception to this rule. So observer the height in index_stats time to time and if height remain unchanged . It may be assumed that It is correct .Obervation 2.Observe del_lf_rows and lf_rows in index_stats view after analyzing the particular index. If the percentage (del_lf_rows/ lf_rows)* 100 > = 20 , It is good to rebuild index as it indicate unbalanced tree because of high update and delete occurred on it.Example :-ora816 SamSQL :> analyze index IND_PK validate structure;ora816 SamSQL :> select name,height, del_lf_rows, lf_rows,( del_lf_rows/ lf_rows) *100 from index_stats;NAME HEIGHT DEL_LF_ROWS LF_ROWS (DEL_LF_ROWS/ LF_ROWS)* 100------------ --------- --------- ---------- ----------- ---------- ------------ --------- ----INDX_PK 4 277353 990206 28.0096263ora816 SamSQL :> alter index IND_PK rebuild;Check the index_stats again.

121 Explain the analytical functions with examples

• ROLLUP AND CUBE AGGREGATE FUNCTIONS• RANKED FUNCTION• CASE• LAG AND LEAD FUNCTION• RATIO_TO_REPORT

To understand the power of ROLLUP and CUBE functions ,consider the following SQL statement :-

ora816 SamSQL :> compute sum of totsal on deptno

ora816 SamSQL :> break on deptno

ora816 SamSQL :> select deptno,job,sum( sal) totsal from emp group by deptno,job;

DEPTNO JOB TOTSAL

---------- --------- ----------

10 CLERK 1300

MANAGER 2450

PRESIDENT 5000

********** ----------

sum 8750

20 ANALYST 6000

CLERK 1900

MANAGER 2975

********** ----------

Page 106: Interview_Q1

sum 10875

30 CLERK 950

MANAGER 2850

SALESMAN 5600

********** ----------

sum 9400

Now see the use of ROLLUP Function

ora816 SamSQL :> select deptno,job,sum( sal) totsal from emp group by ROLLUP(deptno, job);

DEPTNO JOB TOTSAL

---------- --------- ----------

10 CLERK 1300

10 MANAGER 2450

10 PRESIDENT 5000

10 8750 Total of Deptno 10

20 ANALYST 6000

20 CLERK 1900

20 MANAGER 2975

20 10875

30 CLERK 950

30 MANAGER 2850

30 SALESMAN 5600

30 9400

29025 Grand Total

So if you compare the two output you will notice that you are getting the same output. By using rollup you can avoid compute and break clausesfrom SQL. This will mostly helpful in PL/SQL . We do not have to put logic for computing values on break of groups.

Now see the use of CUBE Function

Page 107: Interview_Q1

ora816 SamSQL :> select deptno,job,sum( sal) totsal from emp group by CUBE(deptno, job);

Fri Mar 23

NuGenesis Report

DEPTNO JOB TOTSAL

---------- --------- ----------

10 CLERK 1300

10 MANAGER 2450

10 PRESIDENT 5000

10 8750 Total of Deptno 10

20 ANALYST 6000

20 CLERK 1900

20 MANAGER 2975

20 10875

30 CLERK 950

30 MANAGER 2850

30 SALESMAN 5600

30 9400

ANALYST 6000

CLERK 4150

MANAGER 8275 Total w.r.t JOB

PRESIDENT 5000

SALESMAN 5600

Grand Total 29025

Cube also do a total with respect to second group for example JOB in our case . Also at end you will see the grand total

Conclusion : Rollup and Cube are the aggregate function which allows developers and dbas to avoid compute and break clauses and simplify logic of programming

Ranked Function in 8i (816)

Page 108: Interview_Q1

Suppose you have a data in table which you want to rank in a specified order for example you have a table test and you want to rank a value of repcol.

Ora816 SamSQL> select * from test;

REPCOL VALUE

---------- ----------

A 100

A 200

A 300

B 1000

B 900

B 800

A 500

B 400

B 500

Ora816 SamSQL> select repcol,value, rank() over ( partition by repcol

2 order by value desc ) ranked_value

3 from test;

REPCOL VALUE RANKED_VALUE

---------- ---------- ------------

A 500 1

A 300 2

A 200 3

A 100 4

B 1000 1

B 900 2

B 800 3

B 500 4

B 400 5

Page 109: Interview_Q1

The above value is ranked by the rank function provided by 8.1.6

Use of Case in SELECT

Case Statement are similar to decode , it is more flexible and gives better performace

Ora816 SamSQL> ed

Wrote file afiedt.buf

1 select sum(case when repcol='A' then value else 0 end) sum_of_A,

2 sum(Case when repcol='B' then value else 0 end) Sum_of_B,

3 sum(case when value = 500 then 1 else 0 end) Value_Eq_500,

4 sum(case when value > 100 then 1 else 0 end) Value_Gre_100

5* from test

Ora816 SamSQL> /

SUM_OF_A SUM_OF_B VALUE_EQ_500 VALUE_GRE_100

---------- ---------- ------------ ------------ -

1100 3600 2 8

Use of Group by in CASE

Ora816 SamSQL> ed

Wrote file afiedt.buf

1 select repcol,sum(case when repcol='A' then value else 0 end) sum_of_A,

2 sum(Case when repcol='B' then value else 0 end) Sum_of_B,

3 sum(case when value = 500 then 1 else 0 end) Value_Eq_500,

4 sum(case when value > 100 then 1 else 0 end) Value_Gre_100

5 from test

6* group by repcol

Ora816 SamSQL> /

REPCOL SUM_OF_A SUM_OF_B VALUE_EQ_500 VALUE_GRE_100

---------- ---------- ---------- ------------ ------------ -

A 1100 0 1 3

Page 110: Interview_Q1

B 0 3600 1 5

Ora816 SamSQL> ed

Wrote file afiedt.buf

1 select (case when value between 100 and 300 then '100-300'

2 when value between 400 and 700 then '400-700'

3 when value between 800 and 900 then '800-900'

4 when value > 900 then '>900' end) VALUE_RANGE,

5 count(*) as VALUE_COUNT

6 from test

7 group by

8 (case when value between 100 and 300 then '100-300'

9 when value between 400 and 700 then '400-700'

10 when value between 800 and 900 then '800-900'

11* when value > 900 then '>900' end )

Ora816 SamSQL> /

VALUE_R VALUE_COUNT

------- -----------

100-300 3

400-700 3

800-900 2

>900 1

Ora816 SamSQL> ed

Wrote file afiedt.buf

1 select (case when value between 100 and 300 then '100-300'

2 when value between 400 and 700 then '400-700'

3 when value between 800 and 900 then '800-900'

4 when value > 900 then '>900' end) VALUE_RANGE, value

Page 111: Interview_Q1

5* from test

Ora816 SamSQL> /

VALUE_R VALUE

------- ----------

100-300 100

100-300 200

100-300 300

>900 1000

800-900 900

800-900 800

400-700 500

400-700 400

400-700 500

9 rows selected.

Lag and Lead FunctionsOra816 SamSQL> ed

Wrote file afiedt.buf

1 select repcol,

2 value,

3 lag(value,1) over (order by repcol) lag_value ,

4 lead(value,1) over (order by repcol) lead_value

5* from test

Ora816 SamSQL> /

REPCOL VALUE LAG_VALUE LEAD_VALUE

---------- ---------- ---------- ----------

A 100 200

A 200 100 500

A 500 200 300

Page 112: Interview_Q1

A 300 500 1000

B 1000 300 500

B 500 1000 900

B 900 500 400

B 400 900 800

B 800 400

9 rows selected.

The LAG function provides access to a row at a given offset prior to the position and the LEAD function provides access to a row at a given offset after the current position.

The functions have the following syntax:

{LAG | LEAD}(, [ [, ]]) OVER([PARTITION BY [,...]]ORDER BY [collate clause>][ASC | DESC] [NULLS FIRST | NULLS LAST] [,...])

is an optional parameter and defaults to 1. is an optional parameter and is the value returned if the falls outside the bounds of the table or partition.

Ratio_to_reportThe RATIO_TO_REPORT function computes the ratio of a value to the sum of a set of values. If the expression value expression evaluates to NULL, RATIO_TO_REPORT also evaluates to NULL, but it is treated as zero for computing the sum of values for the denominator. Its syntax is:

RATIO_TO_REPORT() OVER([PARTITION BY [,...]])

where

• and can be any valid expression involving column references or aggregates.

• The PARTITION BY clause defines the groups on which the RATIO_TO_REPORT function is to be computed. If the PARTITION BY clause is absent, then the function is computed over the whole query result set.

Ora816 SamSQL> ed

Wrote file afiedt.buf

1 select repcol,2 value,3 sum(value) over() sumofvalue,4 ratio_to_report (sum(value)) over() RATIO

Page 113: Interview_Q1

5 from test6* group by repcol ,value

Ora816 SamSQL> /

REPCOL VALUE SUMOFVALUE RATIO

---------- ---------- ---------- ----------

A 100 4700 .021276596A 200 4700 .042553191A 300 4700 .063829787A 500 4700 .106382979B 400 4700 .085106383B 500 4700 .106382979B 800 4700 .170212766B 900 4700 .191489362B 1000 4700 .2127659579 rows selected.

Ora816 SamSQL> ed

Wrote file afiedt.buf

1 select repcol,2 value,3 sum(value) over(partition by repcol) sumofvalue,4 ratio_to_report (sum(value)) over(partition by repcol) RATIO5 from test6* group by repcol ,valueOra816 SamSQL> /

REPCOL VALUE SUMOFVALUE RATIO---------- ---------- ---------- ----------A 100 1100 .090909091A 200 1100 .181818182A 300 1100 .272727273A 500 1100 .454545455B 400 3600 .111111111B 500 3600 .138888889B 800 3600 .222222222

B 900 3600 .25B 1000 3600 .277777778

9 rows selected.

122 What is High Water Mark ?

High-water mark is an indicator or pointer up to which table or index has ever contain data

123 what is the utility used to licence a product ? Is it possible to delicence a product which is fully licenced ?A: adlicmgr.sh utility is used to licnece a product/products

Page 114: Interview_Q1

You cannot de-license an existing fully licensed product.

124 how to find the version of iAS ?

Apps 11.5.4 uses Apache 1.3.9 (must upgrade) Apps 11.5.5 uses Apache 1.3.12 (iAS 1.0.2.1s) --> OHS 1.0.2.1s Apps 11.5.7 uses Apache 1.3.19 (iAS 1.0.2.2.2) --> OHS 1.0.2.2 Apps 11.5.8 uses Apache 1.3.19 (iAS 1.0.2.2.2) --> OHS 1.0.2.2karunakarkandhi: that means if the apache version is 1.3.19 means iAS version is 1.0.2.2.2karunakarkandhi: rightbkpraveen25: yepbkpraveen25: Apache Version is 1.3.9 in Agilent

125 How do you generate a report (.rdf) file from the UNIX command line?

Solution Description------------ --------Use r25convm.

The following command will convert an .rdf report file to a .rex report fileand back to a .rdf report file:

r25convm syntax:

cd to where your .rdf file resides which is:<schema top>/srw If your Application version is 10.7<schema top>/reports If your Application version is 11

Logon as applmgr

r25convm userid=<schema owner of report>/<password> source=<report name>.rdfstype=rdffile dtype=rexfile dest=<report name>.rex overwrite=yes batch=yes

r25convm userid=<schema owner of report>/<password> source=<report name>.rexstype=rexfile dtype=rdffile dest=<report name>.rex overwrite=yes batch=yes

ie: r25convm FNDSCURS.rdf

*Note: userid is the schema owner;If the report is a GL report then the userid will be gl/glIf the report is a FND report then the userid will be apps/apps

For the FNDSCURS.rdf example the report reside in:cd $FND_TOP/srw If your Application version is 10.7cd $FND_TOP/reports If your Application version is 11

Logon as applmgr

The command line syntax is:

r25convm userid=apps/ apps source=FNDSCURS. rdf stype=rdffile dtype=rexfiledest=FNDSCURS. rex overwrite=yes batch=yes

Page 115: Interview_Q1

r25convm userid=apps/ apps source=FNDSCURS. rex stype=rexfile dtype=rdffiledest=FNDSCURS. rdf overwrite=yes batch=yes

*** Note: You may get the following error; just ignore the error message, this*** is a known issue with the reports team.

REP-25200: Converting 'FNDSCURS.rex' to 'FNDSCURS.rdf' ...

126 How do you generate a report (.rdf file) from a Windows NT command line?

Solution Description------------ --------Use r25conv32.exe to generate a report from the Windows NT command line.

The following command will convert an .rdf report file to a .rex report fileand back to a .rdf report file:

r25conv32 syntax:

1. Logon as applmgr

2. cd to where your .rdf file resides which is:<schema top>/srw If your Application version is 10.7<schema top>/reports If your Application version is 11

3. Issue the following commands:

r25conv32 userid=<schema owner of report>/<password>source=<reportname> .rdf stype=rdffile dtype=rexfile dest=<report name>.rexoverwrite=yes batch=yes

r25conv32 userid=<schema owner of report>/<password>source=<reportname> .rex stype=rexfile dtype=rdffile dest=<report name>.rdfoverwrite=yes batch=yes

Example: Generating FNDSCURS.rdf using r25conv32

***Note: userid is the schema owner;If the report is a GL report then the userid will be gl/glIf the report is a FND report then the userid will be apps/apps

1. Logon as applmgr

2. For the FNDSCURS.rdf example the report resides in:cd $FND_TOP/srw If your Application version is 10.7cd $FND_TOP/reports If your Application version is 11

3. The command line syntax is:

r25conv32 userid=apps/ apps source=FNDSCURS. rdf stype=rdffile dtype=rexfiledest=FNDSCURS. rex overwrite=yes batch=yes

r25conv32 userid=apps/ apps source=FNDSCURS. rex stype=rexfile dtype=rdffile

Page 116: Interview_Q1

dest=FNDSCURS. rdf overwrite=yes batch=yes.127 Running SQL*Trace on an Applications Report ?

Running a Report with SQL*Trace------------ --------- --------- -

Method #1:---------Normally, in order to run a report with SQL*Trace, you would haveto do the following:

1. Turn SQL*Trace on by modifying your init.ora file.2. Shut down the concurrent managers and the database.3. Bring the database and the concurrent managers back up.4. Arrange to run JUST that specific report without runninganything else.5. After running the report, shut down the database andconcurrent managers.6. Turn SQL*Trace off by modifying your init.ora file.7. Bring the database and concurrent managers back up.

Method #2:---------A simpler method is as follows (detailed instructions follow):

1. Backup your current .rdf of the report.2. Modify the .rex for the report, adding two simple lines.3. Convert the new .rex into the new .rdf file.4. Run the report.5. Restore the original .rdf file.

How to Run a Report with SQL*Trace using Method #2------------ --------- --------- --------- --------- --

1. Backup your current .rdf and .rex files.

2. Create the .rex file if necessary:

Make sure a .rex text file of the report exists. (Customers arenot shipped the .rex text file to save space on their system).If the .rex does not exist, create one by issuing the followingcommand as the applmgr user:

r25convm userid=<userid> /<password> source=<reportname> .rdfstype=rdffile dtype=rexfile dest=<reportname> .rex

For Example:

r25convm userid=ar/ar source=RAXIIR. rdf stype=rdffiledtype=rexfile dest=RAXIIR. rex

3. Edit the .rex file:

Page 117: Interview_Q1

A. Pull the .rex file into your editor of choice and searchfor 'SRWINIT'. You should find an entry similar to thefollowing, with a NAME of 'beforerep__ __':

Example I:

DEFINE TOOL_PLSQLBEGINITEMID = 103NAME = <<"beforerep0040" >>PLSLFID_EP = (BLONG) NULLPOBJECT_ID = 0TYPEPLSLFID_ST = (TLONG)<<"SRW.USER_ EXIT('FND SRWINIT');">>END

Example II:

BEGINSRW.USER_EXIT( 'FND SRWINIT');IF (:p_debug_switch = 'Y') THENSRW.MESSAGE( '1','After SRWINIT');END IF;END

B. Immediately after the ; which follows 'FND SRWINIT', (andremaining within the "" that surround the line) add thefollowing line:

srw.do_sql(' alter session set sql_trace=TRUE' );

The modified versions of the above examples should looklike the following:

Example I:

DEFINE TOOL_PLSQLBEGINITEMID = 103NAME = <<"beforerep0040" >>PLSLFID_EP = (BLONG) NULLPOBJECT_ID = 0TYPEPLSLFID_ST = (TLONG)<<"SRW.USER_ EXIT('FND SRWINIT');srw.do_sql(' alter session set sql_trace=TRUE' );">>END

Example II:

BEGINSRW.USER_EXIT( 'FND SRWINIT');

Page 118: Interview_Q1

srw.do_sql(' alter session set sql_trace=TRUE' );IF (:p_debug_switch = 'Y') THENSRW.MESSAGE( '1','After SRWINIT');END IF;END

C. Find the line similar to the following, by searchingfor 'SRWEXIT':

<<"SRW.USER_ EXIT('FND SRWEXIT');">>END

D. Immediately after the ; which follows 'FND SRWEXIT',but remaining within the "", add the following line:

srw.do_sql(' alter session set sql_trace=FALSE' );

For Example:

<<"SRW.USER_ EXIT('FND SRWEXIT');srw.do_sql(' alter session set sql_trace=FALSE' );">>END

NOTE: This is really not necessary as the trace sessionwill terminate when the report completes, but it's agood idea to include it as a precautionary measure.

4. Convert the modified .rex file into a .rdf file:

To do this, issue the following command as the applmgr user:

r25convm userid=<userid> /<password> source=<reportname> .rexstype=rexfile dtype=rdffile dest=<reportname> .rdf

For Example:

r25convm userid=ap/ap source=RAXIIR. rex stype=rexfiledtype=rdffile dest=RAXIIR. rdf

NOTE: If you did not properly modify the .rex file, the systemwill not be able to generate the .rdf file. An example of themessage you may get is: "Conversion of 'RAXNCAR.rex' cancelled".

5. Run the report:

Logon to the Applications and run the report through the concurrentmanagers. When it has completed, exit the Applications.

6. Access the trace file:

The trace file will be located in the directory specified by theuser_dump_dest variable in your init.ora file.

Page 119: Interview_Q1

7. Restore the original report files:

Restore the original .rdf file (and .rex if one existed beforemodification) . You may wish to backup the .rdf file containingthe SQL*Trace code, just in case you need to run it at a latertime. Once the issue you're troubleshooting is resolved, youcan delete it.

128. How to find the Apache Version?The Apache version can be obtained from the httpd executable:$ORACLE_HOME/ Apache/Apache/ httpd -version.

129 how to find the ojsp version ?Login: Accessing ibeCZzdMinisites. jsp it is giving the Application error - java.lang.ClassCast Exception: java.lang.ObjectCause: Profile Option valueResolution: Reset the profile option "IBE: Preload Specialty Store Cache" to null at all levels, clear the cache, and bounce apache[top]

Login: "Application Error" when logging into iStore home page (ibeCZzpHome. jsp)Problem: When logging into iStore home page (ibeCZzpHome. jsp) it shows "Application Error". Java Stack shows java.lang.NullPoint erException You have to use the Delete Cookies option (in IE) to get around this. Even restarting the browser doesn't handle it until you delete the cookies. - The FND patchset level is E. - The OJSP version is: 1.1.0.0.0Resolution: You may need to upgrade to either OJSP 1.1.1.0 or OJSP 1.1.2.0. Refer to Note 132604.1 on how to upgrade your OJSP. To check your OJSP version: Create a jsp file with the following code, place it in the OA_HTML directory and call it from the browser. <HTML> <HEAD> <TITLE>OJSP Version Getter</TITLE> </HEAD> <BODY> The OJSP version that you are using is: <%= application. getAttribute( "oracle.jsp. versionNumber" ) %> </BODY> </HTML>

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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?

Page 120: Interview_Q1

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 tablespaces?

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.

Page 121: Interview_Q1

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

11. What is Partial Backup ?

A Partial Backup is any operating system backup short of a full backup, taken while the database is open or shut down.

12. What is Mirrored on-line Redo Log ?

A mirrored on-line redo log consists of copies of on-line redo log files physically located on separate disks, changes made to one member of the group are made to all members.

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

14. Can a View based on another View ?

Yes.

15. Can a Tablespace hold objects from different Schemes ?

Yes.

16. Can objects of the same Schema reside in different tablespaces. ?

Yes.

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

18. Do View contain Data ?

Page 122: Interview_Q1

Views do not contain or store data.

19. What are the Referential actions supported by FOREIGN KEY integrity constraint ?

UPDATE and DELETE Restrict - A referential integrity rule that disallows the update or deletion of referenced data. DELETE Cascade - When a referenced row is deleted all associated dependent rows are deleted.

20. What are the type of Synonyms?

There are two types of Synonyms Private and Public.

21. What is a Redo Log ?

The set of Redo Log files YSDATE,UID,USER or USERENV SQL functions, or the pseudo columns LEVEL or ROWNUM.

22. What is an Index Segment ?

Each Index has an Index segment that stores all of its data.

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

24. What are the different type of Segments ?

Data Segment, Index Segment, Rollback Segment and Temporary Segment.

25. What are Clusters ?

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

26. What is an Integrity Constrains ?

An integrity constraint is a declarative way to define a business rule for a column of a table.

Page 123: Interview_Q1

27. What is an 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.

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

29. What is a 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.)

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

31. Can a view based on another view?

Yes.

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

33. What is an Oracle sequence?

A sequence generates a serial list of unique numbers for numerical columns of a database's tables.

34. What is a synonym?

Page 124: Interview_Q1

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

35. What are the types of synonyms?

There are two types of synonyms private and public.

36. What is a private synonym?

Only its owner can access a private synonym.

37. What is a public synonym?

Any database user can access a public synonym.

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

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

40. How are the index updates?

Indexes are automatically maintained and used by Oracle. Changes to table data are automatically incorporated into all relevant indexes.

41. What is a Tablespace?

A database is divided into Logical Storage Unit called tablespaces. A tablespace is used to grouped related logical structures together

42. What is Rollback Segment ?

Page 125: Interview_Q1

A Database contains one or more Rollback Segments to temporarily store "undo" information.

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

44. 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 datablocks. Block size is specified in INIT.ORA file and can’t be changed latter.

45. What does a Control file Contain ?

A Control file records the physical structure of the database. It contains the following information.Database NameNames and locations of a database's files and redolog files.Time stamp of database creation.

46.What is difference between UNIQUE constraint and PRIMARY KEY constraint ?

A column defined as UNIQUE can contain Nulls while a column defined as PRIMARY KEY can't contain Nulls.

47.What is Index Cluster ?

A Cluster with an index on the Cluster Key

48.When does a Transaction end ?

When it is committed or Rollbacked.

49. What is the effect of setting the value "ALL_ROWS" for OPTIMIZER_GOAL parameter of the ALTER SESSION command ? What are the factors that affect OPTIMIZER in choosing an Optimization approach ?

Page 126: Interview_Q1

Answer The OPTIMIZER_MODE initialization parameter Statistics in the Data Dictionary the OPTIMIZER_GOAL parameter of the ALTER SESSION command hints in the statement.

50. What is the effect of setting the value "CHOOSE" for OPTIMIZER_GOAL, parameter of the ALTER SESSION Command ?

The Optimizer chooses Cost_based approach and optimizes with the goal of best throughput if statistics for atleast one of the tables accessed by the SQL statement exist in the data dictionary. Otherwise the OPTIMIZER chooses RULE_based approach.

51. How does one create a new database? (for DBA)

One can create and modify Oracle databases using the Oracle "dbca" (Database Configuration Assistant) utility. The dbca utility is located in the $ORACLE_HOME/ bin directory. The Oracle Universal Installer (oui) normally starts it after installing the database server software.One can also create databases manually using scripts. This option, however, is falling out of fashion, as it is quite involved and error prone. Look at this example for creating and Oracle 9i database:CONNECT SYS AS SYSDBAALTER SYSTEM SET DB_CREATE_FILE_ DEST='/u01/ oradata/' ;ALTER SYSTEM SET DB_CREATE_ONLINE_ LOG_DEST_ 1='/u02/oradata/ ';ALTER SYSTEM SET DB_CREATE_ONLINE_ LOG_DEST_ 2='/u03/oradata/ ';CREATE DATABASE;

52. What database block size should I use? (for DBA)

Oracle recommends that your database block size match, or be multiples of your operating system block size. One can use smaller block sizes, but the performance cost is significant. Your choice should depend on the type of application you are running. If you have many small transactions as with OLTP, use a smaller block size. With fewer but larger transactions, as with a DSS application, use a larger block size. If you are using a volume manager, consider your "operating system block size" to be 8K. This is because volume manager products use 8K blocks (and this is not configurable) .

53. What are the different approaches used by Optimizer in choosing an execution plan ?

Rule-based and Cost-based.

54. What does ROLLBACK do ?

ROLLBACK retracts any of the changes resulting from the SQL statements in the transaction.

Page 127: Interview_Q1

How does one coalesce free space?(for DBA)

SMON coalesces free space (extents) into larger, contiguous extents every 2 hours and even then, only for a short period of time.SMON will not coalesce free space if a tablespace's default storage parameter "pctincrease" is set to 0. With Oracle 7.3 one can manually coalesce a tablespace using the ALTER TABLESPACE ... COALESCE; command, until then use:SQL> alter session set events 'immediate trace name coalesce level n';Where 'n' is the tablespace number you get from SELECT TS#, NAME FROM SYS.TS$;You can get status information about this process by selecting from the SYS.DBA_FREE_ SPACE_COALESCED dictionary view.

55. How does one prevent tablespace fragmentation? (for DBA)

Always set PCTINCREASE to 0 or 100.Bizarre values for PCTINCREASE will contribute to fragmentation. For example if you set PCTINCREASE to 1 you will see that your extents are going to have weird and wacky sizes: 100K, 100K, 101K, 102K, etc. Such extents of bizarre size are rarely re-used in their entirety. PCTINCREASE of 0 or 100 gives you nice round extent sizes that can easily be reused. Eg. 100K, 100K, 200K, 400K, etc.Thiru Vadivelu contributed the following:Use the same extent size for all the segments in a given tablespace. Locally Managed tablespaces (available from 8i onwards) with uniform extent sizes virtually eliminates any tablespace fragmentation. Note that the number of extents per segment does not cause any performance issue anymore, unless they run into thousands and thousands where additional I/O may be required to fetch the additional blocks where extent maps of the segment are stored.

56. Where can one find the high water mark for a table? (for DBA)

There is no single system table, which contains the high water mark (HWM) for a table. A table's HWM can be calculated using the results from the following SQL statements:SELECT BLOCKSFROM DBA_SEGMENTSWHERE OWNER=UPPER( owner) AND SEGMENT_NAME = UPPER(table) ;ANALYZE TABLE owner.table ESTIMATE STATISTICS;SELECT EMPTY_BLOCKSFROM DBA_TABLESWHERE OWNER=UPPER( owner) AND SEGMENT_NAME = UPPER(table) ;Thus, the tables' HWM = (query result 1) - (query result 2) - 1NOTE: You can also use the DBMS_SPACE package and calculate the HWM = TOTAL_BLOCKS - UNUSED_BLOCKS - 1.

57. What is COST-based approach to optimization ?

Page 128: Interview_Q1

Considering available access paths and determining the most efficient execution plan based on statistics in the data dictionary for the tables accessed by the statement and their associated clusters and indexes.

58. What does COMMIT do ?

COMMIT makes permanent the changes resulting from all SQL statements in the transaction. The changes made by the SQL statements of a transaction become visible to other user sessions transactions that start only after transaction is committed.

59. How are extents allocated to a segment? (for DBA)

Oracle8 and above rounds off extents to a multiple of 5 blocks when more than 5 blocks are requested. If one requests 16K or 2 blocks (assuming a 8K block size), Oracle doesn't round it up to 5 blocks, but it allocates 2 blocks or 16K as requested. If one asks for 8 blocks, Oracle will round it up to 10 blocks.Space allocation also depends upon the size of contiguous free space available. If one asks for 8 blocks and Oracle finds a contiguous free space that is exactly 8 blocks, it would give it you. If it were 9 blocks, Oracle would also give it to you. Clearly Oracle doesn't always round extents to a multiple of 5 blocks.The exception to this rule is locally managed tablespaces. If a tablespace is created with local extent management and the extent size is 64K, then Oracle allocates 64K or 8 blocks assuming 8K-block size. Oracle doesn't round it up to the multiple of 5 when a tablespace is locally managed.

60. Can one rename a database user (schema)? (for DBA)

No, this is listed as Enhancement Request 158508. Workaround:Do a user-level export of user Acreate new user BImport system/manager fromuser=A touser=BDrop user A

61. Define Transaction ?

A Transaction is a logical unit of work that comprises one or more SQL statements executed by a single user.

62. What is Read-Only Transaction ?

A Read-Only transaction ensures that the results of each query executed in the transaction are consistant with respect to the same point in time.

63. What is a deadlock ? Explain .

Page 129: Interview_Q1

Two processes wating to update the rows of a table which are locked by the other process then deadlock arises. In a database environment this will often happen because of not issuing proper row lock commands. Poor design of front-end application may cause this situation and the performance of server will reduce drastically.These locks will be released automatically when a commit/rollback operation performed or any one of this processes being killed externally.

64. What is a Schema ?

The set of objects owned by user account is called the schema.

65. What is a cluster Key ?

The related columns of the tables are called the cluster key. The cluster key is indexed using a cluster index and its value is stored only once for multiple tables in the cluster.

66. What is Parallel Server ?

Multiple instances accessing the same database (Only In Multi-CPU environments)

67. What are the basic element of Base configuration of an oracle Database ?

It consists ofone or more data files.one or more control files.two or more redo log files.The Database containsmultiple users/schemasone or more rollback segmentsone or more tablespacesData dictionary tablesUser objects (table,indexes, views etc.,)The server that access the database consists ofSGA (Database buffer, Dictionary Cache Buffers, Redo log buffers, Shared SQL pool)SMON (System MONito)PMON (Process MONitor)LGWR (LoG Write)DBWR (Data Base Write)ARCH (ARCHiver)CKPT (Check Point)RECODispatcherUser Process with associated PGS

Page 130: Interview_Q1

68. What is clusters ?

Group of tables physically stored together because they share common columns and are often used together is called Cluster.

69. What is an Index ? How it is implemented in Oracle Database ?

An index is a database structure used by the server to have direct access of a row in a table. An index is automatically created when a unique of primary key constraint clause is specified in create table comman (Ver 7.0)

70. What is a Database instance ? Explain

A database instance (Server) is a set of memory structure and background processes that access a set of database files.The process can be shared by all users. The memory structure that are used to store most queried data from database. This helps up to improve database performance by decreasing the amount of I/O performed against data file.

71. WWhat is the use of ANALYZE command ?

To perform one of these function on an index,table, or cluster:- To collect statistics about object used by the optimizer and store them in the data dictionary.- To delete statistics about the object used by object from the data dictionary.- To validate the structure of the object.- To identify migrated and chained rows of the table or cluster.

72. What is default tablespace ?

The Tablespace to contain schema objects created without specifying a tablespace name.

73. What are the system resources that can be controlled through Profile ?

The number of concurrent sessions the user can establish the CPU processing time available to the user's session the CPU processing time available to a single call to ORACLE made by a SQL statement the amount of logical I/O available to the user's session the amout of logical I/O available to a single call to ORACLE made by a SQL statement the allowed amount of idle time for the user's session the allowed amount of connect time for the user's session.

74. What is Tablespace Quota ?

Page 131: Interview_Q1

The collective amount of disk space available to the objects in a schema on a particular tablespace.

76. What are the different Levels of Auditing ?

Statement Auditing, Privilege Auditing and Object Auditing.

77. What is Statement Auditing ?

Statement auditing is the auditing of the powerful system privileges without regard to specifically named objects.

78. What are the database administrators utilities avaliable ?

SQL * DBA - This allows DBA to monitor and control an ORACLE database. SQL * Loader - It loads data from standard operating system files (Flat files) into ORACLE database tables. Export (EXP) and Import (imp) utilities allow you to move existing data in ORACLE format to and from ORACLE database.

79. How can you enable automatic archiving ?

Shut the databaseBackup the databaseModify/Include LOG_ARCHIVE_ START_TRUE in init.ora file.Start up the database.

80. What are roles? How can we implement roles ?

Roles are the easiest way to grant and manage common privileges needed by different groups of database users. Creating roles and assigning provides to roles. Assign each role to group of users. This will simplify the job of assigning privileges to individual users.

81. What are Roles ?

Roles are named groups of related privileges that are granted to users or other roles.

82. What are the use of Roles ?

REDUCED GRANTING OF PRIVILEGES - Rather than explicitly granting the same set of privileges to many users a database administrator can grant the privileges for a

Page 132: Interview_Q1

group of related users granted to a role and then grant only the role to each member of the group.DYNAMIC PRIVILEGE MANAGEMENT - When the privileges of a group must change, only the privileges of the role need to be modified. The security domains of all users granted the group's role automatically reflect the changes made to the role.SELECTIVE AVAILABILITY OF PRIVILEGES - The roles granted to a user can be selectively enable (available for use) or disabled (not available for use). This allows specific control of a user's privileges in any given situation.APPLICATION AWARENESS - A database application can be designed to automatically enable and disable selective roles when a user attempts to use the application.

83. What is Privilege Auditing ?

Privilege auditing is the auditing of the use of powerful system privileges without regard to specifically named objects.

84. What is Object Auditing ?

Object auditing is the auditing of accesses to specific schema objects without regard to user.

85. What is Auditing ?

Monitoring of user access to aid in the investigation of database use.

85. How does one see the uptime for a database? (for DBA

Look at the following SQL query:SELECT to_char (startup_time, 'DD-MON-YYYY HH24: MI: SS') "DB Startup Time"FROM sys.v_$instance;Marco Bergman provided the following alternative solution:SELECT to_char (logon_time, 'Dy dd Mon HH24: MI: SS') "DB Startup Time"FROM sys.v_$sessionWHERE Sid=1 /* this is pmon *//Users still running on Oracle 7 can try one of the following queries:Column STARTED format a18 head 'STARTUP TIME'Select C.INSTANCE,to_date (JUL.VALUE, 'J')|| to_char (floor (SEC.VALUE/3600) , '09')|| ':'-- || Substr (to_char (mod (SEC.VALUE/60, 60), '09'), 2, 2)|| Substr (to_char (floor (mod (SEC.VALUE/60, 60)), '09'), 2, 2)|| '.'|| Substr (to_char (mod (SEC.VALUE, 60), '09'), 2, 2) STARTEDfrom SYS.V_$INSTANCE JUL,SYS.V_$INSTANCE SEC,SYS.V_$THREAD CWhere JUL.KEY like '%JULIAN%'

Page 133: Interview_Q1

and SEC.KEY like '%SECOND%';Select to_date (JUL.VALUE, 'J')|| to_char (to_date (SEC.VALUE, 'SSSSS'), ' HH24:MI:SS') STARTEDfrom SYS.V_$INSTANCE JUL,SYS.V_$INSTANCE SECwhere JUL.KEY like '%JULIAN%'and SEC.KEY like '%SECOND%';select to_char (to_date (JUL.VALUE, 'J') + (SEC.VALUE/86400) , -Return a DATE'DD-MON-YY HH24:MI:SS') STARTEDfrom V$INSTANCE JUL,V$INSTANCE SECwhere JUL.KEY like '%JULIAN%'and SEC.KEY like '%SECOND%';

86. Where are my TEMPFILES, I don't see them in V$DATAFILE or DBA_DATA_FILE? (for DBA

Tempfiles, unlike normal datafiles, are not listed in v$datafile or dba_data_files. Instead query v$tempfile or dba_temp_files:SELECT * FROM v$tempfile;SELECT * FROM dba_temp_files;

87. How do I find used/free space in a TEMPORARY tablespace? (for DBA

Unlike normal tablespaces, true temporary tablespace information is not listed in DBA_FREE_SPACE. Instead use the V$TEMP_SPACE_ HEADER view:SELECT tablespace_name, SUM (bytes used), SUM (bytes free)FROM V$temp_space_ headerGROUP BY tablespace_name;

88. What is a profile ?

Each database user is assigned a Profile that specifies limitations on various system resources available to the user.

89. How will you enforce security using stored procedures?

Don't grant user access directly to tables within the application. Instead grant the ability to access the procedures that access the tables. When procedure executed it will execute the privilege of procedures owner. Users cannot access tables except via the procedure.

90. How can one see who is using a temporary segment? (for DBA

Page 134: Interview_Q1

For every user using temporary space, there is an entry in SYS.V$_LOCK with type 'TS'.All temporary segments are named 'ffff.bbbb' where 'ffff' is the file it is in and 'bbbb' is first block of the segment. If your temporary tablespace is set to TEMPORARY, all sorts are done in one large temporary segment. For usage stats, see SYS.V_$SORT_ SEGMENTFrom Oracle 8.0, one can just query SYS.v$sort_usage. Look at these examples:select s.username, u."USER", u.tablespace, u.contents, u.extents, u.blocksfrom sys.v_$session s, sys.v_$sort_ usage uwhere s.addr = u.session_addr/select s.osuser, s.process, s.username, s.serial#,Sum (u.blocks)*vp. value/1024 sort_sizefrom sys.v_$session s, sys.v_$sort_ usage u, sys.v_$parameter VPwhere s.saddr = u.session_addrand vp.name = 'db_block_size'and s.osuser like '&1'group by s.osuser, s.process, s.username, s.serial#, vp.value/

91. How does one get the view definition of fixed views/tables?

Query v$fixed_view_ definition. Example: SELECT * FROM v$fixed_view_ definition WHERE view_name='V$ SESSION';

92. What are the dictionary tables used to monitor a database spaces ?

DBA_FREE_SPACEDBA_SEGMENTSDBA_DATA_FILES.

93. How can we specify the Archived log file name format and destination?

By setting the following values in init.ora file. LOG_ARCHIVE_ FORMAT = arch %S/s/T/tarc (%S - Log sequence number and is zero left paded, %s - Log sequence number not padded. %T - Thread number lef-zero-paded and %t - Thread number not padded). The file name created is arch 0001 are if %S is used. LOG_ARCHIVE_ DEST = path.

94. What is user Account in Oracle database?

An user account is not a physical structure in Database but it is having important relationship to the objects in the database and will be having certain privileges.

95. When will the data in the snapshot log be used?

Page 135: Interview_Q1

We must be able to create a after row trigger on table (i.e., it should be not be already available) After giving table privileges. We cannot specify snapshot log name because oracle uses the name of the master table in the name of the database objects that support its snapshot log. The master table name should be less than or equal to 23 characters. (The table name created will be MLOGS_tablename, and trigger name will be TLOGS name).

96. What dynamic data replication?

Updating or Inserting records in remote database through database triggers. It may fail if remote database is having any problem.

97. What is Two-Phase Commit ?

Two-phase commit is mechanism that guarantees a distributed transaction either commits on all involved nodes or rolls back on all involved nodes to maintain data consistency across the global distributed database. It has two phase, a Prepare Phase and a Commit Phase.

98. How can you Enforce Referential Integrity in snapshots ?

Time the references to occur when master tables are not in use. Peform the reference the manually immdiately locking the master tables. We can join tables in snopshots by creating a complex snapshots that will based on the master tables.

99. What is a SQL * NET?

SQL *NET is ORACLE's mechanism for interfacing with the communication protocols used by the networks that facilitate distributed processing and distributed databases. It is used in Clint-Server and Server-Server communications.

100. What is a SNAPSHOT ?

Snapshots are read-only copies of a master table located on a remote node which is periodically refreshed to reflect changes made to the master table.

101. What is the mechanism provided by ORACLE for table replication ?

Snapshots and SNAPSHOT LOGs

102. What is snapshots?

Page 136: Interview_Q1

Snapshot is an object used to dynamically replicate data between distribute database at specified time intervals. In ver 7.0 they are read only.

103. What are the various type of snapshots?

Simple and Complex.

104. Describe two phases of Two-phase commit ?

Prepare phase - The global coordinator (initiating node) ask a participants to prepare (to promise to commit or rollback the transaction, even if there is a failure) Commit - Phase - If all participants respond to the coordinator that they are prepared, the coordinator asks all nodes to commit the transaction, if all participants cannot prepare, the coordinator asks all nodes to roll back the transaction.

105. What is snapshot log ?

It is a table that maintains a record of modifications to the master table in a snapshot. It is stored in the same database as master table and is only available for simple snapshots. It should be created before creating snapshots.

106. What are the benefits of distributed options in databases?

Database on other servers can be updated and those transactions can be grouped together with others in a logical unit.Database uses a two phase commit.

107. What are the options available to refresh snapshots ?

COMPLETE - Tables are completely regenerated using the snapshots query and the master tables every time the snapshot referenced.FAST - If simple snapshot used then a snapshot log can be used to send the changes to the snapshot tables.FORCE - Default value. If possible it performs a FAST refresh; Otherwise it will perform a complete refresh.

108. What is a SNAPSHOT LOG ?

A snapshot log is a table in the master database that is associated with the master table. ORACLE uses a snapshot log to track the rows that have been updated in the master table. Snapshot logs are used in updating the snapshots based on the master table.

Page 137: Interview_Q1

109. What is Distributed database ?

A distributed database is a network of databases managed by multiple database servers that appears to a user as single logical database. The data of all databases in the distributed database can be simultaneously accessed and modified.

110. How can we reduce the network traffic?

- Replication of data in distributed environment.- Using snapshots to replicate data.- Using remote procedure calls.

111. Differentiate simple and complex, snapshots ?

- A simple snapshot is based on a query that does not contains GROUP BY clauses, CONNECT BY clauses, JOINs, sub-query or snashot of operations.- A complex snapshots contain atleast any one of the above.

112. What are the Built-ins used for sending Parameters to forms?

You can pass parameter values to a form when an application executes the call_form, New_form, Open_form or Run_product.

113. Can you have more than one content canvas view attached with a window?

Yes. Each window you create must have atleast one content canvas view assigned to it. You can also create a window that has manipulated content canvas view. At run time only one of the content canvas views assign to a window is displayed at a time.

114. Is the After report trigger fired if the report execution fails?

Yes.

115. Does a Before form trigger fire when the parameter form is suppressed?

Yes.

116. What is SGA?

The System Global Area in an Oracle database is the area in memory to facilitate the transfer of information between users. It holds the most recently requested structural

Page 138: Interview_Q1

information between users. It holds the most recently requested structural information about the database. The structure is database buffers, dictionary cache, redo log buffer and shared pool area.

117. What is a shared pool?

The data dictionary cache is stored in an area in SGA called the shared pool. This will allow sharing of parsed SQL statements among concurrent users.

118. What is mean by Program Global Area (PGA)?

It is area in memory that is used by a single Oracle user process.

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

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

121. What are clusters?

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

122. What is cluster key?

The related columns of the tables in a cluster are called the cluster key.

123. Do a view contain data?

Views do not contain or store data.

124. What is user Account in Oracle database?

A user account is not a physical structure in database but it is having important relationship to the objects in the database and will be having certain privileges.

Page 139: Interview_Q1

125. How will you enforce security using stored procedures?

Don't grant user access directly to tables within the application. Instead grant the ability to access the procedures that access the tables. When procedure executed it will execute the privilege of procedures owner. Users cannot access tables except via the procedure.

126. What are the dictionary tables used to monitor a database space?

DBA_FREE_SPACEDBA_SEGMENTSDBA_DATA_FILES.

127. Can a property clause itself be based on a property clause?

Yes

128. If a parameter is used in a query without being previously defined, what diff. exist betw. report 2.0 and 2.5 when the query is applied?

While both reports 2.0 and 2.5 create the parameter, report 2.5 gives a message that a bind parameter has been created.

129. What are the sql clauses supported in the link property sheet?

Where start with having.

130. What is trigger associated with the timer?

When-timer-expired.

131. What are the trigger associated with image items?

When-image-activate d fires when the operators double clicks on an image itemwhen-image- pressed fires when an operator clicks or double clicks on an image item

132. What are the different windows events activated at runtimes?

When_window_ activated

Page 140: Interview_Q1

When_window_ closedWhen_window_ deactivatedWhen_window_ resizedWithin this triggers, you can examine the built in system variable system. event_window to determine the name of the window for which the trigger fired.

133. When do you use data parameter type?

When the value of a data parameter being passed to a called product is always the name of the record group defined in the current form. Data parameters are used to pass data to produts invoked with the run_product built-in subprogram.

134. What is difference between open_form and call_form?

when one form invokes another form by executing open_form the first form remains displayed, and operators can navigate between the forms as desired. when one form invokes another form by executing call_form, the called form is modal with respect to the calling form. That is, any windows that belong to the calling form are disabled, and operators cannot navigate to them until they first exit the called form.

135. What is new_form built-in?

When one form invokes another form by executing new_form oracle form exits the first form and releases its memory before loading the new form calling new form completely replace the first with the second. If there are changes pending in the first form, the operator will be prompted to save them before the new form is loaded.

136. What is the "LOV of Validation" Property of an item? What is the use of it?

When LOV for Validation is set to True, Oracle Forms compares the current value of the text item to the values in the first column displayed in the LOV. Whenever the validation event occurs. If the value in the text item matches one of the values in the first column of the LOV, validation succeeds, the LOV is not displayed, and processing continues normally. If the value in the text item does not match one of the values in the first column of the LOV, Oracle Forms displays the LOV and uses the text item value as the search criteria to automatically reduce the lis

137. What is the diff. when Flex mode is mode on and when it is off?

When flex mode is on, reports automatically resizes the parent when the child is resized.

138. What is the diff. when confine mode is on and when it is off?

When confine mode is on, an object cannot be moved outside its parent in the layout.

Page 141: Interview_Q1

139. What are visual attributes?

Visual attributes are the font, color, pattern proprieties that you set for form and menu objects that appear in your application interface.

140. Which of the two views should objects according to possession?

view by structure.

141. What are the two types of views available in the object navigator(specific to report 2.5)?

View by structure and view by type .

142. What are the vbx controls?

Vbx control provide a simple method of building and enhancing user interfaces. The controls can use to obtain user inputs and display program outputs.vbx control where originally develop as extensions for the ms visual basic environments and include such items as sliders, rides and knobs.

143. What is the use of transactional triggers?

Using transactional triggers we can control or modify the default functionality of the oracle forms.

144. How do you create a new session while open a new form?

Using open_form built-in setting the session option Ex. Open_form('Stocks ',active,session) . when invoke the mulitiple forms with open form and call_form in the same application, state whether the following are true/False

145. What are the ways to monitor the performance of the report?

Use reports profile executable statement. Use SQL trace facility.

146. If two groups are not linked in the data model editor, What is the hierarchy between them?

Page 142: Interview_Q1

Two group that is above are the left most rank higher than the group that is to right or below it.

147. An open form can not be execute the call_form procedure if you chain of called forms has been initiated by another open form?

True

148. Explain about horizontal, Vertical tool bar canvas views?

Tool bar canvas views are used to create tool bars for individual windows. Horizontal tool bars are display at the top of a window, just under its menu bar. Vertical Tool bars are displayed along the left side of a window

149. What is the purpose of the product order option in the column property sheet?

To specify the order of individual group evaluation in a cross products.

150. What is the use of image_zoom built-in?

To manipulate images in image items.

151. How do you reference a parameter indirectly?

To indirectly reference a parameter use the NAME IN, COPY 'built-ins to indirectly set and reference the parameters value' Example name_in ('capital parameter my param'), Copy ('SURESH','Paramete r my_param')

152. What is a timer?

Timer is an "internal time clock" that you can programmatically create to perform an action each time the times.

153. What are the two phases of block coordination?

There are two phases of block coordination: the clear phase and the population phase. During, the clear phase, Oracle Forms navigates internally to the detail block and flushes the obsolete detail records. During the population phase, Oracle Forms issues a SELECT statement to repopulate the detail block with detail records associated with the new master record. These operations are accomplished through the execution of triggers.

Page 143: Interview_Q1

154. What are Most Common types of Complex master-detail relationships?

There are three most common types of complex master-detail relationships:master with dependent detailsmaster with independent detailsdetail with two masters

155. What is a text list?

The text list style list item appears as a rectangular box which displays the fixed number of values. When the text list contains values that can not be displayed, a vertical scroll bar appears, allowing the operator to view and select undisplayed values.

156. What is term?

The term is terminal definition file that describes the terminal form which you are using r20run

167. How does one do off-line database backups? (for DBA

Shut down the database from sqlplus or server manager. Backup all files to secondary storage (eg. tapes). Ensure that you backup all data files, all control files and all log files. When completed, restart your database.Do the following queries to get a list of all files that needs to be backed up:select name from sys.v_$datafile;select member from sys.v_$logfile;select name from sys.v_$controlfile;Sometimes Oracle takes forever to shutdown with the "immediate" option. As workaround to this problem, shutdown using these commands:alter system checkpoint;shutdown abortstartup restrictshutdown immediateNote that if you database is in ARCHIVELOG mode, one can still use archived log files to roll forward from an off-line backup. If you cannot take your database down for a cold (off-line) backup at a convenient time, switch your database into ARCHIVELOG mode and perform hot (on-line) backups.

170. How does one do on-line database backups? (for DBA

Each tablespace that needs to be backed-up must be switched into backup mode before copying the files out to secondary storage (tapes). Look at this simple example.ALTER TABLESPACE xyz BEGIN BACKUP;! cp xyfFile1 /backupDir/

Page 144: Interview_Q1

ALTER TABLESPACE xyz END BACKUP;It is better to backup tablespace for tablespace than to put all tablespaces in backup mode. Backing them up separately incurs less overhead. When done, remember to backup your control files. Look at this example:ALTER SYSTEM SWITCH LOGFILE; -- Force log switch to update control file headersALTER DATABASE BACKUP CONTROLFILE TO '/backupDir/ control.dbf' ;NOTE: Do not run on-line backups during peak processing periods. Oracle will write complete database blocks instead of the normal deltas to redo log files while in backup mode. This will lead to excessive database archiving and even database freezes.

171. How does one backup a database using RMAN? (for DBA

The biggest advantage of RMAN is that it only backup used space in the database. Rman doesn't put tablespaces in backup mode, saving on redo generation overhead. RMAN will re-read database blocks until it gets a consistent image of it. Look at this simple backup example.rman target sys/*** nocatalogrun {allocate channel t1 type disk;backupformat '/app/oracle/ db_backup/ %d_t%t_s% s_p%p'( database );release channel t1;}Example RMAN restore:rman target sys/*** nocatalogrun {allocate channel t1 type disk;# set until time 'Aug 07 2000 :51';restore tablespace users;recover tablespace users;release channel t1;}The examples above are extremely simplistic and only useful for illustrating basic concepts. By default Oracle uses the database controlfiles to store information about backups. Normally one would rather setup a RMAN catalog database to store RMAN metadata in. Read the Oracle Backup and Recovery Guide before implementing any RMAN backups.Note: RMAN cannot write image copies directly to tape. One needs to use a third-party media manager that integrates with RMAN to backup directly to tape. Alternatively one can backup to disk and then manually copy the backups to tape.

172. What are the different file extensions that are created by oracle reports?

Rep file and Rdf file.

173. What is strip sources generate options?

Page 145: Interview_Q1

Removes the source code from the library file and generates a library files that contains only pcode. The resulting file can be used for final deployment, but can not be subsequently edited in the designer.ex. f45gen module=old_lib. pll userid=scott/ tiger strip_source YES output_file

173. How does one put a database into ARCHIVELOG mode? (for DBA

The main reason for running in archivelog mode is that one can provide 24-hour availability and guarantee complete data recoverability. It is also necessary to enable ARCHIVELOG mode before one can start to use on-line database backups. To enable ARCHIVELOG mode, simply change your database startup command script, and bounce the database:SQLPLUS> connect sys as sysdbaSQLPLUS> startup mount exclusive;SQLPLUS> alter database archivelog;SQLPLUS> archive log start;SQLPLUS> alter database open;NOTE1: Remember to take a baseline database backup right after enabling archivelog mode. Without it one would not be able to recover. Also, implement an archivelog backup to prevent the archive log directory from filling-up.NOTE2: ARCHIVELOG mode was introduced with Oracle V6, and is essential for database point-in-time recovery. Archiving can be used in combination with on-line and off-line database backups.NOTE3: You may want to set the following INIT.ORA parameters when enabling ARCHIVELOG mode: log_archive_ start=TRUE, log_archive_ dest=... and log_archive_ format=.. .NOTE4: You can change the archive log destination of a database on-line with the ARCHIVE LOG START TO 'directory'; statement. This statement is often used to switch archiving between a set of directories.NOTE5: When running Oracle Real Application Server (RAC), you need to shut down all nodes before changing the database to ARCHIVELOG mode.

174. What is the basic data structure that is required for creating an LOV?

Record Group.

175. How does one backup archived log files? (for DBA

One can backup archived log files using RMAN or any operating system backup utility. Remember to delete files after backing them up to prevent the archive log directory from filling up. If the archive log directory becomes full, your database will hang! Look at this simple RMAN backup script:RMAN> run {2> allocate channel dev1 type disk;3> backup4> format '/app/oracle/ arch_backup/ log_t%t_s% s_p%p'5> (archivelog all delete input);6> release channel dev1;7> }

Page 146: Interview_Q1

176. Does Oracle write to data files in begin/hot backup mode? (for DBA

Oracle will stop updating file headers, but will continue to write data to the database files even if a tablespace is in backup mode.In backup mode, Oracle will write out complete changed blocks to the redo log files. Normally only deltas (changes) are logged to the redo logs. This is done to enable reconstruction of a block if only half of it was backed up (split blocks). Because of this, one should notice increased log activity and archiving during on-line backups.

188. What is an administrative (privileged) user? (for DBA

Oracle DBAs and operators typically use administrative accounts to manage the database and database instance. An administrative account is a user that is granted SYSOPER or SYSDBA privileges. SYSDBA and SYSOPER allow access to a database instance even if it is not running. Control of these privileges is managed outside of the database via password files and special operating system groups. This password file is created with the orapwd utility.

191. How does one connect to an administrative user? (for DBA

If an administrative user belongs to the "dba" group on Unix, or the "ORA_DBA" (ORA_sid_DBA) group on NT, he/she can connect like this:connect / as sysdbaNo password is required. This is equivalent to the desupported "connect internal" method.A password is required for "non-secure" administrative access. These passwords are stored in password files. Remote connections via Net8 are classified as non-secure. Look at this example:connect sys/password as sysdba

192. How does one create a password file? (for DBA

The Oracle Password File ($ORACLE_HOME/ dbs/orapw or orapwSID) stores passwords for users with administrative privileges. One needs to create a password files before remote administrators (like OEM) will be allowed to connect.Follow this procedure to create a new password file:. Log in as the Oracle software owner. Runcommand: orapwd file=$ORACLE_ HOME/dbs/ orapw$ORACLE_ SID password=mypasswd. Shutdown the database (SQLPLUS> SHUTDOWN IMMEDIATE). Edit the INIT.ORA file and ensure REMOTE_LOGIN_ PASSWORDFILE= exclusive is set.. Startup the database (SQLPLUS> STARTUP)NOTE: The orapwd utility presents a security risk in that it receives a password from the command line. This password is visible in the process table of many systems. Administrators needs to be aware of this!

195. How does one add users to a password file? (for DBA

One can select from the SYS.V_$PWFILE_ USERS view to see which users are listed in the password file. New users can be added to the password file by granting them

Page 147: Interview_Q1

SYSDBA or SYSOPER privileges, or by using the orapwd utility. GRANT SYSDBA TO scott;

197. Why are OPS$ accounts a security risk in a client/server environment? (for DBA

If you allow people to log in with OPS$ accounts from Windows Workstations, you cannot be sure who they really are. With terminals, you can rely on operating system passwords, with Windows, you cannot.If you set REMOTE_OS_AUTHENT= TRUE in your init.ora file, Oracle assumes that the remote OS has authenticated the user. If REMOTE_OS_AUTHENT is set to FALSE (recommended) , remote users will be unable to connect without a password. IDENTIFIED EXTERNALLY will only be in effect from the local host. Also, if you are using "OPS$" as your prefix, you will be able to log on locally with or without a password, regardless of whether you have identified your ID with a password or defined it to be IDENTIFIED EXTERNALLY.

236. What third party tools can be used with Oracle EBU/ RMAN? (for DBA

The following Media Management Software Vendors have integrated their media management software packages with Oracle Recovery Manager and Oracle7 Enterprise Backup Utility. The Media Management Vendors will provide first line technical support for the integrated backup/recover solutions.Veritas NetBackupEMC Data Manager (EDM)HP OMNIBack IIIBM's Tivoli Storage Manager - formerly ADSMLegato NetworkerManageIT Backup and RecoverySterling Software's SAMS: Alexandria - formerly from SpectralogicSun Solstice Backup

237. Why and when should one tune? (for DBA

One of the biggest responsibilities of a DBA is to ensure that the Oracle database is tuned properly. The Oracle RDBMS is highly tunable and allows the database to be monitored and adjusted to increase its performance. One should do performance tuning for the following reasons:The speed of computing might be wasting valuable human time (users waiting for response); Enable your system to keep-up with the speed business is conducted; and Optimize hardware usage to save money (companies are spending millions on hardware). Although this FAQ is not overly concerned with hardware issues, one needs to remember than you cannot tune a Buick into a Ferrari.

241. What database aspects should be monitored? (for DBA

One should implement a monitoring system to constantly monitor the following aspects of a database. Writing custom scripts, implementing Oracle's Enterprise Manager, or buying a third-party monitoring product can achieve this. If an alarm is triggered, the system should automatically notify the DBA (e-mail, page, etc.) to take appropriate action.Infrastructure availability:. Is the database up and responding to requests. Are the listeners up and responding to requests

Page 148: Interview_Q1

. Are the Oracle Names and LDAP Servers up and responding to requests

. Are the Web Listeners up and responding to requests

Things that can cause service outages:. Is the archive log destination filling up?. Objects getting close to their max extents. User and process limits reached

Things that can cause bad performance:See question "What tuning indicators can one use?".

242. Where should the tuning effort be directed? (for DBA

Consider the following areas for tuning. The order in which steps are listed needs to be maintained to prevent tuning side effects. For example, it is no good increasing the buffer cache if you can reduce I/O by rewriting a SQL statement. Database Design (if it's not too late):Poor system performance usually results from a poor database design. One should generally normalize to the 3NF. Selective denormalization can provide valuable performance improvements. When designing, always keep the "data access path" in mind. Also look at proper data partitioning, data replication, aggregation tables for decision support systems, etc.Application Tuning:Experience showed that approximately 80% of all Oracle system performance problems are resolved by coding optimal SQL. Also consider proper scheduling of batch tasks after peak working hours.Memory Tuning:Properly size your database buffers (shared pool, buffer cache, log buffer, etc) by looking at your buffer hit ratios. Pin large objects into memory to prevent frequent reloads.Disk I/O Tuning:Database files needs to be properly sized and placed to provide maximum disk subsystem throughput. Also look for frequent disk sorts, full table scans, missing indexes, row chaining, data fragmentation, etcEliminate Database Contention:Study database locks, latches and wait events carefully and eliminate where possible. Tune the Operating System:Monitor and tune operating system CPU, I/O and memory utilization. For more information, read the related Oracle FAQ dealing with your specific operating system.

256. Does one need to drop/ truncate objects before importing? (for DBA

Before one import rows into already populated tables, one needs to truncate or drop these tables to get rid of the old data. If not, the new data will be appended to the existing tables. One must always DROP existing Sequences before re-importing. If the sequences are not dropped, they will generate numbers inconsistent with the rest of the database. Note: It is also advisable to drop indexes before importing to speed up the import process. Indexes can easily be recreated after the data was successfully imported.

258. Can one import/export between different versions of Oracle? (for DBA

Page 149: Interview_Q1

Different versions of the import utility is upwards compatible. This means that one can take an export file created from an old export version, and import it using a later version of the import utility. This is quite an effective way of upgrading a database from one release of Oracle to the next.Oracle also ships some previous catexpX.sql scripts that can be executed as user SYS enabling older imp/exp versions to work (for backwards compatibility) . For example, one can run $ORACLE_HOME/ rdbms/admin/ catexp7.sql on an Oracle 8 database to allow the Oracle 7.3 exp/imp utilities to run against an Oracle 8 database.

260. Can one export to multiple files?/ Can one beat the Unix 2 Gig limit? (for DBA

From Oracle8i, the export utility supports multiple output files. This feature enables large exports to be divided into files whose sizes will not exceed any operating system limits (FILESIZE= parameter). When importing from multi-file export you must provide the same filenames in the same sequence in the FILE= parameter. Look at this example:exp SCOTT/TIGER FILE=D:\F1.dmp, E:\F2.dmp FILESIZE=10m LOG=scott.logUse the following technique if you use an Oracle version prior to 8i:Create a compressed export on the fly. Depending on the type of data, you probably can export up to 10 gigabytes to a single file. This example uses gzip. It offers the best compression I know of, but you can also substitute it with zip, compress or whatever.# create a named pipemknod exp.pipe p# read the pipe - output to zip file in the backgroundgzip < exp.pipe > scott.exp.gz &# feed the pipeexp userid=scott/ tiger file=exp.pipe ...

262. How can one improve Import/ Export performance? (for DBA

EXPORT:

. Set the BUFFER parameter to a high value (e.g. 2M)

. Set the RECORDLENGTH parameter to a high value (e.g. 64K)

. Stop unnecessary applications to free-up resources for your job.

. If you run multiple export sessions, ensure they write to different physical disks.

. DO NOT export to an NFS mounted filesystem. It will take forever.IMPORT:

. Create an indexfile so that you can create indexes AFTER you have imported data. Do this by setting INDEXFILE to a filename and then import. No data will be imported but a file containing index definitions will be created. You must edit this file afterwards and supply the passwords for the schemas on all CONNECT statements.. Place the file to be imported on a separate physical disk from the oracle data files. Increase DB_CACHE_SIZE (DB_BLOCK_BUFFERS prior to 9i) considerably in the init$SID.ora file. Set the LOG_BUFFER to a big value and restart oracle.. Stop redo log archiving if it is running (ALTER DATABASE NOARCHIVELOG; ). Create a BIG tablespace with a BIG rollback segment inside. Set all other rollback segments offline (except the SYSTEM rollback segment of course). The rollback segment must be as big as your biggest table (I think?). Use COMMIT=N in the import parameter file if you can afford it. Use ANALYZE=N in the import parameter file to avoid time consuming ANALYZE statements

Page 150: Interview_Q1

. Remember to run the indexfile previously created

264. What are the common Import/ Export problems? (for DBA

ORA-00001: Unique constraint (...) violated - You are importing duplicate rows. Use IGNORE=NO to skip tables that already exist (imp will give an error if the object is re-created).ORA-01555: Snapshot too old - Ask your users to STOP working while you are exporting or use parameter CONSISTENT=NOORA-01562: Failed to extend rollback segment - Create bigger rollback segments or set parameter COMMIT=Y while importingIMP-00015: Statement failed ... object already exists... - Use the IGNORE=Y import parameter to ignore these errors, but be careful as you might end up with duplicate rows.

276. My database was terminated while in BACKUP MODE, do I need to recover? (for DBA

If a database was terminated while one of its tablespaces was in BACKUP MODE (ALTER TABLESPACE xyz BEGIN BACKUP;), it will tell you that media recovery is required when you try to restart the database. The DBA is then required to recover the database and apply all archived logs to the database. However, from Oracle7.2, you can simply take the individual datafiles out of backup mode and restart the database.ALTER DATABASE DATAFILE '/path/filename' END BACKUP;One can select from V$BACKUP to see which datafiles are in backup mode. This normally saves a significant amount of database down time.Thiru Vadivelu contributed the following:From Oracle9i onwards, the following command can be used to take all of the datafiles out of hot backup mode:ALTER DATABASE END BACKUP;The above commands need to be issued when the database is mounted.

279. My database is down and I cannot restore. What now? (for DBA

Recovery without any backup is normally not supported, however, Oracle Consulting can sometimes extract data from an offline database using a utility called DUL (Disk UnLoad). This utility reads data in the data files and unloads it into SQL*Loader or export dump files. DUL does not care about rollback segments, corrupted blocks, etc, and can thus not guarantee that the data is not logically corrupt. It is intended as an absolute last resort and will most likely cost your company a lot of money!!!

280. I've lost my REDOLOG files, how can I get my DB back? (for DBA

The following INIT.ORA parameter may be required if your current redo logs are corrupted or blown away. Caution is advised when enabling this parameter as you might end-up losing your entire database. Please contact Oracle Support before using it. _allow_resetlogs_ corruption = true

283. I've lost some Rollback Segments, how can I get my DB back? (for DBA

Re-start your database with the following INIT.ORA parameter if one of your rollback segments is corrupted. You can then drop the corrupted rollback segments and create it from scratch.

Page 151: Interview_Q1

Caution is advised when enabling this parameter, as uncommitted transactions will be marked as committed. One can very well end up with lost or inconsistent data!!! Please contact Oracle Support before using it. _Corrupted_rollback _segments = (rbs01, rbs01, rbs03, rbs04)

284. What are the differences between EBU and RMAN? (for DBA

Enterprise Backup Utility (EBU) is a functionally rich, high performance interface for backing up Oracle7 databases. It is sometimes referred to as OEBU for Oracle Enterprise Backup Utility. The Oracle Recovery Manager (RMAN) utility that ships with Oracle8 and above is similar to Oracle7's EBU utility. However, there is no direct upgrade path from EBU to RMAN.

285. How does one create a RMAN recovery catalog? (for DBA

Start by creating a database schema (usually called rman). Assign an appropriate tablespace to it and grant it the recovery_catalog_ owner role. Look at this example:sqlplus sysSQL>create user rman identified by rman;SQL> alter user rman default tablespace tools temporary tablespace temp;SQL> alter user rman quota unlimited on tools;SQL> grant connect, resource, recovery_catalog_ owner to rman;SQL> exit;Next, log in to rman and create the catalog schema. Prior to Oracle 8i this was done by running the catrman.sql script. rman catalog rman/rmanRMAN>create catalog tablespace tools;RMAN> exit;You can now continue by registering your databases in the catalog. Look at this example:rman catalog rman/rman target backdba/backdbaRMAN> register database;

314. What is the difference between locks, latches, enqueues and semaphores? (for DBA

A latch is an internal Oracle mechanism used to protect data structures in the SGA from simultaneous access. Atomic hardware instructions like TEST-AND-SET is used to implement latches. Latches are more restrictive than locks in that they are always exclusive. Latches are never queued, but will spin or sleep until they obtain a resource, or time out.Enqueues and locks are different names for the same thing. Both support queuing and concurrency. They are queued and serviced in a first-in-first- out (FIFO) order.Semaphores are an operating system facility used to control waiting. Semaphores are controlled by the following Unix parameters: semmni, semmns and semmsl. Typical settings are:semmns = sum of the "processes" parameter for each instance(see init<instance>.ora for each instance)semmni = number of instances running simultaneously;semmsl = semmns

315. What is a logical backup?

Page 152: Interview_Q1

Logical backup involves reading a set of database records and writing them into a file. Export utility is used for taking backup and Import utility is used to recover from backup.

316. Where can one get a list of all hidden Oracle parameters? (for DBA

Oracle initialization or INIT.ORA parameters with an underscore in front are hidden or unsupported parameters. One can get a list of all hidden parameters by executing this query:select *from SYS.X$KSPPIwhere substr(KSPPINM, 1,1) = '_';The following query displays parameter names with their current value:select a.ksppinm "Parameter", b.ksppstvl "Session Value", c.ksppstvl "Instance Value"from x$ksppi a, x$ksppcv b, x$ksppsv cwhere a.indx = b.indx and a.indx = c.indxand substr(ksppinm, 1,1)='_'order by a.ksppinm;Remember: Thou shall not play with undocumented parameters!

317. What is a database EVENT and how does one set it? (for DBA

Oracle trace events are useful for debugging the Oracle database server. The following two examples are simply to demonstrate syntax. Refer to later notes on this page for an explanation of what these particular events do.Either adding them to the INIT.ORA parameter file can activate events. E.g.event='1401 trace name errorstack, level 12'... or, by issuing an ALTER SESSION SET EVENTS command: E.g.alter session set events '10046 trace name context forever, level 4';The alter session method only affects the user's current session, whereas changes to the INIT.ORA file will affect all sessions once the database has been restarted.

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

319. What database events can be set? (for DBA

The following events are frequently used by DBAs and Oracle Support to diagnose problems:" 10046 trace name context forever, level 4 Trace SQL statements and show bind variables in trace output." 10046 trace name context forever, level 8 This shows wait events in the SQL trace files

Page 153: Interview_Q1

" 10046 trace name context forever, level 12 This shows both bind variable names and wait events in the SQL trace files" 1401 trace name errorstack, level 12 1401 trace name errorstack, level 4 1401 trace name processstate Dumps out trace information if an ORA-1401 "inserted value too large for column" error occurs. The 1401 can be replaced by any other Oracle Server error code that you want to trace." 60 trace name errorstack level 10 Show where in the code Oracle gets a deadlock (ORA-60), and may help to diagnose the problem.The following lists of events are examples only. They might be version specific, so please call Oracle before using them:" 10210 trace name context forever, level 10 10211 trace name context forever, level 10 10231 trace name context forever, level 10 These events prevent database block corruptions" 10049 trace name context forever, level 2 Memory protect cursor" 10210 trace name context forever, level 2 Data block check" 10211 trace name context forever, level 2 Index block check" 10235 trace name context forever, level 1 Memory heap check" 10262 trace name context forever, level 300 Allow 300 bytes memory leak for connectionsNote: You can use the Unix oerr command to get the description of an event. On Unix, you can type "oerr ora 10053" from the command prompt to get event details.

320. How can one dump internal database structures? (for DBA

The following (mostly undocumented) commands can be used to obtain information about internal database structures.o Dump control file contentsalter session set events 'immediate trace name CONTROLF level 10'/o Dump file headersalter session set events 'immediate trace name FILE_HDRS level 10'/o Dump redo log headersalter session set events 'immediate trace name REDOHDR level 10'/o Dump the system stateNOTE: Take 3 successive SYSTEMSTATE dumps, with 10-minute intervals alter session set events 'immediate trace name SYSTEMSTATE level 10'/o Dump the process statealter session set events 'immediate trace name PROCESSSTATE level 10'/o Dump Library Cache detailsalter session set events 'immediate trace name library cache level 10'/o Dump optimizer statistics whenever a SQL statement is parsed (hint: change statement or flush pool) alter session set events '10053 trace name context forever, level 1'/o Dump a database block (File/ Block must be converted to DBA address) Convert file and block number to a DBA (database block address).Eg: variable x varchar2;exec :x := dbms_utility. make_data_ block_address( 1,12);

Page 154: Interview_Q1

print xalter session set events 'immediate trace name blockdump level 50360894'/

321. What are the different kind of export backups?

Full back - Complete databaseIncremental - Only affected tables from last incremental date/full backup date.Cumulative backup - Only affected table from the last cumulative date/full backup date.

327. How does Space allocation table place within a block ?

Each block contains entries as followsFixed block headerVariable block headerRow Header,row date (multiple rows may exists)PCTEREE (% of free space for row updation in future)

328. What are the factors causing the reparsing of SQL statements in SGA?

Due to insufficient Shared SQL 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. LOGICAL & PHYSICAL ARCHITECTURE OF DATABASE.

329. What is dictionary cache ?

Dictionary cache is information about the databse objects stored in a data dictionary table.

330. What is a Control file ?

Database overall physical architecture is maintained in a file called control file. It will be used to maintain internal consistency and guide recovery operations. Multiple copies of control files are advisable.

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

332. How will you create multiple rollback segments in a database ?

Page 155: Interview_Q1

Create a database which implicitly creates a SYSTEM Rollback Segment in a SYSTEM tablespace. Create a Second Rollback Segment name R0 in the SYSTEM tablespace. Make new rollback segment available (After shutdown, modify init.ora file and Start database) Create other tablespaces (RBS) for rollback segments. Deactivate Rollback Segment R0 and activate the newly created rollback segments.

333. What is cold backup? What are the elements of it?

Cold backup is taking backup of all physical files after normal shutdown of database. We need to take.- All Data files.- All Control files.- All on-line redo log files.- The init.ora file (Optional)

334. What is meant by redo log buffer ?

Changes made to entries 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.

335. How will you estimate the space required by a non-clustered tables?

Calculate the total header sizeCalculate the available dataspace per data blockCalculate the combined column lengths of the average rowCalculate the total average row size.Calculate the average number rows that can fit in a blockCalculate the number of blocks and bytes required for the table.After arriving the calculation, add 10 % additional space to calculate the initial extent size for a working table.

336. How will you monitor the space allocation ?

By querying DBA_SEGMENT table/view.

337. What is meant by free extent ?

A free extent is a collection of continuous free blocks in tablespace. When a segment is dropped its extents are reallocated and are marked as free.

349. What are the different methods of backing up oracle database ?

- Logical Backups- Cold Backups- Hot Backups (Archive log)

Page 156: Interview_Q1

358. What is an SQL *FORMS ?

SQL *forms is 4GL tool for developing and executing; Oracle based interactive application.

381. When is cost based optimization triggered? (for DBA

It's important to have statistics on all tables for the CBO (Cost Based Optimizer) to work correctly. If one table involved in a statement does not have statistics, Oracle has to revert to rule-based optimization for that statement. So you really want for all tables to have statistics right away; it won't help much to just have the larger tables analyzed.Generally, the CBO can change the execution plan when you:1. Change statistics of objects by doing an ANALYZE;2. Change some initialization parameters (for example: hash_join_enabled, sort_area_size, db_file_multiblock_ read_count) .

382. How can one optimize %XYZ% queries? (for DBA

It is possible to improve %XYZ% queries by forcing the optimizer to scan all the entries from the index instead of the table. This can be done by specifying hints. If the index is physically smaller than the table (which is usually the case) it will take less time to scan the entire index than to scan the entire table.

384. Where can one find I/O statistics per table? (for DBA

The UTLESTAT report shows I/O per tablespace but one cannot see what tables in the tablespace has the most I/O. The $ORACLE_HOME/ rdbms/admin/ catio.sql script creates a sample_io procedure and table to gather the required information. After executing the procedure, one can do a simple SELECT * FROM io_per_object; to extract the required information. For more details, look at the header comments in the $ORACLE_HOME/ rdbms/admin/ catio.sql script.

385. My query was fine last week and now it is slow. Why? (for DBA

The likely cause of this is because the execution plan has changed. Generate a current explain plan of the offending query and compare it to a previous one that was taken when the query was performing well. Usually the previous plan is not available.Some factors that can cause a plan to change are:. Which tables are currently analyzed? Were they previously analyzed? (ie. Was the query using RBO and now CBO?). Has OPTIMIZER_MODE been changed in INIT.ORA?. Has the DEGREE of parallelism been defined/changed on any table?. Have the tables been re-analyzed? Were the tables analyzed using estimate or compute? If estimate, what percentage was used?. Have the statistics changed?. Has the INIT.ORA parameter DB_FILE_MULTIBLOCK_ READ_COUNT been changed?. Has the INIT.ORA parameter SORT_AREA_SIZE been changed?. Have any other INIT.ORA parameters been changed?

Page 157: Interview_Q1

. What do you think the plan should be? Run the query with hints to see if this produces the required performance.

386. Why is Oracle not using the damn index? (for DBA

This problem normally only arises when the query plan is being generated by the Cost Based Optimizer. The usual cause is because the CBO calculates that executing a Full Table Scan would be faster than accessing the table via the index.Fundamental things that can be checked are:. USER_TAB_COLUMNS. NUM_DISTINCT - This column defines the number of distinct values the column holds.. USER_TABLES. NUM_ROWS - If NUM_DISTINCT = NUM_ROWS then using an index would be preferable to doing a FULL TABLE SCAN. As the NUM_DISTINCT decreases, the cost of using an index increase thereby is making the index less desirable.. USER_INDEXES. CLUSTERING_ FACTOR - This defines how ordered the rows are in the index. If CLUSTERING_FACTOR approaches the number of blocks in the table, the rows are ordered. If it approaches the number of rows in the table, the rows are randomly ordered. In such a case, it is unlikely that index entries in the same leaf block will point to rows in the same data blocks.. Decrease the INIT.ORA parameter DB_FILE_MULTIBLOCK_ READ_COUNT - A higher value will make the cost of a FULL TABLE SCAN cheaper.. Remember that you MUST supply the leading column of an index, for the index to be used (unless you use a FAST FULL SCAN or SKIP SCANNING).. There are many other factors that affect the cost, but sometimes the above can help to show why an index is not being used by the CBO. If from checking the above you still feel that the query should be using an index, try specifying an index hint. Obtain an explain plan of the query either using TKPROF with TIMED_STATISTICS, so that one can see the CPU utilization, or with AUTOTRACE to see the statistics. Compare this to the explain plan when not using an index.

397. When should one rebuild an index? (for DBA

You can run the 'ANALYZE INDEX VALIDATE STRUCTURE' command on the affected indexes - each invocation of this command creates a single row in the INDEX_STATS view. This row is overwritten by the next ANALYZE INDEX command, so copy the contents of the view into a local table after each ANALYZE. The 'badness' of the index can then be judged by the ratio of 'DEL_LF_ROWS' to 'LF_ROWS'

389. What is an Alert ?

An alert is window that appears in the middle of the screen overlaying a portion of the current display.

438. What is an Lov?

A list of values is a single or multi column selection list displayed in a pop-up window

444. What is Oracle Financials? (for DBA

Page 158: Interview_Q1

Oracle Financials products provide organizations with solutions to a wide range of long- and short-term accounting system issues. Regardless of the size of the business, Oracle Financials can meet accounting management demands with:

* Oracle Assets: Ensures that an organization' s property and equipment investment is accurate and that the correct asset tax accounting strategies are chosen. * Oracle General Ledger: Offers a complete solution to journal entry, budgeting, allocations, consolidation, and financial reporting needs. * Oracle Inventory: Helps an organization make better inventory decisions by minimizing stock and maximizing cash flow. * Oracle Order Entry: Provides organizations with a sophisticated order entry system for managing customer commitments. * Oracle Payables: Lets an organization process more invoices with fewer staff members and tighter controls. Helps save money through maximum discounts, bank float, and prevention of duplicate payment. * Oracle Personnel: Improves the management of employee- related issues by retaining and making available every form of personnel data. * Oracle Purchasing: Improves buying power, helps negotiate bigger discounts, eliminates paper flow, increases financial controls, and increases productivity. * Oracle Receivables: . Improves cash flow by letting an organization process more payments faster, without off-line research. Helps correctly account for cash, reduce outstanding receivables, and improve collection effectiveness. * Oracle Revenue Accounting Gives an organization timely and accurate revenue and flexible commissions reporting. * Oracle Sales Analysis: Allows for better forecasting, planning. and reporting of sales information.

446. What is the most important module in Oracle Financials? (for DBA

The General Ledger (GL) module is the basis for all other Oracle Financial modules. All other modules provide information to it. If you implement Oracle Financials, you should switch your current GL system first.GL is relatively easy to implement. You should go live with it first to give your implementation team a chance to be familiar with Oracle Financials.

448. What is the MultiOrg and what is it used for? (for DBA

MultiOrg or Multiple Organizations Architecture allows multiple operating units and their relationships to be defined within a single installation of Oracle Applications. This keeps each operating unit's transaction data separate and secure.Use the following query to determine if MuliOrg is intalled:select multi_org_flag from fnd_product_ groups;

449. What is the difference between Fields and FlexFields? (for DBA

A field is a position on a form that one uses to enter, view, update, or delete information. A field prompt describes each field by telling what kind of information appears in the field, or alternatively, what kind of information should be entered in the field.A flexfield is an Oracle Applications field made up of segments. Each segment has an assigned name and a set of valid values. Oracle Applications uses flexfields to

Page 159: Interview_Q1

capture information about your organization. There are two types of flexfields: key flexfields and descriptive flexfields

470. What is Fine Grained Auditing? (for DBA

Fine Grained Auditing (DBMS_FGA) allows auditing records to be generated when certain rows are selected from a table. A list of defined policies can be obtained from DBA_AUDIT_POLICIES. Audit records are stored in DBA_FGA_AUDIT_ TRAIL. Look at this example:o Add policy on table with autiting condition...execute dbms_fga.add_ policy('HR' , 'EMP', 'policy1', 'deptno > 10');o Must ANALYZE, this feature works with CBO (Cost Based Optimizer)analyze table EMP compute statistics;select * from EMP where c1 = 11; -- Will trigger auditingselect * from EMP where c1 = 09; -- No auditingo Now we can see the statments that triggered the auditing condition...select sqltext from sys.fga_log$ ;delete from sys.fga_log$ ;

472. What is Fine Grained Access Control? (for DBA

See question "What is a Virtual Private Database".

473. What is a Virtual Private Database? (for DBA

Oracle 8i introduced the notion of a Virtual Private Database (VPD). A VPD offers Fine-Grained Access Control (FGAC) for secure separation of data. This ensures that users only have access to data that pertains to them. Using this option, one could even store multiple companies' data within the same schema, without them knowing about it. VPD configuration is done via the DBMS_RLS (Row Level Security) package. Select from SYS.V$VPD_POLICY to see existing VPD configuration.

475. What is Oracle Label Security? (for DBA

Oracle Label Security (formerly called Trusted Oracle MLS RDBMS) uses the VPD (Virtual Private Database) feature of Oracle8i to implement row level security. Access to rows are restricted according to a user's security sensitivity tag or label. Oracle Label Security is configured, controlled and managed from the Policy Manager, an Enterprise Manager-based GUI utility.

477. What is OEM (Oracle Enterprise Manager)? (for DBA

OEM is a set of systems management tools provided by Oracle Corporation for managing the Oracle environment. It provides tools to monitor the Oracle environment and automate tasks (both one-time and repetitive in nature) to take database administration a step closer to "Lights Out" management.

478. Question What is PL/SQL ?

PL/SQL is a procedural language that has both interactive SQL and procedural programming language constructs such as iteration, conditional branching.

Page 160: Interview_Q1

479. What are the components of OEM? (for DBA

Oracle Enterprise Manager (OEM) has the following components:. Management Server (OMS): Middle tier server that handles communication with the intelligent agents. The OEM Console connects to the management server to monitor and configure the Oracle enterprise.. Console: This is a graphical interface from where one can schedule jobs, events, and monitor the database. The console can be opened from a Windows workstation, Unix XTerm (oemapp command) or Web browser session (oem_webstage) .. Intelligent Agent (OIA): The OIA runs on the target database and takes care of the execution of jobs and events scheduled through the Console.

. What are the advantages of having a Package ?

Increased functionality (for example,global package variables can be declared and used by any proecdure in the package) and performance (for example all objects of the package are parsed compiled, and loaded into memory once)

506. What are the uses of Database Trigger ?

Database triggers can be used to automatic data generation, audit data modifications, enforce complex Integrity constraints, and customize complex security authorizations.

507. What is a Procedure ?

A Procedure consist of a set of SQL and PL/SQL statements that are grouped together as a unit to solve a specific problem or perform a set of related tasks.

508. What is a Package ?

A Package is a collection of related procedures, functions, variables and other package constructs together as a unit in the database.

509. What is difference between Procedures and Functions ?

A Function returns a value to the caller where as a Procedure does not.

510. What is Database Trigger ?

A Database Trigger is procedure (set of SQL and PL/SQL statements) that is automatically executed as a result of an insert in,update to, or delete from a table.

511. Can the default values be assigned to actual parameters?

Yes

Page 161: Interview_Q1

512. Can a primary key contain more than one columns?

Yes

515. Differentiate between TRUNCATE and DELETE?

TRUNCATE deletes much faster than DELETETRUNCATEDELETEIt is a DDL statementIt is a DML statementIt is a one way trip,cannot ROLLBACKOne can RollbackDoesn't have selective features (where clause)HasDoesn't fire database triggersDoesIt requires disabling of referential constraints.

518. What are different Oracle database objects?

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

519. What is difference between SUBSTR and INSTR?

SUBSTR returns a specified portion of a string eg SUBSTR('BCDEF' ,4) output BCDE INSTR provides character position in which a pattern is found in a string. eg INSTR('ABC-DC- F','-',2) output 7 (2nd occurence of '-'

529. What is a OUTER JOIN?

Outer Join--Its a join condition used where you can query all the rows of one of the tables in the join condition even though they don’t satisfy the join condition.

530. What is a cursor?

Oracle uses work area to execute SQL statements and store processing information PL/SQL construct called a cursor lets you name a work area and access its stored information A cursor is a mechanism used to fetch more than one row in a Pl/SQl block.

Page 162: Interview_Q1

531. What is the purpose of a cluster?

Oracle does not allow a user to specifically locate tables, since that is a part of the function of the RDBMS. However, for the purpose of increasing performance, oracle allows a developer to create a CLUSTER. A CLUSTER provides a means for storing data from different tables together for faster retrieval than if the table placement were left to the RDBMS.

547. How will you delete duplicating rows from a base table?

delete from table_name where rowid not in (select max(rowid) from table group by duplicate_values_ field_name) ; or delete duplicate_values_ field_name dv from table_name ta where rowid <(select min(rowid) from table_name tb where ta.dv=tb.dv) ;

551. What is a view ?

A view is stored procedure based on one or more tables, it’s a virtual table.

552. What is difference between UNIQUE and PRIMARY KEY constraints?

A table can have only one PRIMARY KEY whereas there can be any number of UNIQUE keys. The columns that compose PK are automatically define NOT NULL, whereas a column that compose a UNIQUE is not automatically defined to be mandatory must also specify the column is NOT NULL.

553. What is use of a cursor variable? How it is defined?

A cursor variable is associated with different statements at run time, which can hold different values at run time. Static cursors can only be associated with one run time query. A cursor variable is reference type (like a pointer in C).Declaring a cursor variable:TYPE type_name IS REF CURSOR RETURN return_type type_name is the name of the reference type,return_ type is a record type indicating the types of the select list that will eventually be returned by the cursor variable.

554. How do you find the numbert of rows in a Table ?

A bad answer is count them (SELECT COUNT(*) FROM table_name)A good answer is :-'By generating SQL to ANALYZE TABLE table_name COUNT STATISTICS by querying Oracle System Catalogues (e.g. USER_TABLES or ALL_TABLES).The best answer is to refer to the utility which Oracle released which makes it unnecessary to do ANALYZE TABLE for each Table individually.

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

Page 163: Interview_Q1

559. What is the fastest way of accessing a row in a table ?

Using ROWID.CONSTRAINTS

560. What is difference between TRUNCATE & DELETE ?

TRUNCATE commits after deleting entire table i.e., can not be rolled back. Database triggers do not fire on TRUNCATEDELETE allows the filtered deletion. Deleted records can be rolled back or committed.Database triggers fire on DELETE.

561. What is a transaction ?

Transaction is logical unit between two commits and commit and rollback.

562. What are the advantages of VIEW ?

To protect some of the columns of a table from other users.To hide complexity of a query.To hide complexity of calculations.

563. How will you a activate/deactivate integrity constraints ?

The integrity constraints can be enabled or disabled by ALTER TABLE ENABLE constraint/DISABLE constraint.

564. Where the integrity constraints are stored in Data Dictionary ?

The integrity constraints are stored in USER_CONSTRAINTS.

565. What is the Subquery ?

Sub query is a query whose return values are used in filtering conditions of the main query.

567. What are the usage of SAVEPOINTS ?value in a session before accessing next value ?

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.

568. What is ROWID ?in a session before accessing next value ?

ROWID is a pseudo column attached to each row of a table. It is 18 character long, blockno, rownumber are the components of ROWID.

Page 164: Interview_Q1

571. What is Referential Integrity ?

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.

572. What is a join ? Explain the different types of joins ?

Join is a query which retrieves related columns or rows from multiple tables.Self Join - Joining the table with itself.Equi Join - Joining two tables by equating two common columns.Non- Equi Join - Joining two tables by equating two common columns.Outer Join - Joining two tables in such a way that query can also retrieve rows that do not have corresponding join value in the other table.

573. If an 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.

574. How does one stop and start the OMS? (for DBA

Use the following command sequence to stop and start the OMS (Oracle Management Server):oemctl start omsoemctl status oms sysman/oem_tempoemctl stop oms sysman/oem_tempWindows NT/2000 users can just stop and start the required services. The default OEM administrator is "sysman" with a password of "oem_temp".NOTE: Use command oemctrl instead of oemctl for Oracle 8i and below.

575. What is an Integrity Constraint ?

Integrity constraint is a rule that restricts values to a column in a table.

576. How does one create a repository? (for DBA

For OEM v2 and above, start the Oracle Enterprise Manager Configuration Assistant (emca on Unix) to create and configure the management server and repository. Remember to setup a backup for the repository database after creating it.

579. What is a database link ?

Database Link is a named path through which a remote database can be accessed.

580. How does one list one's databases in the OEM Console? (for DBA

Page 165: Interview_Q1

Follow these steps to discover databases and other services from the OEM Console:1. Ensure the GLOBAL_DBNAME parameter is set for all databases in your LISTENER.ORA file (optional). These names will be listed in the OEM Console. Please note that names entered are case sensitive. A portion of a listener.ora file:(SID_DESC =(GLOBAL_DBNAME = DB_name_for_ OEM)(SID_NAME = ...2. Start the Oracle Intelligent Agent on the machine you want to discover. See section "How does one start the Oracle Intelligent Agent?".3. Start the OEM Console, navigate to menu "Navigator/ Discover Nodes". The OEM Discovery Wizard will guide you through the process of discovering your databases and other services.

593. What utility is used to create a physical backup?

Either rman or alter tablespace begin backup will do..

594. What are the Back ground processes in Oracle and what are they.

This is one of the most frequently asked question.There are basically 9 Processes but in a general system we need to mention the first five background processes.They do the house keeping activities for the Oracle and are common in any system.The various background processes in oracle area) Data Base Writer(DBWR) :: Data Base Writer Writes Modified blocks from Database buffer cache to Data Files.This is required since the data is not written whenever a transaction is commited.b)LogWriter( LGWR) :: LogWriter writes the redo log entries to disk. Redo Log data is generated in redo log buffer of SGA. As transaction commits and log buffer fills, LGWR writes log entries into a online redo log file.c) System Monitor(SMON) :: The System Monitor performs instance recovery at instance startup.This is useful for recovery from system failured)Process Monitor(PMON) :: The Process Monitor peforms process recovery when user Process fails. Pmon Clears and Frees resources that process was using.e) CheckPoint(CKPT) :: At Specified times, all modified database buffers in SGA are written to data files by DBWR at Checkpoints and Updating all data files and control files of database to indicate the most recent checkpointf)Archieves( ARCH) :: The Archiver copies online redo log files to archival storal when they are busy.g) Recoveror(RECO) :: The Recoveror is used to resolve the distributed transaction in networkh) Dispatcher (Dnnn) :: The Dispatcher is useful in Multi Threaded Architecturei) Lckn :: We can have upto 10 lock processes for inter instance locking in parallel sql.

595. How many types of Sql Statements are there in Oracle

There are basically 6 types of sql statments.They area) Data Defination Language(DDL) :: The DDL statments define and maintain objects and drop objects.b) Data Manipulation Language(DML) :: The DML statments manipulate database data.c) Transaction Control Statements :: Manage change by DMLd) Session Control :: Used to control the properties of current session enabling and disabling roles and changing .e.g :: Alter Statements,Set Rolee) System Control Statements :: Change Properties of Oracle Instance .e.g:: Alter System

Page 166: Interview_Q1

f) Embedded Sql :: Incorporate DDL,DML and T.C.S in Programming Language.e.g: : Using the Sql Statements in languages such as 'C', Open,Fetch, execute and close

596. What is a Transaction in Oracle

A transaction is a Logical unit of work that compromises one or more SQL Statements executed by a single User. According to ANSI, a transaction begins with first executable statment and ends when it is explicitly commited or rolled back.

597. Key Words Used in Oracle

The Key words that are used in Oracle are ::a) Commiting :: A transaction is said to be commited when the transaction makes permanent changes resulting from the SQL statements.b) Rollback :: A transaction that retracts any of the changes resulting from SQL statements in Transaction.c) SavePoint :: For long transactions that contain many SQL statements, intermediate markers or savepoints are declared. Savepoints can be used to divide a transactino into smaller points.d) Rolling Forward :: Process of applying redo log during recovery is called rolling forward.e) Cursor :: A cursor is a handle ( name or a pointer) for the memory associated with a specific stament. A cursor is basically an area allocated by Oracle for executing the Sql Statement. Oracle uses an implicit cursor statement for Single row query and Uses Explcit cursor for a multi row query.f) System Global Area(SGA) :: The SGA is a shared memory region allocated by the Oracle that contains Data and control information for one Oracle Instance.It consists of Database Buffer Cache and Redo log Buffer.g) Program Global Area (PGA) :: The PGA is a memory buffer that contains data and control information for server process.g) Database Buffer Cache :: Databese Buffer of SGA stores the most recently used blocks of datatbase data.The set of database buffers in an instance is called Database Buffer Cache.h) Redo log Buffer :: Redo log Buffer of SGA stores all the redo log entries.i) Redo Log Files :: Redo log files are set of files that protect altered database data in memory that has not been written to Data Files. They are basically used for backup when a database crashes.j) Process :: A Process is a 'thread of control' or mechansim in Operating System that executes series of steps.

603. What is in all those X$ tables? (for DBA

The following list attempts to describe some x$ tables. The list may not be complete or accurate, but represents an attempt to figure out what information they contain. One should generally not write queries against these tables as they are internal to Oracle, and Oracle may change them without any prior notification.

X$K2GTE2

Kernel 2 Phase Commit Global Transaction Entry Fixed Table

Page 167: Interview_Q1

X$K2GTE

Kernel 2 Phase Commit Global Transaction Entry Fixed Table

X$BH

Buffer headers contain information describing the current contents of a piece of the buffer cache

X$KCBCBH

Cache Buffer Current Buffer Header Fixed Table. It can predict the potential loss of decreasing the number of database buffers. The db_block_lru_ statistics parameter has to be set to true to gather information in this table.

X$KCVFH

File Header Fixed Table

X$KDNCE

SGA Cache Entry Fixed Table

X$KDNST

Sequence Cache Statistics Fixed Table

X$KDXHS

Histogram structure Fixed Table

X$KDXST

Statistics collection Fixed Table

X$KGHLU

One-row summary of LRU statistics for the shared pool

X$KGLBODY

Derived from X$KGLOB (col kglhdnsp = 2)

X$KGLCLUSTER

Page 168: Interview_Q1

Derived from X$KGLOB (col kglhdnsp = 5)

X$KGLINDEX

Derived from X$KGLOB (col kglhdnsp = 4)

X$KGLLC

Latch Clean-up state for library cache objects Fixed Table

X$KGLPN

Library cache pin Fixed Table

X$KGLTABLE

Derived from X$KGLOB (col kglhdnsp = 1)

X$KGLTR

Library Cache Translation Table entry Fixed Table

X$KGLTRIGGER

Derived from X$KGLOB (col kglhdnsp = 3)

X$KGLXS

Library Cache Access Table

X$KKMMD

Fixed table to look at what databases are mounted and their status

X$KKSBV

Cursor Cache Bind Variables

X$KSMSP

Each row represents a piece of memory in the shared pool

X$KSQDN

Page 169: Interview_Q1

Global database name

X$KSQST

Enqueue statistics by type

X$KSUCF

Cost function for each Kernel Profile (join to X$KSUPL)

X$KSUPL

Resource Limit for each Kernel Profile

X$KSURU

Resource Usage for each Kernel Profile (join with X$KSUPL)

X$KSQST

Gets and waits for different types of enqueues

X$KTTVS

Indicate tablespace that has valid save undo segments

X$KVII

Internal instance parameters set at instance initialization

X$KVIS

Oracle Data Block (size_t type) variables

X$KVIT

Instance internal flags, variables and parameters that can change during the life of an instance

X$KXFPCDS

Client Dequeue Statistics

Page 170: Interview_Q1

X$KXFPCMS

Client Messages Statistics

X$KZDOS

Represent an os role as defined by the operating system

X$KZSRO

Security state Role: List of enabled roles

X$LE

Lock Element: each PCM lock that is used by the buffer cache (gc_db_locks)

X$MESSAGES

Displays all the different messages that can be sent to the Background processes

X$NLS_PARAMETERS

NLS database parameters

Handy X$table queriesSome handy queries based on the X$ memory tables:. Largest # blocks you can write at any given time:select kviival write_batch_ sizefrom x$kvii where kviitag = 'kcbswc';. See the gets and waits for different types of enqueues:select * from x$ksqstwhere ksqstget > 0;Oracle Kernel SubsystemsListed below are some of the important subsystems in the Oracle kernel. This table might help you to read those dreaded trace files and internal messages. For example, if you see messages like this, you will at least know where they come from: OPIRIP: Uncaught error 447. Error stack:KCF: write/open error block=0x3e800 online=1

OPI

Oracle Program Interface

KK

Page 171: Interview_Q1

Compilation Layer - Parse SQL, compile PL/SQL

KX

Execution Layer - Bind and execute SQL and PL/SQL

K2

Distributed Execution Layer - 2PC handling

NPI

Network Program Interface

KZ

Security Layer - Validate privs

KQ

Query Layer

RPI

Recursive Program Interface

KA

Access Layer

KD

Data Layer

KT

Transaction Layer

KC

Cache Layer

KS

Page 172: Interview_Q1

Services Layer

KJ

Lock Manager Layer

KG

Generic Layer

KV

Kernel Variables (eg. x$KVIS and X$KVII)

S or ODS

Operating System Dependencies

605. How does one change an Oracle user's password?(for DBA

Issue the following SQL command:ALTER USER <username> IDENTIFIED BY <new_password>;From Oracle8 you can just type "password" from SQL*Plus, or if you need to change another user's password, type "password user_name". Look at this example:SQL> passwordChanging password for SCOTTOld password:New password:Retype new password:

606. How does one create and drop database users?

Look at these examples:CREATE USER scottIDENTIFIED BY tiger -- Assign passwordDEFAULT TABLESACE tools -- Assign space for table and index segmentsTEMPORARY TABLESPACE temp; -- Assign sort spaceDROP USER scott CASCADE; -- Remove userAfter creating a new user, assign the required privileges:GRANT CONNECT, RESOURCE TO scott;GRANT DBA TO scott; -- Make user a DB AdministratorRemember to give the user some space quota on its tablespaces:ALTER USER scott QUOTA UNLIMITED ON tools;

607. Who created all these users in my database?/ Can I drop this user? (for DBA

Page 173: Interview_Q1

Oracle creates a number of default database users or schemas when a new database is created. Below are a few of them:SYS/CHANGE_ON_ INSTALL or INTERNALOracle Data Dictionary/ CatalogCreated by: ?/rdbms/admin/ sql.bsq and various cat*.sql scriptsCan password be changed: Yes (Do so right after the database was created)Can user be dropped: NOSYSTEM/MANAGERThe default DBA user name (please do not use SYS)Created by: ?/rdbms/admin/ sql.bsqCan password be changed: Yes (Do so right after the database was created)Can user be dropped: NOOUTLN/OUTLNStored outlines for optimizer plan stabilityCreated by: ?/rdbms/admin/ sql.bsqCan password be changed: Yes (Do so right after the database was created)Can user be dropped: NOSCOTT/TIGER, ADAMS/WOOD, JONES/STEEL, CLARK/CLOTH and BLAKE/PAPER.Training/ demonstration users containing the popular EMP and DEPT tablesCreated by: ?/rdbms/admin/ utlsampl. sqlCan password be changed: YesCan user be dropped: YES - Drop users cascade from all production environmentsHR/HR (Human Resources), OE/OE (Order Entry), SH/SH (Sales History).Training/ demonstration users containing the popular EMPLOYEES and DEPARTMENTS tablesCreated by: ?/demo/schema/ mksample. sqlCan password be changed: YesCan user be dropped: YES - Drop users cascade from all production environmentsCTXSYS/CTXSYSOracle interMedia (ConText Cartridge) administrator userCreated by: ?/ctx/admin/ dr0csys.sqlTRACESVR/TRACEOracle Trace serverCreated by: ?/rdbms/admin/ otrcsvr.sqlDBSNMP/DBSNMPOracle Intelligent agentCreated by: ?/rdbms/admin/ catsnmp.sql, called from catalog.sqlCan password be changed: Yes - put the new password in snmp_rw.ora fileCan user be dropped: YES - Only if you do not use the Intelligent AgentsORDPLUGINS/ORDPLUGI NSObject Relational Data (ORD) User used by Time Series, etc.Created by: ?/ord/admin/ ordinst.sqlORDSYS/ORDSYSObject Relational Data (ORD) User used by Time Series, etcCreated by: ?/ord/admin/ ordinst.sqlDSSYS/DSSYSOracle Dynamic Services and Syndication ServerCreated by: ?/ds/sql/dssys_ init.sqlMDSYS/MDSYSOracle Spatial administrator userCreated by: ?/ord/admin/ ordinst.sqlAURORA$ORB$UNAUTHEN TICATED/INVALIDUsed for users who do not authenticate in Aurora/ORBCreated by: ?/javavm/install/ init_orb. sql called from ?/javavm/install/ initjvm.sqlPERFSTAT/PERFSTAT

Page 174: Interview_Q1

Oracle Statistics Package (STATSPACK) that supersedes UTLBSTAT/UTLESTATCreated by: ?/rdbms/admin/ statscre. sqlRemember to change the passwords for the SYS and SYSTEM users immediately after installation!Except for the user SYS, there should be no problem altering these users to use a different default and temporary tablespace.

608. How does one enforce strict password control? (for DBA

By default Oracle's security is not extremely good. For example, Oracle will allow users to choose single character passwords and passwords that match their names and userids. Also, passwords don't ever expire. This means that one can hack an account for years without ever locking the user.From Oracle8 one can manage passwords through profiles. Some of the things that one can restrict:. FAILED_LOGIN_ ATTEMPTS - failed login attempts before the account is locked. PASSWORD_LIFE_ TIME - limits the number of days the same password can be used for authentication. PASSWORD_REUSE_ TIME - number of days before a password can be reused. PASSWORD_REUSE_ MAX - number of password changes required before the current password can be reused. PASSWORD_LOCK_ TIME - number of days an account will be locked after maximum failed login attempts. PASSWORD_GRACE_ TIME - number of days after the grace period begins during which a warning is issued and login is allowed. PASSWORD_VERIFY_ FUNCTION - password complexity verification scriptLook at this simple example:CREATE PROFILE my_profile LIMITPASSWORD_LIFE_ TIME 30;ALTER USER scott PROFILE my_profile;

609. How does one switch to another user in Oracle? (for DBA

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> select password from dba_users where username='SCOTT' ;PASSWORDF894844C34402B67SQL> alter user scott identified by lion;User altered.

SQL> connect scott/lionConnected.

REM Do whatever you like...SQL> connect system/managerConnected.

SQL> alter user scott identified by values 'F894844C34402B67' ;User altered.SQL> connect scott/tigerConnected.

Page 175: Interview_Q1

Note: Also see the su.sql script in the Useful Scripts and Sample Programs Page.

612. What is the difference between candidate key, unique key and primary key

Candidate keys are the columns in the table that could be the primary keys and the primary key is the key that has been selected to identify the rows. Unique key is also useful for identifying the distinct rows in the table.)

613. What is concurrency

Cuncurrency is allowing simultaneous access of same data by different users. Locks useful for accesing the database area) ExclusiveThe exclusive lock is useful for locking the row when an insert,update or delete is being done.This lock should not be applied when we do only select from the row.b) Share lockWe can do the table as Share_Lock as many share_locks can be put on the same resource.

614. Previleges and Grants

Previleges are the right to execute a particulare type of SQL statements. e.g :: Right to Connect, Right to create, Right to resource Grants are given to the objects so that the object might be accessed accordingly. The grant has to be given by the owner of the object.

615. Table Space,Data Files,Parameter File, Control Files

Table Space :: The table space is useful for storing the data in the database.When a database is created two table spaces are created.a) System Table space :: This data file stores all the tables related to the system and dba tablesb) User Table space :: This data file stores all the user related tablesWe should have seperate table spaces for storing the tables and indexes so that the access is fast.Data Files :: Every Oracle Data Base has one or more physical data files.They store the data for the database.Every datafile is associated with only one database.Once the Data file is created the size cannot change.To increase the size of the database to store more data we have to add data file.Parameter Files :: Parameter file is needed to start an instance.A parameter file contains the list of instance configuration parameters e.g.::db_block_buffers = 500db_name = ORA7db_domain = u.s.acme langControl Files :: Control files record the physical structure of the data files and redo log filesThey contain the Db name, name and location of dbs, data files ,redo log files and time stamp.

616. Physical Storage of the Data

Page 176: Interview_Q1

The finest level of granularity of the data base are the data blocks.Data Block :: One Data Block correspond to specific number of physical database spaceExtent :: Extent is the number of specific number of contigious data blocks.Segments :: Set of Extents allocated for Extents. There are three types of Segmentsa) Data Segment :: Non Clustered Table has data segment data of every table is stored in cluster data segmentb) Index Segment :: Each Index has index segment that stores datac) Roll Back Segment :: Temporarily store 'undo' information

617. What are the Pct Free and Pct Used

Pct Free is used to denote the percentage of the free space that is to be left when creating a table. Similarly Pct Used is used to denote the percentage of the used space that is to be used when creating a tableeg.:: Pctfree 20, Pctused 40

618. What is Row Chaining

The data of a row in a table may not be able to fit the same data block.Data for row is stored in a chain of data blocks .

619. What is a 2 Phase Commit

Two Phase commit is used in distributed data base systems. This is useful to maintain the integrity of the database so that all the users see the same values. It contains DML statements or Remote Procedural calls that reference a remote object. There are basically 2 phases in a 2 phase commit.a) Prepare Phase :: Global coordinator asks participants to prepareb) Commit Phase :: Commit all participants to coordinator to Prepared, Read only or abort Reply

620. What is the difference between deleting and truncating of tables

Deleting a table will not remove the rows from the table but entry is there in the database dictionary and it can be retrieved But truncating a table deletes it completely and it cannot be retrieved.

621. What are mutating tables

When a table is in state of transition it is said to be mutating. eg :: If a row has been deleted then the table is said to be mutating and no operations can be done on the table except select.

622. What are Codd Rules

Page 177: Interview_Q1

Codd Rules describe the ideal nature of a RDBMS. No RDBMS satisfies all the 12 codd rules and Oracle Satisfies 11 of the 12 rules and is the only Rdbms to satisfy the maximum number of rules.

623. What is Normalisation

Normalisation is the process of organising the tables to remove the redundancy.There are mainly 5 Normalisation rules.a) 1 Normal Form :: A table is said to be in 1st Normal Form when the attributes are atomicb) 2 Normal Form :: A table is said to be in 2nd Normal Form when all the candidate keys are dependant on the primary keyc) 3rd Normal Form :: A table is said to be third Normal form when it is not dependant transitively

624. What is the Difference between a post query and a pre query

A post query will fire for every row that is fetched but the pre query will fire only once.

625. Deleting the Duplicate rows in the table

We can delete the duplicate rows in the table by using the Rowid

627. What is pseudo columns ? Name them?

A pseudocolumn behaves like a table column, but is not actually stored in the table. You can select from pseudocolumns, but you cannot insert, update, or delete their values. This section describes these pseudocolumns:* CURRVAL* NEXTVAL* LEVEL* ROWID* ROWNUM

628. How many columns can table have?

The number of columns in a table can range from 1 to 254.

629. Is space acquired in blocks or extents ?

In extents .

630. what is clustered index?

Page 178: Interview_Q1

In an indexed cluster, rows are stored together based on their cluster key values . Can not applied for HASH.

677. What is Log Switch ?

The point at which ORACLE ends writing to one online redo log file and begins writing to another is called a log switch.

678. What is On-line Redo Log?

The On-line Redo Log is a set of tow or more on-line redo files that record all committed changes made to the database. Whenever a transaction is committed, the corresponding redo entries temporarily stores in redo log buffers of the SGA are written to an on-line redo log file by the background process LGWR. The on-line redo log files are used in cyclical fashion.

679. Which parameter specified in the DEFAULT STORAGE clause of CREATE TABLESPACE cannot be altered after creating the tablespace?

All the default storage parameters defined for the tablespace can be changed using the ALTER TABLESPACE command. When objects are created their INITIAL and MINEXTENS values cannot be changed.

680. What are the steps involved in Database Startup ?

Start an instance, Mount the Database and Open the Database.

< ? Recovery Instance in involved steps the are What>

Rolling forward to recover data that has not been recorded in data files, yet has been recorded in the on-line redo log, including the contents of rollback segments. Rolling back transactions that have been explicitly rolled back or have not been committed as indicated by the rollback segments regenerated in step a. Releasing any resources (locks) held by transactions in process at the time of the failure. Resolving any pending distributed transactions undergoing a two-phase commit at the time of the instance failure.

682. Can Full Backup be performed when the database is open ?

No.

683. What are the different modes of mounting a Database with the Parallel Server ?

Page 179: Interview_Q1

Exclusive Mode If the first instance that mounts a database does so in exclusive mode, only that Instance can mount the database.Parallel Mode If the first instance that mounts a database is started in parallel mode, other instances that are started in parallel mode can also mount the database.

684. What are the advantages of operating a database in ARCHIVELOG mode over operating it in NO ARCHIVELOG mode ?

Complete database recovery from disk failure is possible only in ARCHIVELOG mode. Online database backup is possible only in ARCHIVELOG mode.

685. What are the steps involved in Database Shutdown ?

Close the Database, Dismount the Database and Shutdown the Instance.

686. What is Archived Redo Log ?

Archived Redo Log consists of Redo Log files that have archived before being reused.

687. What is Restricted Mode of Instance Startup ?

An instance can be started in (or later altered to be in) restricted mode so that when the database is open connections are limited only to those whose user accounts have been granted the RESTRICTED SESSION system privilege.

688.. What is a Synonym ?

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

689. What is a Sequence ?

A sequence generates a serial list of unique numbers for numerical columns of a database's tables.

690. What is a Segment ?

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

691. What is schema?

Page 180: Interview_Q1

A schema is collection of database objects of a User.

692. Describe Referential Integrity ?

A rule defined on a column (or set of columns) in one table that allows the insert or update of a row only if the value for the column or set of columns (the dependent value) matches a value in a column of a related table (the referenced value). It also specifies the type of data manipulation allowed on referenced data and the action to be performed on dependent data as a result of any action on referenced data.

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

694. What is a Private Synonyms ?

A Private Synonyms can be accessed only by the owner.

695. What is Database Link ?

A database link is a named object that describes a "path" from one database to another

696. What is index cluster?

A cluster with an index on the cluster key.

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

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

Page 181: Interview_Q1

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

700. What are the types of database links?

Private database link, public database link & network database link.

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

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

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

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

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

706. What is row chaining?

Page 182: Interview_Q1

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.

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

708. What are the different types of segments?

Data segment, index segment, rollback segment and temporary segment.

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

709. What is an index segment?

Each index has an index segment that stores all of its data.

710. What is rollback segment?

A database contains one or more rollback segments to temporarily store "undo" information.

711. What are the uses of rollback segment?

To generate read-consistent database information during database recovery and to rollback uncommitted transactions by the users.

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

713. What is a datafile?

Page 183: Interview_Q1

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.

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

715. What is a redo log?

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

716. What is the function of redo log?

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

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

718. What does a control file contains?

- Database name- Names and locations of a database's files and redolog files.- Time stamp of database creation.

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

730. Explain the difference between a hot backup and a cold backup and the benefits associated with each.

A hot backup is basically taking a backup of the database while it is still up and running and it must be in archive log mode. A cold backup is taking a backup of the database while it is shut down and does not require being in archive log mode. The benefit of taking a hot backup is that the database is still available for use while the backup is occurring and you can recover the database to any point in time. The

Page 184: Interview_Q1

benefit of taking a cold backup is that it is typically easier to administer the backup and recovery process. In addition, since you are taking cold backups the database does not require being in archive log mode and thus there will be a slight performance gain as the database is not cutting archive logs to disk.

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

732. How do you switch from an init.ora file to a spfile?

Issue the create spfile from pfile command.

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

733. Give two examples of how you might determine the structure of the table DEPT.

Use the describe command or use the dbms_metadata. get_ddl package.

734. Where would you look for errors from the database engine?

In the alert log.

735. Compare and contrast TRUNCATE and DELETE for a table.

Both the truncate and delete command have the desired outcome of getting rid of all the rows in a table. The difference between the two is that the truncate command is a DDL operation and just moves the high water mark and produces a now rollback. The delete command, on the other hand, is a DML operation, which will produce a rollback and thus take longer to complete.

736. Give the reasoning behind using an index.

Page 185: Interview_Q1

Faster access to data blocks in a table.

737. Give the two types of tables involved in producing a star schema and the type of data they hold.

Fact tables and dimension tables. A fact table contains measurements while dimension tables will contain data that will help describe the fact tables.

738. What type of index should you use on a fact table?

A Bitmap index.

739. Give two examples of referential integrity constraints.

A primary key and a foreign key.

740. 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, enable the foreign key constraint.

741. Explain the difference between ARCHIVELOG mode and NOARCHIVELOG mode and the benefits and disadvantages to each.

ARCHIVELOG mode is a mode that you can put the database in for creating a backup of all transactions that have occurred in the database so that you can recover to any point in time. NOARCHIVELOG mode is basically the absence of ARCHIVELOG mode and has the disadvantage of not being able to recover to any point in time. NOARCHIVELOG mode does have the advantage of not having to write transactions to an archive log and thus increases the performance of the database slightly.

742. What command would you use to create a backup control file?

Alter database backup control file to trace.

743. Give the stages of instance startup to a usable state where normal users may access it.

STARTUP NOMOUNT - Instance startupSTARTUP MOUNT - The database is mountedSTARTUP OPEN - The database is opened

Page 186: Interview_Q1

744. What column differentiates the V$ views to the GV$ views and how?

The INST_ID column which indicates the instance in a RAC environment the information came from.

745. How would you go about generating an EXPLAIN plan?

Create a plan table with utlxplan.sql.Use the explain plan set statement_id = 'tst1' into plan_table for a SQL statementLook at the explain plan with utlxplp.sql or utlxpls.sql

746. How would you go about increasing the buffer cache hit ratio?

Use the buffer cache advisory over a given workload and then query the v$db_cache_advice table. If a change was necessary then I would use the alter system set db_cache_size command.

747. Explain an ORA-01555

You get this error when you get a snapshot too old within rollback. It can usually be solved by increasing the undo retention or increasing the size of rollbacks. You should also look at the logic involved in the application getting the error message.

748. Explain the difference between $ORACLE_HOME and $ORACLE_BASE.

ORACLE_BASE is the root directory for oracle. ORACLE_HOME located beneath ORACLE_BASE is where the oracle products reside.

749. How would you determine the time zone under which a database was operating?

select DBTIMEZONE from dual;

750. Explain the use of setting GLOBAL_NAMES equal to TRUE.

Setting GLOBAL_NAMES dictates how you might connect to a database. This variable is either TRUE or FALSE and if it is set to TRUE it enforces database links to have the same name as the remote database to which they are linking.

751. What command would you use to encrypt a PL/SQL application?

Page 187: Interview_Q1

WRAP

752. Explain the difference between a FUNCTION, PROCEDURE and PACKAGE.

A function and procedure are the same in that they are intended to be a collection of PL/SQL code that carries a single task. While a procedure does not have to return any values to the calling application, a function will return a single value. A package on the other hand is a collection of functions and procedures that are grouped together based on their commonality to a business function or application.

753. Explain the use of table functions.

Table functions are designed to return a set of rows through PL/SQL logic but are intended to be used as a normal table or view in a SQL statement. They are also used to pipeline information in an ETL process.

(Continued on next part...)

754. Name three advisory statistics you can collect.

Buffer Cache Advice, Segment Level Statistics, & Timed Statistics

755. Where in the Oracle directory tree structure are audit traces placed?

In unix $ORACLE_HOME/ rdbms/audit, in Windows the event viewer

756. Explain materialized views and how they are used.

Materialized views are objects that are reduced sets of information that have been summarized, grouped, or aggregated from base tables. They are typically used in data warehouse or decision support systems.

757. When a user process fails, what background process cleans up after it?

PMON

758. What background process refreshes materialized views?

The Job Queue Processes.

Page 188: Interview_Q1

759. How would you determine what sessions are connected and what resources they are waiting for?

Use of V$SESSION and V$SESSION_WAIT

760. Describe what redo logs are.

Redo logs are logical and physical structures that are designed to hold all the changes made to a database and are intended to aid in the recovery of a database.

761. How would you force a log switch?

ALTER SYSTEM SWITCH LOGFILE;

762. Give two methods you could use to determine what DDL changes have been made.

You could use Logminer or Streams

763. What does coalescing a tablespace do?

Coalescing is only valid for dictionary-managed tablespaces and de-fragments space by combining neighboring free extents into large single extents.

764. What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace?

A temporary tablespace is used for temporary objects such as sort structures while permanent tablespaces are used to store those objects meant to be used as the true objects of the database.

765. Name a tablespace automatically created when you create a database.

The SYSTEM tablespace.

766. When creating a user, what permissions must you grant to allow them to connect to the database?

Grant the CONNECT to the user.

767. How do you add a data file to a tablespace

Page 189: Interview_Q1

ALTER TABLESPACE <tablespace_name> ADD DATAFILE <datafile_name> SIZE

768. How do you resize a data file?

ALTER DATABASE DATAFILE <datafile_name> RESIZE <new_size>;

769. What view would you use to look at the size of a data file?

DBA_DATA_FILES

770. What view would you use to determine free space in a tablespace?

DBA_FREE_SPACE

771. How would you determine who has added a row to a table?

Turn on fine grain auditing for the table.

772. How can you rebuild an index?

ALTER INDEX <index_name> REBUILD;

773. Explain what partitioning is and what its benefit is.

Partitioning is a method of taking large tables and indexes and splitting them into smaller, more manageable pieces.

774. You have just compiled a PL/SQL package but got errors, how would you view the errors?

SHOW ERRORS

775. How can you gather statistics on a table?

The ANALYZE command.

Page 190: Interview_Q1

776. How can you enable a trace for a session?

Use the DBMS_SESSION. SET_SQL_TRACE orUse ALTER SESSION SET SQL_TRACE = TRUE;

777. What is the difference between the SQL*Loader and IMPORT utilities?

These two Oracle utilities are used for loading data into the database. The difference is that the import utility relies on the data being produced by another Oracle utility EXPORT while the SQL*Loader utility allows data to be loaded that has been produced by other utilities from different data sources just so long as it conforms to ASCII formatted or delimited files.

778. Name two files used for network connection to a database.

TNSNAMES.ORA and SQLNET.ORA

781. Can one resize tablespaces and data files? (for DBA)

One can manually increase or decrease the size of a datafile from Oracle 7.2 using the command.ALTER DATABASE DATAFILE 'filename2' RESIZE 100M;Because you can change the sizes of datafiles, you can add more space to your database without adding more datafiles. This is beneficial if you are concerned about reaching the maximum number of datafiles allowed in your database.Manually reducing the sizes of datafiles allows you to reclaim unused space in the database. This is useful for correcting errors in estimations of space requirements.Also, datafiles can be allowed to automatically extend if more space is required. Look at the following command:CREATE TABLESPACE pcs_data_tsDATAFILE 'c:\ora_apps\ pcs\pcsdata1. dbf' SIZE 3MAUTOEXTEND ON NEXT 1M MAXSIZE UNLIMITEDDEFAULT STORAGE (INITIAL 10240NEXT 10240MINEXTENTS 1MAXEXTENTS UNLIMITEDPCTINCREASE 0)ONLINEPERMANENT;

782. What is SAVE POINT ?

For long transactions that contain many SQL statements, intermediate markers or savepoints can be declared which can be used to divide a transaction into smaller parts. This allows the option of later rolling back all work performed from the current point in the transaction to a declared savepoint within the transaction.

784. Can one rename a tablespace? (for DBA)

No, this is listed as Enhancement Request 148742. Workaround:Export all of the objects from the tablespace

Page 191: Interview_Q1

Drop the tablespace including contentsRecreate the tablespaceImport the objects

787. How does one create a standby database? (for DBA)

While your production database is running, take an (image copy) backup and restore it on duplicate hardware. Note that an export will not work!!!On your standby database, issue the following commands:ALTER DATABASE CREATE STANDBY CONTROLFILE AS 'filename';ALTER DATABASE MOUNT STANDBY DATABASE;RECOVER STANDBY DATABASE;On systems prior to Oracle 8i, write a job to copy archived redo log files from the primary database to the standby system, and apply the redo log files to the standby database (pipe it). Remember the database is recovering and will prompt you for the next log file to apply.Oracle 8i onwards provide an "Automated Standby Database" feature, which will send archived, log files to the remote site via NET8, and apply then to the standby database.When one needs to activate the standby database, stop the recovery process and activate it:ALTER DATABASE ACTIVATE STANDBY DATABASE;

788.How does one give developers access to trace files (required as input to tkprof)? (for DBA)

The "alter session set sql_trace=true" command generates trace files in USER_DUMP_DEST that can be used by developers as input to tkprof. On Unix the default file mask for these files are "rwx r-- ---".There is an undocumented INIT.ORA parameter that will allow everyone to read (rwx r-r--) these trace files:_trace_files_ public = trueInclude this in your INIT.ORA file and bounce your database for it to take effect.

789. What are the responsibilities of a Database Administrator ?

Installing and upgrading the Oracle Server and application tools. Allocating system storage and planning future storage requirements for the database system. Managing primary database structures (tablespaces) Managing primary objects (table,views, indexes) Enrolling users and maintaining system security. Ensuring compliance with Oralce license agreement Controlling and monitoring user access to the database. Monitoring and optimizing the performance of the database. Planning for backup and recovery of database information. Maintain archived data on tape Backing up and restoring the database. Contacting Oracle Corporation for technical support.

790. What is a trace file and how is it created ?

Each server and background process can write an associated trace file. When an internal error is detected by a process or user process, it dumps information about the error to its trace. This can be used for tuning the database.

Page 192: Interview_Q1

791. What are the roles and user accounts created automatically with the database?

DBA - role Contains all database system privileges.SYS user account - The DBA role will be assigned to this account. All of the base tables and views for the database's dictionary are store in this schema and are manipulated only by ORACLE. SYSTEM user account - It has all the system privileges for the database and additional tables and views that display administrative information and internal tables and views used by oracle tools are created using this username.

792. What are the minimum parameters should exist in the parameter file (init.ora) ?

DB NAME - Must set to a text string of no more than 8 characters and it will be stored inside the datafiles, redo log files and control files and control file while database creation.DB_DOMAIN - It is string that specifies the network domain where the database is created. The global database name is identified by setting these parameters(DB_NAME & DB_DOMAIN) CONTORL FILES - List of control filenames of the database. If name is not mentioned then default name will be used.DB_BLOCK_BUFFERS - To determine the no of buffers in the buffer cache in SGA.PROCESSES - To determine number of operating system processes that can be connected to ORACLE concurrently. The value should be 5 (background process) and additional 1 for each user.ROLLBACK_SEGMENTS - List of rollback segments an ORACLE instance acquires at database startup. Also optionally LICENSE_MAX_ SESSIONS, LICENSE_SESSION_ WARNING and LICENSE_MAX_ USERS.

793. Why and when should I backup my database? (for DBA

Backup and recovery is one of the most important aspects of a DBAs job. If you lose your company's data, you could very well lose your job. Hardware and software can always be replaced, but your data may be irreplaceable!Normally one would schedule a hierarchy of daily, weekly and monthly backups, however consult with your users before deciding on a backup schedule. Backup frequency normally depends on the following factors:. Rate of data change/ transaction rate. Database availability/ Can you shutdown for cold backups?. Criticality of the data/ Value of the data to the company. Read-only tablespace needs backing up just once right after you make it read-only. If you are running in archivelog mode you can backup parts of a database over an extended cycle of days. If archive logging is enabled one needs to backup archived log files timeously to prevent database freezes. Etc.Carefully plan backup retention periods. Ensure enough backup media (tapes) are available and that old backups are expired in-time to make media available for new backups. Off-site vaulting is also highly recommended.Frequently test your ability to recover and document all possible scenarios. Remember, it's the little things that will get you. Most failed recoveries are a result of organizational errors and miscommunications.

Page 193: Interview_Q1

794. What strategies are available for backing-up an Oracle database? (for DBA

The following methods are valid for backing-up an Oracle database:Export/Import - Exports are "logical" database backups in that they extract logical definitions and data from the database to a file.Cold or Off-line Backups - Shut the database down and backup up ALL data, log, and control files.Hot or On-line Backups - If the databases are available and in ARCHIVELOG mode, set the tablespaces into backup mode and backup their files. Also remember to backup the control files and archived redo log files.RMAN Backups - While the database is off-line or on-line, use the "rman" utility to backup the database.It is advisable to use more than one of these methods to backup your database. For example, if you choose to do on-line database backups, also cover yourself by doing database exports. Also test ALL backup and recovery scenarios carefully. It is better to be save than sorry.Regardless of your strategy, also remember to backup all required software libraries, parameter files, password files, etc. If your database is in ARCGIVELOG mode, you also need to backup archived log files.

795. What is the difference between online and offline backups? (for DBA

A hot backup is a backup performed while the database is online and available for read/write. Except for Oracle exports, one can only do on-line backups when running in ARCHIVELOG mode.A cold backup is a backup performed while the database is off-line and unavailable to its users.

796. What is the difference between restoring and recovering? (for DBA

Restoring involves copying backup files from secondary storage (backup media) to disk. This can be done to replace damaged files or to copy/move a database to a new location.Recovery is the process of applying redo logs to the database to roll it forward. One can roll-forward until a specific point-in-time (before the disaster occurred), or roll-forward until the last transaction recorded in the log files. Sql> connect SYS as SYSDBASql> RECOVER DATABASE UNTIL TIME '2001-03-06: 16:00:00' USING BACKUP CONTROLFILE;

797. How does one backup a database using the export utility? (for DBA

Oracle exports are "logical" database backups (not physical) as they extract data and logical definitions from the database into a file. Other backup strategies normally back-up the physical data files.One of the advantages of exports is that one can selectively re-import tables, however one cannot roll-forward from an restored export file. To completely restore a database from an export file one practically needs to recreate the entire database.

Page 194: Interview_Q1

Always do full system level exports (FULL=YES). Full exports include more information about the database in the export file than user level exports.

812. What tuning indicators can one use? (for DBA

The following high-level tuning indicators can be used to establish if a database is performing optimally or not:. Buffer Cache Hit RatioFormula: Hit Ratio = (Logical Reads - Physical Reads) / Logical ReadsAction: Increase DB_CACHE_SIZE (DB_BLOCK_BUFFERS prior to 9i) to increase hit ratio. Library Cache Hit RatioAction: Increase the SHARED_POOL_ SIZE to increase hit ratio

813. What tools/utilities does Oracle provide to assist with performance tuning? (for DBA

Oracle provide the following tools/ utilities to assist with performance monitoring and tuning:. TKProf. UTLBSTAT.SQL and UTLESTAT.SQL - Begin and end stats monitoring. Statspack. Oracle Enterprise Manager - Tuning Pack

814. What is STATSPACK and how does one use it? (for DBA

Statspack is a set of performance monitoring and reporting utilities provided by Oracle from Oracle8i and above. Statspack provides improved BSTAT/ESTAT functionality, though the old BSTAT/ESTAT scripts are still available. For more information about STATSPACK, read the documentation in file $ORACLE_HOME/ rdbms/admin/ spdoc.txt.Install Statspack:cd $ORACLE_HOME/ rdbms/adminsqlplus "/ as sysdba" @spdrop.sql -- Install Statspack -sqlplus "/ as sysdba" @spcreate.sql- - Enter tablespace names when promptedUse Statspack:sqlplus perfstat/perfstatexec statspack.snap; -- Take a performance snapshotsexec statspack.snap;o Get a list of snapshotsselect SNAP_ID, SNAP_TIME from STATS$SNAPSHOT;@spreport.sql -- Enter two snapshot id's for difference reportOther Statspack Scripts:. sppurge.sql - Purge a range of Snapshot Id's between the specified begin and end Snap Id's. spauto.sql - Schedule a dbms_job to automate the collection of STATPACK statistics. spcreate.sql - Installs the STATSPACK user, tables and package on a database (Run as SYS).. spdrop.sql - Deinstall STATSPACK from database (Run as SYS). sppurge.sql - Delete a range of Snapshot Id's from the database. spreport.sql - Report on differences between values recorded in two snapshots. sptrunc.sql - Truncates all data in Statspack tables

Page 195: Interview_Q1

815. What are the common RMAN errors (with solutions)? (for DBA

Some of the common RMAN errors are:RMAN-20242: Specification does not match any archivelog in the recovery catalog.Add to RMAN script: sql 'alter system archive log current';RMAN-06089: archived log xyz not found or out of sync with catalogExecute from RMAN: change archivelog all validate;

822. What is mean by Program Global Area (PGA) ?

It is area in memory that is used by a Single Oracle User Process.

830. How does one manage Oracle database users? (for DBA

Oracle user accounts can be locked, unlocked, forced to choose new passwords, etc. For example, all accounts except SYS and SYSTEM will be locked after creating an Oracle9iDB database using the DB Configuration Assistant (dbca). DBA's must unlock these accounts to make them available to users.Look at these examples:ALTER USER scott ACCOUNT LOCK -- lock a user accountALTER USER scott ACCOUNT UNLOCK; -- unlocks a locked users accountALTER USER scott PASSWORD EXPIRE; -- Force user to choose a new password

831. How does one tune Oracle Wait events? (for DBA

Some wait events from V$SESSION_WAIT and V$SYSTEM_EVENT views:

Event Name:

Tuning Recommendation:

db file sequential read

Tune SQL to do less I/O. Make sure all objects are analyzed. Redistribute I/O across disks.

buffer busy waits

Increase DB_CACHE_SIZE (DB_BLOCK_BUFFERS prior to 9i)/ Analyze contention from SYS.V$BH

log buffer spaces

Increase LOG_BUFFER parameter or move log files to faster disks

832. What is the difference between DBFile Sequential and Scattered Reads?(for DBA

Page 196: Interview_Q1

Both "db file sequential read" and "db file scattered read" events signify time waited for I/O read requests to complete. Time is reported in 100's of a second for Oracle 8i releases and below, and 1000's of a second for Oracle 9i and above. Most people confuse these events with each other as they think of how data is read from disk. Instead they should think of how data is read into the SGA buffer cache.db file sequential read:A sequential read operation reads data into contiguous memory (usually a single-block read with p3=1, but can be multiple blocks). Single block I/Os are usually the result of using indexes. This event is also used for rebuilding the controlfile and reading datafile headers (P2=1). In general, this event is indicative of disk contention on index reads.db file scattered read:Similar to db file sequential reads, except that the session is reading multiple data blocks and scatters them into different discontinuous buffers in the SGA. This statistic is NORMALLY indicating disk contention on full table scans. Rarely, data from full table scans could be fitted into a contiguous buffer area, these waits would then show up as sequential reads instead of scattered reads.The following query shows average wait time for sequential versus scattered reads:prompt "AVERAGE WAIT TIME FOR READ REQUESTS"select a.average_wait "SEQ READ", b.average_wait "SCAT READ"from sys.v_$system_ event a, sys.v_$system_ event bwhere a.event = 'db file sequential read'and b.event = 'db file scattered read';

836. How does one use ORADEBUG from Server Manager/ SQL*Plus? (for DBA

Execute the "ORADEBUG HELP" command from svrmgrl or sqlplus to obtain a list of valid ORADEBUG commands. Look at these examples:SQLPLUS> REM Trace SQL statements with bind variablesSQLPLUS> oradebug setospid 10121Oracle pid: 91, Unix process pid: 10121, image: oracleorclSQLPLUS> oradebug EVENT 10046 trace name context forever, level 12Statement processed.SQLPLUS> ! vi /app/oracle/ admin/orcl/ bdump/ora_ 10121.trcSQLPLUS> REM Trace Process StatisticsSQLPLUS> oradebug setorapid 2Unix process pid: 1436, image: ora_pmon_orclSQLPLUS> oradebug procstatStatement processed.SQLPLUS>> oradebug TRACEFILE_NAME/app/oracle/ admin/orcl/ bdump/pmon_ 1436.trcSQLPLUS> REM List semaphores and shared memory segments in useSQLPLUS> oradebug ipcSQLPLUS> REM Dump Error StackSQLPLUS> oradebug setospid <pid>SQLPLUS> oradebug event immediate trace name errorstack level 3SQLPLUS> REM Dump Parallel Server DLM locksSQLPLUS> oradebug lkdebug -a convlockSQLPLUS> oradebug lkdebug -a convresSQLPLUS> oradebug lkdebug -r <resource handle> (i.e 0x8066d338 from convres dump)

837. Are there any undocumented commands in Oracle? (for DBA

Page 197: Interview_Q1

Sure there are, but it is hard to find them. Look at these examples:From Server Manager (Oracle7.3 and above): ORADEBUG HELPIt looks like one can change memory locations with the ORADEBUG POKE command. Anyone brave enough to test this one for us? Previously this functionality was available with ORADBX (ls -l $ORACLE_HOME/ rdbms/lib/ oradbx.o; make -f oracle.mk oradbx) SQL*Plus: ALTER SESSION SET CURRENT_SCHEMA = SYS;

849. WHAT IS RMAN ? (for DBA

Recovery Manager is a tool that: manages the process of creating backups and also manages the process of restoring and recovering from them.

850. WHY USE RMAN ? (for DBA

* No extra costs …Its available free * ?RMAN introduced in Oracle 8 it has become simpler with newer versions and easier than user managed backups * ?Proper security * ?You are 100% sure your database has been backed up. * ?Its contains detail of the backups taken etc in its central repository * Facility for testing validity of backups also commands like crosscheck to check the status of backup. * Faster backups and restores compared to backups without RMAN * RMAN is the only backup tool which supports incremental backups. * Oracle 10g has got further optimized incremental backup which has resulted in improvement of performance during backup and recovery time * Parallel operations are supported * Better querying facility for knowing different details of backup * No extra redo generated when backup is taken..compared to online * backup without RMAN which results in saving of space in hard disk * RMAN an intelligent tool * Maintains repository of backup metadata * Remembers backup set location * Knows what need to backed up * Knows what is required for recovery * Knows what backups are redundant

UNDERSTANDING THE RMAN ARCHITECTUREAn oracle RMAN comprises ofRMAN EXECUTABLE This could be present and fired even through client sideTARGET DATABASE This is the database which needs to be backed up .RECOVERY CATALOG Recovery catalog is optional otherwise backup details are stored in target database controlfile .It is a repository of information queried and updated by Recovery ManagerIt is a schema or user stored in Oracle database. One schema can support many databasesIt contains information about physical schema of target database datafile and archive log ,backup sets and pieces Recovery catalog is a must in following scenarios. In order to store scripts. For tablespace point in time recovery

Page 198: Interview_Q1

Media Management SoftwareMedia Management software is a must if you are using RMAN for storing backup in tape drive directly.

Backups in RMANOracle backups in RMAN are of the following typeRMAN complete backup OR RMAN incremental backupThese backups are of RMAN proprietary nature

IMAGE COPYThe advantage of uing Image copy is its not in RMAN proprietary format..

Backup FormatRMAN backup is not in oracle format but in RMAN format. Oracle backup comprises of backup sets and it consists of backup pieces. Backup sets are logical entity In oracle 9i it gets stored in a default location There are two type of backup sets Datafile backup sets, Archivelog backup sets One more important point of data file backup sets is it do not include empty blocks. A backup set would contain many backup pieces.A single backup piece consists of physical files which are in RMAN proprietary format.

Example of taking backup using RMANTaking RMAN BackupIn non archive mode in dos prompt typeRMANYou get the RMAN promptRMAN > Connect TargetConnect to target database : Magicusing target database controlfile instead of recovery catalog

Lets take a simple backup of database in non archive modeshutdown immediate ; - - Shutdowns the databasestartup mountbackup database ;- its start backing the databasealter database open;We can fire the same command in archive log modeAnd whole of datafiles will be backedBackup database plus archivelog;

Restoring databaseRestoring database has been made very simple in 9i .It is justRestore database..RMAN has become intelligent to identify which datafiles has to be restoredand the location of backuped up file.

Oracle Enhancement for RMAN in 10 G

Flash Recovery AreaRight now the price of hard disk is falling. Many dba are taking oracle database backup inside the hard disk itself since it results in lesser mean time between recoverability.The new parameter introduced isDB_RECOVERY_ FILE_DEST = /oracle/flash_ recovery_ area

Page 199: Interview_Q1

By configuring the RMAN RETENTION POLICY the flash recovery area will automatically delete obsolete backups and archive logs that are no longer required based on that configuration Oracle has introduced new features in incremental backup

Change Tracking FileOracle 10g has the facility to deliver faster incrementals with the implementation of changed tracking file feature.This will results in faster backups lesser space consumption and also reduces the time needed for daily backups

Incrementally Updated BackupsOracle database 10g Incrementally Updates Backup features merges the image copy of a datafile with RMAN incremental backup. The resulting image copy is now updated with block changes captured by incremental backups.The merging of the image copy and incremental backup is initiated with RMAN recover command. This results in faster recovery.

Binary compression technique reduces backup space usage by 50-75%.

With the new DURATION option for the RMAN BACKUP command, DBAs can weigh backup performance against system service level requirements. By specifying a duration, RMAN will automatically calculate the appropriate backup rate; in addition, DBAs can optionally specify whether backups should minimize time or system load.

New Features in Oem to identify RMAN related backup like backup pieces, backup sets and image copy

Oracle 9i New features Persistent RMAN ConfigurationA new configure command has been introduced in Oracle 9i , that lets you configure various features including automatic channels, parallelism ,backup options, etc.These automatic allocations and options can be overridden by commands in a RMAN command file.

Controlfile Auto backupsThrough this new feature RMAN will automatically perform a controlfile auto backup. after every backup or copy command.

Block Media RecoveryIf we can restore a few blocks rather than an entire file we only need few blocks.We even dont need to bring the data file offline.Syntax for it as followsBlock Recover datafile 8 block 22;

Configure Backup OptimizationPrior to 9i whenever we backed up database using RMAN our backup also used take backup of read only table spaces which had already been backed up and also the same with archive log too.Now with 9i backup optimization parameter we can prevent repeat backup of read only tablespace and archive log. The command for this is as follows Configure backup optimization on

Archive Log failoverIf RMAN cannot read a block in an archived log from a destination. RMAN automatically attempts to read from an alternate location this is called as archive log failover

Page 200: Interview_Q1

There are additional commands likebackup database not backed up since time '31-jan-2002 14:00:00'Do not backup previously backed up files(say a previous backup failed and you want to restart from where it left off).Similar syntax is supported for restoresbackup device sbt backup set all Copy a disk backup to tape(backing up a backupAdditionally it supports. Backup of server parameter file. Parallel operation supported. Extensive reporting available. Scripting. Duplex backup sets. Corrupt block detection. Backup archive logs

Pitfalls of using RMANPrevious to version Oracle 9i backups were not that easy which means you had to allocate a channel compulsorily to take backup You had to give a run etc . The syntax was a bit complex …RMAN has now become very simple and easy to use..If you changed the location of backup set it is compulsory for you to register it using RMAN or while you are trying to restore backup It resulted in hanging situationsThere is no method to know whether during recovery database restore is going to fail because of missing archive log file.Compulsory Media Management only if using tape backupIncremental backups though used to consume less space used to be slower since it used to read the entire database to find the changed blocks and also They have difficult time streaming the tape device. .Considerable improvement has been made in 10g to optimize the algorithm to handle changed block.

ObservationIntroduced in Oracle 8 it has become more powerful and simpler with newer version of Oracle 9 and 10 g.So if you really don't want to miss something critical please start using RMAN.

854. What kind of jobs can one schedule with OEM? (for DBA

OEM comes with pre-defined jobs like Export, Import, run OS commands, run sql scripts, SQL*Plus commands etc. It also gives you the flexibility of scheduling custom jobs written with the TCL language.

855. What are the pre requisites ?

I. to modify data type of a column ? ii. 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.

856. How does one backout events and jobs during maintenance slots? (for DBA

Page 201: Interview_Q1

Managemnet and data collection activity can be suspended by imposing a blackout. Look at these examples:agentctl start blackout # Blackout the entrire agentagentctl stop blackout # Resume normal monitoring and managementagentctl start blackout ORCL # Blackout database ORCLagentctl stop blackout ORCL # Resume normal monitoring and managementagentctl start blackout -s jobs -d 00:20 # Blackout jobs for 20 minutes

858. What is the Oracle Intelligent Agent? (for DBA

The Oracle Intelligent Agent (OIA) is an autonomous process that needs to run on a remote node in the network to make the node OEM manageable. The Oracle Intelligent Agent is responsible for:. Discovering targets that can be managed (Database Servers, Net8 Listeners, etc.);. Monitoring of events registered in Enterprise Manager; and. Executing tasks associated with jobs submitted to Enterprise Manager.

859. How does one start the Oracle Intelligent Agent? (for DBA

One needs to start an OIA (Oracle Intelligent Agent) process on all machines that will to be managed via OEM.For OEM 9i and above:agentctl start agentagentctl stop agent

For OEM 2.1 and below:lsnrctl dbsnmp_startlsnrctl dbsnmp_status

On Windows NT, start the "OracleAgent" Service.If the agent doesn't want to start, ensure your environment variables are set correctly and delete the following files before trying again:1) In $ORACLE_HOME/ network/admin: snmp_ro.ora and snmp_rw.ora.2) Also delete ALL files in $ORACLE_HOME/ network/agent/ .

Can one write scripts to send alert messages to the console?

Start the OEM console and create a new event. Select option "Enable Unsolicited Event". Select test "Unsolicited Event". When entering the parameters, enter values similar to these:Event Name: /oracle/script/ myalertObject: *Severity: *Message: *One can now write the script and invoke the oemevent command to send alerts to the console. Look at this example: oemevent /oracle/script/ myalert DESTINATION alert "My custom error message" where DESTINATION is the same value as entered in the "Monitored Destinations" field when you've registered the event in the OEM Console.

860. Where can one get more information about TCL? (for DBA

Page 202: Interview_Q1

One can write custom event checking routines for OEM using the TCL (Tool Command Language) language. Check the following sites for more information about TCL:. The Tcl Developer Xchange - download and learn about TCL. OraTCL at Sourceforge - Download the OraTCL package. Tom Poindexter's Tcl Page - Oratcl was originally written by Tom Poindexter

861. Are there any troubleshooting tips for OEM? (for DBA

. Create the OEM repository with a user (which will manage the OEM) and store it in a tablespace that does not share any data with other database users. It is a bad practice to create the repository with SYS and System.. If you are unable to launch the console or there is a communication problem with the intelligent agent (daemon). Ensure OCX files are registered. Type the following in the DOS prompt (the current directory should be $ORACLE_HOME\ BIN:C:\Orawin95\ Bin> RegSvr32 mmdx32.OCXC:\Orawin95\ Bin> RegSvr32 vojt.OCX. If you have a problem starting the Oracle AgentSolution A: Backup the *.Q files and Delete all the *.Q Files ($Oracle_home/ network/agent folder)Backup and delete SNMP_RO.ora, SNMP_RW.ora, dbsnmp.ver and services.ora files ($Oracle_Home/ network/admin folder) Start the Oracle Agent service.Solution B: Your version of Intelligent Agent could be buggy. Check with Oracle for any available patches. For example, the Intelligent Agent that comes with Oracle 8.0.4 is buggy.Sometimes you get a Failed status for the job that was executed successfully.Check the log to see the results of the execution rather than relying on this status.

862. What is import/export and why does one need it? (for DBA

The Oracle export (EXP) and import (IMP) utilities are used to perform logical database backup and recovery. They are also used to move Oracle data from one machine, database or schema to another.The imp/exp utilities use an Oracle proprietary binary file format and can thus only be used between Oracle databases. One cannot export data and expect to import it into a non-Oracle database. For more information on how to load and unload data from files, read the SQL*Loader FAQ.The export/import utilities are also commonly used to perform the following tasks:. Backup and recovery (small databases only). Reorganization of data/ Eliminate database fragmentation. Detect database corruption. Ensure that all the data can be read.. Transporting tablespaces between databases. Etc.

867. How does one use the import/export utilities? (for DBA

Look for the "imp" and "exp" executables in your $ORACLE_HOME/ bin directory. One can run them interactively, using command line parameters, or using parameter files. Look at the imp/exp parameters before starting. These parameters can be listed by executing the following commands: "exp help=yes" or "imp help=yes".The following examples demonstrate how the imp/exp utilities can be used:exp scott/tiger file=emp.dmp log=emp.log tables=emp rows=yes indexes=noexp scott/tiger file=emp.dmp tables=(emp, dept)

Page 203: Interview_Q1

imp scott/tiger file=emp.dmp full=yesimp scott/tiger file=emp.dmp fromuser=scott touser=scott tables=deptexp userid=scott/ tiger@orcl parfile=export. txt... where export.txt contains:BUFFER=100000FILE=account. dmpFULL=nOWNER=scottGRANTS=yCOMPRESS=yNOTE: If you do not like command line utilities, you can import and export data with the "Schema Manager" GUI that ships with Oracle Enterprise Manager (OEM).

868. What are the types of visual attribute settings?

Custom Visual attributes Default visual attributes Named Visual attributes. Window

869. Can one export a subset of a table? (for DBA

From Oracle8i one can use the QUERY= export parameter to selectively unload a subset of the data from a table. Look at this example:exp scott/tiger tables=emp query=\"where deptno=10\"

870. What are the two ways to incorporate images into a oracle forms application?

Boilerplate ImagesImage_items

871. Can one monitor how fast a table is imported? (for DBA

If you need to monitor how fast rows are imported from a running import job, try one of the following methods:Method 1:select substr(sql_text, instr(sql_ text,'INTO "'),30) table_name,rows_processed,round((sysdate- to_date(first_ load_time, 'yyyy-mm- dd hh24:mi:ss') )*24*60,1) minutes,trunc(rows_processe d/((sysdate- to_date(first_ load_time, 'yyyy-mm- dd hh24:mi:ss') )*24*60)) rows_per_minfrom sys.v_$sqlareawhere sql_text like 'INSERT %INTO "%'and command_type = 2and open_versions > 0;For this to work one needs to be on Oracle 7.3 or higher (7.2 might also be OK). If the import has more than one table, this statement will only show information about the current table being imported.Contributed by Osvaldo Ancarola, Bs. As. Argentina.

Page 204: Interview_Q1

Method 2:Use the FEEDBACK=n import parameter. This command will tell IMP to display a dot for every N rows imported.

872. Can one import tables to a different tablespace? (for DBA

Oracle offers no parameter to specify a different tablespace to import data into. Objects will be re-created in the tablespace they were originally exported from. One can alter this behaviour by following one of these procedures: Pre-create the table(s) in the correct tablespace:. Import the dump file using the INDEXFILE= option. Edit the indexfile. Remove remarks and specify the correct tablespaces.. Run this indexfile against your database, this will create the required tables in the appropriate tablespaces. Import the table(s) with the IGNORE=Y option.Change the default tablespace for the user:

. Revoke the "UNLIMITED TABLESPACE" privilege from the user

. Revoke the user's quota from the tablespace from where the object was exported. This forces the import utility to create tables in the user's default tablespace.. Make the tablespace to which you want to import the default tablespace for the user. Import the table

875. What is SQL*Loader and what is it used for? (for DBA

SQL*Loader is a bulk loader utility used for moving data from external files into the Oracle database. Its syntax is similar to that of the DB2 Load utility, but comes with more options. SQL*Loader supports various load formats, selective loading, and multi-table loads.

876. How does one use the SQL*Loader utility? (for DBA

One can load data into an Oracle database by using the sqlldr (sqlload on some platforms) utility. Invoke the utility without arguments to get a list of available parameters. Look at the following example:sqlldr scott/tiger control=loader. ctlThis sample control file (loader.ctl) will load an external data file containing delimited data:load datainfile 'c:\data\mydata. csv'into table empfields terminated by "," optionally enclosed by '"'( empno, empname, sal, deptno )The mydata.csv file may look like this:10001,"Scott Tiger", 1000, 4010002,"Frank Naude", 500, 20Another Sample control file with in-line data formatted as fix length records. The trick is to specify "*" as the name of the data file, and use BEGINDATA to start the data section in the control file.load datainfile *

Page 205: Interview_Q1

replaceinto table departments( dept position (02:05) char(4),deptname position (08:27) char(20))begindataCOSC COMPUTER SCIENCEENGL ENGLISH LITERATUREMATH MATHEMATICSPOLY POLITICAL SCIENCE

878. Is there a SQL*Unloader to download data to a flat file? (for DBA

Oracle does not supply any data unload utilities. However, you can use SQL*Plus to select and format your data and then spool it to a file:set echo off newpage 0 space 0 pagesize 0 feed off head off trimspool onspool oradata.txtselect col1 || ',' || col2 || ',' || col3from tab1where col2 = 'XYZ';spool offAlternatively use the UTL_FILE PL/SQL package:rem Remember to update initSID.ora, utl_file_dir= 'c:\oradata' parameterdeclarefp utl_file.file_ type;beginfp := utl_file.fopen( 'c:\oradata' ,'tab1.txt' ,'w');utl_file.putf( fp, '%s, %s\n', 'TextField', 55);utl_file.fclose( fp);end;/You might also want to investigate third party tools like SQLWays from Ispirer Systems, TOAD from Quest, or ManageIT Fast Unloader from CA to help you unload data from Oracle.

879. Can one load variable and fix length data records? (for DBA

Yes, look at the following control file examples. In the first we will load delimited data (variable length):LOAD DATAINFILE *INTO TABLE load_delimited_ dataFIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'TRAILING NULLCOLS( data1,data2)BEGINDATA11111,AAAAAAAAAA22222,"A,B,C,D,"If you need to load positional data (fixed length), look at the following control file example:LOAD DATA

Page 206: Interview_Q1

INFILE *INTO TABLE load_positional_ data( data1 POSITION(1:5) ,data2 POSITION(6:15))BEGINDATA11111AAAAAAAAAA22222BBBBBBBBBBCan one skip header records load while loading?Use the "SKIP n" keyword, where n = number of logical rows to skip. Look at this example:LOAD DATAINFILE *INTO TABLE load_positional_ dataSKIP 5( data1 POSITION(1:5) ,data2 POSITION(6:15))BEGINDATA11111AAAAAAAAAA22222BBBBBBBBBB

880. Can one modify data as it loads into the database? (for DBA

Data can be modified as it loads into the Oracle Database. Note that this only applies for the conventional load path and not for direct path loads.LOAD DATAINFILE *INTO TABLE modified_data( rec_no "my_db_sequence. nextval",region CONSTANT '31',time_loaded "to_char(SYSDATE, 'HH24:MI')",data1 POSITION(1:5) ":data1/100",data2 POSITION(6:15) "upper(:data2)",data3 POSITION(16: 22)"to_date(:data3, 'YYMMDD')")BEGINDATA11111AAAAAAAAAA9912 0122222BBBBBBBBBB9901 12LOAD DATAINFILE 'mail_orders. txt'BADFILE 'bad_orders. txt'APPENDINTO TABLE mailing_listFIELDS TERMINATED BY ","( addr,city,state,zipcode,mailing_addr "decode(:mailing_ addr, null, :addr, :mailing_addr)",mailing_city "decode(:mailing_ city, null, :city, :mailing_city)",mailing_state)

Page 207: Interview_Q1

881.Can one load data into multiple tables at once? (for DBA

Look at the following control file:LOAD DATAINFILE *REPLACEINTO TABLE empWHEN empno != ' '( empno POSITION(1:4) INTEGER EXTERNAL,ename POSITION(6:15) CHAR,deptno POSITION(17: 18) CHAR,mgr POSITION(20: 23) INTEGER EXTERNAL)INTO TABLE projWHEN projno != ' '( projno POSITION(25: 27) INTEGER EXTERNAL,empno POSITION(1:4) INTEGER EXTERNAL)

885. Can one selectively load only the records that one need? (for DBA

Look at this example, (01) is the first character, (30:37) are characters 30 to 37:LOAD DATAINFILE 'mydata.dat' BADFILE 'mydata.bad' DISCARDFILE 'mydata.dis'APPENDINTO TABLE my_selective_ tableWHEN (01) <> 'H' and (01) <> 'T' and (30:37) = '19991217'(region CONSTANT '31',service_key POSITION(01: 11) INTEGER EXTERNAL,call_b_no POSITION(12: 29) CHAR)

886. Can one skip certain columns while loading data? (for DBA

One cannot use POSTION(x:y) with delimited data. Luckily, from Oracle 8i one can specify FILLER columns. FILLER columns are used to skip columns/fields in the load file, ignoring fields that one does not want. Look at this example: -- One cannot use POSTION(x:y) as it is stream data, there are no positional fields-the next field begins after some delimiter, not in column X. -->LOAD DATATRUNCATE INTO TABLE T1FIELDS TERMINATED BY ','( field1,field2 FILLER,field3)

Page 208: Interview_Q1

887. How does one load multi-line records? (for DBA

One can create one logical record from multiple physical records using one of the following two clauses:. CONCATENATE: - use when SQL*Loader should combine the same number of physical records together to form one logical record.. CONTINUEIF - use if a condition indicates that multiple records should be treated as one. Eg. by having a '#' character in column 1.

889. How can get SQL*Loader to COMMIT only at the end of the load file? (for DBA

One cannot, but by setting the ROWS= parameter to a large value, committing can be reduced. Make sure you have big rollback segments ready when you use a high value for ROWS=.

890. Can one improve the performance of SQL*Loader? (for DBA

A very simple but easily overlooked hint is not to have any indexes and/or constraints (primary key) on your load tables during the load process. This will significantly slow down load times even with ROWS= set to a high value.Add the following option in the command line: DIRECT=TRUE. This will effectively bypass most of the RDBMS processing. However, there are cases when you can't use direct load. Refer to chapter 8 on Oracle server Utilities manual.Turn off database logging by specifying the UNRECOVERABLE option. This option can only be used with direct data loads. Run multiple load jobs concurrently.

891. How does one use SQL*Loader to load images, sound clips and documents? (for DBA

SQL*Loader can load data from a "primary data file", SDF (Secondary Data file - for loading nested tables and VARRAYs) or LOGFILE. The LOBFILE method provides and easy way to load documents, images and audio clips into BLOB and CLOB columns. Look at this example:Given the following table:CREATE TABLE image_table (image_id NUMBER(5),file_name VARCHAR2(30) ,image_data BLOB);Control File:LOAD DATAINFILE *INTO TABLE image_tableREPLACEFIELDS TERMINATED BY ','(image_id INTEGER(5),file_name CHAR(30),image_data LOBFILE (file_name) TERMINATED BY EOF)

Page 209: Interview_Q1

BEGINDATA001,image1.gif002,image2.jpg

892. What is the difference between the conventional and direct path loader? (for DBA

The conventional path loader essentially loads the data by using standard INSERT statements. The direct path loader (DIRECT=TRUE) bypasses much of the logic involved with that, and loads directly into the Oracle data files. More information about the restrictions of direct path loading can be obtained from the Utilities Users Guide.

23.Describe Oracle database's physical and logical structure ?

Physical : Data files, Redo Log files, Control file.Logical : Tables, Views, Tablespaces, etc.

24.Can you increase the size of a tablespace ? How ?

Yes, by adding datafiles to it.

26.What is the use of Control files ?

Contains pointers to locations of various data files, redo log files, etc.

27.What is the use of Data Dictionary ?

Used by Oracle to store information about various physical and logical Oracle structures e.g. Tables, Tablespaces, datafiles, etc

28.What are the advantages of clusters ?

Access time reduced for joins.

80.What are the advantages of Oracle ?

Portability : Oracle is ported to more platforms than any of its competitors, running on more than 100 hardware platforms and 20 networking protocols.Market Presence : Oracle is by far the largest RDBMS vendor and spends more on R & D than most of its competitors earn in total revenue. This market clout means that you are unlikely to be left in the lurch by Oracle and there are always lots of third party interfaces available.

Page 210: Interview_Q1

Backup and Recovery : Oracle provides industrial strength support for on-line backup and recovery and good software fault tolerence to disk failure. You can also do point-in-time recovery.Performance : Speed of a 'tuned' Oracle Database and application is quite good, even with large databases. Oracle can manage > 100GB databases.Multiple database support : Oracle has a superior ability to manage multiple databases within the same transaction using a two-phase commit protocol.