{"id":1934,"date":"2020-05-04T15:38:04","date_gmt":"2020-05-04T13:38:04","guid":{"rendered":"http:\/\/www.ludovicocaldara.net\/dba\/?p=1934"},"modified":"2020-08-18T15:57:34","modified_gmt":"2020-08-18T13:57:34","slug":"catpcat-19c","status":"publish","type":"post","link":"https:\/\/www.ludovicocaldara.net\/dba\/catpcat-19c\/","title":{"rendered":"Parallel Oracle Catalog\/Catproc creation with catpcat.sql"},"content":{"rendered":"<p>With Oracle 19c, Oracle has released a new script, annotated for parallel execution, to create the CATALOG and CATPROC in parallel at instance creation.<\/p>\n<p>I have a customer who is in the process of migrating massively to Multitenant using many CDBs, so I decided to give it a try to check how much time they could save for the CDB creations.<\/p>\n<p>I have run the tests on my laptop, on a VirtualBox VM with 4 vCPUs.<\/p>\n<p><strong>Test 1: catalog.sql + catproc.sql<\/strong><\/p>\n<p>In this test, I use the classic way (this is also the case when DBCA creates the scripts):<\/p>\n<pre class=\"lang:sh decode:true\">${ORACLE_HOME}\/perl\/bin\/perl ${ORACLE_HOME}\/rdbms\/admin\/catcon.pl -n 1 -l \/u01\/app\/oracle\/admin\/CDB1\/create -v \\\r\n  -b catalog  -U \"SYS\"\/\"manager\" ${ORACLE_HOME}\/rdbms\/admin\/catalog.sql\r\n${ORACLE_HOME}\/perl\/bin\/perl ${ORACLE_HOME}\/rdbms\/admin\/catcon.pl -n 1 -l \/u01\/app\/oracle\/admin\/CDB1\/create -v \\\r\n  -b catproc  -U \"SYS\"\/\"manager\" ${ORACLE_HOME}\/rdbms\/admin\/catproc.sql\r\n<\/pre>\n<p>The <strong>catalog<\/strong> is created first on CDB$ROOT and PDB$SEED. Then the <strong>catproc<\/strong> is created.<\/p>\n<p>Looking at the very first occurrence of BEGIN_RUNNING (start of catalog for CDB$ROOT) and the very last of END_RUNNING in the log (end of catproc in PDB$SEED), I can see that it took ~ 44 minutes to complete:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true\">BEGIN_RUNNING\r\n--------------------------------------------------------------------------------\r\n==== @\/u01\/app\/oracle\/product\/db_19_6_0\/rdbms\/admin\/catalog.sql\r\nContainer:CDB$ROOT Id:1 20-05-04 11:30:54 Proc:0 ====\r\n\r\nEND_RUNNING\r\n--------------------------------------------------------------------------------\r\n==== @\/u01\/app\/oracle\/product\/db_19_6_0\/rdbms\/admin\/catproc.sql\r\nContainer:PDB$SEED Id:2 20-05-04 12:15:00 Proc:0 ====\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Test 2: catpcat.sql<\/strong><\/p>\n<p>In this test, I use the new catpcat.sql using catctl.pl, with a parallelism of 4 processes:<\/p>\n<pre class=\"lang:sh decode:true\">${ORACLE_HOME}\/perl\/bin\/perl ${ORACLE_HOME}\/rdbms\/admin\/catctl.pl -n 4 -c 'CDB$ROOT PDB$SEED' \\\r\n  -l \/u01\/app\/oracle\/admin\/CDB2\/create -d ${ORACLE_HOME}\/rdbms\/admin catpcat.sql<\/pre>\n<p>This creates <strong>catalog<\/strong> and <strong>catproc<\/strong> first on CDB$ROOT, than creates them on PDB$SEED. So, same steps but in different orders.<\/p>\n<p>By running vmstat in the background, I noticed during the run that most of the time the creation was running serially, and when there was some parallelism, it was short and compensated by a lot of process synchronizations (waits, sleeps) done by the catctl.pl.<\/p>\n<p>At the end, the process took ~ 45 minutes to complete.<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true\">BEGIN_RUNNING\r\n--------------------------------------------------------------------------------\r\n==== @\/u01\/app\/oracle\/product\/db_19_6_0\/rdbms\/admin\/catpcatstr.sql\r\nContainer:CDB$ROOT Id:1 20-05-04 01:53:22 Proc:0 ====\r\n...\r\nEND_RUNNING\r\n--------------------------------------------------------------------------------\r\n==== @\/u01\/app\/oracle\/admin\/CDB2\/create\/catpcatpdb_seed20.0362629753546919.sql\r\nContainer:PDB$SEED Id:2 20-05-04 02:38:37 Proc:0 ====<\/pre>\n<p>So the answer is no: it is not faster to run catpcat.sql with parallel degree 4 compared to running catalog.sql and catproc.sql serially.<\/p>\n<p>HTH<\/p>\n<p>&#8212;<\/p>\n<p>Ludo<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Oracle 19c, Oracle has released a new script, annotated for parallel execution, to create the CATALOG and CATPROC in parallel at instance creation. I have a customer who is in the process of migrating massively to Multitenant using many &hellip; <a href=\"https:\/\/www.ludovicocaldara.net\/dba\/catpcat-19c\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[321,326,3,315,330,132,1],"tags":[],"class_list":["post-1934","post","type-post","status-publish","format-standard","hentry","category-aced","category-oracle","category-oracledb","category-oracle-database-19c","category-oracle-inst-upg","category-triblog","category-uncategorized"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/comments?post=1934"}],"version-history":[{"count":3,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1934\/revisions"}],"predecessor-version":[{"id":1937,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1934\/revisions\/1937"}],"wp:attachment":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/media?parent=1934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/categories?post=1934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/tags?post=1934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}