EBSCollection.sql 70 KB

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