Disclaimer

Monday, 23 December 2024

Undo - PDB Database

 



SQL> SELECT name, open_mode FROM  v$pdbs ORDER BY name;

NAME                 OPEN_MODE
-------------------- ----------
PDB$SEED             READ ONLY
PDB1                 READ WRITE

SQL>
SQL>
SQL> show con_id

CON_ID
------------------------------
1
SQL>
SQL> select name from v$datafile where con_id=1;

NAME
-----------------------------------
/data2/CDBPROD/system01.dbf
/data2/CDBPROD/sysaux01.dbf
/data2/CDBPROD/undotbs01.dbf
/data2/CDBPROD/users01.dbf


SQL> select name from v$datafile where con_id=2;

NAME
-----------------------------------
/data2/CDBPROD/pdbseed/system01.dbf
/data2/CDBPROD/pdbseed/sysaux01.dbf

SQL> select name from v$datafile where con_id=3; - No UNDO

NAME
-----------------------------------
/data2/CDBPROD/pdb1/system01.dbf
/data2/CDBPROD/pdb1/sysaux01.dbf
/data2/CDBPROD/pdb1/users01.dbf





SQL> alter session set container=PDB$SEED;

Session altered.


SQL> show con_id

CON_ID
------------------------------
2

SQL> show con_name

CON_NAME
------------------------------
PDB$SEED
SQL>
SQL> select name from v$datafile;

NAME
-----------------------------------
/data2/CDBPROD/undotbs01.dbf
/data2/CDBPROD/pdbseed/system01.dbf
/data2/CDBPROD/pdbseed/sysaux01.dbf

SQL> select FILE_NAME, TABLESPACE_NAME from dba_temp_files;

FILE_NAME                                                              TABLESPACE_NAME
-----------------------------------------------------            -------------------------  
/data2/CDBPROD/pdbseed/temp012024-12-23_15-22-16-492-PM.dbf       TEMP


SQL> SELECT tablespace_name, file_name
FROM dba_data_files
WHERE tablespace_name IN (SELECT value FROM v$parameter WHERE name = 'undo_tablespace');  

no rows selected



SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
TEMP

SQL> select name,open_mode from v$pdbs;

NAME                                OPEN_MODE
----------------------------------- ----------
PDB$SEED                            READ ONLY




SQL> select * from database_properties where property_name like '%UNDO%';

PROPERTY_NAME            PROPERTY_VALUE        DESCRIPTION
---------------------- ---------------------- ----------------------
LOCAL_UNDO_ENABLED       FALSE                 true if local undo is enabled



SQL> show pdbs

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


SQL> show parameter undo

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
temp_undo_enabled                    boolean     FALSE
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS1






SQL>
SELECT property_value
FROM   database_properties
WHERE  property_name = 'DEFAULT_PERMANENT_TABLESPACE'; SQL>   2    3

PROPERTY_VALUE
--------------------
SYSTEM

SQL> column property_name format a30
column property_value format a30

select property_name, property_value
from   database_properties
where  property_name = 'LOCAL_UNDO_ENABLED';
SQL> SQL> SQL>   2    3
PROPERTY_NAME                  PROPERTY_VALUE
------------------------------ ------------------------------
LOCAL_UNDO_ENABLED             FALSE

SQL> select con_id, tablespace_name
from   cdb_tablespaces
where  contents = 'UNDO'
order by con_id;  2    3    4

no rows selected


SQL> alter session set container=CDB$ROOT;

Session altered.

SQL>
SQL>
SQL>
SQL> show con_id

CON_ID
------------------------------
1
SQL>
SQL>
SQL> select con_id, tablespace_name
from   cdb_tablespaces
where  contents = 'UNDO'
order by con_id;  2    3    4

    CON_ID TABLESPACE_NAME
---------- ------------------------------
         1 UNDOTBS1

SQL> column property_name format a30
column property_value format a30

select property_name, property_value
from   database_properties
where  property_name = 'LOCAL_UNDO_ENABLED';
SQL> SQL> SQL>   2    3
PROPERTY_NAME                  PROPERTY_VALUE
------------------------------ ------------------------------
LOCAL_UNDO_ENABLED             FALSE

SQL>
SQL>
SQL> select con_id, tablespace_name
from   cdb_tablespaces
where  contents = 'UNDO'
order by con_id;  2    3    4

    CON_ID TABLESPACE_NAME
---------- ------------------------------
         1 UNDOTBS1

SQL>
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                           READ WRITE NO
SQL>




SQL> alter session set container = pdb1;

Session altered.

SQL>
SQL> select file_name
from   dba_data_files
where  tablespace_name = 'UNDOTBS1';  2    3

no rows selected

SQL> select file_name from   dba_data_files;

FILE_NAME
--------------------------------------------------
/data2/CDBPROD/pdb1/system01.dbf
/data2/CDBPROD/pdb1/sysaux01.dbf
/data2/CDBPROD/pdb1/users01.dbf

SQL> select con_id, tablespace_name
from   cdb_tablespaces
where  contents = 'UNDO'
order by con_id;  2    3    4

no rows selected




SQL> alter session set container = cdb$root;

Session altered.

SQL>
SQL>  select con_id, tablespace_name
from   cdb_tablespaces
where  contents = 'UNDO'
order by con_id;  2    3    4

    CON_ID TABLESPACE_NAME
---------- ------------------------------
         1 UNDOTBS1

SQL>
SQL>
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL>
SQL> startup upgrade;
ORACLE instance started.

Total System Global Area 2432695808 bytes
Fixed Size                  9166336 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7610368 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL>
SQL>
SQL> alter database local undo on;

Database altered.

SQL>
SQL> column property_name format a30
column property_value format a30

select property_name, property_value
from   database_properties
where  property_name = 'LOCAL_UNDO_ENABLED';SQL> SQL> SQL>   2    3

PROPERTY_NAME                  PROPERTY_VALUE
------------------------------ ------------------------------
LOCAL_UNDO_ENABLED             TRUE

SQL>
SQL>
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> startup;
ORACLE instance started.

Total System Global Area 2432695808 bytes
Fixed Size                  9166336 bytes
Variable Size             536870912 bytes
Database Buffers         1879048192 bytes
Redo Buffers                7610368 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL> column property_name format a30
column property_value format a30

select property_name, property_value
from   database_properties
where  property_name = 'LOCAL_UNDO_ENABLED';

PROPERTY_NAME                  PROPERTY_VALUE
------------------------------ ------------------------------
LOCAL_UNDO_ENABLED             TRUE

SQL>
SQL>
SQL> select con_id, tablespace_name from cdb_tablespaces
where  tablespace_name LIKE 'UNDO%' order by con_id;  

    CON_ID TABLESPACE_NAME
---------- ------------------------------
         1 UNDOTBS1




SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                           MOUNTED
SQL>
SQL> alter session set container=PDB1;

Session altered.

SQL> alter database open;

Database altered.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 PDB1                           READ WRITE NO
SQL>
SQL> alter session set container=cdb$root;

Session altered.

SQL>
SQL> select con_id, tablespace_name
from   cdb_tablespaces
where  contents = 'UNDO'
order by con_id;
  2    3    4
    CON_ID TABLESPACE_NAME
---------- ------------------------------
         1 UNDOTBS1
         3 UNDO_1




SQL> alter session set container = pdb1;

Session altered.

SQL> select file_name
from   dba_data_files
where  tablespace_name = 'UNDOTBS1';  2    3

no rows selected

SQL> select file_name from   dba_data_files;

FILE_NAME
--------------------------------------------
/data2/CDBPROD/pdb1/system01.dbf
/data2/CDBPROD/pdb1/sysaux01.dbf
/data2/CDBPROD/pdb1/users01.dbf
/data2/CDBPROD/pdb1/system01_i1_undo.dbf



How to Switch/Recreate Undo Tablespace at PDB Level (Doc ID 2560841.1)

 

Applies to:

Oracle Database - Enterprise Edition - Version 12.2.0.1 and later
Information in this document applies to any platform.


Goal

How to Switch/Recreate Undo Tablespace at PDB level

-------------------------------------------------------------

SQL> SELECT property_name, property_value FROM database_properties WHERE property_name = 'LOCAL_UNDO_ENABLED';  

PROPERTY_NAME                  PROPERTY_VALUE
------------------------------ ------------------------------
LOCAL_UNDO_ENABLED             TRUE

 

show parameter undo;

NAME              TYPE    VALUE    
----------------- ------- -------- 
temp_undo_enabled boolean FALSE    
undo_management   string  AUTO     
undo_retention    integer 5        
undo_tablespace   string  UNDOTBS1





Solution

$ sqlplus / as sysdba;

SQL> startup
     ORACLE instance started.

SQL> show pdbs

   CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
        2 PDB$SEED                       READ ONLY  NO
        3 PDB1                               MOUNTED

SQL> alter session set container=PDB1;


SQL> alter pluggable database PDB1 open restricted;

SQL> show pdbs

   CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
        3 PDB1                           READ WRITE YES

SQL> CREATE UNDO TABLESPACE test_undo datafile '...../PDB1/test_undo.dbf'  SIZE 100M AUTOEXTEND ON ;


SQL> ALTER SYSTEM set  UNDO_TABLESPACE='TEST_UNDO' scope=both;


SQL> DROP tablespace UNDOTBS1 including contents and datafiles;  << Drop previous undo tablespace


SQL> alter pluggable database PDB1 close;
SQL> alter pluggable database PDB1 open;

 

Also Check  : Undo Modes in 12.2 Multitenant Databases - Local and Shared Modes (Doc ID 2169828.1)











Create a Pluggable Database (PDB)

 


Create a Pluggable Database (PDB):-


To create a pluggable database, you need to be connected to the CDB with the container 

set to the root (which is the default). 


You must also have the Create Pluggable Database privilege.


SQL> select CON_ID, NAME from  v$datafile where CON_ID=1;

    CON_ID NAME
---------- -----------------------------------------------------------
         1 /data2/CDBDB/system01.dbf
         1 /data2/CDBDB/sysaux01.dbf
         1 /data2/CDBDB/users01.dbf
         1 /data2/CDBDB/undotbs01.dbf


SQL> select CON_ID, NAME from  v$datafile where CON_ID=2;

    CON_ID NAME
---------- -----------------------------------------------------------
         2 /data2/CDBDB/pdbseed/system01.dbf
         2 /data2/CDBDB/pdbseed/sysaux01.dbf
         2 /data2/CDBDB/pdbseed/users01.dbf


Before creating PDB1, check the DB_CREATE_FILE_DEST:-

Check if DB_CREATE_FILE_DEST is already set:

SQL> show parameter db_create_file_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- --------------------
db_create_file_dest                  string


If it’s not set, define it with an appropriate path:


SQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST='/data2/CDBDB/PDB1/';

System altered.


SQL> SHOW PARAMETER db_create_file_dest;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest                  string      /data2/CDBDB/PDB1/




To create a PDB:

SQL> CREATE PLUGGABLE DATABASE PDB1 ADMIN USER pdbadmin1 IDENTIFIED BY pdbadmin1;

Pluggable database created.


This will create a new pluggable database called PDB1. 





SQL> SELECT NAME FROM V$DATAFILE WHERE CON_ID = 3;

NAME
----------------------------------------------------------------------------------------------------
/data2/CDBDB/PDB1/CDBDB/29EA4183169B10B1E063C900A8C06423/datafile/o1_mf_system_mpkx6hwd_.dbf
/data2/CDBDB/PDB1/CDBDB/29EA4183169B10B1E063C900A8C06423/datafile/o1_mf_sysaux_mpkx6hwm_.dbf
/data2/CDBDB/PDB1/CDBDB/29EA4183169B10B1E063C900A8C06423/datafile/o1_mf_users_mpkx6hwm_.dbf



Check the status of Newly Created PDB1 database :-
SQL> SELECT name, open_mode FROM  v$pdbs ORDER BY name;

NAME                  OPEN_MODE
--------------------- ----------
PDB$SEED              READ ONLY
PDB1                  MOUNTED




Let's open PDB1 database :-
SQL> ALTER PLUGGABLE DATABASE PDB1 OPEN;

Pluggable database altered.


SQL> SELECT name, open_mode FROM  v$pdbs ORDER BY name;

NAME            OPEN_MODE
--------------- ----------
PDB$SEED        READ ONLY
PDB1            READ WRITE





SQL> select CON_ID, NAME from  v$datafile where CON_ID=1;

    CON_ID NAME
---------- ----------------------------------------------------------------------------------------------------
         1 /data2/CDBDB/system01.dbf
         1 /data2/CDBDB/sysaux01.dbf
         1 /data2/CDBDB/users01.dbf
         1 /data2/CDBDB/undotbs01.dbf

SQL>
SQL> select CON_ID, NAME from  v$datafile where CON_ID=2;

    CON_ID NAME
---------- ----------------------------------------------------------------------------------------------------
         2 /data2/CDBDB/pdbseed/system01.dbf
         2 /data2/CDBDB/pdbseed/sysaux01.dbf
         2 /data2/CDBDB/pdbseed/users01.dbf

SQL>
SQL> select CON_ID, NAME from  v$datafile where CON_ID=3;

    CON_ID NAME
---------- ----------------------------------------------------------------------------------------------------
         3 /data2/CDBDB/PDB1/CDBDB/29EA4183169B10B1E063C900A8C06423/datafile/o1_mf_system_mpkx6hwd_.dbf
         3 /data2/CDBDB/PDB1/CDBDB/29EA4183169B10B1E063C900A8C06423/datafile/o1_mf_sysaux_mpkx6hwm_.dbf
         3 /data2/CDBDB/PDB1/CDBDB/29EA4183169B10B1E063C900A8C06423/datafile/o1_mf_users_mpkx6hwm_.dbf






Wednesday, 18 December 2024

xtt.properties - file in rman_xttconvert_VER4.5.zip - Explanation



The file you shared is the xtt.properties file template from Doc ID 2471245.1, designed for configuring the XTTS (Cross-Platform Transportable Tablespace) utility with xttdriver.pl

Below is an explanation of key properties and their usage:


Detailed Explanation of Parameters

Tablespace Configuration

  • tablespaces
    • List the tablespaces to migrate, separated by commas.
    • Use uppercase names, without spaces, and do not include quotes.
    • Example:

tablespaces=USERS,EXAMPLE,MY_DATA_TS



Platform ID

  • platformid
    • arget platform ID obtained from the source database using the query:

SELECT PLATFORM_NAME, PLATFORM_ID FROM V$TRANSPORTABLE_PLATFORM;
platformid=6  # AIX-Based Systems (64-bit)


File Locations

  1. src_scratch_location

    • Temporary directory on the source for incremental backups and datafile copies.
Example:
src_scratch_location=/src_backups/


dest_datafile_location

  • Final location for the converted datafiles in the destination database.
  • Use ASM (e.g., +DATA) if the destination is ASM, or a filesystem path otherwise.
dest_datafile_location=+DATA


dest_scratch_location

  • Temporary directory on the destination for receiving files copied from the source.
dest_scratch_location=/dest_backups/




ASM Configuration (if applicable)

  • asm_home and asm_sid
    • Specify the ASM instance home and SID for the destination.
    • Uncomment and update if the destination uses ASM.
asm_home=/u01/app/19.0.0/grid
asm_sid=+ASM



Parallelism

  1. parallel

    • Number of RMAN channels for the prepare phase and conversion.
    • Default: 8. Example:
parallel=4


rollparallel

  • Parallelism for the roll forward phase during incremental backups.
  • Default: 0 (serial). Example:
rollparallel=2



getfileparallel

  • Parallelism for the -G operation (getting incremental backups).
  • Default: 1. Example
getfileparallel=4



Automatic File Transfer

  • metatransfer

    • Enable automated file transfer between source and destination (requires passwordless SSH).
    • Default: 0. Enable by setting:
metatransfer=1


destuser and desthost

  • Credentials and hostname for the destination when using metatransfer.
destuser=oracle
desthost=target-server

desttmpdir

  • Temporary directory for intermediate files on the destination.
desttmpdir=/tmp


allowstandby

  • Set to 1 if you want to execute the script from a standby database.
allowstandby=1


usermantransport

Mandatory for databases using Oracle 12c or higher.
usermantransport=1



Connection Strings (CDB/PDB Only)

  • srcconnstr and destconnstr
    • Used for migrating pluggable databases (PDBs).
srcconnstr=sys/oracle@cdb1_pdb1
destconnstr=sys/oracle@cdb2_pdb1



Example Configuration
# Tablespaces to transport
tablespaces=USERS,EXAMPLE,MY_DATA_TS

# Source database platform ID
platformid=13

# Source and Destination Scratch Locations
src_scratch_location=/src_backups/
dest_scratch_location=/dest_backups/

# Destination Datafile Location
dest_datafile_location=+DATA

# ASM Configuration
asm_home=/u01/app/19.0.0/grid
asm_sid=+ASM

# Parallelism Configuration
parallel=4
rollparallel=2
getfileparallel=4

# Automatic File Transfer
metatransfer=1
destuser=oracle
desthost=target-server
desttmpdir=/tmp

# Optional Settings
allowstandby=1
usermantransport=1


Checklist for Running XTTS:

  1. Set Up Passwordless SSH (if using metatransfer=1).
  2. Verify Disk Space in src_scratch_location and dest_scratch_location.
  3. Validate Tablespaces with:

EXEC DBMS_TTS.TRANSPORT_SET_CHECK('USERS,EXAMPLE,MY_DATA_TS', TRUE);
SELECT * FROM TRANSPORT_SET_VIOLATIONS;

   4. Perform a Test Run with a small tablespace before migrating all.












Tuesday, 17 December 2024

Solving ORA-00742 Log read detects lost write in Oracle

 


[oracle@rac201 ~]$ sqlplus '/as sysdba'

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Dec 17 10:47:58 2024
Version 19.21.0.0.0

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

Connected to an idle instance.

SQL> startup;
ORACLE instance started.

Total System Global Area 2415917856 bytes
Fixed Size                  8928032 bytes
Variable Size            1006632960 bytes
Database Buffers         1392508928 bytes
Redo Buffers                7847936 bytes
Database mounted.
ORA-00742: Log read detects lost write in thread 1 sequence 170 block 72959
ORA-00312: online log 1 thread 1: '/data1/ORCL/redo01.log'



ORA-00742: Log read detects lost write in thread 1 sequence 170 block 72959




In this post we will see how to solve ORA-00742: Log read detects lost write-in thread 1 sequence, You can encounter this error if your Oracle Database machine was suddenly stopped without proper shutdown command due to some unavoidable problem like Power Failure, Power cable issue, etc.


STEP1: In this step, tried to login to the database, and below is an error.

SQL> startup;
ORACLE instance started.

Total System Global Area 2415917856 bytes
Fixed Size                  8928032 bytes
Variable Size            1006632960 bytes
Database Buffers         1392508928 bytes
Redo Buffers                7847936 bytes
Database mounted.
ORA-00742: Log read detects lost write in thread 1 sequence 170 block 72959
ORA-00312: online log 1 thread 1: '/data1/ORCL/redo01.log'



STEP2: Check the status of log file 1 in v$log & v$logfile and you can notice log group 1 is the current logfile.
set lines 300
set pages 3000
col MEMBER for a60
select * from v$Logfile;SQL> SQL> SQL>

    GROUP# STATUS  TYPE    MEMBER                                                       IS_     CON_ID
---------- ------- ------- ------------------------------------------------------------ --- ----------
         3         ONLINE  /data1/ORCL/redo03.log                                       NO           0
         2         ONLINE  /data1/ORCL/redo02.log                                       NO           0
         1         ONLINE  /data1/ORCL/redo01.log                                       NO           0
        11         STANDBY /data1/ORCL/stb_redo11.log                                   NO           0
        12         STANDBY /data1/ORCL/stb_redo12.log                                   NO           0
        13         STANDBY /data1/ORCL/stb_redo13.log                                   NO           0
        14         STANDBY /data1/ORCL/stb_redo14.log                                   NO           0

7 rows selected.

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME     CON_ID
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ --------- ----------
         1          1        170  209715200        512          1 NO  CURRENT                4974163 17-DEC-24   9.2954E+18                    0
         3          1        169  209715200        512          1 YES INACTIVE               4939898 14-DEC-24      4974163 17-DEC-24          0
         2          1        168  209715200        512          1 YES INACTIVE               4859292 08-DEC-24      4939898 14-DEC-24          0




STEP3: Try to clear the current log file most likely it will fail as group log 1 is the current logfile.
SQL> alter database clear unarchived logfile group 1;
alter database clear unarchived logfile group 1
*
ERROR at line 1:
ORA-01624: log 1 needed for crash recovery of instance orcl (thread 1)
ORA-00312: online log 1 thread 1: '/data1/ORCL/redo01.log'




STEP4: So we will try to perform manual recovery on the database, Please note since Group log 1 is current it will be not archived, and the requested archive log sequence 170 is the current redo logfile, and hence I have provided manually redo log 1 file location.

 But even after “Media recovery complete” While trying to open DB, I encounter an ORA-00600 error.


SQL> recover database until cancel;
ORA-00279: change 4974164 generated at 12/17/2024 10:08:15 needed for thread 1
ORA-00289: suggestion : /data1/ORCL/ARCH/1_170_1178543939.arc
ORA-00280: change 4974164 for thread 1 is in sequence #170


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/data1/ORCL/redo01.log
Log applied.
Media recovery complete.
SQL>
SQL>
SQL>
SQL>
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL>
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [krsi_al_hdr_update.invalid_nab_1], [4294967295], [], [], [], [], [], [], [], [], [], []



At this point, I tried to search in MOS and fortunately found below MOS note for the above issue


Alter Database Open Resetlogs returns error ORA-00600: [krsi_al_hdr_update.15], (Doc ID 2026541.1)


STEP 5: We followed the steps mention in MOS Note and again attempted fake recovery with the CANCEL option and was able to open the database. 

At the OS level move the current online redologs:



SQL> !mv /data1/ORCL/redo01.log /data1/ORCL/redo01_old.log

SQL>
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 4977857 generated at 12/17/2024 10:23:53 needed for thread 1
ORA-00289: suggestion : /data1/ORCL/ARCH/1_170_1178543939.arc
ORA-00280: change 4977857 for thread 1 is in sequence #170


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
Media recovery cancelled.
SQL>
SQL>
SQL>
SQL>
SQL> alter database open resetlogs;

Database altered.




SQL> select status from v$instance;

STATUS
------------
OPEN

SQL>
SQL>  set lines 300
set pages 3000
col MEMBER for a60
select * from v$Logfile;SQL> SQL> SQL>

    GROUP# STATUS  TYPE    MEMBER                                                       IS_     CON_ID
---------- ------- ------- ------------------------------------------------------------ --- ----------
         3         ONLINE  /data1/ORCL/redo03.log                                       NO           0
         2         ONLINE  /data1/ORCL/redo02.log                                       NO           0
         1         ONLINE  /data1/ORCL/redo01.log                                       NO           0
        11         STANDBY /data1/ORCL/stb_redo11.log                                   NO           0
        12         STANDBY /data1/ORCL/stb_redo12.log                                   NO           0
        13         STANDBY /data1/ORCL/stb_redo13.log                                   NO           0
        14         STANDBY /data1/ORCL/stb_redo14.log                                   NO           0

7 rows selected.







Saturday, 14 December 2024

Multi tenant architecture interview questions

 

General CDB / PDB Concept in 12c Multitenant Architecture
What is a pluggable database (PDB) in Multitenant Architecture?
Pluggable Databases (PDBs) is new in Oracle Database 12c Release 1 (12.1). You can have many pluggable databases inside a single Oracle Database occurrence. Pluggable Databases are fully backwards compatible with an ordinary pre-12.1 database.

