Advertisement
Guest User

Step by step applying 32k script on CDB and PDBs

a guest
Aug 6th, 2022
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. ==> To get here, I followed the previous URL (using XE 18c) - first I did the change in the CDB$ROOT container :
  2.  
  3. SQL> show parameter string_size
  4.  
  5. NAME TYPE VALUE
  6. ------------------------------------ ----------- ------------------------------
  7. max_string_size string STANDARD
  8.  
  9. SQL> alter system set max_string_size=EXTENDED scope=spfile;
  10.  
  11. System altered.
  12.  
  13. SQL> shutdown immediate;
  14. Database closed.
  15. Database dismounted.
  16. ORACLE instance shut down.
  17. SQL> startup upgrade;
  18. ORACLE instance started.
  19.  
  20. ... lot of messages ...
  21. Database mounted.
  22. Database opened.
  23.  
  24. ==> Now I run the utl32k script IN this container :
  25.  
  26. SQL> @?/rdbms/admin/utl32k.sql
  27.  
  28. Session altered.
  29.  
  30. DOC>#######################################################################
  31. DOC>#######################################################################
  32. DOC> The following statement will cause an "ORA-01722: invalid number"
  33. DOC> error if the database has not been opened for UPGRADE.
  34. DOC>
  35. DOC> Perform a "SHUTDOWN ABORT" and
  36. DOC> restart using UPGRADE.
  37. DOC>#######################################################################
  38. DOC>#######################################################################
  39. DOC>#
  40.  
  41. ... lots of messages, the important thing is to check if NO errors ORA-xxx happens ......
  42. Package altered.
  43.  
  44. Package altered.
  45.  
  46. ==>> restart of the CDB :
  47.  
  48.  
  49. SQL> shutdown immediate;
  50. Database closed.
  51. Database dismounted.
  52. ORACLE instance shut down.
  53. SQL> startup
  54. ORACLE instance started.
  55.  
  56. ==>> see the changed parameter :
  57.  
  58. SQL> show parameter string_size
  59.  
  60. NAME TYPE VALUE
  61. ------------------------------------ ----------- ------------------------------
  62. max_string_size string EXTENDED
  63.  
  64. ==> We are done with CDB but not with the whole task : I have the PDBs to be changed...
  65.  
  66. SQL> show pdbs
  67.  
  68. CON_ID CON_NAME OPEN MODE RESTRICTED
  69. ------ ---------- ---------- ----------
  70. 2 PDB$SEED MOUNTED
  71. 3 XEPDB1 MOUNTED
  72. 4 DB_APP MOUNTED
  73.  
  74. ==> Solution: we have to run utl32k.sql in each PDB. For PDB$SEED let's use the well known “_oracle_script”-trick:
  75.  
  76. SQL> alter session set "_oracle_script"=true;
  77. Session altered.
  78.  
  79. SQL> alter pluggable database pdb$seed open upgrade;
  80. Pluggable database altered.
  81.  
  82. SQL> alter session set container=PDB$SEED;
  83. Session altered.
  84.  
  85. SQL> @?/rdbms/admin/utl32k
  86.  
  87. Session altered.
  88.  
  89. .. again, lot of messages, no ORA-xxx erros ...
  90.  
  91. SQL> alter session set container=cdb$root;
  92.  
  93. Session altered.
  94.  
  95. SQL> alter pluggable database pdb$seed close;
  96.  
  97. Pluggable database altered.
  98.  
  99. SQL> alter pluggable database pdb$seed open read only;
  100.  
  101. Pluggable database altered.
  102.  
  103. ==> The other ones will be done normally :
  104.  
  105. SQL> alter pluggable database XEPDB1,DB_APP open upgrade;
  106. Pluggable database altered.
  107.  
  108. SQL> alter session set container=XEPDB1;
  109. Session altered.
  110.  
  111. SQL> @?/rdbms/admin/utl32k
  112. .. again, lot of messages, no ORA-xxxx errors....
  113.  
  114. SQL> alter session set container=DB_APP;
  115. Session altered.
  116.  
  117. SQL> @?/rdbms/admin/utl32k
  118. .. etc...
  119.  
  120. ==> restart of the PDBs :
  121.  
  122. SQL> alter pluggable database XEPDB1,DB_APP close;
  123.  
  124. Pluggable database altered.
  125.  
  126. SQL> alter pluggable database XEPDB1,DB_APP open;
  127.  
  128. Pluggable database altered.
  129.  
  130. SQL> show pdbs
  131.  
  132. CON_ID CON_NAME OPEN MODE RESTRICTED
  133. ---------- ------------------------------ ---------- ----------
  134. 2 PDB$SEED READ ONLY NO
  135. 3 XEPDB1 READ WRITE NO
  136. 4 DB_APP READ WRITE NO
  137.  
  138. ==> That's all, folks....
  139.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement