Category Archives: CDB

Startup all PDB in a CDB

In Oracle 12c multitenant databases consist of a container database CDB which contain one or more pluggable databases PDB.   Startup of the PDB must be done after the CDB it is contained in has been started.   This procedures covers the startup and shutdown of all PDBs in a CDB.

 

  1. Logon to your server as the oracle software owner.

 

[larry@linux2 ~]$ su – oracle

Password:

Last login: Mon Mar 24 14:55:04 EDT 2016 on pts/1

[oracle@linux2 ~]$

 

  1. Logon to your CDB where the PDB you wish to start is stored.

 

[oracle@linux2 ~]$ sqlplus / as sysdba

 

SQL*Plus: Release 12.1.0.2.0 Production on Tue Mar 25 09:41:06 2016

 

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

 

Connected to an idle instance.

 

SQL> startup open

ORACLE instance started.

 

Total System Global Area  734003200 bytes

Fixed Size                  2928728 bytes

Variable Size             524292008 bytes

Database Buffers          201326592 bytes

Redo Buffers                5455872 bytes

Database mounted.

Database opened.

SQL>

 

 

  1. View the available PDBs within the CDB with SQL statement: select name, open_mode from v$pdbs.

 

SQL> select name, open_mode from v$pdbs;

 

NAME                           OPEN_MODE

—————————— ———-

PDB$SEED                       READ ONLY

PDB1                           MOUNTED

PDB2                           MOUNTED

 

SQL>

 

NOTE: MOUNTED is the closed state for a PDB while it CDB is open.

 

  1. You have four options for PDBs to choose from:
    1. MOUNTED – PDB closed but CDB open.
    2. OPEN MIGRATE – PDB is open for upgrade and patching.
    3. OPEN READ ONLY – PDB is open for reads but not writes.
    4. OPEN READ WRITE – PDB is open for all operations.

All of this modes can be moved to and from with the SQL statement:  ‘ALTER PLUGGABLE DATABASE all <OPTION>;    In this step we will move all the PDBs from mounted to open read write.   NOTE: read write is optional.

 

SQL> alter pluggable database all open;

 

Pluggable database altered.

 

SQL> select name, open_mode from v$pdbs;

 

NAME                           OPEN_MODE

—————————— ———-

PDB$SEED                       READ ONLY

PDB1                           READ WRITE

PDB2                           READ WRITE

 

SQL>

 

  1. You can close all the PDB with close option.

 

SQL>  alter pluggable database all close;

 

Pluggable database altered.

 

SQL> select name, open_mode from v$pdbs;

 

NAME                           OPEN_MODE

—————————— ———-

PDB$SEED                       READ ONLY

PDB1                           MOUNTED

PDB2                           MOUNTED

 

SQL>

 

  1. You can actually specify the read write option and it will be accepted.

 

SQL> alter pluggable database all open read write;

 

Pluggable database altered.

 

SQL> select name, open_mode from v$pdbs;

 

NAME                           OPEN_MODE

—————————— ———-

PDB$SEED                       READ ONLY

PDB1                           READ WRITE

PDB2                           READ WRITE

 

SQL>

 

  1. You cannot move from read write to simply read option with all PDB and you cannot move all PDB into read only mode. You can only open all PDBs in read write mode and close all PDBs with all option.

 

SQL> alter pluggable database all open read;

alter pluggable database all open read

                                     *

ERROR at line 1:

ORA-00922: missing or invalid option

 

 

SQL> alter pluggable database all close;

 

Pluggable database altered.

 

SQL> alter pluggable database all open read;

alter pluggable database all open read

                                     *

ERROR at line 1:

ORA-00922: missing or invalid option

 

 

SQL>

 

  1. There are no other options to move all PDBs open mode. This completes startup and shutdown of all PDB within its CDB.

Larry Catt

OCP

Root and Multitenant Architecture

Oracle multitenant database architecture gives the ability to virtualize oracle database implementations, similarly to OS virtualization.   The multitenant architecture has two main components:  The CDB – Container Database and PDB – Pluggable database.  These two components have many aspects which help to describe their architecture and are detailed below:

 

CDB – Container Database

  1. CDB is commonly referred to as the root container.
  2. One root container in any implementation and contains all oracle provided metadata and common user.
  3. CDB$ROOT is the name of the root container.
  4. All PDBs belong to a single root container.
  5. User or application data should never stored in the root.
  6. You can have common users for system administration in root that crosses all PDB in the root container.
  7. One seed PDB exist in all root containers, Oracle supplies this template to create new PDB.

 

PDB – Pluggable Database

  1. PDB$SEED is the name of the seed PDB in all root container databases.
  2. You cannot add or modify objects in PDB$SEED.
  3. Zero or more user-created PDBs in CDB.
  4. PDBs are entities that contain application data and code for specific features.
  5. PDBs do not contain oracle supplied metadata or common users.
  6. No PDBs exist at CDB creation.
  7. PDBs are uniquely named in a CDB.
  8. PDBs name must be unique across multiple CDB if using the same listener.

 

 

Larry Catt

OCP

Non-supported features in Oracle 12c Multitenant database (CDB)

As of Oracle 12c release 12.1.0.2  the following features are not supported for use in CDB instances.

  1. Database Change Notification
  2. Continuous Query Notification (CQN)
  3. Client Side Cache
  4. Heat Map
  5. Automatic Data Optimization
  6. Oracle Streams
  7. Oracle Fail Safe
  8. Flashback Pluggable Database (Flashback Database works but will flashback CDB$ROOT including all PDBs)
  9. DBVERIFY
  10. Data Recovery Advisor (DRA)
  11. Flashback Transaction Backout

 

Larry Catt

OCP

Configure listener.ora for CDB

With Oracle 12c multitenant databases connection is still normally performed through the Oracle networking files of listener.ora, tnsnames.ora, and sqlnet.ora.   This articles shows the configuration of listener.ora file to support connection to a CDB database called cdb1.

 

 

  1. Logon to your Oracle Server as the oracle software owner.

 

[larry@linux2 ~]$ su – oracle

Password:

Last login: Mon FEB 24 09:57:56 EDT 2016 on pts/0

[oracle@linux2 ~]$

 

  1. Create the file listener.ora with the following statement:

 

echo -e “SID_LIST_LISTENER =\n” \

”  (SID_LIST =\n” \

”      (SID_DESC =\n” \

”      (SID_NAME = “$ORACLE_SID”)\n” \

”      (SERVICE_NAME = “$ORACLE_SID”)\n” \

”      (GLOBAL_DBNAME = “$ORACLE_SID”)\n” \

”      (ORACLE_HOME = “$ORACLE_HOME”)\n” \

”    )\n” \

”  )\n” \

“\nLISTENER =\n” \

”  (DESCRIPTION_LIST =\n” \

”    (DESCRIPTION =\n” \

”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

”  ))\n” \

“\nADR_BASE_LISTENER = /opt/app/oracle\n” \

“\nLOGGING_LISTENER=ON\n” \

“\nTRACE_LEVEL_SERVER=SUPPORT\n” \

“\nSQLNET.INBOUND_CONNECT_TIMEOUT=240\n” >> $ORACLE_HOME/network/admin/listener.ora

 

 

Execution example:

 

 

[oracle@linux2 admin]$ echo -e “SID_LIST_LISTENER =\n” \

> ”  (SID_LIST =\n” \

> ”      (SID_DESC =\n” \

> ”      (SID_NAME = “$ORACLE_SID”)\n” \

> ”      (SERVICE_NAME = “$ORACLE_SID”)\n” \

> ”      (GLOBAL_DBNAME = “$ORACLE_SID”)\n” \

> ”      (ORACLE_HOME = “$ORACLE_HOME”)\n” \

> ”    )\n” \

> ”  )\n” \

> “\nLISTENER =\n” \

> ”  (DESCRIPTION_LIST =\n” \

> ”    (DESCRIPTION =\n” \

> ”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

> ”  ))\n” \

> “\nADR_BASE_LISTENER = /opt/app/oracle\n” \

> “\nLOGGING_LISTENER=ON\n” \

> “\nTRACE_LEVEL_SERVER=SUPPORT\n” \

> “\nSQLNET.INBOUND_CONNECT_TIMEOUT=240\n” >> $ORACLE_HOME/network/admin/listener.ora

 

  1. Now start the listener with the command: lsnrctl start

 

[oracle@linux2 ~]$ lsnrctl start

 

LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 24-FEB-2016 10:58:06

 

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

 

Starting /opt/app/oracle/product/12.1.0.2/db_1/bin/tnslsnr: please wait…

 

TNSLSNR for Linux: Version 12.1.0.2.0 – Production

System parameter file is /opt/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora

Log messages written to /opt/app/oracle/diag/tnslsnr/linux2/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.30.15.75)(PORT=1521)))

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.30.15.75)(PORT=1521)))

STATUS of the LISTENER

————————

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.1.0.2.0 – Production

Start Date                24-FEB-2016 10:58:06

Uptime                    0 days 0 hr. 0 min. 0 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /opt/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora

Listener Log File         /opt/app/oracle/diag/tnslsnr/linux2/listener/alert/log.xml

Listening Endpoints Summary…

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.30.15.75)(PORT=1521)))

Services Summary…

Service “cdb1” has 1 instance(s).

  Instance “cdb1”, status UNKNOWN, has 1 handler(s) for this service…

The command completed successfully

[oracle@linux2 ~]$

 

  1. You can test the listener configuration by suppling the tnsping utility with the <machine_IP>:<Port>/<service_name> as below:

 

[oracle@linux2 admin]$ tnsping 10.30.15.75:1521/cdb1

 

TNS Ping Utility for Linux: Version 12.1.0.2.0 – Production on 24-FEB-2016 11:04:40

 

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

 

Used parameter files:

 

Used HOSTNAME adapter to resolve the alias

Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=cdb1))(ADDRESS=(PROTOCOL=TCP)(HOST=10.30.15.75)(PORT=1521)))

OK (10 msec)

[oracle@linux2 admin]$

 

  1. This completes configuration of listener.ora file for CDB.

 

 

Larry Catt

OCP

 

 

Methods to Migrate stand-alone database to PDB

12c release has given us the ability to virtualize databases.   These procedure outlines three methods to move a stand-alone database to a 12c PDB.   Each of these methods have both positive and negatives aspects.  Careful thought, analysis and some testing should be performed before deciding which method is best for your situation.

 

 

Method 1 – DBMS_PDB package.

DBMS_PDB package is provided with Oracle 12c RDBMS release.  It provides multiple procedures for checking, preparing, creating conversions, and cleaning up after movement of standalone database to PDB.

 

Pros:

  1. Removes guess work from conversion process.
  2. No coding on administrators part.
  3. No need to create PDB before procedure.

 

Cons:

  1. No ability to transform data elements.

 

Method 2 – Data Pump

Use the EXP/IMP to extract metadata and data from standalone database into PDB.

 

Pros:

  1. EXP/IMP utility of data pump are well known.
  2. Able to do inclusive/exclusive data movement.
  3. Able to start and stop.

 

Cons:

  1. Have to build CDB and PDB for destination.
  2. Can requires disk space for exports.
  3. Can be very time consuming.

 

Method 3 – Goldengate / ETL technology

Use Goldengate or other ETL tool to move data from existing standalone into PDB.

 

Pros:

  1. Can be done online with minimal down time.
  2. Is extremely flexible.
  3. Able to start and stop.
  4. Able to transform data during process.

 

Cons:

  1. Have to build CDB and PDB for destination.
  2. Expensive licensing cost.
  3. Can be time consuming.

 

 

 

Larry Catt

OCP

Configure Linux for multiple Oracle Database connections

You can have multiple database on a single server of any platform.    The key to this configuration is have the appropriate environmental parameter for the database you which to attach to.   This procedure demonstrates the setup of .bash_profile file to set the appropriate OS environmental parameters upon attachment as the Oracle software owner.  NOTE: This procedure was done on a Oracle Enterprise Linux server.

 

  1. Logon to your database server as the root user.

 

[larry@linux2 ~]$ su –

Password:

Last login: Wed Jan  7 08:49:18 EST 2016 on pts/1

[root@linux2 ~]#

 

  1. List the current databases running on your database server with command: ps –ef|grep smon

 

[root@linux2 ~]# ps -ef|grep smon

oracle    3793     1  0 08:47 ?        00:00:00 ora_smon_cdb1

oracle    6454     1  0 09:38 ?        00:00:00 ora_smon_orcl

root     15059 15008  0 13:44 pts/1    00:00:00 grep –color=auto smon

[root@linux2 ~]#

 

  1. From the ‘ps’ command, we can see there are two active database instance on this server: CDB1 and ORCL.   We need to adjust the .bash_profile file in the oracle software owner home directory to choose between these two instances at logon.
  2. Go to the home directory of your oracle software owner.

 

[root@linux2 ~]# cd /home/oracle

[root@linux2 oracle]#

 

  1. Now normal install of multiple databases on a single server will all use the same Oracle binaries, thus the only thing which will be different between the environmental variables will be the ORACLE_SID value. If something else is different, you can adjust the shell script below to allow for more variable definition.   In this example attach the following to end of the .bash_profile file with vi.

 

## Beginning of request for information

database=””

while [ -z “$db” ]

do

   echo “Enter database to use:”

   echo “1 – ORCL       “

   echo “2 – CDB1       “

   echo “Option > “

read db

   if [[ “$db” != “1” &&

         “$db” != “2” ]]

   then

      echo “$db” is not valid >&2

      db=””

   fi

done

## Ending of request for information </strong>

 

 

 

##Beginning of local variable definitions

if [[ $db = “1” ]]

then

   export ORACLE_SID=orcl

elif [[ $db = “2” ]]

then

   export ORACLE_SID=cdb1

else

   echo “Invalid options “

fi

## Ending of local variable definitions

 

  1. Now logon as the oracle software owner and you will be prompted to give 1 for orcl instance or 2 for cdb1. Any other options will produce nothing.

 

Choosing option 1 example:

 

[root@linux2 oracle]# su – oracle

Last login: Wed Jan  7 14:02:23 EST 2016 on pts/1

Enter database to use:

1 – ORCL

2 – CDB1

1

[oracle@linux2 ~]$ echo $ORACLE_SID

orcl

[oracle@linux2 ~]$

 

 

 

 

 

Choosing option 2 example:

 

[root@linux2 oracle]# su – oracle

Last login: Wed Jan  7 14:04:51 EST 2016 on pts/1

Enter database to use:

1 – ORCL

2 – CDB1

2

[oracle@linux2 ~]$ echo $ORACLE_SID

cdb1

[oracle@linux2 ~]$

 

 

Choosing option other than 1 or 2 example:

 

[root@linux2 oracle]# su – oracle

Last login: Wed Jan  7 14:12:24 EST 2016 on pts/1

Enter database to use:

1 – ORCL

2 – CDB1

Option >

3

3 is not valid

Enter database to use:

1 – ORCL

2 – CDB1

Option >

4

4 is not valid

Enter database to use:

1 – ORCL

2 – CDB1

Option >

 

 

 

  1. This completes setup of Linux for multiple Oracle Databases.

 

 

Larry Catt

OCP

 

RMAN Backup of CDB in Oracle 12c Multitenant Database

RMAN backup of a CDB in Oracle 12c Multitenant Database can be performed from the Recovery Manager utility or EM Cloud Control.    This procedure shows the steps of performing a CDB backup from RMAN utility.

 

  1. Logon to your oracle database server as the oracle software owner.

 

[root@linux2 larry]# su – oracle

Last login: Thu Jan  3 11:02:25 EDT 2016 on pts/1

[oracle@linux2 ~]$

 

  1. Enter the RMAN utility.

 

[oracle@linux2 ~]$ rman

 

Recovery Manager: Release 12.1.0.2.0 – Production on Tue Jan 15 12:26:22 2016

 

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

 

RMAN>

 

  1. Connect to your target CDB database with SYSBACKUP privilege.

 

RMAN> connect target ‘”sys/@cdb1 as sysbackup”‘

 

target database Password:

connected to target database: CDB1 (DBID=898165058)

 

RMAN>

 

  1. Validate the database you are connected to with SQL command: select name from v$database.

 

RMAN> select name from v$database;

 

using target database control file instead of recovery catalog

NAME

———

CDB1

 

RMAN>

 

  1. Now that you are connected to the database you can perform the following backups:
    • Example of entire CDB backup and all PDBs:

RMAN> BACKUP DATABASE;

  • Example of CDB backup and all PDBs, switch online redo logs and include archivelog.

RMAN>  BACKUP DATABASE PLUS ARCHIVELOG;

  • Backup just the root.

RMAN>  BACKUP DATABASE ROOT;

 

  1. This completes backup of CDB using RMAN utility.

 

Larry Catt

OCP

 

 

Managing tablespaces in CDB and PDB