Why would I consider using the Multitenant option?
You should consider following Database Consolidation Goals to achieve:

Reduce Total Cost of Operation
Administration costs
Operations costs
Data center costs
Storage costs
Contingency costs
Improve Functionalities
Resource utilization
Manageability
Integration
Service management
Must not need to change applications
Must not harm performance
Must provide resource management and isolation between applications
Must simplify patching and upgrade of Oracle Database
What other benefits will I get from Multitenant option?
The benefits of mulitenant Pluggable Databases are:


 
Fast provisioning of a new database or of a copy of an existing database.
Fast redeployment, by unplug and plug, of an existing database to a new platform.
Quickly patch or upgrade the Oracle Database version for many databases and for the cost of doing it once.
Patch or upgrade by unplugging a PDB and plugging it into a different container database (CDB) in a later version.
A machine can run more database instances in the form of PDBs than as individual, monolithic databases.
Separate the duties of the application administrator from the duties of the administrator of the Oracle-supplied system.
How easy to migrate an existing pre 12.1 database to 12c Multitenant database ?
Migrate to 12c Pluggable database is very simple and easy. You can evaluate and adopt which one best suit for you.
Plan A.

Upgrade an existing pre 12.1 database to 12.1
Plug-in the database post upgrade into a CDB
Plan B.

Provision empty PDBs per database that need to consolidated
Use datapump or golden gate replication to migrate a Database into a PDB
Which Oracle Database features are currently not supported in a Multitenant architecture?
The following Oracle Database features are currently not supported in a CDB:

Continuous Query Notification
Flashback Data Archive
Heat Maps
Automatic Data Optimization
If you must use one or more of these features, then create a non-CDB.

Q) Does each non-CDB need its own CDB if I do not have a license for Multitenant?
Yes

Q) Can multiple CDBs run on the same server?
Yes

Q) Can multiple CDBs run out of the same ORACLE_HOME installation?
Yes

Q. What are the major changes in architecture for 12c?

From 12c Onwards, the instance is shared with multiple databases.


This multiple databases are self contained and pluggable from one database to another database. This is very useful methodology where database consolidation.


In short a single SGA and background process will be shared to multiple databases, the databases can be created on fly and drop or attach and detach from one server to another server.


Q. What is a pluggable database (PDB) in Multitenant Architecture?

Pluggable Databases (PDBs) is new in Oracle Database 12c Release 1 (12.1). 
You can have many pluggable databases inside a single Oracle Database occurrence. Pluggable Databases are always part of a Container Database (CDB) but a PDB looks like a normal standalone database to the outside world.


Q. Does In-memory require a separate license cost?

Yes, In-memory does require a separate license cost.


Q. Why would I consider using the Multitenant option?

You should consider following Database Consolidation Goals to achieve:

Reduce Total Cost of Operation
Administration costs
Operations costs
Data center costs
Storage costs
Contingency costs
Improve Functionalities
Resource utilization
Manageability
Integration
Service management
Must not need to change applications
Must not harm performance
Must provide resource management and isolation between applications
Must simplify patching and upgrade of Oracle Database


Q. What are the common concepts of multitenant database?

Multitenant database consists of:

CDB is a container database which is similar like standalone database. Called CDB$ROOT

PDB$SEED is a template database to create a databases within the CDB databases

PDB<n> are individual or application databases

Data dictionary between this databases are shared via internal links called object link and data link

Users between CDB and PDB are different, there will be common users (starts with C##) and local users

When the CDB starts up, the PDB will be in mount state, you must open them exclusively


Q. Will CDB’s become the future?

Yes, Oracle has already depreciated standalone database development. No further improvements will be released in future for standalone databases.


Q. How many PDBs can you create?

12cR1 –> 252 PDBs
12cR2 –> 4096 PDBs


Q. Can multiple CDBs run on the same server?

Yes!


Q. Can multiple CDBs run out of the same ORACLE_HOME installation?
Yes, you can invoke DBCA and create new CDBs out of same Oracle_Home


Q. What are the methods to create Multitenant Database?

DBCA method
DBCA silent method
Manual method using CREATE DATABASE statement


Q. What is the limit of container databases (CDBs) on a server?

As many as supported by server CPU, RAM and Hard disk space.


Q. How do I know if my database is Multitenant or not?

You can use below query to identify a CDB database:
SELECT NAME, OPEN_MODE, CDB FROM V$DATABASE;
SHOW CON_ID;
SHOW CON_NAME;

Q. How to distinguish you are in CDB or PDB?

Once you logged in you can check show con_name or con_id will show you which db you are in.


Q. What are the different ways you can create a PDB?

Copying from PDB$SEED
Copying from another PDB
Copying from a remote PDB
Converting a Non-CDB into PDB
Unplugging and plugging in a PDB

Q. Can I have one PDB at release 1, and a second PDB at release 2?

No, one instance, one version for all PDBs.


Q. What Pluggable databases do we have in this container database ?

You can check this by querying v$containers:

SELECT NAME, OPEN_MODE FROM V$CONTAINERS;
SHOW pdbs;


Q. How do you switch from one container to another container inside SQL*PLUS?

ALTER SESSION SET CONTAINER=pdb1;


Q. How about the datafiles system, sysaux , undo, redo etc , does they create when you create PDB?

Datafiles are individual to each database for cdb and each pdb

Undofiles and redofiles are only one across container

From 12cR2 onwards we can create local undo for each PDB

Tempfiles can be created in each database or share one across all databases

SGA is shared across all databases

Background process are shared across all databases , no additional back ground process defined


Q. Is the alert log the same for all pdbs in a cdb, or are they different?

Yes, one CDB, one alert log.


Q. How can I connect to a PDB directly from SQL* PLUS?

You can use Oracle easy connect method to connect a PDB directly.

CONNECT username/password@host[:port][/service_name][:server][/instance_name]

OR

sqlplus user/password@//localhost/pdb2

Q. How do I switch to main container Database?

ALTER SESSION SET CONTAINER = CDB$ROOT;


Q. As you said, if SGA and background process are shared, is there any performance impact?

Ideally this architecture is used for database consolidation projects which and where small databases are 
shared in a single database host and not that high critical applications running. 
This leverages the reduction in licensing cost and also resource utilization effectively.


Q. How do I start up a Pluggable database?

From CDB$ROOT container:
ALTER PLUGGABLE DATABASE PDB1 OPEN;

Q. How about creating a user?

Normally you will use create user username identified by password, however this is not work anymore.

When you want to create a common user across all databases for example, you must use C## as prefix

SQL> create user c##username identified by password; ---> will create common user across all databases

SQL> create user c##username identified by password container=current; ---> will create common user only at current container

SQL> create user username identified by password container=all; ---->does not work since the username does not contain c## prefix


Q. How about AWR data, does it common across all databases or individual to database?

That is why you have individual sysaux tablespace for each database, whenever the AWR statistics collected the statistics will be pushed respective databases not the common sysaux. 
Since this will give you the ability to have self contained database where if you plug this database to another instance, the statistics will not lost.


Q. Which parameters are modifiable at PDB level?

select NAME, ISPDB_MODIFIABLE from V$PARAMETER;


Q. What is the difference between Container ID Zero and One?

CON_ID “0” means data does not pertain to any particular Container but to the CDB as a whole. 

For example, a row returned by fetching from V$DATABASE pertains to the CDB and not to any particular Container, so CON_ID is set to “0”. 

A CONTAINER_DATA object can conceivably return data pertaining to various Containers (including the Root which has CON_ID==1) as well as to the CDB as a whole, and CON_ID in the row for the CDB will be set to 0.


Following table describes various values of CON_ID Column in Container Data Objects.

0 = The data pertains to the entire CDB
1 = The data pertains to the root
2 = The data pertains to the seed
3 – 254 = The data pertains to a PDB, Each PDB has its own container ID.


Q. Are there any background processes ex, PMON, SMON etc associated with PDBs?

No. There is one set of background processes shared by the root and all PDBs.


Q. Are there separate control file required for each PDB?

No. There is a single redo log and a single control file for an entire CDB.


Q. Are there separate Redo log file required for each PDB?

No. There is a single redo log and a single control file for an entire CDB.


Q. Can I monitor SGA usage on a PDB by PDB basis?

SQL> alter session set container=CDB$ROOT;
SQL> select POOL, NAME, BYTES from V$SGASTAT where CON_ID = '&con_id';
SQL> select CON_ID, POOL, sum(bytes) from  v$sgastat group by CON_ID, POOL order by  CON_ID, POOL;


Q. Do I need separate SYSTEM and SYSAUX tablespaces for each of my PDB?

There is a separate SYSTEM and SYSAUX tablespace for the root and for each PDB.


Q. Where is user data stored in CDB?

In a CDB, most user data is in the PDBs. The root contains no user data or minimal user data.


Q. How can I create a pluggable database ?

sql> create pluggable database x admin user a identified by p;

Q. How to drop a PDB irrevocably?

sql> drop pluggable database x including datafiles;





Basic Multitenant CDB / PDB Operations:---

How do I know if my database is Multitenant or not?
Establish a SQL Session and run this Query:

SQL> select NAME, DECODE(CDB, 'YES', 'Multitenant Option enabled', 'Regular 12c Database: ') "Multitenant Option ?" , OPEN_MODE, CON_ID from V$DATABASE;
 
NAME     Multitenant Option?        OPEN_MODE     CON_ID
----- ---------------------------- ----------------------
CDB2  Multitenant Option enabled     MOUNTED         0


What Pluggable databases do we have in this container database ?
To view pluggable database in the container databases execute the below query.

SQL>  Show pdb's;

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ --------------- ---------------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
4 PDB2 MOUNTED
5 PDB3 READ WRITE YES

How do I connect to a Pluggable Database, say PDB6?
You can switch to PDB6 from other PDB or Root Container using following command.

SQL> alter session set container = pdb6;


Connecting to a PDB directly Using the SQL*Plus CONNECT Command:
You can use the following techniques to connect to a PDB with the SQL*Plus CONNECT command:

A) Database connection using easy connect:

SQL> CONNECT username/password@host[:port][/service_name][:server][/instance_name]
Examples of SQLPLUS from OS prompt:

$ sqlplus user/password@//node1:1521/pdb2
$ sqlplus user/password@//localhost:1521/pdb2
$ sqlplus user/password@//localhost/pdb2

SQL> show con_name
CON_NAME
------------------------------
PDB2

B) Database connection using a net service name:
Example TNSNAMES.ora:


 
LISTENER_CDB1 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

CDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdb1)
    )
  )

PDB2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = hpal-node1.us.oracle.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = pdb2)
    )
  )


Example of SQLPLUS from Os prompt:

$ sqlplus user/password@pdb2

How do I switch to main container Database?

SQL> ALTER SESSION SET CONTAINER = CDB$ROOT;

How do I determine which PDB or CDB I am currently connected to?
SQL> show con_name
CON_NAME
------------------------------
PDB6

SQL>  select sys_context ( 'Userenv', 'Con_Name') "Container DB" from dual;
Container DB
--------------------------------------------------------------------------------
PDB6

How do I start up a Pluggable database ?
When connected to current PDB:

SQL> alter pluggable database open;
When connected to root:

SQL> alter pluggable database pdb6 open;

How do I shutdown / close a Pluggable database?
When connected to current PDB:

SQL> alter pluggable database close;
When connected to root:

SQL> alter pluggable database pdb6 close;


How do I shut down / Startup the Container Database?
Use startup/Shutdown command similar to startup/shutdown of Non-CDB.
When the container database is shutdown, no PDB is accessible.


In a CDB, the root and all of the PDBs share a single instance, or, when using Oracle RAC, multiple concurrent database instances
You start up and shut down an entire CDB, not individual PDBs. 

However, when the CDB is open, you can change the open mode of an individual PDB by using the ALTER PLUGGABLE DATABASE statement.

Which parameters are modifiable at PDB level?

SQL> select NAME, ISPDB_MODIFIABLE from V$PARAMETER;


What common users do I have in my cdb?

SQL> select distinct USERNAME from CDB_USERS where common = 'YES';

How do I create a common user ?
SQL> create user c##db_dba1 identified by manager1 container=all;


How do I create a local user ?
SQL> create user pdb6_dba1 identified by manager1 container=current;


Multitenant Architecture
What is the difference between Container ID Zero and One?
CON_ID “0” means data does not pertain to any particular Container but to the CDB as a whole. For example, a row returned by fetching from V$DATABASE pertains to the CDB and not to any particular Container, so CON_ID is set to “0”. A CONTAINER_DATA object can conceivably return data pertaining to various Containers (including the Root which has CON_ID==1) as well as to the CDB as a whole, and CON_ID in the row for the CDB will be set to 0.

Following table describes various values of CON_ID Column in Container Data Objects.
0 = The data pertains to the entire CDB
1 = The data pertains to the root
2 = The data pertains to the seed
3 – 254 = The data pertains to a PDB, Each PDB has its own container ID.

Are there any background processes ex, PMON, SMON etc associated with PDBs?
No. There is one set of background processes shared by the root and all PDBs.

Are there separate control file required for each PDB?
No. There is a single redo log and a single control file for an entire CDB.

Are there separate Redo log file required for each PDB?
No. There is a single redo log and a single control file for an entire CDB.

Can I monitor SGA usage on a PDB by PDB basis?
There are single SGA shared by all pluggable databases. However, you can determine SGA consumptions by all containers i.e, root and PDB.

SQL> alter session set container=CDB$ROOT;

SQL> select POOL, NAME, BYTES from V$SGASTAT where CON_ID = '&con_id';
SQL> select CON_ID, POOL, sum(bytes) from  v$sgastat group by CON_ID, POOL order by  CON_ID, POOL;

Can I monitor PGA usage on a PDB by PDB basis?
Use the below queries to monitor the SGA usage on per PDB basis.

SQL> select CON_ID, sum(PGA_USED_MEM), sum(PGA_ALLOC_MEM), sum(PGA_MAX_MEM) 
from  v$process 
group by CON_ID order by  CON_ID;



SQL> alter session set container =CDB$ROOT;

SQL> select NAME , value from  v$sysstat  where NAME like 'workarea%';
SQL> alter session set container = [targetPDB];

select NAME , value from  v$sysstat  where NAME like 'workarea%';


Do I need separate UNDO tablespaces for for each of my PDB?
There is one active undo tablespace for a single-instance CDB. For an Oracle RAC CDB, there is one active undo tablespace for each instance. Only a common user who has the appropriate privileges and whose current container is the root can create an undo tablespace.

Please refer the below post for various modes of Undo available from 12.2 onwards:

Undo Modes in 12.2 Multitenant Databases – Local and Shared Modes

Do I need separate SYSTEM tablespaces for each of my PDB?
There is a separate SYSTEM tablespace for the root and for each PDB.

Do I need separate SYSAUX tablespaces for for each of my PDB?
There is a separate SYSAUX tablespace for the root and for each PDB.

Do I need Temporary tablespaces for for each of my PDB?
There is one default temporary tablespace for the entire CDB. 

However, you can create additional temporary tablespaces in individual PDBs. 

One active temporary tablespace is needed for a single-instance CDB, or one active temporary tablespace is needed for each instance of an Oracle RAC CDB.

Can I specify a separate default tablespace for the root and for each PDB?
Yes. You can specify a separate default tablespace for the root and for each PDB.

Are all physical datafiles separate for root and PDB?
There are separate datafiles for the root, the seed, and each PDB.

Where is user data stored in CDB?
In a CDB, most user data is in the PDBs. 
The root contains no user data or minimal user data.

Does Pluggable database support separate database characterset?
A CDB uses a single character set. 
All of the PDBs in the CDB use this character set. Oracle recommends the following:

For all new deployments and if all PDBs are created empty, Oracle strongly recommends AL32UTF8 for the CDB database character set and AL16UTF16 for the CDB national character set.

If you can migrate your existing databases to AL32UTF8 before consolidation, Oracle recommends that you do so and consolidate into one or more AL32UTF8 CDBs, depending on your needs. 

You can use Oracle Database Migration Assistant for Unicode to migrate a non-CDB to AL32UTF8. You cannot migrate the CDB using Oracle Database Migration Assistant for Unicode, after creation.

If you cannot migrate your existing databases prior to consolidation, then you have to partition them into sets with plug-in compatible database character sets and plug each set into a separate CDB with the appropriate superset character set.

How do I configure Net Files in a Pluggable database environment?
There is a single listener.ora, tnsnames.ora, and sqlnet.ora file for an entire CDB. All of the PDBs in the CDB use these files.

Advance CDB / PDB Operations
How can I install and setup Pluggable Database?
Use runInstaller to install the Oracle Database software. 
Use dbca to create databases. 
You can create many pluggable databases in a single operation. 
DBCA enables you to specify the number of PDBs in the CDB when it is created.After a CDB is created, you can use DBCA to plug PDBs into it and unplug PDBs from it.

What Operations act on PDBs as entities?
These operations act on PDBs as entities:

create PDB (brand-new, as a clone of an existing PDB, by plugging in an unplugged PDB)
unplug PDB
drop PDB
set the Open_Mode for a PDB

How can I create a pluggable database ?
Use the below queries to create a pluggable database.

sql> create pluggable database x admin user a identified by p;
sql> create pluggable database y admin user a identified by p file_name_convert = ('pdbseed', 'y');

How to drop a PDB irrevocably?
Use the below queries to drop a PDB database irrevocably.

sql> drop pluggable database x including datafiles;

How easy it is to manage the provisioning of PDBs using PL/SQL?
Following an Example of PL/SQL Code to show this.
Using Oracle-Managed Files

declare
t0 integer not null := -1;
procedure Show_Time(What in varchar2) is
t varchar2(10);

begin
t := Lpad((DBMS_Utility.Get_Time() - t0), 5);

DBMS_Output.Put_Line('create PDB:'||t||' centiseconds');

end Show_Time;

begin
t0 := DBMS_Utility.Get_Time();

execute immediate '
create pluggable database x
admin user a identified by p
';

Show_Time('create PDB:');

t0 := DBMS_Utility.Get_Time();

execute immediate '
drop pluggable database x
including datafiles
';

Show_Time('drop PDB: ');

end;
How to clone a PDB from an existing PDB?
The clonee must be open in read only mode. Example using Oracle-Managed Files:

sql> create pluggable database x2 from x;


How to unplug a PDB ?
Use the below query to unplug a plugged database.

sql> alter pluggable database x unplug into '/some_directory/x_description.xml' ;
The into keyword must be followed by the full path for a description of the PDB, in XML, generated by the operation.

Scalability & RAC

How to add or modify a user-managed service ?
sql> srvctl add service –pdb [pdb_name]

Starting a user-managed service using srvtcl will open the PDB automatically in all the instances in which the service is started. Specifying the empty string (“”) as the [pdb_name] will cause the pluggable database attribute of a service to be set to null. 

The service can then be used only to connect to the root.

How can I view which service is attached to my Pluggable database?
SQL> column NAME format a30
SQL> select PDB, INST_ID, NAME from gv$services order by 1;

PDB                                INST_ID  NAME
-------------------------------- ---------- --------------------------------
CDB$ROOT                                  1 cdb1XDB
CDB$ROOT                                  1 SYS$BACKGROUND
CDB$ROOT                                  1 SYS$USERS
CDB$ROOT                                  1 cdb1
PDB1                                          1 pdb1
PDB2                                          1 pdb2



Diagnosibility

Where can I find the Alert log for my pluggable Database?
A Single copy of Alert log is generated which contains warnings and alert information for all PDBs. 
XML version of alert can be found in “Diag Alert” and text formatted Aler log can be found in “Diag Trace” of the container database. 
You can find details by selecting from v$diag_info dynamic view.

Where can I find trace files related to my pluggable Database?
All traces generated from all PDBs are currently found in “Diag Trace” of the container database. 
You can find details by selecting from v$diag_info dynamic view.

Miscellaneous
If a user-defined, common user creates schema objects in a PDB, and if later that PDB is unplugged and plugged into a different CDB in which that common user does not exist, then what happens to the schema objects? 

By which user will they be owned? Will other users within the PDB, which had been granted privileges on those schema objects, still retain those privileges?

If you plug a PDB that contains a common user into a CDB, then the following actions take place:
– The common user accounts in this PDB lose commonly granted privileges that they may have had, including the SET CONTAINER privilege.
– If the target CDB has a common user with the same name as a common user in a newly plugged-in PDB, then the new common user is merged with the target CDB common user.
– The password of the target CDB common user takes precedence. Otherwise, a common user in a newly plugged in PDB becomes a locked account. In this case, you can do one of the following:

Leave the user account locked and use the objects of its schema.
Use Oracle Data Pump to copy these objects to another schema, and then drop the locked user account.
Close the PDB, connect to the root, and then create a common user with the same name as the locked account. When you re-open the PDB, Oracle Database resolves the differences in the roles and privileges that were commonly granted to the locked user. Afterward, you can unlock this user account in the PDB. Privileges and roles that were locally granted to the user will remain unchanged.
Is the multitenant option available in Standard Edition?
Yes, but you may only create one PDB, per CDB.

Can a transaction span across PDBS?
No, though “alter session set container” is allowed after starting a transaction in a PDB, only select is allowed in the second PDB. The transaction is preserved and you can do commit or rollback after switch back to original PDB.

What data can be seen in CDB_ and V$ views from each container?
CDB_* views are container data objects. 
When a user connected to the root queries a CDB_* view, the query results will depend on the CONTAINER_DATA attribute for users for the view. 

The CONTAINER_DATA clause of the SQL ALTER USER statement is used to set and modify users’ CONTAINER_DATA attribute.

In the root of a multitenant container database (CDB), CDB_* views can be used to obtain information about tables, tablespaces, users, privileges, parameters, and so on contained in the root and in pluggable databases (PDBs).

The CDB_* views are owned by SYS, regardless of who owns the underlying DBA_* view. By default, a user connected to the root will only see data pertaining to the root.

May the database timezone be set on a per-PDB basis?
Yes.

May NLS currency settings (NLS_CURRENCY) be set on a per-PDB basis?
Yes.

How to monitor the undo usage of each container/database in CDB/PDB?
Use the below queries to monitor the undo usage of each container or database in a CDB or PDB architecture.

sql> select NAME,MAX(TUNED_UNDORETENTION), MAX(MAXQUERYLEN), MAX(NOSPACEERRCNT), MAX(EXPSTEALCNT)
from V$CONTAINERS c , V$UNDOSTAT u
where c.CON_ID=u.CON_ID
group by NAME;

sql> select NAME,SNAP_ID,UNDOTSN,UNDOBLKS,TXNCOUNT,MAXQUERYLEN,MAXQUERYSQLID
from V$CONTAINERS c , DBA_HIST_UNDOSTAT u
where c.CON_ID=u.CON_ID
and u.CON_DBID=c.DBID
order by NAME;


What is the difference between schema-based consolidation and the multitenant architecture?
1. Name collision might prevent schema-based consolidation.
2. Schema-based consolidation brings weak security.
3. Per-application, back-end, point-in-time recovery is prohibitively difficult.
4. Resource management between application back-ends is difficult.
5. Patching the Oracle version for a single application back-end is not possible.
6. Cloning a single application back-end is difficult.






How to recovery PDB when PDB database is dropped in Oracle

  How to recovery PDB when PDB database is dropped :) [oracle@rac01 ~]$ sqlplus '/as sysdba' SQL*Plus: Release 21.0.0.0.0 - Product...