{"id":296,"date":"2008-01-22T09:20:09","date_gmt":"2008-01-22T13:20:09","guid":{"rendered":"http:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/"},"modified":"2008-01-22T09:24:14","modified_gmt":"2008-01-22T13:24:14","slug":"collection-of-queriesscripts","status":"publish","type":"post","link":"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/","title":{"rendered":"Collection of Queries\/Scripts"},"content":{"rendered":"<p>1)How to check if the partitions of a table are set to LOGGING<\/p>\n<p>select partition_name, logging<br \/>\nfrom dba_tab_partitions<br \/>\nwhere table_name=&#8217;WF_LOCAL_ROLES&#8217;;<\/p>\n<p>2)How to Correct Session Cookie Name.<br \/>\na)select session_cookie_name from icx_parameters;<\/p>\n<p>b)update icx_parameters set session_cookie_name = &#8216;&lt;hostname_sid&gt;&#8217;;<\/p>\n<p>c)select session_cookie_name from icx_parameters;<\/p>\n<p>3) How to find database SID from a Concurrent request.<\/p>\n<p>column process heading &#8220;FNDLIBR PID&#8221;<br \/>\nSELECT a.request_id, d.sid, d.serial# ,d.osuser,d.process , c.SPID<br \/>\nFROM apps.fnd_concurrent_requests a,<br \/>\napps.fnd_concurrent_processes b,<br \/>\nv$process c,<br \/>\nv$session d<br \/>\nWHERE a.controlling_manager = b.concurrent_process_id<br \/>\nAND c.pid = b.oracle_process_id<br \/>\nAND b.session_id=d.audsid<br \/>\nAND a.request_id = &amp;Request_ID<br \/>\nAND a.phase_code = &#8216;R&#8217;;<br \/>\nYou need your concurrent request ID as an input.<br \/>\nc.SPID= is the operating system process id<br \/>\nd.sid= is the Oracle process id<\/p>\n<p>4) How to check which object is corrupted.<\/p>\n<p>SELECT tablespace_name, segment_type, owner, segment_name<br \/>\nFROM dba_extents<br \/>\nWHERE file_id = 64 and 1 between block_id AND block_id + blocks-1;<\/p>\n<p>5) How to check whether the product is install,shared and Not installed in Apps.<\/p>\n<p>select t.application_name<br \/>\n, t.application_id<br \/>\n, i.patch_level<br \/>\n, decode(i.status,&#8217;I&#8217;,&#8217;Fully Installed&#8217;,<br \/>\n&#8216;N&#8217;,&#8217;Not Installed&#8217;,&#8217;S&#8217;,&#8217;Shared&#8217;,&#8217;Undetermined&#8217;) status<br \/>\nfrom fnd_product_installations i<br \/>\n, fnd_application_vl t<br \/>\nwhere i.application_id = t.application_id<br \/>\norder by t.application_id;<\/p>\n<p>6) How to check access level when label security feature is installed.<\/p>\n<p>col\u00a0 USER_NAME format a15<br \/>\ncol POLICY_NAME format a15<br \/>\ncol USER_PRIVILEGES format a15<br \/>\ncol USER_LABELS format a20<br \/>\nselect USER_NAME,POLICY_NAME,USER_PRIVILEGES,USER_LABELS from dba_sa_users<br \/>\n\u00a0where USER_NAME=&#8217;APPS&#8217;;<\/p>\n<p>7) How to find out Summary of Concurrent requests.<\/p>\n<p>SELECT<br \/>\nrequest_id, SUBSTR(requestor,1,25), SUBSTR(program,1,50), SUBSTR(user_concurrent_program_name,1,100),<br \/>\nTO_CHAR(actual_start_date,&#8217;dd\/mm\/yy :hh24:mi&#8217;) start_date,<br \/>\nTO_CHAR(actual_completion_date,&#8217;dd\/mm\/yy :hh24:mi&#8217;) completion_date,<br \/>\nFLOOR((ACTUAL_COMPLETION_DATE- ACTUAL_START_DATE)*24) &#8220;in Hours&#8221;,<br \/>\n(((ACTUAL_COMPLETION_DATE- ACTUAL_START_DATE)*24)-(FLOOR((ACTUAL_COMPLETION_DATE- ACTUAL_START_DATE)*24)))*60 &#8220;In_Min&#8221;<br \/>\n&#8211;requestor, program, user_concurrent_program_name<br \/>\nFROM fnd_conc_req_summary_v<br \/>\nWHERE (ACTUAL_COMPLETION_DATE- ACTUAL_START_DATE)*24*60 &gt;10<\/p>\n<p>8 ) How to find out Package Header.<\/p>\n<p>select name,text from dba_source where text like &#8216;%Header: %&#8217;<br \/>\nand owner = &#8216;APPS&#8217; and name = &#8216;INVALID_OBJECT_NAME&#8217;;<\/p>\n<p>9) How to find out version of a package.<\/p>\n<p>select text from dba_source<br \/>\nwhere line=2<br \/>\nand name=&#8217;AP_IMPORT_INVOICES_PKG&#8217;;<\/p>\n<p>10) How to find out which request is handle by which concurrent queue.<\/p>\n<p>a) First find out short_name of a program and then pass it as parameter to below query.<\/p>\n<p>b) The below query will give you output<br \/>\n\u00a0I &#8211; Included\u00a0 &#8211; Included in new concurrent queue<br \/>\n\u00a0E &#8211; excluded from Standard Manager\u00a0<\/p>\n<p>This way you know now this running program (concurrent request) is handled by new manager and not part of standard manager.<\/p>\n<p>SELECT A.INCLUDE_FLAG, A.QUEUE_APPLICATION_ID, C.USER_CONCURRENT_QUEUE_NAME,<br \/>\n\u00a0B.CONCURRENT_PROGRAM_NAME<br \/>\nFROM APPLSYS.FND_CONCURRENT_QUEUE_CONTENT A, APPLSYS.FND_CONCURRENT_PROGRAMS B, APPS.FND_CONCURRENT_QUEUES_VL C<br \/>\nWHERE type_id = b.concurrent_program_id and b.concurrent_program_name = &#8216;&amp;SHORT_NAME&#8217; and c.concurrent_queue_id = a.concurrent_queue_id<br \/>\n\/<\/p>\n<p>11) How to backup the defination of a View before droping a view.<\/p>\n<p>\u00a0select dbms_metadata.get_ddl(&#8216;VIEW&#8217;,&#8217;RG_View&#8217;,&#8217;APPS&#8217;) from dual;<\/p>\n<p>I will update some more scripts in my next post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1)How to check if the partitions of a table are set to LOGGING select partition_name, logging from dba_tab_partitions where table_name=&#8217;WF_LOCAL_ROLES&#8217;; [&hellip;]<\/p>\n","protected":false},"author":115,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[172],"tags":[],"class_list":["post-296","post","type-post","status-publish","format-standard","hentry","category-scripts"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Collection of Queries\/Scripts -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Collection of Queries\/Scripts -\" \/>\n<meta property=\"og:description\" content=\"1)How to check if the partitions of a table are set to LOGGING select partition_name, logging from dba_tab_partitions where table_name=&#8217;WF_LOCAL_ROLES&#8217;; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/\" \/>\n<meta property=\"article:published_time\" content=\"2008-01-22T13:20:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2008-01-22T13:24:14+00:00\" \/>\n<meta name=\"author\" content=\"Masroof Ahmad\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Masroof Ahmad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/\",\"url\":\"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/\",\"name\":\"Collection of Queries\/Scripts -\",\"isPartOf\":{\"@id\":\"https:\/\/onlineappsdba.com\/#website\"},\"datePublished\":\"2008-01-22T13:20:09+00:00\",\"dateModified\":\"2008-01-22T13:24:14+00:00\",\"author\":{\"@id\":\"https:\/\/onlineappsdba.com\/#\/schema\/person\/909a876ed58d400faf82caf81d61bfdb\"},\"breadcrumb\":{\"@id\":\"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/onlineappsdba.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Collection of Queries\/Scripts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/onlineappsdba.com\/#website\",\"url\":\"https:\/\/onlineappsdba.com\/\",\"name\":\"\",\"description\":\"Oracle Implementation &amp; Training Experts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/onlineappsdba.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/onlineappsdba.com\/#\/schema\/person\/909a876ed58d400faf82caf81d61bfdb\",\"name\":\"Masroof Ahmad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/onlineappsdba.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/10f9db7bdbbd7f9ccfbe9b2d208e5978fc28315e9c704383e639a926ea0fce5f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/10f9db7bdbbd7f9ccfbe9b2d208e5978fc28315e9c704383e639a926ea0fce5f?s=96&d=mm&r=g\",\"caption\":\"Masroof Ahmad\"},\"url\":\"https:\/\/onlineappsdba.com\/index.php\/author\/masroof\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Collection of Queries\/Scripts -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/","og_locale":"en_US","og_type":"article","og_title":"Collection of Queries\/Scripts -","og_description":"1)How to check if the partitions of a table are set to LOGGING select partition_name, logging from dba_tab_partitions where table_name=&#8217;WF_LOCAL_ROLES&#8217;; [&hellip;]","og_url":"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/","article_published_time":"2008-01-22T13:20:09+00:00","article_modified_time":"2008-01-22T13:24:14+00:00","author":"Masroof Ahmad","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Masroof Ahmad","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/","url":"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/","name":"Collection of Queries\/Scripts -","isPartOf":{"@id":"https:\/\/onlineappsdba.com\/#website"},"datePublished":"2008-01-22T13:20:09+00:00","dateModified":"2008-01-22T13:24:14+00:00","author":{"@id":"https:\/\/onlineappsdba.com\/#\/schema\/person\/909a876ed58d400faf82caf81d61bfdb"},"breadcrumb":{"@id":"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/22\/collection-of-queriesscripts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/onlineappsdba.com\/"},{"@type":"ListItem","position":2,"name":"Collection of Queries\/Scripts"}]},{"@type":"WebSite","@id":"https:\/\/onlineappsdba.com\/#website","url":"https:\/\/onlineappsdba.com\/","name":"","description":"Oracle Implementation &amp; Training Experts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/onlineappsdba.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/onlineappsdba.com\/#\/schema\/person\/909a876ed58d400faf82caf81d61bfdb","name":"Masroof Ahmad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/onlineappsdba.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/10f9db7bdbbd7f9ccfbe9b2d208e5978fc28315e9c704383e639a926ea0fce5f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/10f9db7bdbbd7f9ccfbe9b2d208e5978fc28315e9c704383e639a926ea0fce5f?s=96&d=mm&r=g","caption":"Masroof Ahmad"},"url":"https:\/\/onlineappsdba.com\/index.php\/author\/masroof\/"}]}},"_links":{"self":[{"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/posts\/296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/users\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/comments?post=296"}],"version-history":[{"count":0,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/posts\/296\/revisions"}],"wp:attachment":[{"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/media?parent=296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/categories?post=296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/tags?post=296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}