An Oracle 12c multitenant database consist of a CDB which houses one to many PDBs serving end user applications.    Thus objects such as tablespaces can become a little confusing to manage with questions of do they belong to CDB or PDB or both.   This article tries to clear this subject and give a brief tutorial in managing tablespaces in the multitenant architecture.

 

Rules to tablespaces in CDB and PDB:

 

  1. Permanent tablespace can only be associated with a single container (CDB or PDB).
  2. When you create a tablespace in a container, it belongs to that container.
  3. CDB can have only one active undo tablespace or one active undo tablespace for each instance of RAC.
  4. Only one default temporary tablespace for CDB.
  5. PDBs can use the CDB’s temporary tablespace.
  6. Each PDB can have its own default temporary tablespace.
  7. PDBs can have their own tablespaces.
  8. Permanent Default tablespace in PDB can still use the ALTER DATABASE command, but it is preferred to use the command:

ALTER PLUGGABLE DATABASE DEFAULT TABLESPACE tbs_user_pdb;

  1. CDB will have only one temporary tablespace.
  2. To modify the temporary tablespace for CDB, the current container must be root.
  3. You can have other temporary tablespaces in CDB with specific users assigned to them, but only one default.
  4. Each PDB can have only one temporary tablespace and when PDB is unplugged so is its temporary tablespace.

 

 

 

Managing tablespaces in Multitenant architecture.

 

  1. Logon as the oracle software owner.

[larry@linux2 ~]$ su – oracle

Password:

Last login: Tue Oct 25 09:29:48 EDT 2015 on pts/1

[oracle@linux2 ~]$

 

  1. Connect to your CDB with sqlplus and show current container.

 

[oracle@linux2 ~]$ sqlplus / as sysdba

 

SQL*Plus: Release 12.1.0.2.0 Production on Wed Oct 26 10:02:53 2015

 

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, OLAP, Advanced Analytics and Real Application Testing options

 

SQL> show con_name

 

CON_NAME

——————————

CDB$ROOT

SQL>

 

  1. Create a new permanent tablespace in the root container of cdb1_user, set it as the default tablespace for root.

 

SQL> create tablespace cdb1_users

datafile ‘/opt/app/oradata/cdb1_users.dbf’ size 10m;  2

 

Tablespace created.

 

SQL> ALTER DATABASE DEFAULT TABLESPACE cdb1_users;

 

Database altered.

 

SQL>

 

  1. View tablespaces from the root container and default tablespaces.

 

SQL> select tablespace_name from dba_tablespaces;

 

TABLESPACE_NAME

——————————

SYSTEM

SYSAUX

UNDOTBS1

TEMP

USERS

CDB1_USERS

 

6 rows selected.

 

SQL> select distinct(default_tablespace) from dba_users;

 

DEFAULT_TABLESPACE

——————————

SYSAUX

CDB1_USERS

SYSTEM

 

 

  1. Change to one of your pluggable database and note that you cannot see the newly create tablespace cdb1_users.

 

SQL> alter session set container=pdb1;

 

Session altered.

 

SQL> select tablespace_name from dba_tablespaces;

 

TABLESPACE_NAME

——————————

SYSTEM

SYSAUX

TEMP

USERS

 

SQL>

 

  1. Create a tablespace tablespace in your PDB and move back to your root container.

 

SQL> create tablespace pdb1_users

datafile ‘/opt/app/oradata/pdb1_users.dbf’ size 10m;  2

 

Tablespace created.

 

SQL> select tablespace_name from dba_tablespaces;

 

TABLESPACE_NAME

——————————

SYSTEM

SYSAUX

TEMP

USERS

PDB1_USERS

 

SQL> alter session set container=CDB$ROOT;

 

Session altered.

 

SQL> select tablespace_name from dba_tablespaces;

 

TABLESPACE_NAME

——————————

SYSTEM

SYSAUX

UNDOTBS1

TEMP

USERS

CDB1_USERS

 

6 rows selected.

 

SQL>

 

 

  1. This completes the management of tablespaces within the multitenant database architecture.

 

Larry Catt

OCP

Benefits of Oracle CDB and PDB

