The implementation of the PDB alter pluggable database pdbprod2 open; the operation after prompt: Warning: the Altered PDB with errors from. AskScuti blog Park
table of Contents
1. condition
2. reasons
3. Program
1. condition
SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- --------- ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB1 MOUNTED 4 PDBPROD1 MOUNTED 5 PDBPROD2 MOUNTED SQL> alter pluggable database pdbprod2 open; Warning: PDB altered with errors.
2. reasons
After creating PDB PDB with seed or inserting or cloning method, you can view the status of the new column PDB by querying CDB_PDBS view STATUS. If you create a public users and roles before opening a new PDB, you must synchronize PDB to retrieve new public users and roles from the root. When the PDB opened in read / write mode, it will automatically synchronize. If PDB open in read-only mode, an error is returned. You can query PDB_PLUG_IN_VIOLATIONS view to see the violation.
SQL> select CAUSE,CON_ID,MESSAGE from pdb_plug_in_violations; CAUSE -------- CON_ID -------- MESSAGE -------- Sync Failure 4 Sync PDB failed with ORA-959 during 'CREATE USER "C##AAA" IDENTIFIED BY VALUES * DEFAULT TABLESPACE "IMPDATA" container = all'
Because before you create a database in a container in public user AAA ## C , now also you need to create the user in all pluggable database. This user is created in the database normally open, but using a custom table space "IMPDATA", when open can be inserted into the database PDBPROD2 when synchronizing this operation, which is synchronized to create the common user. However, this may be inserted into the database PDBPROD2 no IMPDATA table space, and therefore can not synchronize to create the common user, it can be inserted into the final database PDBPROD2 open only in restricted mode, as follows:
SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- --------- ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB1 MOUNTED 4 PDBPROD1 MOUNTED 5 PDBPROD2 READ WRITE YES
3. Program
This time to delete the public user still does not work, because the synchronization action has been in the queue inside the. Therefore, the only thing to do is to create space in PDBPROD2 in the table, close the database, synchronize again.
SQL> alter session set container=pdbprod2; Session altered. SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- /u01/app/oracle/oradata/CDBOCP/pdbprod2/CDBOCP/8EE4C86D91688487E053C81212AC968B/ datafile/o1_mf_system_gn08jj5k_.dbf /u01/app/oracle/oradata/CDBOCP/pdbprod2/CDBOCP/8EE4C86D91688487E053C81212AC968B/ datafile/o1_mf_sysaux_gn08jj5p_.dbf /u01/app/oracle/oradata/CDBOCP/pdbprod2/CDBOCP/8EE4C86D91688487E053C81212AC968B/ datafile/o1_mf_undotbs1_gn08jj63_.dbf SQL> create tablespace impdata datafile '/u01/app/oracle/oradata/CDBOCP/pdbprod2/CDBOCP/8EE4C86D91688487E053C81212AC968B/datafile/impdata01.dbf' size 10m; Tablespace created. SQL> alter session set container=cdb$root; Session altered. SQL> alter pluggable database pdbprod2 close; Pluggable database altered. SQL> alter pluggable database pdbprod2 open; Pluggable database altered. SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- --------- ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB1 MOUNTED 4 PDBPROD1 MOUNTED 5 PDBPROD2 READ WRITE NO