Wednesday 12 November 2014

Container & Pluggable Databases 12C



Container Database & Pluggable Databases:
The multitenant option represents one of the biggest architectural changes in the history of the Oracle database. The option introduced the concepts of the Container Database (CDB) and Pluggable Database (PDB).
  • Container Databases (CDB) : This seems very similar to a conventional Oracle database, as it contains most of the working parts you will be already familiar with (controlfiles, datafiles, undo, tempfiles, redo logs etc.). It also houses the data dictionary for those objects that are owned by the root container and those that are visible to all PDBs.
  • Pluggable Database (PDB) : Since the CDB contains most of the working parts for the database, the PDB only needs to contain information specific to itself. It does not need to worry about controlfiles, redo logs and undo etc. Instead it is just made up of datafiles and tempfiles to handle it's own objects. This includes it's own data dictionary, containing information about only those objects that are specific to the PDB.
This split of the data dictionary between common objects, in the root container, and PDB-specific objects, in the PDB's data dictionary, is very important, because this separation is what gives the multitenant option its flexibility. From the perspective of the PDB, the data dictionary is the union of the root and PDB data dictionaries, so internally the PDB feels very much like a normal Oracle database. For example, the DBA_% and ALL_% views within the PDB appears the same as any non-CDB database.
Creating Pluggable Databases (PDBs)
Since the bulk of the working parts are already present in the root container, creating a new PDB is a comparatively quick and simple task. When creating a completely new PDP, the PDB is created as a copy of a seed PDB, so it only takes as long as the files take to copy.
Instead of creating a new PDB from the seed, you can clone an existing PDB.


It is also possible to create clones in a remote CDB.


Wednesday 27 August 2014

Dividing the Backup of a Large Datafile into Sections

Dividing the Backup of a Large Datafile into Sections


If you specify the SECTION SIZE parameter on the BACKUP command, then RMAN creates a backup set in which each backup piece contains the blocks from one file section. A file section is a contiguous range of blocks in a file. This type of backup is called a multi-section backup.

Note:
You cannot specify SECTION SIZE in conjunction with MAXPIECESIZE.
The purpose of multisection backups is to enable RMAN channels to back up a single large file in parallel. RMAN divides the work among multiple channels, with each channel backing up one file section in a file. Backing up a file in separate sections can improve the performance of backups of large datafiles.

If a multisection backup completes successfully, then none of the backup sets generated during the backup contain a partial datafile. If a multisection backup is unsuccessful, then it is possible for the RMAN metadata to contain a record for a partial backup set. RMAN does not consider partial backups for restore and recovery. You must use the DELETE command to delete the partial backup set.

If you specify a section size that is larger than the size of the file, then RMAN does not use multisection backup for the file. If you specify a small section size that would produce more than 256 sections, then RMAN increases the section size to a value that results in exactly 256 sections.

To make a multisection backup:

Start RMAN and connect to a target database and recovery catalog (if used).

If necessary, configure channel parallelism so that RMAN can parallelize the backup.

Execute BACKUP with the SECTION SIZE parameter.

For example, suppose that the users tablespace contains a single datafile of 900 MB. Also assume that three SBT channels are configured, with the parallelism setting for the SBT device set to 3. You can break up the datafile in this tablespace into file sections as shown in the following example:

BACKUP
  SECTION SIZE 300M
  TABLESPACE users; 

In this example, each of the three SBT channels backs up a 300 MB file section of the users datafile.

Monday 18 August 2014

RMAN script to take full database backup

RMAN script to take full database backup

Before taking a backup using RMAN , First we have to decide which type of backup you want to take. You can take online or offline backup using RMAN. For online backups, database archiving must be turned ON. If archiving of you database is not ON, database must be in MOUNT stage to take backup using RMAN. Oracle recommends you to turn ON archiving to protect your data. This example is tested with online backup option.

 First step is to start RMAN, click Start->Run and type RMAN and press Enter key.
 Second step is to connect RMAN to database. In this example, RMAN metadata will be saved in control
 file of target database. Now, issue following commands to connect database.
  RMAN> Connect target /
  Here note down DBID of database. This DBID will be used in recovery process
Third step is to Create a directory name as “D:\RMANBACKUP”. Now type following script to take full database backup.

RMAN> run{
2> configure controlfile autobackup format for device type disk to 'd:/rmanbackup/%F';
3> configure controlfile autobackup on;
4> allocate channel d1 type disk;
5> backup tag FULL_DB format 'd:/rmanbackup/db_%t_%s.bk' (database);
6> release channel d1;
7> }

After the procedure is competed, you will find backupup files in “D:\RMANBACKUP” directory.These backup files can be used to recover any datafile or all datafiles, control file or SPFILE.

In production database, you will have several backups. What if you want to restore a particular backup? To handle this issue, RMAN supports a TAG with each backup. In above script tag FULL_DB is used at line 3. At the time of recovery this tag can be used to restore a particular backup.
Following is the snapshot of all above process.

Thursday 14 August 2014

When do I use Active Data Guard and GoldenGate Together

When do I use Active Data Guard and GoldenGate Together


Active Data Guard and GoldenGate are not mutually exclusive. The following examples of high availability architectures that include the simultaneous use of both technologies:
  • An Active Data Guard standby is utilized for disaster protection and database rolling upgrades for a mission critical OLTP database. GoldenGate is used to extract data from the Data Guard primary database (or from the standby database using GoldenGate ALO mode) for ETL update of an enterprise data warehouse.
  • GoldenGate subset replication is used extract, transforms, and aggregate data from numerous data sources into a central operational data store (ODS). The ODS supports mission critical application systems that generate significant revenue for the company. An Active Data Guard standby database is used to protect the ODS, providing optimal data protection and availability.
  • GoldenGate multi-master replication is utilized to synchronize several databases, each located in different geographies. Each GoldenGate copy has its own local synchronous Data Guard standby database that enables zero data loss failover should an outage occur. GoldenGate capture and apply processes are easily restarted on the new primary database following a failover since primary and standby are an exact, up-to-date replica of each other.
  • Reducing planned downtime for various planned maintenance activities not supported by Data Guard – such as cross-endian platform migration or application upgrades that modify back-end database objects. In many cases customers wish to isolate a current mission critical production environment having a Data Guard primary and standby database from being impacted by the maintenance activity. A parallel environment (new primary and standby) is deployed on the new release or new platform and GoldenGate one-way or bi-directional replication is used to keep old and new environments synchronized. Production is moved to the new environment once sufficiently tested. GoldenGate can continue to replicate to the previous environment for fast fall-back until the stability of the new version is no longer in question, at which time the old environment can be de-commissioned.

More Links :


Wednesday 13 August 2014

When do I use Oracle Golden-Gate

When do I use Oracle GoldenGate?

Use Oracle GoldenGate when a replica database must be open read-write while replication is active, or for advanced replication requirements beyond what is addressed by Active Data Guard:
  • Any requirement where the replica database must be open read-write while synchronizing with the primary database
  • Any advanced replication requirements such as: multimaster and bidirectional replication, subset replication, many to one replication, cross endian replication, and data transformations
  • Maintenance and migrations where zero downtime using bi-directional replication is required
  • Application upgrades that modify back-end database objects. GoldenGate maintains availability and reduces planned downtime by replicating between old and new versions of the database (the user implements mapping between differences in database objects in old and new versions of the database
  • Any cross platform migration not supported by Data Guard (e.g. cross endian platform migration)
  • Any replication requirement where you replicate from a more recent version of Oracle Database to an earlier version of Oracle Database (e.g. from Oracle Database 11g to Oracle Database 10g)
More Links :