New to Oracle 12c is the feature of multitenant databases or CBD/PDB implementation to add a form of Virtualization to the Oracle RDBMS world.    This new feature is designed to reduce the number of physical server machines currently required to house normal database suites.    It is fairly common to have a large number of small data stores in an organization to server various system needs and though the resource requirements of these data stores is relatively low, they still exist on a single VM or physical server.   CDB and PDB technology looks to resolve this issue by combining these databases into a single instance which appears to be stand-alone to the outside world.   This article lists and describes the benefits of a CDB/PDB implementation.

 

  1. Database Consolidation – Multitenant Databases implementations can consolidate several small databases on separate servers into a CDB using one server. Allowing the organization to minimize the number of physical or virtual servers being used without reducing the number of application data stores being accessed.

 

  1. Reduced Cost – Reduction in the number of physical and virtual machines in use saves money in hardware, labor costs, floor space, and a multitude of other ways.

 

 

  1. Rapid Implementation – Implementation of a new data store or the movement of existing database is significantly reduced both in complexity and resource requirements. New PDB can be created on the fly to test various applications and removed when no longer needed.

 

  1. Simplified Management – Reduced number of servers and database instances easies the burden placed on administrators and management to ensure proper operations of a data center. Thus allowing of an increased level of performance to end users.

 

  1. Separation of administrative duties – Administration of the CDB and PDB are branched along resource lines where CDB control memory and processes and allocate them to various PDBs based on needs. CDB administration consists of managing performance related to OS and internal processes.  PDB administration is focused on performance related to application using the data store.   Thus creating a well-defined separation of administrative duties between CDB and PDB.   DBA responsible for CDB administration are focused on system/processes performance improvements and DBA responsible for individual PDB are focused on application implementation performance.

 

  1. Simplified Patching – Patching/upgrade single CDB database which contains multiple PDBs and not multiple separate databases.

 

 

Larry Catt

OCP

Recovery of CDB in Oracle 12c Multitenant Database

Oracle 12c multitenant database can use the Recovery Manager utility or EM Cloud control to recover a database from a previously taken backup set.   This procedure outlines the general steps to recover a database using the RMAN utility.

 

 

  1. Logon to your database server as the oracle software owner.

 

[root@linux2 etc]# su – oracle

Last login: Wed Nov 30 11:45:07 EST 2015 on pts/1

[oracle@linux2 ~]$

 

  1. Logon to RMAN utility with sysbackup privileges.

 

[oracle@linux2 ~]$ rman target ‘”/ as sysbackup”‘

Recovery Manager: Release 12.1.0.2.0 – Production on Thu Dec 1 09:26:07 2015

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CDB1 (DBID=898155058)

 

RMAN>

 

  1. Place the database in mount mode.

 

RMAN> shutdown immediate

Oracle instance shut down

 

RMAN> startup mount

connected to target database (not started)

Oracle instance started

database mounted

Total System Global Area     734003200 bytes

Fixed Size                     2928728 bytes

Variable Size                524292008 bytes

Database Buffers             201326592 bytes

Redo Buffers                   5455872 bytes

 

RMAN>

 

  1. Issue the command RESTORE DATABASE;

 

RMAN> restore database;

 

Starting restore at 01-DEC-15

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=22 device type=DISK

 

skipping datafile 5; already restored to file /u01/oradata/cdb1/pdbseed/system01.dbf

skipping datafile 7; already restored to file /u01/oradata/cdb1/pdbseed/sysaux01.dbf

channel ORA_DISK_1: starting datafile backup set restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_DISK_1: restoring datafile 00001 to /u01/oradata/cdb1/system01.dbf

…………….

…………….

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:00:45

Finished restore at 01-DEC-15

 

RMAN>

 

  1. Issue the command RECOVER DATABASE;

 

RMAN> RECOVER DATABASE;

 

Starting recover at 01-DEC-15

using channel ORA_DISK_1

 

starting media recovery

media recovery complete, elapsed time: 00:00:04

 

Finished recover at 01-DEC-15

 

RMAN>

 

 

  1. You can remove any database archive redo logs after they are no longer needed using command: RECOVER DATABASE DELETE ARCHIVELOG;

 

RMAN> RECOVER DATABASE DELETE ARCHIVELOG;

 

Starting recover at 01-DEC-15

using channel ORA_DISK_1

 

starting media recovery

media recovery complete, elapsed time: 00:00:00

 

Finished recover at 01-DEC-15

 

RMAN>

 

  1. Open the database for normal operation with command: alter database open;

 

RMAN> alter database open;

 

Statement processed

 

RMAN>

 

 

  1. This completes recovery of CDB database with all PDBs.

 

Larry Catt

OCP