EBSCollection19.1.sql 70 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925
  1. SET ECHO OFF
  2. SET PAUSE OFF
  3. SET TERMOUT OFF
  4. REM ORACLE - Global Licensing and Advisory Services - EBS Collection Script
  5. REM
  6. REM Change History
  7. REM ---------------------------------
  8. REM Date Release Author
  9. REM ----------- ------- ---------------
  10. REM 2017-03-20 18.1 tstoenes sserban
  11. REM 2018-09-06 19.1 cpanait
  12. define CT_V=19.1
  13. SET DEFINE ON
  14. SET MARKUP HTML OFF
  15. SET COLSEP ' '
  16. -- Settings for customized functionality - the last definition of each parameter will dictate the customization
  17. -- Set SCRIPT_OO to collect all information or options only
  18. define SCRIPT_OO=_OO_IGNORE_THIS_ERR -- collect only options information
  19. define SCRIPT_OO='' -- collect all information [default behavior]
  20. -- Set SCRIPT_TS to generate filenames with or without timestamp
  21. define SCRIPT_TS=_TS_IGNORE_THIS_ERR -- include timestamp in names of the output directory and output files: YYYY.MM.DD.HH24.MI.SS
  22. define SCRIPT_TS='' -- standard names for output directory and output files [default behavior]
  23. -- Set SCRIPT_LA set license agreement prompt behavior
  24. define SCRIPT_LA=_LA_IGNORE_THIS_ERR -- script does not prompt for license agreement
  25. define SCRIPT_LA='' -- script prompts for license agreement [default behavior]
  26. -- Set SCRIPT_SI to run in interactive or in silent mode
  27. define SCRIPT_SI=_SI_IGNORE_THIS_ERR -- script does not prompt for privilege check confirmation
  28. define SCRIPT_SI='' -- script prompts for privilege check confirmation [default behavior]
  29. -- Set SCRIPT_SD to create output subdirectory
  30. define SCRIPT_SD=EBS -- create output subdirectory
  31. --#<CT>#define SCRIPT_SD='' -- no output subdirectory
  32. -- PREPARE AND DISPLAY LICENSE AGREEMENT
  33. SPOOL&SCRIPT_LA license_agreement.txt
  34. PROMPT ===============================================================
  35. PROMPT For reading LICENSE AGREEMENT use:
  36. PROMPT <SPACE> to display next page
  37. PROMPT <RETURN> to display next line
  38. PROMPT ===============================================================
  39. PROMPT
  40. PROMPT Terms for Oracle Software Collection Tool
  41. PROMPT
  42. PROMPT
  43. PROMPT By selecting "Accept License Agreement" (or the equivalent) or by installing or using the Software (as defined below), You indicate Your acceptance of these terms and Your agreement, as an authorized representative of Your company or organization (if being acquired for use by an entity) or as an individual, to comply with the license terms that apply to the Software. If you are not willing to be bound by these terms, do not indicate Your acceptance and do not download, install, or use the Software.
  44. PROMPT
  45. PROMPT
  46. PROMPT License Agreement
  47. PROMPT
  48. PROMPT PLEASE SCROLL DOWN AND READ ALL OF THE FOLLOWING TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT (this "Agreement") CAREFULLY. THIS AGREEMENT IS A LEGALLY BINDING CONTRACT BETWEEN YOU AND ORACLE AMERICA, INC. THAT SETS FORTH THE TERMS THAT GOVERN YOUR USE OF THE SOFTWARE.
  49. PROMPT
  50. PROMPT YOU MUST ACCEPT AND ABIDE BY THESE TERMS AS PRESENTED TO YOU - ANY CHANGES, ADDITIONS OR DELETIONS BY YOU TO THESE TERMS ARE NOT ACCEPTED AND WILL NOT BE PART OF THIS AGREEMENT.
  51. PROMPT
  52. PROMPT Definitions
  53. PROMPT "Oracle" refers to Oracle America, Inc.
  54. PROMPT
  55. PROMPT "You" and "Your" refers to the individual or entity that wishes to use the Software.
  56. PROMPT
  57. PROMPT "Software" refers to the tool(s), script(s) and/or software product(s) (and any applicable documentation) provided with these terms to You by Oracle and which You wish to access and use to measure, monitor and/or manage Your usage of separately-licensed Oracle software (the "Programs") that has been licensed under a separate agreement between Oracle and You, such as an Oracle Master Agreement, an Oracle Software License and Services Agreement, an Oracle PartnerNetwork Agreement or an Oracle distribution agreement (each, an "Oracle License Agreement").
  58. PROMPT
  59. PROMPT Rights Granted
  60. PROMPT Oracle grants You a non-exclusive, non-transferable limited right to use the Software, subject to the terms of this Agreement, for the limited purpose of measuring, monitoring and/or managing Your usage of the Programs. You may allow Your agents and contractors (including, without limitation, outsourcers) to use the Software for this purpose and You are responsible for their compliance with this Agreement in such use. You (including Your agents, contractors and/or outsourcers) may not use the Software for any other purpose.
  61. PROMPT
  62. PROMPT Ownership and Restrictions
  63. PROMPT Oracle and Oracle's licensors retain all ownership and intellectual property rights to the Software. The Software may be installed on one or more servers; provided, however, that You may only make one copy of the Software for backup or archival purposes.
  64. PROMPT
  65. PROMPT Third party technology that may be appropriate or necessary for use with the Software is specified in the Software documentation, notice files or readme files. Such third party technology is licensed to You under the terms of the third party technology license agreement specified in the Software documentation, notice files or readme files and not under the terms of this Agreement.
  66. PROMPT
  67. PROMPT You may not:
  68. PROMPT - use the Software for Your own internal data processing or for any commercial or production purposes, or use the Software for any purpose except the purpose stated herein;
  69. PROMPT - remove or modify any Software markings or any notice of Oracle's or Oracle's licensors' proprietary rights;
  70. PROMPT - make the Software available in any manner to any third party for use in the third party's business operations, without Oracle's prior written consent;
  71. PROMPT - use the Software to provide third party training or rent or lease the Software or use the Software for commercial time sharing or service bureau use;
  72. PROMPT - assign this Agreement or give or transfer the Software or an interest in them to another individual or entity;
  73. PROMPT - cause or permit reverse engineering (unless required by law for interoperability), disassembly or decompilation of the Software (the foregoing prohibition includes but is not limited to review of data structures or similar materials produced by the Software);
  74. PROMPT - disclose results of any Software benchmark tests without Oracle's prior written consent;
  75. PROMPT - use any Oracle name, trademark or logo without Oracle's prior written consent.
  76. PROMPT
  77. PROMPT Disclaimer of Warranty
  78. PROMPT ORACLE DOES NOT GUARANTEE THAT THE SOFTWARE WILL PERFORM ERROR-FREE OR UNINTERRUPTED. TO THE EXTENT NOT PROHIBITED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND THERE ARE NO WARRANTIES, EXPRESS OR IMPLIED, OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF MERCHANTABILITY, NONINFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE, THAT APPLY TO THE SOFTWARE.
  79. PROMPT
  80. PROMPT No Right to Technical Support
  81. PROMPT You acknowledge and agree that Oracle's technical support organization will not provide You with technical support for the Software licensed under this Agreement.
  82. PROMPT
  83. PROMPT End of Agreement
  84. PROMPT You may terminate this Agreement by destroying all copies of the Software. Oracle has the right to terminate Your right to use the Software at any time upon notice to You, in which case You shall destroy all copies of the Software.
  85. PROMPT
  86. PROMPT Entire Agreement
  87. PROMPT You agree that this Agreement is the complete agreement for the Software and supersedes all prior or contemporaneous agreements or representations, written or oral, regarding the Software. If any term of this Agreement is found to be invalid or unenforceable, the remaining provisions will remain effective and such term shall be replaced with a term consistent with the purpose and intent of this Agreement.
  88. PROMPT
  89. PROMPT Limitation of Liability
  90. PROMPT IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOSS OF PROFITS, REVENUE, DATA OR DATA USE, INCURRED BY YOU OR ANY THIRD PARTY. ORACLE'S ENTIRE LIABILITY FOR DAMAGES ARISING OUT OF OR RELATED TO THIS AGREEMENT, WHETHER IN CONTRACT OR TORT OR OTHERWISE, SHALL IN NO EVENT EXCEED THE GREATER OF ONE THOUSAND U.S. DOLLARS (U.S. $1,000) OR THE LICENSE FEES THAT YOU HAVE PAID TO ORACLE FOR PROGRAMS PURSUANT TO AN ORACLE LICENSE AGREEMENT.
  91. PROMPT
  92. PROMPT Export
  93. PROMPT Export laws and regulations of the United States and any other relevant local export laws and regulations apply to the Software. You agree that such export control laws govern Your use of the Software (including technical data) provided under this Agreement, and You agree to comply with all such export laws and regulations (including "deemed export" and "deemed re-export" regulations). You agree that no data, information, and/or Software (or direct product thereof) will be exported, directly or indirectly, in violation of any export laws, nor will they be used for any purpose prohibited by these laws including, without limitation, nuclear, chemical, or biological weapons proliferation, or development of missile technology.
  94. PROMPT
  95. PROMPT Other
  96. PROMPT 1. This Agreement is governed by the substantive and procedural laws of the State of California, USA. You and Oracle agree to submit to the exclusive jurisdiction of, and venue in, the courts of San Francisco or Santa Clara counties in California in any dispute arising out of or relating to this Agreement.
  97. PROMPT
  98. PROMPT 2. You may not assign this Agreement or give or transfer the Software or an interest in them to another individual or entity. If You grant a security interest in the Software, the secured party has no right to use or transfer the Software.
  99. PROMPT
  100. PROMPT 3. Except for actions for breach of Oracle's proprietary rights, no action, regardless of form, arising out of or relating to this Agreement may be brought by either party more than two years after the cause of action has accrued.
  101. PROMPT
  102. PROMPT 4. The relationship between You and Oracle is that of licensee/licensor. Nothing in this Agreement shall be construed to create a partnership, joint venture, agency, or employment relationship between the parties. The parties agree that they are acting solely as independent contractors hereunder and agree that the parties have no fiduciary duty to one another or any other special or implied duties that are not expressly stated herein. Neither party has any authority to act as agent for, or to incur any obligations on behalf of or in the name of the other.
  103. PROMPT
  104. PROMPT 5. This Agreement may not be modified and the rights and restrictions may not be altered or waived except in a writing signed by authorized representatives of You and Oracle.
  105. PROMPT
  106. PROMPT 6. Any notice required under this Agreement shall be provided to the other party in writing.
  107. PROMPT
  108. PROMPT 7. In order to assist You with the measurement, monitoring or management of Your usage of the Programs, Oracle may have access to and collect Your information, which may include personal information, and data residing on Oracle, customer or third-party systems on which the Software is used and/or to which Oracle is provided access to perform any associated services. Oracle treats such information and data in accordance with the terms of the Oracle Services Privacy Policy and the Oracle Corporate Security Practices, which are available at http://www.oracle.com/contracts, and treats such data as confidential in accordance with the terms of the Oracle License Agreement applicable to the Programs. The Oracle Services Privacy Policy and the Oracle Corporate Security Practices are subject to change at Oracle's discretion; however, Oracle will not materially reduce the level of protection specified in the Oracle Services Privacy Policy or the Oracle Corporate Security Practices in effect at the time the information was collected during the period that Oracle retains such information.
  109. PROMPT
  110. PROMPT Contact Information
  111. PROMPT Should You have any questions concerning Your use of the Software or this Agreement, please contact Oracle at: http://www.oracle.com/corporate/contact/
  112. PROMPT
  113. PROMPT Oracle America, Inc.
  114. PROMPT 500 Oracle Parkway,
  115. PROMPT Redwood City, CA 94065
  116. PROMPT
  117. PROMPT Last updated 1 November 2018
  118. PROMPT
  119. PROMPT ===============================================================
  120. SPOOL OFF
  121. HOST&SCRIPT_LA more license_agreement.txt 2> fii_err.txt
  122. -- PROMT FOR LICENSE AGREEMENT ACCEPTANCE
  123. DEFINE LANSWER=N
  124. SET TERMOUT ON
  125. ACCEPT&SCRIPT_LA LANSWER FORMAT A1 PROMPT 'Accept License Agreement? (y\n): '
  126. HOST&SCRIPT_LA rm license_agreement.txt 2> fii_err.txt
  127. HOST&SCRIPT_LA del license_agreement.txt 2> fii_err.txt
  128. SET TERMOUT OFF
  129. WHENEVER SQLERROR EXIT
  130. SET TERMOUT ON
  131. prompt Checking agreement acceptance ...
  132. SET TERMOUT OFF
  133. -- FORCE "divisor is equal to zero" AND SQLERROR EXIT IF NOT ACCEPTED
  134. -- WILL ALSO CONTINUE IF SCRIPT_LA SUBSTITUTION VARIABLE IS NOT NULL
  135. select 1/decode('&LANSWER', 'Y', null, 'y', null, decode('&SCRIPT_LA', null, 0, null)) as " " from DUAL;
  136. WHENEVER SQLERROR CONTINUE
  137. SET TERMOUT ON
  138. alter session set NLS_LANGUAGE='AMERICAN';
  139. alter session set NLS_TERRITORY='AMERICA';
  140. alter session set NLS_DATE_FORMAT='YYYY-MM-DD_HH24:MI:SS';
  141. alter session set NLS_TIMESTAMP_FORMAT='YYYY-MM-DD_HH24:MI:SS';
  142. alter session set NLS_TIMESTAMP_TZ_FORMAT='YYYY-MM-DD_HH24:MI:SS_TZH:TZM';
  143. SET TERMOUT OFF
  144. SET TAB OFF
  145. SET TRIMOUT ON
  146. SET TRIMSPOOL ON
  147. SET PAGESIZE 5000
  148. SET LINESIZE 300
  149. SET SERVEROUTPUT ON
  150. col DESCRIPTION format A65 wrap
  151. -- Get host_name and instance_name
  152. prompt Getting HOST_NAME and INSTANCE_NAME ...
  153. define INSTANCE_NAME=UNKNOWN
  154. define HOST_NAME=UNKNOWN
  155. col C1 new_val INSTANCE_NAME
  156. col C2 new_val HOST_NAME
  157. -- Oracle7
  158. SELECT min(machine) C2 FROM v$session WHERE type = 'BACKGROUND';
  159. SELECT name C1 FROM v$database;
  160. -- Oracle8 and higher
  161. SELECT instance_name C1, host_name C2 FROM v$instance;
  162. -- Oracle12 and higher
  163. define INSTANCE_NAME_0=&INSTANCE_NAME
  164. select '&&INSTANCE_NAME' || decode(VALUE, 'TRUE', '~' || replace(sys_context('USERENV', 'CON_NAME'), '$', '_'), '') C1
  165. from V$PARAMETER where name = 'enable_pluggable_database';
  166. SET FEEDBACK ON
  167. SET VERIFY ON
  168. -- Get SYSDATE
  169. define SYSDATE_START=UNKNOWN
  170. col C0 new_val SYSDATE_START
  171. select SYSDATE C0 from dual;
  172. -- Set output location
  173. define OUTPUT_PATH=***
  174. col C3 new_val OUTPUT_PATH
  175. select '&&HOST_NAME._&&INSTANCE_NAME.' ||
  176. decode('&SCRIPT_TS', null, null, '_'||to_char(to_date('&SYSDATE_START', 'YYYY-MM-DD_HH24:MI:SS'), 'YYYY.MM.DD.HH24.MI.SS')) C3 from DUAL;
  177. define GREP_PREFIX=***
  178. col C4 new_val GREP_PREFIX noprint
  179. SELECT 'GREP'||'ME>>,&&HOST_NAME.,&&INSTANCE_NAME.,' || '&SYSDATE_START' || ',&&HOST_NAME.,' || name as C4 FROM v$database;
  180. --{
  181. --Detect SQL*Plus client path separator
  182. --Using some Unix/Linux specific syntax
  183. host echo select \'$PWD\' as PWD_, \'rm\' as RMDEL_, \'/\' as PSEP_ from dual where \'$PWD\' like \'%/%\'\; > psep.sql 2> fii_err.txt
  184. define PWD=*
  185. define RMDEL=del
  186. define PSEP=\
  187. col PWD_ new_val PWD noprint
  188. col RMDEL_ new_val RMDEL noprint
  189. col PSEP_ new_val PSEP noprint
  190. -- The query syntax is correct only on Unix/Linux
  191. SET TERMOUT OFF
  192. @psep.sql
  193. SET TERMOUT ON
  194. -- Cleanup
  195. host &RMDEL psep.sql 2> fii_err.txt
  196. --}
  197. HOST mkdir &SCRIPT_SD 2> fii_err.txt
  198. define OUTPUT_PATH_SD=***
  199. col C3 new_val OUTPUT_PATH_SD
  200. select decode('&&SCRIPT_SD', null, '&&OUTPUT_PATH', '&&SCRIPT_SD&&PSEP&&OUTPUT_PATH') C3 from DUAL;
  201. HOST mkdir &&OUTPUT_PATH_SD
  202. define OUTPUT_PATH_ROOT=***
  203. col C3 new_val OUTPUT_PATH_ROOT
  204. select decode(instr('&&OUTPUT_PATH_SD', '&&PSEP', -1),
  205. length('&&OUTPUT_PATH_SD'), '&&OUTPUT_PATH_SD', -- if terminated by path separator, do noting
  206. '&&OUTPUT_PATH_SD&&PSEP') as C3
  207. from dual;
  208. col C3 clear
  209. SET VERIFY OFF
  210. SET TERMOUT ON
  211. ALTER SESSION SET CURRENT_SCHEMA = APPS;
  212. SPOOL &&OUTPUT_PATH_ROOT.export_log_01.txt
  213. PROMPT Collection Tool version &&CT_V
  214. PROMPT
  215. PROMPT ***** Collecting audit tables *****
  216. PROMPT
  217. REM *** FND_APPLICATION
  218. PROMPT ======================================================================
  219. WHENEVER SQLERROR CONTINUE
  220. SET HEADING OFF
  221. SELECT 'FND_APPLICATION: Exporting '||COUNT(*)||' rows' FROM FND_APPLICATION;
  222. SPOOL OFF
  223. SPOOL &&OUTPUT_PATH_ROOT.FND_APPLICATION.csv
  224. SET TERMOUT OFF
  225. SET HEADING ON
  226. SET PAGESIZE 50000
  227. SET LINESIZE 1000
  228. SELECT CHR(35)||'^~*~^'||APPLICATION_ID||'^~*~^'||','||
  229. '^~*~^'||APPLICATION_SHORT_NAME||'^~*~^'||','||
  230. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  231. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  232. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  233. FROM FND_APPLICATION;
  234. SPOOL OFF
  235. SET TERMOUT ON
  236. SPOOL &&OUTPUT_PATH_ROOT.export_log_02.txt
  237. PROMPT
  238. REM *** FND_APPLICATION_TL
  239. PROMPT ======================================================================
  240. SET HEADING OFF
  241. SELECT 'FND_APPLICATION_TL: Exporting '||COUNT(*)||' rows' FROM FND_APPLICATION_TL;
  242. SPOOL OFF
  243. SPOOL &&OUTPUT_PATH_ROOT.FND_APPLICATION_TL.csv
  244. SET TERMOUT OFF
  245. SET HEADING ON
  246. SELECT CHR(35)||'^~*~^'||APPLICATION_ID||'^~*~^'||','||
  247. '^~*~^'||LANGUAGE||'^~*~^'||','||
  248. '^~*~^'||APPLICATION_NAME||'^~*~^'||','||
  249. '^~*~^'||REPLACE(REPLACE(DESCRIPTION, CHR(10)), CHR(13))||'^~*~^'||','||
  250. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  251. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  252. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  253. FROM FND_APPLICATION_TL;
  254. SPOOL OFF
  255. SET TERMOUT ON
  256. SPOOL &&OUTPUT_PATH_ROOT.export_log_03.txt
  257. PROMPT
  258. REM *** FND_RESPONSIBILITY
  259. PROMPT ======================================================================
  260. SET HEADING OFF
  261. SELECT 'FND_RESPONSIBILITY: Exporting '||COUNT(*)||' rows' FROM FND_RESPONSIBILITY;
  262. SPOOL OFF
  263. SPOOL &&OUTPUT_PATH_ROOT.FND_RESPONSIBILITY.csv
  264. SET TERMOUT OFF
  265. SET HEADING ON
  266. SELECT CHR(35)||'^~*~^'||APPLICATION_ID||'^~*~^'||','||
  267. '^~*~^'||RESPONSIBILITY_ID||'^~*~^'||','||
  268. '^~*~^'||MENU_ID||'^~*~^'||','||
  269. '^~*~^'||TO_CHAR(START_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  270. '^~*~^'||TO_CHAR(END_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  271. '^~*~^'||VERSION||'^~*~^'||','||
  272. '^~*~^'||RESPONSIBILITY_KEY||'^~*~^'||','||
  273. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  274. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  275. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  276. FROM FND_RESPONSIBILITY;
  277. SPOOL OFF
  278. SET TERMOUT ON
  279. SPOOL &&OUTPUT_PATH_ROOT.export_log_04.txt
  280. PROMPT
  281. REM *** FND_RESPONSIBILITY_TL
  282. PROMPT ======================================================================
  283. SET HEADING OFF
  284. SELECT 'FND_RESPONSIBILITY_TL: Exporting '||COUNT(*)||' rows' FROM FND_RESPONSIBILITY_TL;
  285. SPOOL OFF
  286. SPOOL &&OUTPUT_PATH_ROOT.FND_RESPONSIBILITY_TL.csv
  287. SET TERMOUT OFF
  288. SET HEADING ON
  289. SELECT CHR(35)||'^~*~^'||APPLICATION_ID||'^~*~^'||','||
  290. '^~*~^'||RESPONSIBILITY_ID||'^~*~^'||','||
  291. '^~*~^'||LANGUAGE||'^~*~^'||','||
  292. '^~*~^'||RESPONSIBILITY_NAME||'^~*~^'||','||
  293. '^~*~^'||REPLACE(REPLACE(DESCRIPTION, CHR(10)), CHR(13))||'^~*~^'||','||
  294. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  295. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  296. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  297. FROM FND_RESPONSIBILITY_TL;
  298. SPOOL OFF
  299. SET TERMOUT ON
  300. SPOOL &&OUTPUT_PATH_ROOT.export_log_05.txt
  301. PROMPT
  302. REM *** FND_USER
  303. PROMPT ======================================================================
  304. SET HEADING OFF
  305. SELECT 'FND_USER: Exporting '||COUNT(*)||' rows' FROM FND_USER;
  306. SPOOL OFF
  307. SPOOL &&OUTPUT_PATH_ROOT.FND_USER.csv
  308. SET TERMOUT OFF
  309. SET HEADING ON
  310. SELECT CHR(35)||'^~*~^'||USER_ID ||'^~*~^'||','||
  311. '^~*~^'||USER_NAME ||'^~*~^'||','||
  312. '^~*~^'||''||'^~*~^'||','||
  313. '^~*~^'||REPLACE(REPLACE(DECODE(INSTR(email_Address,'@'),0,NULL,SUBSTR(email_address,INSTR(email_address,'@'))), CHR(10)), CHR(13))||'^~*~^'||','||
  314. '^~*~^'||TO_CHAR(START_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  315. '^~*~^'||TO_CHAR(END_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  316. '^~*~^'||TO_CHAR(LAST_LOGON_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  317. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  318. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  319. '^~*~^'||EMPLOYEE_ID||'^~*~^'||','||
  320. '^~*~^'||CUSTOMER_ID||'^~*~^'||','||
  321. '^~*~^'||SUPPLIER_ID||'^~*~^'||','||
  322. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY')||'^~*~^'
  323. FROM FND_USER;
  324. SPOOL OFF
  325. SET TERMOUT ON
  326. SPOOL &&OUTPUT_PATH_ROOT.export_log_06.txt
  327. PROMPT
  328. REM *** FND_LOGINS
  329. PROMPT ======================================================================
  330. SET HEADING OFF
  331. SELECT 'FND_LOGINS: Exporting '||COUNT(*)||' rows' FROM FND_LOGINS WHERE start_time BETWEEN TRUNC(ADD_MONTHS(SYSDATE,-6),'mm') AND SYSDATE
  332. AND (terminal_id != 'Concurrent' OR terminal_id IS NULL);
  333. SPOOL OFF
  334. SPOOL &&OUTPUT_PATH_ROOT.FND_LOGINS.csv
  335. SET TERMOUT OFF
  336. SET HEADING ON
  337. SELECT CHR(35)||'^~*~^'||LOGIN_ID||'^~*~^'||','||
  338. '^~*~^'||USER_ID||'^~*~^'||','||
  339. '^~*~^'||TO_CHAR(START_TIME, 'MM/DD/YYYY HH:MI:SS AM')||'^~*~^'||','||
  340. '^~*~^'||TO_CHAR(END_TIME, 'MM/DD/YYYY HH:MI:SS AM')||'^~*~^'||','||
  341. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  342. FROM FND_LOGINS
  343. WHERE START_TIME BETWEEN TRUNC(ADD_MONTHS(SYSDATE,-6),'mm') AND SYSDATE
  344. AND (terminal_id != 'Concurrent' OR terminal_id IS NULL);
  345. SPOOL OFF
  346. SET TERMOUT ON
  347. SPOOL &&OUTPUT_PATH_ROOT.export_log_07.txt
  348. PROMPT
  349. REM *** FND_LOGIN_RESPONSIBILITIES
  350. PROMPT ======================================================================
  351. SET HEADING OFF
  352. SELECT 'FND_LOGIN_RESPONSIBILITIES: Exporting '||COUNT(*)||' rows' FROM FND_LOGIN_RESPONSIBILITIES;
  353. SPOOL OFF
  354. SPOOL &&OUTPUT_PATH_ROOT.FND_LOGIN_RESPONSIBILITIES.csv
  355. SET TERMOUT OFF
  356. SET HEADING ON
  357. SELECT CHR(35)||'^~*~^'||LOGIN_ID||'^~*~^'||','||
  358. '^~*~^'||LOGIN_RESP_ID||'^~*~^'||','||
  359. '^~*~^'||RESP_APPL_ID||'^~*~^'||','||
  360. '^~*~^'||RESPONSIBILITY_ID||'^~*~^'||','||
  361. '^~*~^'||TO_CHAR(START_TIME,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  362. '^~*~^'||TO_CHAR(END_TIME,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  363. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  364. FROM FND_LOGIN_RESPONSIBILITIES
  365. WHERE START_TIME BETWEEN TRUNC(ADD_MONTHS(SYSDATE,-6),'MM') AND SYSDATE;
  366. SPOOL OFF
  367. SET TERMOUT ON
  368. SPOOL &&OUTPUT_PATH_ROOT.export_log_08.txt
  369. PROMPT
  370. REM *** WF_LOCAL_USER_ROLES
  371. PROMPT ======================================================================
  372. SET HEADING OFF
  373. SELECT 'WF_LOCAL_USER_ROLES: Exporting '||COUNT(*)||' rows' FROM WF_LOCAL_USER_ROLES WHERE ROLE_ORIG_SYSTEM = 'FND_RESP';
  374. SPOOL OFF
  375. SPOOL &&OUTPUT_PATH_ROOT.WF_LOCAL_USER_ROLES.csv
  376. SET TERMOUT OFF
  377. SET HEADING ON
  378. SELECT CHR(35)||'^~*~^'||ROLE_NAME||'^~*~^'||','||
  379. '^~*~^'||USER_NAME||'^~*~^'||','||
  380. '^~*~^'||USER_ORIG_SYSTEM||'^~*~^'||','||
  381. '^~*~^'||USER_ORIG_SYSTEM_ID||'^~*~^'||','||
  382. '^~*~^'||ROLE_ORIG_SYSTEM||'^~*~^'||','||
  383. '^~*~^'||ROLE_ORIG_SYSTEM_ID||'^~*~^'||','||
  384. '^~*~^'||TO_CHAR(START_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  385. '^~*~^'||TO_CHAR(EXPIRATION_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  386. '^~*~^'||SECURITY_GROUP_ID||'^~*~^'||','||
  387. '^~*~^'||PARTITION_ID||'^~*~^'||','||
  388. '^~*~^'||ASSIGNMENT_TYPE||'^~*~^'||','||
  389. '^~*~^'||CREATED_BY||'^~*~^'||','||
  390. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  391. '^~*~^'||LAST_UPDATED_BY||'^~*~^'||',' ||
  392. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  393. '^~*~^'||LAST_UPDATE_LOGIN||'^~*~^'||','||
  394. '^~*~^'||OWNER_TAG||'^~*~^'||','||
  395. '^~*~^'||PARENT_ORIG_SYSTEM||'^~*~^'||','||
  396. '^~*~^'||PARENT_ORIG_SYSTEM_ID||'^~*~^'||','||
  397. '^~*~^'||TO_CHAR(ROLE_END_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  398. '^~*~^'||TO_CHAR(ROLE_START_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  399. '^~*~^'||TO_CHAR(USER_END_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  400. '^~*~^'||TO_CHAR(USER_START_DATE, 'MM/DD/YYYY')||'^~*~^'|| ','||
  401. '^~*~^'||TO_CHAR(EFFECTIVE_START_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  402. '^~*~^'||TO_CHAR(EFFECTIVE_END_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  403. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  404. FROM WF_LOCAL_USER_ROLES
  405. WHERE ROLE_ORIG_SYSTEM = 'FND_RESP';
  406. SPOOL OFF
  407. SET TERMOUT ON
  408. SPOOL &&OUTPUT_PATH_ROOT.export_log_09.txt
  409. PROMPT
  410. REM *** WF_USER_ROLE_ASSIGNMENTS
  411. PROMPT ======================================================================
  412. SET HEADING OFF
  413. SELECT 'WF_USER_ROLE_ASSIGNMENTS: Exporting '||COUNT(*)||' rows' FROM WF_USER_ROLE_ASSIGNMENTS WHERE ROLE_NAME LIKE 'FND_RESP|%';
  414. SPOOL OFF
  415. SPOOL &&OUTPUT_PATH_ROOT.WF_USER_ROLE_ASSIGNMENTS.csv
  416. SET TERMOUT OFF
  417. SET HEADING ON
  418. SELECT CHR(35)||'^~*~^'||ROLE_NAME||'^~*~^'||','||
  419. '^~*~^'||USER_NAME||'^~*~^'||','||
  420. '^~*~^'||RELATIONSHIP_ID||'^~*~^'||','||
  421. '^~*~^'||ASSIGNING_ROLE||'^~*~^'||','||
  422. '^~*~^'||TO_CHAR(START_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  423. '^~*~^'||TO_CHAR(END_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  424. '^~*~^'||CREATED_BY||'^~*~^'||','||
  425. '^~*~^'||TO_CHAR(CREATION_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  426. '^~*~^'||LAST_UPDATED_BY||'^~*~^'||','||
  427. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  428. '^~*~^'||LAST_UPDATE_LOGIN||'^~*~^'||','||
  429. '^~*~^'||TO_CHAR(USER_START_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  430. '^~*~^'||TO_CHAR(ROLE_START_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  431. '^~*~^'||TO_CHAR(ASSIGNING_ROLE_START_DATE, 'MM/DD/YYYY') ||'^~*~^'||','||
  432. '^~*~^'||TO_CHAR(USER_END_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  433. '^~*~^'||TO_CHAR(ROLE_END_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  434. '^~*~^'||TO_CHAR(ASSIGNING_ROLE_END_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  435. '^~*~^'||PARTITION_ID||'^~*~^'||','||
  436. '^~*~^'||TO_CHAR(EFFECTIVE_START_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  437. '^~*~^'||TO_CHAR(EFFECTIVE_END_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  438. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  439. FROM WF_USER_ROLE_ASSIGNMENTS
  440. WHERE ROLE_NAME LIKE 'FND_RESP|%';
  441. SPOOL OFF
  442. SET TERMOUT ON
  443. SPOOL &&OUTPUT_PATH_ROOT.export_log_10.txt
  444. PROMPT
  445. REM *** FND_PRODUCT_INSTALLATIONS
  446. PROMPT ======================================================================
  447. SET HEADING OFF
  448. SELECT 'FND_PRODUCT_INSTALLATIONS: Exporting '||COUNT(*)||' rows' FROM FND_PRODUCT_INSTALLATIONS;
  449. SPOOL OFF
  450. SPOOL &&OUTPUT_PATH_ROOT.FND_PRODUCT_INSTALLATIONS.csv
  451. SET TERMOUT OFF
  452. SET HEADING ON
  453. SELECT CHR(35)||'^~*~^'||APPLICATION_ID||'^~*~^'||','||
  454. '^~*~^'||PRODUCT_VERSION||'^~*~^'||','||
  455. '^~*~^'||STATUS||'^~*~^'||','||
  456. '^~*~^'||PATCH_LEVEL||'^~*~^'||','||
  457. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  458. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  459. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  460. FROM FND_PRODUCT_INSTALLATIONS;
  461. SPOOL OFF
  462. SET TERMOUT ON
  463. SPOOL &&OUTPUT_PATH_ROOT.export_log_11.txt
  464. PROMPT
  465. REM *** FND_SECURITY_GROUPS
  466. PROMPT ======================================================================
  467. SET HEADING OFF
  468. SELECT 'FND_SECURITY_GROUPS: Exporting '||COUNT(*)||' rows' FROM FND_SECURITY_GROUPS;
  469. SPOOL OFF
  470. SPOOL &&OUTPUT_PATH_ROOT.FND_SECURITY_GROUPS.csv
  471. SET TERMOUT OFF
  472. SET HEADING ON
  473. SELECT CHR(35)||'^~*~^'||SECURITY_GROUP_ID||'^~*~^'||','||
  474. '^~*~^'||SECURITY_GROUP_KEY||'^~*~^'||','||
  475. '^~*~^'||CREATED_BY||'^~*~^'||','||
  476. '^~*~^'||TO_CHAR(CREATION_DATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'||','||
  477. '^~*~^'||LAST_UPDATED_BY||'^~*~^'||','||
  478. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'||','||
  479. '^~*~^'||LAST_UPDATE_LOGIN||'^~*~^'||','||
  480. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  481. FROM FND_SECURITY_GROUPS;
  482. SPOOL OFF
  483. SET TERMOUT ON
  484. SPOOL &&OUTPUT_PATH_ROOT.export_log_12.txt
  485. PROMPT
  486. REM *** FND_FORM_FUNCTIONS
  487. PROMPT ======================================================================
  488. SET HEADING OFF
  489. SELECT 'FND_FORM_FUNCTIONS: Exporting '||COUNT(*)||' rows' FROM FND_FORM_FUNCTIONS;
  490. SPOOL OFF
  491. SPOOL &&OUTPUT_PATH_ROOT.FND_FORM_FUNCTIONS.csv
  492. SET TERMOUT OFF
  493. SET HEADING ON
  494. SELECT CHR(35)||'^~*~^'||FUNCTION_ID||'^~*~^'||','||
  495. '^~*~^'||FUNCTION_NAME||'^~*~^'|| ',' ||
  496. '^~*~^'||REPLACE(REPLACE(TYPE, CHR(10)), CHR(13))||'^~*~^'|| ',' ||
  497. '^~*~^'||REPLACE(REPLACE(PARAMETERS, CHR(10)), CHR(13))||'^~*~^'||','||
  498. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  499. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  500. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  501. FROM FND_FORM_FUNCTIONS;
  502. SPOOL OFF
  503. SET TERMOUT ON
  504. SPOOL &&OUTPUT_PATH_ROOT.export_log_13.txt
  505. PROMPT
  506. REM *** FND_FORM_FUNCTIONS_TL
  507. PROMPT ======================================================================
  508. SET HEADING OFF
  509. SELECT 'FND_FORM_FUNCTIONS_TL: Exporting '||COUNT(*)||' rows' FROM FND_FORM_FUNCTIONS_TL;
  510. SPOOL OFF
  511. SPOOL &&OUTPUT_PATH_ROOT.FND_FORM_FUNCTIONS_TL.csv
  512. SET TERMOUT OFF
  513. SET HEADING ON
  514. SELECT CHR(35)||'^~*~^'||LANGUAGE||'^~*~^'||','||
  515. '^~*~^'||FUNCTION_ID||'^~*~^'||','||
  516. '^~*~^'||REPLACE(REPLACE(user_function_name,CHR(10),''),CHR(13),'')||'^~*~^'||','||
  517. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  518. '^~*~^'||CREATED_BY||'^~*~^'||','||
  519. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  520. '^~*~^'||LAST_UPDATED_BY||'^~*~^'||','||
  521. '^~*~^'||LAST_UPDATE_LOGIN||'^~*~^'||','||
  522. '^~*~^'||REPLACE(REPLACE(DESCRIPTION,CHR(10),''),CHR(13),'')||'^~*~^'||','||
  523. '^~*~^'||SOURCE_LANG||'^~*~^'||','||
  524. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  525. FROM FND_FORM_FUNCTIONS_TL;
  526. SPOOL OFF
  527. SET TERMOUT ON
  528. SPOOL &&OUTPUT_PATH_ROOT.export_log_14.txt
  529. PROMPT
  530. REM *** FND_MENU_ENTRIES
  531. PROMPT ======================================================================
  532. SET HEADING OFF
  533. SELECT 'FND_MENU_ENTRIES: Exporting '||COUNT(*)||' rows' FROM FND_MENU_ENTRIES;
  534. SPOOL OFF
  535. SPOOL &&OUTPUT_PATH_ROOT.FND_MENU_ENTRIES.csv
  536. SET TERMOUT OFF
  537. SET HEADING ON
  538. SELECT CHR(35)||'^~*~^'||MENU_ID||'^~*~^'||','||
  539. '^~*~^'||ENTRY_SEQUENCE||'^~*~^'||','||
  540. '^~*~^'||SUB_MENU_ID||'^~*~^'||','||
  541. '^~*~^'||FUNCTION_ID||'^~*~^'||','||
  542. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  543. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  544. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  545. FROM FND_MENU_ENTRIES;
  546. SPOOL OFF
  547. SET TERMOUT ON
  548. SPOOL &&OUTPUT_PATH_ROOT.export_log_15.txt
  549. PROMPT
  550. REM *** FND_MENU_ENTRIES_TL
  551. PROMPT ======================================================================
  552. SET HEADING OFF
  553. SELECT 'FND_MENU_ENTRIES_TL: Exporting '||COUNT(*)||' rows' FROM FND_MENU_ENTRIES_TL;
  554. SPOOL OFF
  555. SPOOL &&OUTPUT_PATH_ROOT.FND_MENU_ENTRIES_TL.csv
  556. SET TERMOUT OFF
  557. SET HEADING ON
  558. SELECT CHR(35)||'^~*~^'||MENU_ID||'^~*~^'||','||
  559. '^~*~^'||ENTRY_SEQUENCE||'^~*~^'||','||
  560. '^~*~^'||REPLACE(REPLACE(PROMPT, CHR(10)), CHR(13))||'^~*~^'||','||
  561. '^~*~^'||REPLACE(REPLACE(DESCRIPTION, CHR(10)), CHR(13))||'^~*~^'||','||
  562. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  563. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  564. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  565. FROM FND_MENU_ENTRIES_TL;
  566. SPOOL OFF
  567. SET TERMOUT ON
  568. SPOOL &&OUTPUT_PATH_ROOT.export_log_16.txt
  569. PROMPT
  570. REM *** FND_MENUS
  571. PROMPT ======================================================================
  572. SET HEADING OFF
  573. SELECT 'FND_MENUS: Exporting '||COUNT(*)||' rows' FROM FND_MENUS;
  574. SPOOL OFF
  575. SPOOL &&OUTPUT_PATH_ROOT.FND_MENUS.csv
  576. SET TERMOUT OFF
  577. SET HEADING ON
  578. SELECT CHR(35)||'^~*~^'||MENU_ID||'^~*~^'||','||
  579. '^~*~^'||MENU_NAME||'^~*~^'||','||
  580. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  581. '^~*~^'||LAST_UPDATED_BY||'^~*~^'||','||
  582. '^~*~^'||LAST_UPDATE_LOGIN||'^~*~^'||','||
  583. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  584. '^~*~^'||CREATED_BY||'^~*~^'||','||
  585. '^~*~^'||TYPE||'^~*~^'||','||
  586. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  587. FROM FND_MENUS t;
  588. SPOOL OFF
  589. SET TERMOUT ON
  590. SPOOL &&OUTPUT_PATH_ROOT.export_log_17.txt
  591. PROMPT
  592. REM *** FND_MENUS_TL
  593. PROMPT ======================================================================
  594. SET HEADING OFF
  595. SELECT 'FND_MENUS_TL: Exporting '||COUNT(*)||' rows' FROM FND_MENUS_TL;
  596. SPOOL OFF
  597. SPOOL &&OUTPUT_PATH_ROOT.FND_MENUS_TL.csv
  598. SET TERMOUT OFF
  599. SET HEADING ON
  600. SELECT CHR(35)||'^~*~^'||LANGUAGE||'^~*~^'||','||
  601. '^~*~^'||MENU_ID||'^~*~^'||','||
  602. '^~*~^'||REPLACE(REPLACE(USER_MENU_NAME,CHR(10),''),CHR(13),'')||'^~*~^'||','||
  603. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  604. '^~*~^'||LAST_UPDATED_BY||'^~*~^'||','||
  605. '^~*~^'||LAST_UPDATE_LOGIN||'^~*~^'||','||
  606. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  607. '^~*~^'||CREATED_BY||'^~*~^'||','||
  608. '^~*~^'||REPLACE(REPLACE(DESCRIPTION,CHR(10),''),CHR(13),'')||'^~*~^'||','||
  609. '^~*~^'||SOURCE_LANG||'^~*~^'||','||
  610. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  611. FROM FND_MENUS_TL;
  612. SPOOL OFF
  613. SET TERMOUT ON
  614. SPOOL &&OUTPUT_PATH_ROOT.export_log_18.txt
  615. PROMPT
  616. REM *** ICX_SESSIONS
  617. PROMPT ======================================================================
  618. SET HEADING OFF
  619. SELECT 'ICX_SESSIONS: Exporting '||COUNT(*)||' rows' FROM ICX_SESSIONS WHERE creation_date>=SYSDATE-365;
  620. SPOOL OFF
  621. SPOOL &&OUTPUT_PATH_ROOT.ICX_SESSIONS.csv
  622. SET TERMOUT OFF
  623. SET HEADING ON
  624. SELECT CHR(35)||'^~*~^'||SESSION_ID||'^~*~^'||','||
  625. '^~*~^'||USER_ID||'^~*~^'||','||
  626. '^~*~^'||RESPONSIBILITY_ID||'^~*~^'||','||
  627. '^~*~^'||TO_CHAR(FIRST_CONNECT,'MM/DD/YYYY HH24:MI:SS')||'^~*~^'||','||
  628. '^~*~^'||TO_CHAR(LAST_CONNECT,'MM/DD/YYYY HH24:MI:SS')||'^~*~^'||','||
  629. '^~*~^'||DISABLED_FLAG||'^~*~^'||','||
  630. '^~*~^'||RESPONSIBILITY_APPLICATION_ID||'^~*~^'||','||
  631. '^~*~^'||LOGIN_ID||'^~*~^'||','||
  632. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  633. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  634. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  635. FROM ICX_SESSIONS
  636. WHERE creation_date>=SYSDATE-365;
  637. SPOOL OFF
  638. SET TERMOUT ON
  639. SPOOL &&OUTPUT_PATH_ROOT.export_log_19.txt
  640. PROMPT
  641. REM *** FND_USER_RESPONSIBILITY
  642. PROMPT ======================================================================
  643. SET HEADING OFF
  644. SELECT 'FND_USER_RESPONSIBILITY: Exporting '||COUNT(*)||' rows' FROM FND_USER_RESPONSIBILITY;
  645. SPOOL OFF
  646. SPOOL &&OUTPUT_PATH_ROOT.FND_USER_RESPONSIBILITY.csv
  647. SET TERMOUT OFF
  648. SET HEADING ON
  649. SELECT CHR(35)||'^~*~^'||USER_ID||'^~*~^'||','||
  650. '^~*~^'||APPLICATION_ID||'^~*~^'||','||
  651. '^~*~^'||RESPONSIBILITY_ID||'^~*~^'||','||
  652. '^~*~^'||TO_CHAR(START_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  653. '^~*~^'||TO_CHAR(END_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  654. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  655. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  656. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  657. FROM FND_USER_RESPONSIBILITY;
  658. SPOOL OFF
  659. SET TERMOUT ON
  660. SPOOL &&OUTPUT_PATH_ROOT.export_log_20.txt
  661. PROMPT
  662. REM *** FND_USER_RESP_GROUPS_ALL
  663. PROMPT ======================================================================
  664. SET HEADING OFF
  665. SELECT 'FND_USER_RESP_GROUPS_ALL: Exporting '||COUNT(*)||' rows' FROM FND_USER_RESP_GROUPS_ALL;
  666. SPOOL OFF
  667. SPOOL &&OUTPUT_PATH_ROOT.FND_USER_RESP_GROUPS_ALL.csv
  668. SET TERMOUT OFF
  669. SET HEADING ON
  670. SELECT CHR(35)||'^~*~^'||USER_ID||'^~*~^'||','||
  671. '^~*~^'||RESPONSIBILITY_ID||'^~*~^'||','||
  672. '^~*~^'||RESPONSIBILITY_APPLICATION_ID||'^~*~^'||','||
  673. '^~*~^'||SECURITY_GROUP_ID||'^~*~^'||','||
  674. '^~*~^'||TO_CHAR(START_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  675. '^~*~^'||TO_CHAR(END_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  676. '^~*~^'||CREATED_BY||'^~*~^'||','||
  677. '^~*~^'||TO_CHAR(CREATION_DATE, 'MM/DD/YYYY HH24:MI:SS')||'^~*~^'||','||
  678. '^~*~^'||LAST_UPDATED_BY||'^~*~^'||','||
  679. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE, 'MM/DD/YYYY HH24:MI:SS')||'^~*~^'||','||
  680. '^~*~^'||LAST_UPDATE_LOGIN||'^~*~^'||','||
  681. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  682. FROM FND_USER_RESP_GROUPS_ALL;
  683. SPOOL OFF
  684. SET TERMOUT ON
  685. SPOOL &&OUTPUT_PATH_ROOT.export_log_21.txt
  686. PROMPT
  687. REM *** FND_USER_RESP_GROUPS
  688. PROMPT ======================================================================
  689. SET HEADING OFF
  690. SELECT 'FND_USER_RESP_GROUPS: Exporting '||COUNT(*)||' rows' FROM FND_USER_RESP_GROUPS;
  691. SPOOL OFF
  692. SPOOL &&OUTPUT_PATH_ROOT.FND_USER_RESP_GROUPS.csv
  693. SET TERMOUT OFF
  694. SET HEADING ON
  695. SELECT CHR(35)||'^~*~^'||USER_ID||'^~*~^'||','||
  696. '^~*~^'||RESPONSIBILITY_ID||'^~*~^'||','||
  697. '^~*~^'||RESPONSIBILITY_APPLICATION_ID||'^~*~^'||','||
  698. '^~*~^'||TO_CHAR(START_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  699. '^~*~^'||TO_CHAR(END_DATE, 'MM/DD/YYYY')||'^~*~^'||','||
  700. '^~*~^'||REPLACE(REPLACE(DESCRIPTION, CHR(10)), CHR(13))||'^~*~^'||','||
  701. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  702. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  703. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  704. FROM FND_USER_RESP_GROUPS;
  705. SPOOL OFF
  706. SET TERMOUT ON
  707. SPOOL &&OUTPUT_PATH_ROOT.export_log_22.txt
  708. PROMPT
  709. REM *** FND_RESP_FUNCTIONS
  710. PROMPT ======================================================================
  711. SET HEADING OFF
  712. SELECT 'FND_RESP_FUNCTIONS: Exporting '||COUNT(*)||' rows' FROM FND_RESP_FUNCTIONS;
  713. SPOOL OFF
  714. SPOOL &&OUTPUT_PATH_ROOT.FND_RESP_FUNCTIONS.csv
  715. SET TERMOUT OFF
  716. SET HEADING ON
  717. SELECT CHR(35)||'^~*~^'||ACTION_ID||'^~*~^'||','||
  718. '^~*~^'||RESPONSIBILITY_ID||'^~*~^'||','||
  719. '^~*~^'||APPLICATION_ID||'^~*~^'||','||
  720. '^~*~^'||RULE_TYPE||'^~*~^'||','||
  721. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  722. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  723. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  724. FROM FND_RESP_FUNCTIONS;
  725. SPOOL OFF
  726. define min_header=0
  727. define max_header=0
  728. define max_line=0
  729. define max_date=sysdate
  730. col max_date new_val max_date
  731. SELECT max(creation_date) max_date FROM oe_order_headers_all;
  732. col max_header new_val max_header
  733. SELECT max(header_id) max_header FROM oe_order_headers_all;
  734. col min_header new_val min_header
  735. SELECT NVL(MIN(header_id),&max_header+1) min_header FROM oe_order_headers_all
  736. WHERE creation_date>=(to_date('&max_date')-730);
  737. col max_line new_val max_line
  738. SELECT NVL(MAX(line_id),&max_line+1) max_line FROM oe_order_lines_all;
  739. SET TERMOUT ON
  740. SPOOL &&OUTPUT_PATH_ROOT.export_log_23.txt
  741. PROMPT
  742. REM *** OE_ORDER_LINES_ALL
  743. PROMPT ======================================================================
  744. SET HEADING OFF
  745. SELECT 'OE_ORDER_LINES_ALL: '||DECODE(COUNT(*),0,'No rows to export','Exporting '||COUNT(*)|| ' rows') FROM OE_ORDER_LINES_ALL WHERE header_id>=&min_header AND line_id<=&max_line;
  746. SET TERMOUT OFF
  747. SPOOL OFF
  748. SPOOL &&OUTPUT_PATH_ROOT.OE_ORDER_LINES_ALL.csv
  749. SET HEADING ON
  750. SELECT CHR(35)||'^~*~^'||LINE_ID||'^~*~^'||','||
  751. '^~*~^'||ORG_ID||'^~*~^'||','||
  752. '^~*~^'||HEADER_ID||'^~*~^'||','||
  753. '^~*~^'||LINE_TYPE_ID||'^~*~^'||','||
  754. '^~*~^'||LINE_NUMBER||'^~*~^'||','||
  755. '^~*~^'||PRICING_QUANTITY||'^~*~^'||','||
  756. '^~*~^'||SHIPPED_QUANTITY||'^~*~^'||','||
  757. '^~*~^'||ORDERED_QUANTITY||'^~*~^'||','||
  758. '^~*~^'||FULFILLED_QUANTITY||'^~*~^'||','||
  759. '^~*~^'||SHIPPING_QUANTITY||'^~*~^'||','||
  760. '^~*~^'||SHIP_FROM_ORG_ID||'^~*~^'||','||
  761. '^~*~^'||SHIP_TO_ORG_ID||'^~*~^'||','||
  762. '^~*~^'||SOLD_FROM_ORG_ID||'^~*~^'||','||
  763. '^~*~^'||SOLD_TO_ORG_ID||'^~*~^'||','||
  764. '^~*~^'||CUST_PO_NUMBER||'^~*~^'||','||
  765. '^~*~^'||SHIPMENT_NUMBER||'^~*~^'||','||
  766. '^~*~^'||ORIG_SYS_LINE_REF||'^~*~^'||','||
  767. '^~*~^'||SOURCE_DOCUMENT_LINE_ID||'^~*~^'||','||
  768. '^~*~^'||REFERENCE_LINE_ID||'^~*~^'||','||
  769. '^~*~^'||REFERENCE_TYPE||'^~*~^'||','||
  770. '^~*~^'||REFERENCE_HEADER_ID||'^~*~^'||','||
  771. '^~*~^'||LINK_TO_LINE_ID||'^~*~^'||','||
  772. '^~*~^'||ITEM_TYPE_CODE||'^~*~^'||','||
  773. '^~*~^'||LINE_CATEGORY_CODE||'^~*~^'||','||
  774. '^~*~^'||SOURCE_TYPE_CODE||'^~*~^'||','||
  775. '^~*~^'||SPLIT_FROM_LINE_ID||'^~*~^'||','||
  776. '^~*~^'||ORDER_SOURCE_ID||'^~*~^'||','||
  777. '^~*~^'||ORIG_SYS_DOCUMENT_REF||'^~*~^'||','||
  778. '^~*~^'||CALCULATE_PRICE_FLAG||'^~*~^'||','||
  779. '^~*~^'||DROP_SHIP_FLAG||'^~*~^'||','||
  780. '^~*~^'||SPLIT_BY||'^~*~^'||','||
  781. '^~*~^'||LINE_SET_ID||'^~*~^'||','||
  782. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  783. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  784. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  785. FROM OE_ORDER_LINES_ALL
  786. WHERE header_id>=&min_header
  787. AND line_id<=&max_line;
  788. SPOOL OFF
  789. SET TERMOUT ON
  790. SPOOL &&OUTPUT_PATH_ROOT.export_log_24.txt
  791. PROMPT
  792. REM *** OE_ORDER_SOURCES
  793. PROMPT ======================================================================
  794. SET HEADING OFF
  795. SELECT 'OE_ORDER_SOURCES: Exporting '||COUNT(*)||' rows' FROM OE_ORDER_SOURCES;
  796. SPOOL OFF
  797. SPOOL &&OUTPUT_PATH_ROOT.OE_ORDER_SOURCES.csv
  798. SET TERMOUT OFF
  799. SET HEADING ON
  800. SELECT CHR(35)||'^~*~^'||ORDER_SOURCE_ID||'^~*~^'||','||
  801. '^~*~^'||REPLACE(REPLACE(NAME,CHR(10),''),CHR(13),'')||'^~*~^'||','||
  802. '^~*~^'||REPLACE(REPLACE(DESCRIPTION,CHR(10),''),CHR(13),'')||'^~*~^'||','||
  803. '^~*~^'||ENABLED_FLAG||'^~*~^'||','||
  804. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  805. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  806. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  807. FROM OE_ORDER_SOURCES;
  808. SPOOL OFF
  809. SET TERMOUT ON
  810. SPOOL &&OUTPUT_PATH_ROOT.export_log_25.txt
  811. PROMPT
  812. REM *** OE_ORDER_HEADERS_ALL
  813. PROMPT ======================================================================
  814. SET HEADING OFF
  815. SELECT 'OE_ORDER_HEADERS_ALL: '||DECODE(COUNT(*),0,'No rows to export','Exporting '||COUNT(*)|| ' rows') FROM OE_ORDER_HEADERS_ALL WHERE header_id>=&min_header;
  816. SPOOL OFF
  817. SPOOL &&OUTPUT_PATH_ROOT.OE_ORDER_HEADERS_ALL.csv
  818. SET TERMOUT OFF
  819. SET HEADING ON
  820. SELECT CHR(35)||'^~*~^'||HEADER_ID||'^~*~^'||','||
  821. '^~*~^'||ORG_ID||'^~*~^'||','||
  822. '^~*~^'||ORDER_TYPE_ID||'^~*~^'||','||
  823. '^~*~^'||ORDER_NUMBER||'^~*~^'||','||
  824. '^~*~^'||ORDER_SOURCE_ID||'^~*~^'||','||
  825. '^~*~^'||SOURCE_DOCUMENT_TYPE_ID||'^~*~^'||','||
  826. '^~*~^'||ORIG_SYS_DOCUMENT_REF||'^~*~^'||','||
  827. '^~*~^'||SOURCE_DOCUMENT_ID||'^~*~^'||','||
  828. '^~*~^'||PARTIAL_SHIPMENTS_ALLOWED||'^~*~^'||','||
  829. '^~*~^'||CUST_PO_NUMBER||'^~*~^'||','||
  830. '^~*~^'||SOLD_FROM_ORG_ID||'^~*~^'||','||
  831. '^~*~^'||SOLD_TO_ORG_ID||'^~*~^'||','||
  832. '^~*~^'||SHIP_FROM_ORG_ID||'^~*~^'||','||
  833. '^~*~^'||SHIP_TO_ORG_ID||'^~*~^'||','||
  834. '^~*~^'||INVOICE_TO_ORG_ID||'^~*~^'||','||
  835. '^~*~^'||DELIVER_TO_ORG_ID||'^~*~^'||','||
  836. '^~*~^'||ORDER_CATEGORY_CODE||'^~*~^'||','||
  837. '^~*~^'||DROP_SHIP_FLAG||'^~*~^'||','||
  838. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  839. '^~*~^'||TO_CHAR(LAST_UPDATE_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  840. '^~*~^'||TO_CHAR(SYSDATE, 'MM/DD/YYYY HH24:MI')||'^~*~^'
  841. FROM OE_ORDER_HEADERS_ALL
  842. WHERE HEADER_ID>=&min_header;
  843. SPOOL OFF
  844. SET TERMOUT ON
  845. /*
  846. SPOOL &&OUTPUT_PATH_ROOT.export_log_26.txt
  847. PROMPT
  848. PROMPT *** FND_LOOKUP_VALUES
  849. PROMPT ======================================================================
  850. SET HEADING OFF
  851. SELECT 'Exporting '||COUNT(*)||' rows' FROM FND_LOOKUP_VALUES;
  852. SPOOL OFF
  853. SPOOL &&OUTPUT_PATH_ROOT.FND_LOOKUP_VALUES.csv
  854. SET TERMOUT OFF
  855. SET HEADING ON
  856. SELECT CHR(35)||'^~*~^'||LOOKUP_TYPE||'^~*~^'||','||
  857. '^~*~^'||LANGUAGE||'^~*~^'||','||
  858. '^~*~^'||LOOKUP_CODE||'^~*~^'||','||
  859. '^~*~^'||REPLACE(REPLACE(MEANING,CHR(10),''),CHR(13),'')||'^~*~^'||','||
  860. '^~*~^'||REPLACE(REPLACE(DESCRIPTION,CHR(10),''),CHR(13),'')||'^~*~^'||','||
  861. '^~*~^'||ENABLED_FLAG||'^~*~^'||','||
  862. '^~*~^'||START_DATE_ACTIVE||'^~*~^'||','||
  863. '^~*~^'||END_DATE_ACTIVE||'^~*~^'||','||
  864. '^~*~^'||TO_CHAR(CREATION_DATE,'mm/dd/yyyy hh:mi:ss AM')||'^~*~^'||','||
  865. '^~*~^'||SOURCE_LANG||'^~*~^'||','||
  866. '^~*~^'||SECURITY_GROUP_ID||'^~*~^'||','||
  867. '^~*~^'||VIEW_APPLICATION_ID||'^~*~^'
  868. FROM FND_LOOKUP_VALUES;
  869. SPOOL OFF
  870. */
  871. PROMPT *** Collecting DDL for view FND_USER_RESP_GROUPS_ALL
  872. PROMPT ======================================================================
  873. SET TERMOUT OFF
  874. set heading off;
  875. set echo off;
  876. Set pages 999;
  877. set long 90000;
  878. spool &&OUTPUT_PATH_ROOT.FND_USER_RESP_GROUPS_ALL.ddl
  879. SELECT dbms_metadata.get_ddl('VIEW','FND_USER_RESP_GROUPS_ALL','APPS') FROM dual;
  880. spool off;
  881. SET TERMOUT ON
  882. PROMPT *** Collecting DDL for view FND_USER_RESP_GROUPS
  883. PROMPT ======================================================================
  884. SET TERMOUT OFF
  885. set heading off;
  886. set echo off;
  887. Set pages 999;
  888. set long 90000;
  889. spool &&OUTPUT_PATH_ROOT.FND_USER_RESP_GROUPS.ddl
  890. SELECT dbms_metadata.get_ddl('VIEW','FND_USER_RESP_GROUPS','APPS') FROM dual;
  891. spool off;
  892. SET TERMOUT ON
  893. PROMPT *** Collecting DDL for view FND_USER_RESP_GROUPS_ALL
  894. PROMPT ======================================================================
  895. SET TERMOUT OFF
  896. set heading off;
  897. set echo off;
  898. Set pages 999;
  899. set long 90000;
  900. spool &&OUTPUT_PATH_ROOT.FND_USER_RESP_GROUPS_ALL.ddl
  901. SELECT dbms_metadata.get_ddl('VIEW','FND_USER_RESP_GROUPS_ALL','APPS') FROM dual;
  902. spool off;
  903. SET TERMOUT ON
  904. PROMPT *** Collecting DDL for view WF_ALL_USER_ROLE_ASSIGNMENTS
  905. PROMPT ======================================================================
  906. SET TERMOUT OFF
  907. set heading off;
  908. set echo off;
  909. Set pages 999;
  910. set long 90000;
  911. spool &&OUTPUT_PATH_ROOT.WF_ALL_USER_ROLE_ASSIGNMENTS.ddl
  912. SELECT dbms_metadata.get_ddl('VIEW','WF_ALL_USER_ROLE_ASSIGNMENTS','APPS') FROM dual;
  913. spool off;
  914. SET TERMOUT ON
  915. PROMPT *** Collecting DDL for view WF_USER_ROLE_ASSIGNMENTS_V
  916. PROMPT ======================================================================
  917. SET TERMOUT OFF
  918. set heading off;
  919. set echo off;
  920. Set pages 999;
  921. set long 90000;
  922. spool &&OUTPUT_PATH_ROOT.WF_USER_ROLE_ASSIGNMENTS_V.ddl
  923. SELECT dbms_metadata.get_ddl('VIEW','WF_USER_ROLE_ASSIGNMENTS_V','APPS') FROM dual;
  924. spool off;
  925. SET TERMOUT ON
  926. PROMPT *** Collecting DDL for view WF_USER_ROLES
  927. PROMPT ======================================================================
  928. SET TERMOUT OFF
  929. set heading off;
  930. set echo off;
  931. Set pages 999;
  932. set long 90000;
  933. spool &&OUTPUT_PATH_ROOT.WF_USER_ROLES.ddl
  934. SELECT dbms_metadata.get_ddl('VIEW','WF_USER_ROLES','APPS') FROM dual;
  935. spool off;
  936. SET TERMOUT ON
  937. PROMPT *** USAGE BASED
  938. PROMPT ======================================================================
  939. set pagesize 5000
  940. set linesize 500
  941. set lines 500
  942. set pages 50000
  943. set serveroutput on size 1000000
  944. show user
  945. set time off
  946. set timi off
  947. set termout on
  948. set heading off
  949. set feedback off
  950. set verify off
  951. col ts new_value ts
  952. SELECT TO_CHAR(SYSDATE,'yyyy-mm-dd__hh-mm-ss') as ts FROM dual;
  953. spool &&OUTPUT_PATH_ROOT.lst_usage_based.txt
  954. prompt ================Usage Based Query =====================================
  955. prompt =======================Disclaimer======================================
  956. prompt *** The Usage Based Query is a standard tool and is not customized
  957. prompt to only have certain scripts for a specific review. Therefore, only
  958. prompt script results that are relevant will be considered.
  959. prompt
  960. prompt *** Some version specific scripts will generate an error when ran in
  961. prompt a different version of E-Business Suite. This does not affect the
  962. prompt output and should be ignored.
  963. prompt =======================================================================
  964. COL EBS_version format a15
  965. COL HOST_NAME format a40 wrap
  966. COL Instance_name format a15
  967. prompt
  968. prompt
  969. prompt ==============
  970. prompt ***E-Business Suite Version
  971. col C0 new_val EBS_version
  972. SELECT release_name C0 FROM apps.fnd_product_groups;
  973. prompt
  974. prompt
  975. prompt ==============
  976. prompt ***Instance name and Host name
  977. -- Get host_name and instance_name
  978. col C1 new_val INSTANCE_NAME
  979. col C2 new_val HOST_NAME
  980. -- Oracle7
  981. SELECT name C1 FROM v$database;
  982. SELECT MIN(machine) C2 FROM v$session WHERE type = 'BACKGROUND';
  983. -- Oracle8 and higher
  984. SELECT instance_name C1, host_name C2 FROM v$instance;
  985. col C3 new_val GREP_PREFIX noprint
  986. --SELECT 'GREP'||'ME>>,&&HOST_NAME.,&&INSTANCE_NAME.,'||name as C3 FROM v$database;
  987. SELECT 'GREP'||'ME>>' as C3 FROM dual;
  988. prompt
  989. prompt
  990. prompt ==============
  991. prompt ***E-Business Suite Application Servers
  992. -- Get the list of E-Business Suite Application Servers related with the current EBS underlying database
  993. -- All versions
  994. SELECT 'NODE_NAME:'||node_name||'|HOST:'||host||'|DOMAIN:'||domain||'|WEBHOST:'||webhost FROM fnd_nodes WHERE node_name!='AUTHENTICATION';
  995. prompt
  996. prompt
  997. prompt ==============
  998. prompt ***Database Version
  999. SELECT BANNER FROM V$VERSION;
  1000. prompt
  1001. prompt
  1002. prompt ==============
  1003. prompt ***Collection Tool version
  1004. define USAGE_QUERY=CT_V
  1005. SELECT
  1006. '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1007. '&&CT_V' ||','
  1008. FROM
  1009. dual;
  1010. REM *************************************************************************************************
  1011. REM
  1012. REM Script Name: Advanced Pricing
  1013. REM
  1014. REM DESCRIPTION: This script shows the status of Advanced Pricing installation
  1015. REM
  1016. prompt
  1017. prompt
  1018. prompt ==============
  1019. prompt ***Advanced Pricing installation status
  1020. define USAGE_QUERY=ADVANCED_PRICING
  1021. SELECT
  1022. '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1023. qp_util.get_qp_status ||','
  1024. FROM
  1025. dual;
  1026. set time on
  1027. set timi on
  1028. REM *************************************************************************************************
  1029. REM
  1030. REM Script Name: Incentive Compensation
  1031. REM
  1032. REM DESCRIPTION: This script shows the number of Compensated Individuals,
  1033. REM according with COMPENSATED INDIVIDUAL metric.
  1034. REM
  1035. prompt
  1036. prompt
  1037. prompt ==============
  1038. prompt ***Total number of Compensated Individuals, measured for Incentive Compensation product
  1039. define USAGE_QUERY=INCENTIVE_COMPENSATION
  1040. SELECT
  1041. '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1042. COUNT(DISTINCT salesrep_id) ||','
  1043. FROM
  1044. cn_srp_plan_assigns_all
  1045. WHERE
  1046. end_date IS NULL OR end_date > SYSDATE;
  1047. REM *************************************************************************************************
  1048. REM
  1049. REM Script Name: iEXPENSES
  1050. REM
  1051. REM DESCRIPTION: This script counts the total number of expense
  1052. REM reports processed by Internet Expense for each date.
  1053. REM The default date format is DD-MON-YY.
  1054. REM
  1055. prompt
  1056. prompt
  1057. prompt ==============
  1058. prompt ***Total number of Expense Reports processed by Internet Expenses for each month (last 24 months of usage)
  1059. define USAGE_QUERY=EXPENSE_REPORTS
  1060. SELECT
  1061. '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1062. TO_CHAR(creation_date,'YYYY-MM') ||','||
  1063. COUNT(invoice_id) ||','
  1064. FROM
  1065. ap_invoices_all
  1066. WHERE
  1067. invoice_type_lookup_code='EXPENSE REPORT'
  1068. AND source='SelfService'
  1069. AND (SELECT max(creation_date) FROM ap_invoices_all
  1070. WHERE invoice_type_lookup_code='EXPENSE REPORT'
  1071. AND source='SelfService') <= 730 + creation_date
  1072. GROUP BY TO_CHAR(creation_date,'YYYY-MM')
  1073. ORDER BY TO_CHAR(creation_date,'YYYY-MM');
  1074. REM *************************************************************************************************
  1075. REM
  1076. REM Script Name: iPROCUREMENT
  1077. REM
  1078. REM DESCRIPTION: This script counts the total number of purchase line items processed by
  1079. REM iProcurement, for each year.
  1080. REM
  1081. prompt
  1082. prompt
  1083. prompt ==============
  1084. prompt ***Total number of purchase line items processed by iProcurement, for each month (last 24 months of usage)
  1085. define USAGE_QUERY=IPROCUREMENT
  1086. SELECT
  1087. '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1088. TO_CHAR(b.creation_date,'YYYY-MM') ||','||
  1089. COUNT(b.line_num) ||','
  1090. FROM
  1091. po_requisition_headers_all a,
  1092. po_requisition_lines_all b
  1093. WHERE
  1094. a.requisition_header_id=b.requisition_header_id
  1095. AND apps_source_code='POR' AND a.authorization_status='APPROVED'
  1096. AND (SELECT max(creation_date) FROM po_requisition_lines_all
  1097. WHERE apps_source_code='POR' AND authorization_status='APPROVED') <= 730 + b.creation_date
  1098. GROUP BY TO_CHAR(b.creation_date,'YYYY-MM')
  1099. ORDER BY TO_CHAR(b.creation_date,'YYYY-MM');
  1100. REM ****************************************************************************************************
  1101. REM
  1102. REM Script Name: PURCHINT
  1103. REM
  1104. REM DESCRIPTION: This script counts the total number of purchase line items processed by
  1105. REM the Purchasing Intelligence application.
  1106. REM
  1107. REM METRIC DEFINITION: Purchase Line: is defined as the total number of purchase line items processed by
  1108. REM the application during a 12 month period. Multiple purchase lines may be created
  1109. REM on either a requisition or purchase order or may be automatically generated by
  1110. REM other Oracle Application program.
  1111. REM For Purchasing Intelligence, Purchase Lines are counted as the line items on
  1112. REM purchase orders processed through this application. This does not include
  1113. REM communication on the same P.O.
  1114. REM
  1115. prompt
  1116. prompt
  1117. prompt ==============
  1118. prompt ***Total number of purchase line items processed by the Purchasing Intelligence application, during last 12 months, measured for version >= 11i
  1119. define USAGE_QUERY=PURCHINT_11i
  1120. SELECT
  1121. '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1122. COUNT(distinct INSTANCE_FK_KEY||po_line_id)
  1123. FROM
  1124. poa_edw_po_dist_f
  1125. WHERE
  1126. (SELECT max(creation_date) FROM poa_edw_po_dist_f) <= 365 + creation_date;
  1127. REM *************************************************************************************************
  1128. REM
  1129. REM Script Name: OTL
  1130. REM
  1131. REM DESCRIPTION: This script counts the total number of persons recorded by the Oracle Time & Labor system.
  1132. REM Persons include only active employees and contractors registered in HR.
  1133. REM
  1134. REM Person metric definition: For Time and Labor, a person is defined as an employee or contractor
  1135. REM whose time or labor (piece work) or absences are managed by the system
  1136. REM
  1137. prompt
  1138. prompt
  1139. prompt ==============
  1140. prompt ***Total number of active employees and contractors, recorded by the OTL system, measured for version > 11.5
  1141. define USAGE_QUERY=OTL
  1142. SELECT
  1143. '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1144. 'OTL active employees and contractors: '||
  1145. (SELECT COUNT(DISTINCT paf.party_id)
  1146. FROM hxc_timecard_summary ts, hxc_time_building_blocks tb,
  1147. --apply WHERE condition to have resource_id within active employees and contractors records set
  1148. (SELECT DISTINCT party_id, person_id
  1149. FROM per_all_people_f
  1150. WHERE
  1151. (upper(current_employee_flag)='Y' OR upper(current_npw_flag)='Y')
  1152. AND effective_start_date < SYSDATE
  1153. AND SYSDATE < effective_end_date
  1154. ) paf
  1155. WHERE ts.resource_id = tb.resource_id
  1156. AND tb.scope = 'TIMECARD'
  1157. AND ts.resource_id = paf.person_id) ||','
  1158. FROM dual;
  1159. REM *************************************************************************************************
  1160. REM
  1161. REM Script Name: OTA
  1162. REM
  1163. REM DESCRIPTION: This script counts the total number of trainees recorded by the system.
  1164. REM Trainees include internal trainees (active employees only) and external trainees.
  1165. REM This script counts also the cancelled enrollments.
  1166. REM If one person is doing a training and in the same time is sponsor (signs for other persons),
  1167. REM that person will be counted twice.
  1168. REM
  1169. prompt
  1170. prompt
  1171. prompt ==============
  1172. prompt ***Total number of trainees, both internal and external, recorded by the system
  1173. define USAGE_QUERY=OTA
  1174. SELECT
  1175. '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1176. 'Internal learners: '||
  1177. (SELECT COUNT(DISTINCT trainee) trainee
  1178. FROM
  1179. (SELECT DISTINCT NVL(b.delegate_person_id, b.sponsor_person_id) trainee
  1180. FROM ota.ota_delegate_bookings b
  1181. WHERE (b.delegate_person_id IS NOT NULL OR b.sponsor_person_id IS NOT NULL)
  1182. --apply WHERE condition to have delegate_person_id within active employees records set
  1183. AND b.delegate_person_id in
  1184. (SELECT distinct person_id employee
  1185. FROM per_all_people_f
  1186. WHERE
  1187. (upper(current_employee_flag)='Y' or upper(current_npw_flag)='Y' or upper(current_applicant_flag)='Y')
  1188. AND effective_start_date < SYSDATE AND SYSDATE < effective_end_date)
  1189. )) ||','||
  1190. ', External learners: '||
  1191. (SELECT COUNT(DISTINCT trainee) trainee
  1192. FROM
  1193. (SELECT DISTINCT NVL(b.delegate_contact_id, b.contact_id) trainee
  1194. FROM ota.ota_delegate_bookings b
  1195. WHERE (b.delegate_contact_id IS NOT NULL OR b.contact_id IS NOT NULL)
  1196. )) ||','
  1197. FROM dual;
  1198. REM *************************************************************************************************
  1199. REM
  1200. REM Script Name: HR Employee
  1201. REM
  1202. REM DESCRIPTION: This script counts the number of licenses needed for the Employee
  1203. REM metric. The first section SELECTs all employees, while the seconds
  1204. REM counts all contractors. Counting distinct Party_ID eliminates
  1205. REM double counting the same person across different Business group.
  1206. REM
  1207. REM EMPLOYEE metric: is defined as all of your full-time, part-time, temporary employees
  1208. REM and all of your agents, contractors and consultants. The quantity of the
  1209. REM licenses required is determined by the number of Employees and not the actual
  1210. REM number of users. In addition, if you elect to outsource any business function(s)
  1211. REM to another company, all of the company's full-time, part-time,temporary
  1212. REM employees and agents, contractors and consultants that are providing the
  1213. REM outsourcing services for you must be counted for the purposes of determining
  1214. REM the number of Employees.
  1215. REM
  1216. prompt
  1217. prompt
  1218. prompt ==============
  1219. prompt ***Total number of employees, measured for version 10.7
  1220. define USAGE_QUERY=HR_E_107
  1221. SELECT
  1222. '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1223. COUNT(DISTINCT person_id) ||','
  1224. FROM
  1225. PER_ALL_PEOPLE_F P
  1226. WHERE
  1227. P.EFFECTIVE_START_DATE < SYSDATE AND SYSDATE < P.EFFECTIVE_END_DATE
  1228. AND current_employee_flag = 'Y';
  1229. prompt
  1230. prompt
  1231. prompt ==============
  1232. prompt ***Total number of employees, measured for version 11.0 AND 11i(< 11.5.7)
  1233. define USAGE_QUERY=HR_E_11.0_and_11i(<11.5.7)
  1234. SELECT
  1235. '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1236. COUNT(*) ||','
  1237. FROM
  1238. (SELECT DISTINCT party_id
  1239. FROM PER_ALL_PEOPLE_F P
  1240. WHERE P.EFFECTIVE_START_DATE < SYSDATE AND SYSDATE < P.EFFECTIVE_END_DATE
  1241. AND current_employee_flag = 'Y'
  1242. UNION
  1243. SELECT distinct p.party_id
  1244. FROM per_all_people_f p,
  1245. per_contracts_f c,
  1246. per_person_types ppt
  1247. WHERE c.effective_start_date < SYSDATE AND SYSDATE < c.effective_end_date
  1248. AND p.effective_start_date < SYSDATE AND SYSDATE < p.effective_end_date
  1249. AND c.person_id = p.person_id
  1250. AND p.person_type_id = ppt.person_type_id
  1251. AND p.business_group_id = ppt.business_group_id
  1252. AND ppt.system_person_type = 'OTHER');
  1253. prompt
  1254. prompt
  1255. prompt ==============
  1256. prompt ***Total number of employees, measured for version >= 11.5.7 including R12
  1257. define USAGE_QUERY=HR_E_>=11.5.7_including_R12
  1258. SELECT
  1259. '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1260. COUNT(DISTINCT party_id) ||','
  1261. FROM
  1262. PER_ALL_PEOPLE_F P
  1263. WHERE
  1264. P.EFFECTIVE_START_DATE < SYSDATE AND SYSDATE < P.EFFECTIVE_END_DATE
  1265. AND (current_npw_flag ='Y' OR current_employee_flag = 'Y');
  1266. REM *************************************************************************************************
  1267. REM
  1268. REM Script Name: HR Ex_Emp_WithBenefits
  1269. REM
  1270. REM DESCRIPTION: HR_Person consists of two scripts, the first one counts the number of
  1271. REM employees (and contractors), while the second (below here) counts all
  1272. REM ex_employees with active benefits.
  1273. REM
  1274. prompt
  1275. prompt
  1276. prompt ==============
  1277. prompt ***Total number of ex-employees with active benefits in the system, measured for version 11.0, 11i and 12
  1278. define USAGE_QUERY=HR_P_11.0_11i_and_12
  1279. SELECT
  1280. '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1281. COUNT(DISTINCT PARTY_ID) ||','
  1282. FROM
  1283. per_all_people_f p
  1284. WHERE
  1285. p.employee_number IS NOT NULL
  1286. AND p.effective_start_date < SYSDATE AND SYSDATE < p.effective_end_date
  1287. AND p.current_employee_flag IS NULL
  1288. AND EXISTS
  1289. (SELECT NULL
  1290. FROM ben_prtt_enrt_rslt_f ben
  1291. WHERE ben.effective_start_date < SYSDATE AND SYSDATE < ben.effective_end_date
  1292. ---- check for live coverage
  1293. AND ((ben.enrt_cvg_strt_dt <= SYSDATE) AND (SYSDATE <= ben.enrt_cvg_thru_dt))
  1294. AND ben.prtt_enrt_rslt_stat_cd IS NULL
  1295. AND ben.ENRT_CVG_THRU_DT >= ben.ENRT_CVG_STRT_DT
  1296. AND ben.person_id = p.person_id
  1297. AND ben.business_group_id = p.business_group_id
  1298. AND ben.enrt_cvg_strt_dt <= ben.effective_end_date
  1299. AND ben.enrt_cvg_thru_dt >= ben.effective_start_date);
  1300. REM *************************************************************************************************
  1301. REM
  1302. REM Script Name: Old HR User Types
  1303. REM
  1304. REM DESCRIPTION: This script displays the different system person types and user person
  1305. REM types in the customer's environment and the number of employees under
  1306. REM each type.
  1307. REM
  1308. prompt
  1309. prompt
  1310. prompt ==============
  1311. prompt ***Total number of persons per each system_person_type and user_person_type, measured for version 11i(11.5.x) to 12. Old HR Types script
  1312. define USAGE_QUERY=OLD_HR_TYPES
  1313. SELECT '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1314. spt ||','||
  1315. upt ||','||
  1316. COUNT(DISTINCT party_id) ||','
  1317. FROM
  1318. (SELECT party_id,
  1319. TRIM(HR_PERSON_TYPE_USAGE_INFO.GET_USER_PERSON_TYPE(SYSDATE,paf.person_id)) upt,
  1320. TRIM(HR_PERSON_TYPE_USAGE_INFO.GETSYSTEMPERSONTYPE(paf.person_type_id)) spt
  1321. FROM per_all_people_f paf
  1322. WHERE effective_start_date < SYSDATE AND SYSDATE < effective_end_date)
  1323. GROUP BY
  1324. spt,upt
  1325. ORDER BY
  1326. spt,upt;
  1327. prompt
  1328. prompt
  1329. prompt ==============
  1330. prompt ***HR User Types - Total number of persons per each system_person_type and user_person_type, measured for version 11i(11.5.x) to 12
  1331. define USAGE_QUERY=HR_TYPES_11i(11.5.x)_to_12
  1332. SELECT '&&GREP_PREFIX.,&USAGE_QUERY.,' ||
  1333. spt ||','||
  1334. upt ||
  1335. ' - Flag: '|| cw_emp_flag ||','||
  1336. dist_count_party_id ||','
  1337. FROM
  1338. (SELECT
  1339. spt,
  1340. upt,
  1341. NVL(cw_emp_flag,'NULL') cw_emp_flag,
  1342. COUNT(DISTINCT party_id) dist_count_party_id
  1343. FROM (SELECT party_id,
  1344. TRIM(HR_PERSON_TYPE_USAGE_INFO.GET_USER_PERSON_TYPE(SYSDATE,person_id)) upt,
  1345. TRIM(HR_PERSON_TYPE_USAGE_INFO.GETSYSTEMPERSONTYPE(person_type_id)) spt,
  1346. DECODE(DECODE(current_npw_flag, 'Y','C',NULL),NULL,DECODE(current_employee_flag, 'Y','E',NULL),DECODE(current_npw_flag, 'Y','C',NULL)) cw_emp_flag,
  1347. current_npw_flag contingent_worker_flag,
  1348. current_employee_flag employee_flag
  1349. FROM (SELECT paf.party_id,
  1350. person_id,
  1351. person_type_id,
  1352. current_npw_flag,
  1353. current_employee_flag,
  1354. row_number() over(PARTITION BY party_id ORDER BY person_id DESC) r
  1355. FROM per_all_people_f paf
  1356. WHERE effective_start_date < SYSDATE
  1357. AND SYSDATE < effective_end_date
  1358. AND (current_npw_flag ='Y' OR current_employee_flag = 'Y'))
  1359. WHERE r = 1)
  1360. GROUP BY
  1361. spt,upt,NVL(cw_emp_flag,'NULL')
  1362. UNION ALL
  1363. SELECT
  1364. spt,
  1365. upt,
  1366. NVL(cw_emp_flag,'NULL') cw_emp_flag,
  1367. COUNT(DISTINCT party_id) dist_count_party_id
  1368. FROM (SELECT party_id,
  1369. TRIM(HR_PERSON_TYPE_USAGE_INFO.GET_USER_PERSON_TYPE(SYSDATE,person_id)) upt,
  1370. TRIM(HR_PERSON_TYPE_USAGE_INFO.GETSYSTEMPERSONTYPE(person_type_id)) spt,
  1371. DECODE(DECODE(current_npw_flag, 'Y','C',NULL),NULL,DECODE(current_employee_flag, 'Y','E',NULL),DECODE(current_npw_flag, 'Y','C',NULL)) cw_emp_flag,
  1372. current_npw_flag contingent_worker_flag,
  1373. current_employee_flag employee_flag
  1374. FROM (SELECT paf.party_id,
  1375. person_id,
  1376. person_type_id,
  1377. current_npw_flag,
  1378. current_employee_flag,
  1379. row_number() over(PARTITION BY party_id ORDER BY person_id DESC) r
  1380. FROM per_all_people_f paf
  1381. WHERE effective_start_date < SYSDATE
  1382. AND SYSDATE < effective_end_date)
  1383. WHERE r = 1
  1384. AND (current_npw_flag IS NULL AND current_employee_flag IS NULL)
  1385. ANd party_id not in (SELECT party_id
  1386. FROM (SELECT paf.party_id,
  1387. person_id,
  1388. person_type_id,
  1389. current_npw_flag,
  1390. current_employee_flag,
  1391. row_number() over(PARTITION BY party_id ORDER BY person_id DESC) r
  1392. FROM per_all_people_f paf
  1393. WHERE effective_start_date < SYSDATE
  1394. AND SYSDATE < effective_end_date
  1395. AND (current_npw_flag = 'Y' OR current_employee_flag = 'Y'))
  1396. WHERE r = 1))
  1397. GROUP BY spt,upt,NVL(cw_emp_flag,'NULL') ORDER BY spt,upt,cw_emp_flag);
  1398. REM *************************************************************************************************
  1399. REM
  1400. REM Script Name: HR Foundation functionality checks
  1401. REM
  1402. PROMPT
  1403. PROMPT
  1404. PROMPT ================================
  1405. PROMPT ***People with Datetrack history
  1406. SELECT 'DATETRACK_CNT,' || business_group_id ||','|| cnt ||',' from
  1407. (select count(*) cnt
  1408. , business_group_id
  1409. from
  1410. (select count(*)
  1411. , person_id
  1412. , business_group_id
  1413. from per_all_people_f
  1414. group by person_id,business_group_id
  1415. having count(*) > 1)
  1416. group by business_group_id);
  1417. PROMPT
  1418. PROMPT
  1419. PROMPT ===============================
  1420. PROMPT ***People with Legislative Data
  1421. SELECT 'LEGISLATIVE_CNT,' || per_information_category ||',' ||business_group_id ||','|| cnt ||',' from
  1422. (select per_information_category
  1423. , business_group_id
  1424. , count(*) cnt
  1425. from per_all_people_f p
  1426. where (PER_INFORMATION1 is not null or
  1427. PER_INFORMATION2 is not null or
  1428. PER_INFORMATION3 is not null or
  1429. PER_INFORMATION4 is not null or
  1430. PER_INFORMATION5 is not null or
  1431. PER_INFORMATION6 is not null or
  1432. PER_INFORMATION7 is not null or
  1433. PER_INFORMATION8 is not null or
  1434. PER_INFORMATION9 is not null or
  1435. PER_INFORMATION10 is not null or
  1436. PER_INFORMATION11 is not null or
  1437. PER_INFORMATION12 is not null or
  1438. PER_INFORMATION13 is not null or
  1439. PER_INFORMATION14 is not null or
  1440. PER_INFORMATION15 is not null or
  1441. PER_INFORMATION16 is not null or
  1442. PER_INFORMATION17 is not null or
  1443. PER_INFORMATION18 is not null or
  1444. PER_INFORMATION19 is not null or
  1445. PER_INFORMATION20 is not null or
  1446. PER_INFORMATION21 is not null or
  1447. PER_INFORMATION22 is not null or
  1448. PER_INFORMATION23 is not null or
  1449. PER_INFORMATION24 is not null or
  1450. PER_INFORMATION25 is not null or
  1451. PER_INFORMATION26 is not null or
  1452. PER_INFORMATION27 is not null or
  1453. PER_INFORMATION28 is not null or
  1454. PER_INFORMATION29 is not null or
  1455. PER_INFORMATION30 is not null)
  1456. group by per_information_category,business_group_id);
  1457. PROMPT
  1458. PROMPT
  1459. PROMPT ======================================
  1460. PROMPT ***Human Resources installation status
  1461. SELECT DECODE(status,'S','Shared HR Installed','Full HR')
  1462. FROM fnd_product_installations WHERE application_id=800;
  1463. PROMPT
  1464. PROMPT
  1465. PROMPT =========================================================
  1466. PROMPT ***Support for Applicants or Contacts in HR (user person)
  1467. SELECT DISTINCT hr_person_type_usage_info.get_user_person_type (sysdate,person_id)
  1468. FROM per_all_people_f
  1469. WHERE sysdate BETWEEN effective_start_date AND effective_end_date
  1470. AND hr_person_type_usage_info.getsystempersontype (person_type_id) = 'OTHER';
  1471. PROMPT
  1472. PROMPT
  1473. PROMPT ===============================================
  1474. PROMPT ***Support for Applicants in HR (system person)
  1475. SELECT DISTINCT hr_person_type_usage_info.getsystempersontype (person_type_id)
  1476. FROM per_all_people_f
  1477. WHERE sysdate BETWEEN effective_start_date AND effective_end_date
  1478. AND hr_person_type_usage_info.getsystempersontype (person_type_id) LIKE '%APL%';
  1479. PROMPT
  1480. PROMPT
  1481. PROMPT ========================================
  1482. PROMPT ***Country specific address layout check
  1483. SELECT DISTINCT style
  1484. FROM per_addresses
  1485. WHERE (style NOT LIKE '%GLB' AND style <> 'GENERIC');
  1486. PROMPT
  1487. PROMPT
  1488. PROMPT =========================================
  1489. PROMPT ***Datetrack - Profile Option Value check
  1490. SELECT DISTINCT profile_option_name ,a.profile_option_value
  1491. FROM fnd_profile_option_values a, fnd_profile_options b
  1492. WHERE a.profile_option_id = b.profile_option_id
  1493. AND b.profile_option_name IN ('DATETRACK:ENABLED','PER_ENABLE_DTW4');
  1494. PROMPT
  1495. PROMPT
  1496. PROMPT =============================================
  1497. PROMPT ***Datetrack - Legislation installation check
  1498. SELECT application_short_name,legislation_code
  1499. FROM hr_legislation_installations
  1500. WHERE status = 'I';
  1501. prompt ==============
  1502. SET VERIFY ON
  1503. SPOOL OFF
  1504. HOST cat &&OUTPUT_PATH_ROOT.export_log_*.txt > &&OUTPUT_PATH_ROOT.export_log.txt
  1505. HOST rm &&OUTPUT_PATH_ROOT.export_log_*.txt