sql >> Database teknologi >  >> RDS >> Database

Omdøbning af pluggbar database

Mål
Omdøb en pluggbar database (PDB) fra PDBWFM til PDBWFM01.
$ sqlplus / som sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Tue May 5 12:22:30 2020

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBWFM READ WRITE NO

For at omdøbe operation skal en PDB være i RESTRICTED-tilstand:

SQL> alter pluggable database PDBWFM close immediate;
Pluggable database altered.

SQL> alter pluggable database PDBWFM open restricted;
Pluggable database altered.

SQL> select name, open_mode from v$pdbs;

NAME OPEN_MODE RESTRICTED
------------------------------ ---------- ----------
PDB$SEED READ ONLY NO
PDBWFM READ WRITE YES

Udfør omdøbningen og genstart (LUK / ÅBN) et PDB:


SQL> alter session set container = PDBWFM;
Session altered.

SQL> alter pluggable database PDBWFM rename global_name to PDBWFM01;
Pluggable database altered.

SQL> alter pluggable database PDBWFM01 close immediate;
Pluggable database altered.

SQL> alter pluggable database PDBWFM01 open;
Pluggable database altered.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBWFM01 READ WRITE NO

De mapper, der svarer til FBF, bliver ikke omdøbt. Hvis du ønsker at flytte datafilerne til en ny mappe, skal du bruge funktionen "Online Move Datafile" i Oracle 12c.
For at omdøbe Oracle Managed-Files (OMF) skal du konsultere den tilgængelige dokumentation i referencen til denne artikel [1].

Referencer
[1] Sådan omdøbes Oracle-Managed Files (OMF'er) (Doc ID 191574.1). Tilgængelig på:https://support.oracle.com/knowledge/Oracle%20Database%20Products/191574_1.html


  1. 2 måder at vise alle databaser i PostgreSQL (psql)

  2. Kom godt i gang med GearHost til MySQL-databaseudvikling

  3. Sådan fremskynder du din SQL-server ved hjælp af overvågning af databaseydeevne

  4. Sådan ændres kolonnestørrelse i MySQL