Advertisement
ExaGridDba

rename pdb and its service

Apr 12th, 2015
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. [oracle@stormking cdb12102 multitenant]$ lsnrctl status | grep -i pdb
  2. Service "pdbl" has 1 instance(s).
  3. [oracle@stormking cdb12102 multitenant]$ sqlplus /nolog
  4.  
  5. SQL*Plus: Release 12.1.0.2.0 Production on Sun Apr 12 19:42:22 2015
  6.  
  7. Copyright (c) 1982, 2014, Oracle. All rights reserved.
  8.  
  9. SQL> conn bf/bf@//stormking:1521/pdbl as sysdba
  10. Connected.
  11. SQL> set linesize 400
  12. SQL> set trimspool on
  13. SQL> select con_id, dbid, name, open_mode, restricted, create_scn, total_size, con_uid, guid
  14. 2 from v$containers
  15. 3 order by con_id;
  16.  
  17. CON_ID DBID NAME OPEN_MODE RES CREATE_SCN TOTAL_SIZE CON_UID GUID
  18. ---------- ---------- ------------------------------ ---------- --- ---------- ---------- ---------- --------------------------------
  19. 4 284904620 PDBL READ WRITE NO 12610387 912261120 284904620 1159F1AAA078680BE0537901A8C0C06B
  20.  
  21. SQL> alter pluggable database rename global_name to pdbm;
  22. alter pluggable database rename global_name to pdbm
  23. *
  24. ERROR at line 1:
  25. ORA-65045: pluggable database not in a restricted mode
  26.  
  27.  
  28. SQL> alter pluggable database close;
  29.  
  30. Pluggable database altered.
  31.  
  32. SQL> alter pluggable database open restricted;
  33.  
  34. Pluggable database altered.
  35.  
  36. SQL> alter pluggable database rename global_name to pdbm;
  37.  
  38. Pluggable database altered.
  39.  
  40. SQL> alter pluggable database close;
  41.  
  42. Pluggable database altered.
  43.  
  44. SQL> alter pluggable database open;
  45.  
  46. Pluggable database altered.
  47.  
  48. SQL> select con_id, dbid, name, open_mode, restricted, create_scn, total_size, con_uid, guid
  49. 2 from v$containers
  50. 3 order by con_id;
  51.  
  52. CON_ID DBID NAME OPEN_MODE RES CREATE_SCN TOTAL_SIZE CON_UID GUID
  53. ---------- ---------- ------------------------------ ---------- --- ---------- ---------- ---------- --------------------------------
  54. 4 284904620 PDBM READ WRITE NO 12610387 912261120 284904620 1159F1AAA078680BE0537901A8C0C06B
  55.  
  56. SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  57. With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
  58. and Real Application Testing options
  59. [oracle@stormking cdb12102 multitenant]$ lsnrctl status | grep -i pdb
  60. Service "pdbm" has 1 instance(s).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement