Tuesday, December 31, 2013

Y2013 - Technical Review


1. Three Oracle Technical Articles published in World Famous Site
    "Oracle Technology Network (OTN)" in Y2013.
   
Article-1: Oracle Exadata Database Machine: “Exachk”

Article-2: Oracle RAC 12c: "Flex ASM" y "Flex Cluster"

Article-3: Oracle Exadata Database Machine: "Smart Flash Logging"

url: http://www.oracle.com/technetwork/es/articles/index.html

2. Speaker @OTN Yathra Y2013, @AIOUG-Tech Day Y2013 & Demonstrator @Sangam Y2013

http://otnyatra.com/using-joomla/extensions/components/content-component/article-category-list/73-chennai

http://otnyatra.com/using-joomla/extensions/components/content-component/article-category-list/73-chennai

http://otnyatra.com/index.php?option=com_content&view=article&id=71:bangalore&catid=19&Itemid=260

http://www.aioug.org/events/index.php/using-joomla/extensions/components/content-component/article-category-list/75-techdayhyd

Monday, December 30, 2013

Oracle Articles Published in "Oracle Technology Network (OTN)"


 Article-3 : Oracle Exadata Database Machine: “Exachk”




Sunday, December 29, 2013

Interview with Kellyn Pot’Vin - Oracle ACE & Expert

Kellyn Pot’Vin – Oracle ACE & Expert



A talented and accomplished multi-platform database administrator with twelve years of extensive experience in Oracle and SQL Server, numerous years experience in MySQL, Sybase and other database platforms, database group management and technical project management.
A proven ability to implement large-scale database servers for enterprise level environments, repeatable success in high-end environment performance tuning, migrations, disaster recovery and implementation. Fluent as a liaison between technical and non-technical users and able to build trust through proven reliability and initiative.
Adept at gathering requirements, project scheduling, capacity planning and technology choices for a business’ long-term future.
Possesses multiple certifications, including MCDBA, OCP and PMI and has outstanding presentation and communication skills combined with finely tuned technical skills..

Specialties

Performance Tuning, backup/recovery, monitoring, scripting, trouble-shooting, migrating/upgrading and managing of multi-platform database environments. Has presented at RMOUG, written database articles for multiple technical publications and maintains a popular blog on database performance techniques called DBA Kevlar, (dbakevlar.com).
Member of the Board of Directors for RMOUG, Director of Memberships and Vendors.
Can you please Describe about yourself Personally & professional experience ?
I’m the oldest of three French-Canadian daughters.  My parents raised us all over the US as they found their own path.  My parents are very supportive of each other and in turn, believed “we gave you life, now live it!”  Due to this, I now live in Colorado, at the foothills of the Rock Mountains, with my partner, Tim and my three children, where my middle sister lives near my parents on the Pacific coast and my youngest sister lives in the Eastern area of the United States.
I became a DBA back in 1999, first introduced to Oracle, but quickly given responsibility over SQL Server environments, so my years experience in both platforms is very close to the same.  I was known for taking on challenges that others felt were hopeless and quickly found a niche in performance tuning.  I started contributing to the Oracle-l list and caught the interest of a few folks.  Chet Justice told me I needed to blog and after guest blogging at his site, I started my own, dbakevlar.blogspot.com that evolved into dbakevlar.com as it took off.   I did a stint with Pythian, which is a great group to bring recognition and am now with Enkitec, which seems like a dream!   I’ve been presenting at conferences in the US and Europe, both for Oracle and SQL Server and am currently working on chapters for proposed books in both platforms for Apress.
I have been on the board of directors at RMOUG, (www.rmoug.org) since 2011 after expressing an interest in volunteering to help out.  I am the Vendor and Membership director, providing support for all social media for the group.
Your hobbies,  favorite food & Your best places so far?
I read-  A LOT!  There is a pile of books that I continually adding to and subtracting from as I complete.  I also have books and magazines on my tablet.
I knit, garden, do yoga and enjoy cooking.
I don’t know if I have a favorite food, but I do have many preferred foods!  I love bananas from the grill with melted chocolate, cinnamon and vanilla sauce drizzled on them.  I have a pasty recipe, (sealed meat pie with potato, carrots and seasonings…) that is a favorite from when I was a child and I do love sweet potato fries.  I’m a small eater, so a little of something goes a long way with me.. :)
I haven’t gotten to travel too much yet, but looking forward to doing so in the coming years.  I have enjoyed trips to cities and finding what most people might miss.  In Ottawa, Ontario, there is the Canadian National War Museum, which in my opinion, is one of the best museums around.  I enjoyed the Canadian, (which was the British view) of the war of 1812, (yes, I’m a history buff!) along with the fantastic displays and large quantity of historical memorabilia.
In Galvenston Island, down in Texas, there is the Elise, an 1800′s navy ship that is still manned and lovingly cared for.  Inland from Cancun there is Chitzen Itza, one of the great Inca pyramids in Mexico.
How to reach you?
Twitter                                 : @dbakevlar
Facebook and Linkedin    : Kellyn Potvin
your strengths & weakness ?
Strength: My ability to take in everything at once and see things that are often invisible to others, along with my ability to multi-task on all of it.
I can spend five minutes with a person and tell you most of their strengths and weaknesses, what kind of family life they grew up.
I can find the impacting issue in a database environment that no one else has been able to locate.  I CAN find a needle in a haWeakstack! :)
Weakness:  I can be easily distracted by an odd noise.  It commonly is a noise that no one else would notice, yet for me- can sound akin to nails down a chalkboard and overwhelms everything else I happen to be focusing on at that time.  I dislike open office areas-  have been known to ask people to take their conversations to someplace else, not to be rude, but just due to the impact on my productivity and why I have issue with some of the new AGILE type seating arrangements.

How much time do you spend daily for technical stuff?
About 9 hours.  Six for clients, two for my employer and another one for outside demands such as my blog, etc.  I often spend a couple hours each weekend on technical work and as my partner is also in the same field, yes, it can be a conversations at dinner or during off-hours!
Can you share your experience on the first day of your job?
That was a long time ago….  I mostly remember that being a DBA had a lot of challenges and that my “never-give-up” attitude was going to be important to this career change!
Your opinion on OTN?
I utilize OTN for anything regarding the ACE program and for downloads.  I have not been as involved as I would like in the forums.
What are your overwhelming and embarrassing moments as an Oracle DBA?
I think the beginning of this year-  a combination of receiving my Oracle ACE, my presentation schedule for the year took off and then my employment with Enkitec, (www.enkitec.com)
I think all of us have had times when we were disappointed.  I think the biggest challenge came for me back in 2006 when I realized I was not receiving technical challenges and had to make some big changes in how and who I worked with.
What made you to learn & work on Oracle databases?
I have never hidden this-  I have strong ADHD tendencies and I prefer to have the second “D” stand for dynamic instead of disorder.  This is quite easy when you work with the way my mindset works.  Database administration, as with many technical careers, give me a lot of different, interesting tasks to keep my mind active.  If my focus starts to wane, it is easy to work on another task and keep the momentum up that many ADHD sufferers in other careers aren’t able to do.  The education opportunities are often in a session environment that allows interactive communication that benefits my learning style.  I like puzzles and many database environments are very complex, giving me something to “wrap my head around” and keep me intrigued.  I love the direction that Oracle is headed with EM12c, Exadata and ASH/AWR data.
Biggest technical challenges so far in your career?
Learning Exadata on my own.  I know I pestered so many with questions, such as Uwe Hesse, Greg Rahn and Kerry Osborne.  I had never been on an Exadata before and for me, the performance tuning was an easy jump, but the storage management, for a DBA who had kept her hands out of anything Unix/Linux area involved out of respect for my administrator, meant I needed to come up to speed quick on CELLCLI commands and how to apply a patch to a cell node.

Any role model in career point of view?
I have a list of 10 “DBA Gods” that I have built over the years, but it did all start with one, Tim Gorman. I first worked with him when I was just a junior DBA and he really impressed me as the standard of how a DBA should interact with others and a desire to achieve his level of technical knowledge.  Our roles have changes considerably in the years we’ve known each other, but he is still someone I greatly admire.  I also find role model’s in Alex Gorbachev, Cary Millsap and my boss, Kerry Osborne for how supportive they are to all they come into contact with.  They truly believe that everyone is better in the promotion of each individual through education.
Your own technical best books/ White papers/ Articles so far.. if any?
I really like Christian Antognini’s book,  “Troubleshooting Oracle Performance” and “Expert Oracle Exadata” by Kerry Osborne, Tanel Poder and Randy Johnson and “Oracle Insights:  Tales from the Oak Table” with a list of authors that is longer than my arm… :)
If you have blog, please share link and give a brief explanation on it?
dbakevlar.com
I had this aura around me of being bullet-proof.  Many people felt I could take a lot of challenges on and come out incredibly unharmed, so a few nicknamed me “Kellyn Kevlar”.  When Chet Justice asked me what I would name my blog, it seemed a no-brainer, as I wanted more DBA’s to be bullet proof, so that meant more of the bullet proof material, kevlar to be out there.
Your specialization in oracle?
Performance tuning and Enterprise Manager.  I ended up in Enterprise Manager due to no one wanting to work on it when it broke.  I understood the pieces that made up the application, so it became my tool of choice if I did wish for a GUI interface.
What is your view on Oracle vs Other database ( SQL server/Mysql/ DB2….), Are you proud as an Oracle DBA?
I am a proud multi-platform DBA.  My niche is performance tuning and that is in Oracle, SQL Server and MySQL.  I primarily have opportunities in Oracle and love it!  Oracle has some phenomenal features, but I also know there are some features I love in SQL Server, MySQL and if we get into it, there are some cool things about Informix, Sybase and Postgres, too!
What are the areas you will visit, so that you will keep up to date with Oracle?
I am spending a lot of time on how Oracle plans on addressing the hype around hadoop, some of the new features coming down the pipe for OLTP enhancements in SQL Server and MySQL.  I have been absorbing all the information I can find on ASH data and can’t wait for 12c to be announced!
what all the certifications you have done and in what way did they helped you?
My Oracle 8 certification is very out of date.  I took the class to get my Oracle 10g certification and then just didn’t allocate the time for the test.  In the area of the country I’m at, there is a limited group of senior Oracle DBA’s and if you are in that group, your experience is as important as certifications.  I would like to continue with my certifications, but there just hasn’t been any benefit to it at this time.
so what are you looking forward to learn technically in future?
I am working on more with the “under belly” of EM12c.  I just completed a process to migrate jobs over that I need to turn into Oracle.  I want to work more with the ASH and AWR data to assist other in how this data can contribute to quick answers to performance issues.
Your advice for oracle learners?
Never give up.  My oldest son, once exclaimed, “but Mom, you never screw up!”  I had explain to him that it only appeared that way, that I screwed up all the time, I just never gave up! Often when one gave up, if they had just attempted one more try could have been a success.  Surround yourself with those that will support you in your endeavors.  They don’t have to all be Oracle experts, but to have the support of those around you to succeed is vitally important.
Anything you can do in a GUI interface, (TOAD, DB Artisan, Enterprise Manager)- make sure you are able to do it at the command line, too!  There is nothing wrong with using the GUI, but you need to understand what is going on under the covers!
How are you experiencing as an ACE Member road map, Brief if any other achievements?
I love being an Oracle ACE.  They had made the requirements more strict a while back and I had been turned down a couple times as I was not part of a user group and wasn’t presenting enough.  I was thrilled to be recognized by my peers and OTN with my ACE award.
–Kellyn Pot’vin
–Special Thanks to Kellyn–

Wednesday, December 25, 2013

Oracle Articles Published in "Oracle Technology Network (OTN)".


Article-1 : Oracle Exadata Database Machine: "Smart Flash Logging"
Article-2 : Oracle RAC 12c: "Flex ASM" y "Flex Cluster"


Saturday, December 21, 2013

Publised Oracle Articles in World Famous Site - Oracle Technology Network (OTN)













Co-Author Of Oracle Technology Network (OTN) Articles:


1. Oracle RAC 12c: "Flex ASM" y "Flex Cluster"

http://www.oracle.com/technetwork/es/articles/database-performance/caracteristicas-flex-asm-y-cluster-2088714-esa.html

2. Oracle Exadata Database Machine: "Smart Flash Logging"

http://www.oracle.com/technetwork/es/articles/database-performance/exadata-smart-flash-logging-2088700-esa.html

Thursday, December 19, 2013

Configuring Active Data Guard (ADG) using Oracle Database 12c (With Container Database and Pluggable Databases) - Part-5


Setting Threshold & RedoRoutes Properties for Primary Database, Standby Database & FAR SYNC Database



[oracle@dbnode]$ export ORACLE_SID=cdb
[oracle@dbnode]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode]$ cd /u01/app/oracle/product/12.1.0/dbhome/bin
[oracle@dbnode]$ dgmgrl
DGMGRL for Linux: Version 12.1.0.1.0 - 64bit Production
Copyright (c) 2000, 2012, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle
Connected as SYSDG.

DGMGRL> disable fast_start failover;
Disabled.

DGMGRL> EDIT FAR_SYNC farsync SET PROPERTY 'RedoRoutes' = '(cdb : cdbstby ASYNC)';
Property "RedoRoutes" updated

DGMGRL> edit database cdbstby set property TransportDisconnectedThreshold=0;
Property "transportdisconnectedthreshold" updated

DGMGRL> edit database cdbstby set property transportlagthreshold=0;
Property "transportlagthreshold" updated

DGMGRL> edit database cdb set property TransportDisconnectedThreshold=0;
Property "transportdisconnectedthreshold" updated

DGMGRL> edit database cdb set property transportlagthreshold=0;
Property "transportlagthreshold" updated

DGMGRL> edit far_sync farsync set property TransportDisconnectedThreshold=0;
Property "transportdisconnectedthreshold" updated

DGMGRL> edit far_sync farsync set property transportlagthreshold=0;
Property "transportlagthreshold" updated

DGMGRL> edit database cdb set property ApplyLagThreshold=0;
Property "applylagthreshold" updated

DGMGRL> edit database cdbstby set property ApplyLagThreshold=0;
Property "applylagthreshold" updated

DGMGRL> edit database cdbstby set property logxptmode=sync;
Property "logxptmode" updated

DGMGRL> show configuration;
Configuration - DGCONFIG

  Protection Mode: MaxPerformance
  Databases:
  cdb      - Primary database
  farsync  - Far Sync
  cdbstby  - Physical standby database
  Fast-Start Failover: DISABLED

Configuration Status:
WARNING

DGMGRL> validate database cdb;
  Database Role:    Primary database
  Ready for Switchover:  Yes

DGMGRL> enable far_sync farsync;
Enabled.

Configuring Active Data Guard (ADG) using Oracle Database 12c (With Container Database and Pluggable Databases) - Part-4


Definition Of FAR SYNC database:

1. A lightweight Oracle database instance
2. Only a standby controlfile (created from primary database like phyical standby database controlfile process)
3. Password file, Standby Redo Log files & archive log files will have in Far Sync Instance
4. NO Data files & NO database to open for access
5. Far Sync database will deployed near distance to Primary Database to tolerate the impact of network latency

Configuration:

[oracle@dbnode]$ export ORACLE_SID=farsync
[oracle@dbnode]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode]$ cd /u01/app/oracle/product/12.1.0/dbhome/bin
[oracle@dbnode]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.1.0 Production on Tue Nov 19 13:19:05 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect sys/oracle as sysdba
Connected to an idle instance.

SQL> startup nomount pfile='/u01/pfile1.ora';
ORACLE instance started.

Total System Global Area  217157632 bytes
Fixed Size                         2286656 bytes
Variable Size                     159386560 bytes
Database Buffers              50331648 bytes
Redo Buffers                    5152768 bytes

SQL> alter database mount;
Database altered.

SQL> create spfile from  pfile='/u01/pfile1.ora';
File created.

SQL> shu immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

SQL> connect sys/oracle as sysdba
Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area  217157632 bytes
Fixed Size                         2286656 bytes
Variable Size                     159386560 bytes
Database Buffers              50331648 bytes
Redo Buffers                    5152768 bytes
Database mounted.

SQL> select open_mode,database_role from v$database;

OPEN_MODE            DATABASE_ROLE
--------------------      ---------------------
MOUNTED                 FAR SYNC 

Entries from listener.ora & tnsnames.ora:

[oracle@dbnode bin]$ cat /u01/app/oracle/product/12.1.0/dbhome/network/admin/listener.ora
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = cdb)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome)
      (SID_NAME = cdb)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = cdbstby)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome)
      (SID_NAME = cdbstby)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = cdbstby_DGMGRL)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome)
      (SID_NAME = cdbstby)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = cdb_DGMGRL)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome)
      (SID_NAME = cdb)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = farsync)
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome)
      (SID_NAME = farsync)
    )
   )
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dbnode.oracle.com)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle

[oracle@dbnode bin]$ cat /u01/app/oracle/product/12.1.0/dbhome/network/admin/tnsnames.ora
CDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dbnode.oracle.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdb)
    )
  )

cdbstby =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dbnode.oracle.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdbstby)
    )
  )

CDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dbnode.oracle.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdb_DGMGRL)
    )
  )

cdbstby =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dbnode.oracle.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdbstby_DGMGRL)
    )
  )
farsync =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dbnode.oracle.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = farsync)
    )
  )

Adding "FAR SYNC" database to DGMGRL Configuration:

[oracle@dbnode]$ export ORACLE_SID=cdb
[oracle@dbnode]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode]$ cd /u01/app/oracle/product/12.1.0/dbhome/bin
[oracle@dbnode]$ dgmgrl
DGMGRL for Linux: Version 12.1.0.1.0 - 64bit Production
Copyright (c) 2000, 2012, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle
Connected as SYSDG.

DGMGRL> show configuration;
Configuration - DGCONFIG
  Protection Mode: MaxPerformance
  Databases:
  cdb     - Primary database
  cdbstby - (*) Physical standby database

Fast-Start Failover: ENABLED

Configuration Status:
SUCCESS

DGMGRL> add far_sync 'farsync' as connect identifier is farsync;
far sync instance "farsync" added

DGMGRL> enable far_sync farsync;
Enabled.

Wednesday, November 27, 2013

Speaker @Oracle Technology Network (OTN) Yathra 2014 @Chennai, India on 1st March 2014 On "Oracle 12c Flex ASM and Flex Cluster" & "Oracle Exadata"


http://otnyatra.com/using-joomla/extensions/components/content-component/article-category-list/73-chennai

Speaker @Oracle Technology Network (OTN) Yathra 2014 @Bangalore, India on 27th Feb 2014 On "Oracle 12c Flex ASM and Flex Cluster"


http://otnyatra.com/using-joomla/extensions/components/content-component/article-category-list/71-bangalore

Wednesday, November 20, 2013

Technical Facts On Oracle Data Guard 12c - Far Sync Method


1. A lightweight Oracle database instance
2. Only a standby controlfile (created from primary database like phyical standby database controlfile process)
3. Password file, Standby Redo Log files & archive log files will have in Far Sync Instance
4. NO Data files & NO database to open for access
5. Far Sync database will deployed near distance to Primary Database to tolerate the impact of network latency
6. Far Sync instance will receive from redo synchronsly from primary database
7. Far Sync instance will forwards redo asynchronsly from physical standby database
8. Far Sync instance can compress redo transport
9. Best data protection and least performance impact on Primary Database
10. No changes in application.

Configuring Active Data Guard (ADG) using Oracle Database 12c (With Container Database and Pluggable Databases) - Part-3


Switchover and Switchback using DGMGRL utility

1. Login to the Primary Database (cdb)

[oracle@dbnode]$ export ORACLE_SID=cdb
[oracle@dbnode]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode]$ dgmgrl
DGMGRL for Linux: Version 12.1.0.1.0 - 64bit Production
Copyright (c) 2000, 2012, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle
Connected as SYSDG.

DGMGRL> show database cdb;

Database - cdb

  Role:              PRIMARY
  Intended State:    TRANSPORT-ON
  Instance(s):
    cdb

  Database Error(s):
    ORA-16820: fast-start failover observer is no longer observing this database

Database Status:
ERROR

2. Start 'Observer' (from separate terminal) and check the status of 'Database'
DGMGRL> show database cdb;

Database - cdb

  Role:              PRIMARY
  Intended State:    TRANSPORT-ON
  Instance(s):
    cdb

Database Status:
SUCCESS

DGMGRL> show database cdbstby;

Database - cdbstby

  Role:              PHYSICAL STANDBY
  Intended State:    APPLY-ON
  Transport Lag:     0 seconds (computed 0 seconds ago)
  Apply Lag:         0 seconds (computed 0 seconds ago)
  Apply Rate:        0 Byte/s
  Real Time Query:   OFF
  Instance(s):
    cdbstby

Database Status:
SUCCESS

DGMGRL> show configuration;

Configuration - DGCONFIG

  Protection Mode: MaxPerformance
  Databases:
  cdb     - Primary database
    cdbstby - (*) Physical standby database

Fast-Start Failover: ENABLED

Configuration Status:
SUCCESS

3. Switchover to Physical Standby Database (cdbstby)
DGMGRL> switchover to cdbstby;
Performing switchover NOW, please wait...
Operation requires a connection to instance "cdbstby" on database "cdbstby"
Connecting to instance "cdbstby"...
Connected as SYSDBA.
New primary database "cdbstby" is opening...
Operation requires startup of instance "cdb" on database "cdb"
Starting instance "cdb"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "cdbstby"

DGMGRL> exit

4. Login to the New Physical Standby Database (cdb)
[oracle@dbnode]$ export ORACLE_SID=cdb
[oracle@dbnode]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode]$ sqlplus /nolog

SQL*Plus: Release 12.1.0.1.0 Production on Mon Nov 18 21:29:59 2013

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

SQL> connect sys/oracle as sysdba
Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1386283008 bytes
Fixed Size                  2288248 bytes
Variable Size             469763464 bytes
Database Buffers          905969664 bytes
Redo Buffers                8261632 bytes
Database mounted.

SQL> alter database recover managed standby database cancel;
Database altered.

SQL> alter database recover managed standby database using current logfile disconnect;
Database altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     47
Next log sequence to archive   0
Current log sequence           47
SQL>

4. Login to the New Primary Database (cdbstby)
[oracle@dbnode]$ export ORACLE_SID=cdbstby
[oracle@dbnode]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode]$ sqlplus /nolog

SQL*Plus: Release 12.1.0.1.0 Production on Mon Nov 18 21:30:25 2013

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

SQL> connect sys/oracle@192.168.56.111:1521/cdbstby as sysdba
Connected.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     44
Next log sequence to archive   46
Current log sequence           46

5. Login to the DGMGRL for Switchback to Old Primary Database (cdb)
[oracle@dbnode]$ export ORACLE_SID=cdbstby
[oracle@dbnode]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode]$ dgmgrl

DGMGRL for Linux: Version 12.1.0.1.0 - 64bit Production
Copyright (c) 2000, 2012, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle
Connected as SYSDG.

DGMGRL> show database cdbstby;

Database - cdbstby

  Role:              PRIMARY
  Intended State:    TRANSPORT-ON
  Instance(s):
    cdbstby

Database Status:
SUCCESS

DGMGRL> show database cdb;

Database - cdb

  Role:              PHYSICAL STANDBY
  Intended State:    APPLY-ON
  Transport Lag:     0 seconds (computed 1 second ago)
  Apply Lag:         0 seconds (computed 1 second ago)
  Apply Rate:        0 Byte/s
  Real Time Query:   OFF
  Instance(s):
    cdb

Database Status:
SUCCESS

6. Login to the DGMGRL for Switchback to Old Primary Database (cdb)
DGMGRL> switchover to cdb;
Performing switchover NOW, please wait...
Operation requires a connection to instance "cdb" on database "cdb"
Connecting to instance "cdb"...
Connected as SYSDBA.
New primary database "cdb" is opening...
Operation requires startup of instance "cdbstby" on database "cdbstby"
Starting instance "cdbstby"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "cdb"
DGMGRL> exit

7. Check the status of Primary Database (cdb)
[oracle@dbnode]$ export ORACLE_SID=cdb
[oracle@dbnode]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode]$ dgmgrl
DGMGRL for Linux: Version 12.1.0.1.0 - 64bit Production
Copyright (c) 2000, 2012, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle
Connected as SYSDG.

DGMGRL> show database cdb;

Database - cdb

  Role:              PRIMARY
  Intended State:    TRANSPORT-ON
  Instance(s):
    cdb

Database Status:
SUCCESS

DGMGRL> show database cdbstby

Database - cdbstby

  Role:              PHYSICAL STANDBY
  Intended State:    APPLY-ON
  Transport Lag:     0 seconds (computed 0 seconds ago)
  Apply Lag:         0 seconds (computed 0 seconds ago)
  Apply Rate:        0 Byte/s
  Real Time Query:   OFF
  Instance(s):
    cdbstby

Database Status:
SUCCESS

DGMGRL>

Configuring Active Data Guard (ADG) using Oracle Database 12c (With Container Database and Pluggable Databases) - Part -2

1. Login to the Primary Database (cdb)
[oracle@dbnode ~]$ export ORACLE_SID=cdb
[oracle@dbnode ~]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode ~]$ cd /u01/app/oracle/product/12.1.0/dbhome/bin
[oracle@dbnode bin]$ ./sqlplus /nolog

SQL*Plus: Release 12.1.0.1.0 Production on Mon Nov 18 20:55:33 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect sys/oracle as sysdba
Connected to an idle instance.

SQL> startup;
ORACLE instance started.

Total System Global Area 1386283008 bytes
Fixed Size                  2288248 bytes
Variable Size             469763464 bytes
Database Buffers          905969664 bytes
Redo Buffers                8261632 bytes
Database mounted.
Database opened.

SQL> select con_id,name,open_mode from v$pdbs;

    CON_ID NAME                           OPEN_MODE
---------- ------------------------------ ----------
         2 PDB$SEED                       READ ONLY
         3 PDB1                           MOUNTED
         4 PDB2                           MOUNTED
         5 PDB3                           MOUNTED

SQL> connect sys/oracle@192.168.56.111:1521/pdb1 as sysdba
Connected.

SQL> alter database open;
Database altered.

SQL> connect sys/oracle@192.168.56.111:1521/pdb2 as sysdba
Connected.

SQL> alter database open;
Database altered.

SQL> connect sys/oracle@192.168.56.111:1521/pdb3 as sysdba
Connected.

SQL> alter database open;
Database altered.

SQL> connect sys/oracle@192.168.56.111:1521/cdb as sysdba
Connected.

SQL> select con_id,name,open_mode from v$pdbs;

    CON_ID NAME                           OPEN_MODE
---------- ------------------------------ ----------
         2 PDB$SEED                       READ ONLY
         3 PDB1                           READ WRITE
         4 PDB2                           READ WRITE
         5 PDB3                           READ WRITE

2. Login to the Pluggable Database (pdb1) in Primary Database (cdb) and create user and insert rows.
SQL> connect sys/oracle@192.168.56.111:1521/pdb1 as sysdba
Connected.

SQL> show con_name

CON_NAME
------------------------------
PDB1

SQL> create user user1 identified by user1;
User created.

SQL> grant connect,resource to user1;
Grant succeeded.

SQL> connect user1/user1@192.168.56.111:1521/pdb1
Connected.

SQL> create table user1_pdb1 (no number, name varchar2(20));
Table created.

SQL> insert into user1_pdb1 values (1, 'ORACLE');
1 row created.

SQL> commit;
Commit complete.

SQL> connect sys/oracle@192.168.56.111:1521/cdb as sysdba
Connected.

SQL> alter system switch logfile;
System altered.

SQL> alter system switch logfile;
System altered.

3. Login to the Physical Standby Database (cdbstby) and check Pluggable Database.

[oracle@dbnode ~]$ export ORACLE_SID=cdbstby
[oracle@dbnode ~]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode ~]$ cd /u01/app/oracle/product/12.1.0/dbhome/bin
[oracle@dbnode bin]$ ./sqlplus /nolog

SQL*Plus: Release 12.1.0.1.0 Production on Mon Nov 18 20:56:39 2013

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

SQL> connect sys/oracle as sysdba
Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1386283008 bytes
Fixed Size                  2288248 bytes
Variable Size             469763464 bytes
Database Buffers          905969664 bytes
Redo Buffers                8261632 bytes
Database mounted.

SQL> alter database recover managed standby database cancel;
Database altered.

SQL> alter database recover managed standby database using current logfile disconnect;
Database altered.

SQL> connect user1/user1@192.168.56.111:1521/pdb1
Connected.

SQL> select * from user1_pdb1;

        NO NAME
---------- --------------------
         1 ORACLE

Note: User1 created with user1_pdb1 table with inserted rows from Primary Database.

Configuring Active Data Guard (ADG) using Oracle Database 12c (With Container Database and Pluggable Databases) - Part-1

Configuring Active Data Guard (ADG) using Oracle Database 12c (With Container Database and Pluggable Databases)

Environment Info:

Oracle Software                : Oracle Database 12c (Release 12.1.0.1.0)
Primary Database (cdb)     : Contains one container database (cdb) and
                                           three pluggable databases (pdb1, pdb2 & pdb3)
Standby Database (cdbstby) : Physical Standby database

1. Enable force logging mode in Primary Database:

[oracle@dbnode]$export ORACLE_SID=cdb
[oracle@dbnode]$export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode]$sqlplus /nolog
SQL>connect sys/oracle@192.168.56.111:1521/cdb as sysdba
SQL>alter database force logging;

2. Configure the primary database to receive redo data, by adding the standby logfiles to the primary

SQL>alter database add standby logfile '/u01/app/oracle/oradata/CDB/standbylog/srl01.log' size 50M;
SQL>alter database add standby logfile '/u01/app/oracle/oradata/CDB/standbylog/srl02.log' size 50M;
SQL>alter database add standby logfile '/u01/app/oracle/oradata/CDB/standbylog/srl03.log' size 50M;
SQL>alter database add standby logfile '/u01/app/oracle/oradata/CDB/standbylog/srl04.log' size 50M;

3. Set LOG_ARCHIVE_CONFIG and LOG_ARCHIVE_DEST_2 parameters
SQL>alter system set log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST';
SQL>alter system set log_archive_config='dg_config=(cdb,cdbstby)';
SQL>alter system set log_archive_dest_2='service=cdbstby async valid_for=(online_logfile,primary_role) db_unique_name=cdbstby';
SQL>alter system set db_recovery_file_dest_size=5G;

4. Put the primary database in ARCHIVELOG mode to enable automatic archiving
SQL>shutdown immediate;
SQL>startup mount;
SQL>alter database archivelog;
SQL>alter database open;

5. Open all Pluggable Databases (pdb1, pdb2 & pdb3)
SQL>connect sys/oracle@192.168.56.111:1521/pdb1 as sysdba
SQL>alter database open

SQL>connect sys/oracle@192.168.56.111:1521/pdb2 as sysdba
SQL>alter database open

SQL>connect sys/oracle@192.168.56.111:1521/pdb3 as sysdba
SQL>alter database open

6. Check the Database Parameters before taking RMAN backup for Physical Standby Database
SQL>connect sys/oracle@192.168.56.111:1521/cdb as sysdba
SQL>show parameter

7. Backup database plus archivelog Create a copy of the primary database using RMAN
[oracle@dbnode]$export ORACLE_SID=cdb
[oracle@dbnode]$export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode]$rman
rman>connect target /
rman>backup database plus archivelog;

8. Create the needed folders and start the database in nomount and Copying the password file and
required parameters for pfile for Physical Standby Database (cdbstby)
a. mkdir cdbstby
b. mkdir /u01/app/oracle/admin/cdbstby/adump
c. mkdir /u01/app/oracle/admin/cdbstby/dpdump
d. mkdir /u01/app/oracle/admin/cdbstby/pfile
e. mkdir /u01/app/oracle/oradata/cdbstby
f. mkdir /u01/app/oracle/recovery_area/cdbstby
g. mkdir /u01/app/oracle/oradata/orclstby/cdb_pdb
h. mkdir /u01/app/oracle/oradata/orclstby/pdbseed
i. chmod -R 777 /u01/app/oracle/oradata/cdbstby
j. chmod -R 777 /u01/app/oracle/fast_recovery_area/cdbstby

[oracle@dbnode]$cp /u01/app/oracle/product/12.1.0/dbhome/dbs/orapwcdb /u01/app/oracle/product/12.1.0/dbhome/dbs/orapwcdbstby
[oracle@dbnode]$export ORACLE_SID=cdbstby
[oracle@dbnode]$export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode]$sqlplus /nolog
SQL> connect sys/oracle as sysdba
SQL> startup nomount pfile='/u01/app/oracle/product/12.1.0/dbhome/dbs/initcdbstby.ora'

9. RMAN - Create standby database
[oracle@dbnode]$export ORACLE_SID=cdb
[oracle@dbnode]$export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode bin]$ ./rman

Recovery Manager: Release 12.1.0.1.0 - Production on Mon Nov 18 15:31:22 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

RMAN> connect target sys/oracle@cdb
connected to target database: CDB (DBID=1947832183)

RMAN> connect auxiliary sys/oracle@cdbstby
connected to auxiliary database: CDBSTBY (not mounted)

RMAN> run {
2> duplicate target database for standby from active database
3> spfile
4> parameter_value_convert 'cdb','cdbstby'
5> set db_unique_name='cdbstby'
6> set db_create_file_dest='/u01/app/oracle/oradata/cdbstby'
7> set db_recovery_file_dest='/u01/app/oracle/oradata/cdbstby'
8> set control_files='/u01/app/oracle/oradata/cdbstby/cdbstby.ctl'
9> set db_file_name_convert='/u01/app/oracle/oradata/CDB/datafile/','/u01/app/oracle/oradata/cdbstby/','/u01/app/oracle/oradata/CDB/EAF5D9665BD920EDE0436F38A8C0925F/datafile/','/u01/app/oracle/oradata/cdbstby/','/u01/app/oracle/oradata/CDB/EAF567FA97681A8CE0436F38A8C0EAC5/datafile','/u01/app/oracle/oradata/cdbstby/','/u01/app/oracle/oradata/CDB/EAE60779AFDD1833E0436F38A8C00627/datafile','/u01/app/oracle/oradata/cdbstby/'
10> set log_file_name_convert='/u01/app/oracle/oradata/CDB/onlinelog/','/u01/app/oracle/oradata/cdbstby/','/u01/app/oracle/oradata/CDB/standbylog','/u01/app/oracle/oradata/cdbstby/'
11> set log_archive_max_processes='5'
12> set fal_client='cdbstby'
set fal_server='cdb'
13> 14> set log_archive_config='dg_config=(cdb,cdbstby)'
15> set log_archive_dest_2='service=cdb ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=cdb'
16> ;
17> }

Starting Duplicate Db at 18-NOV-13
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=22 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/12.1.0/dbhome/dbs/orapwcdb' auxiliary format
 '/u01/app/oracle/product/12.1.0/dbhome/dbs/orapwcdbstby'   ;
   restore clone from service  'cdb' spfile to
 '/u01/app/oracle/product/12.1.0/dbhome/dbs/spfilecdbstby.ora';
   sql clone "alter system set spfile= ''/u01/app/oracle/product/12.1.0/dbhome/dbs/spfilecdbstby.ora''";
}
executing Memory Script

Starting backup at 18-NOV-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=53 device type=DISK
Finished backup at 18-NOV-13

Starting restore at 18-NOV-13
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: restoring SPFILE
output file name=/u01/app/oracle/product/12.1.0/dbhome/dbs/spfilecdbstby.ora
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 18-NOV-13

sql statement: alter system set spfile= ''/u01/app/oracle/product/12.1.0/dbhome/dbs/spfilecdbstby.ora''

contents of Memory Script:
{
   sql clone "alter system set  audit_file_dest =
 ''/u01/app/oracle/admin/cdbstby/adump'' comment=
 '''' scope=spfile";
   sql clone "alter system set  dispatchers =
 ''(PROTOCOL=TCP) (SERVICE=cdbstbyXDB)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''cdbstby'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_create_file_dest =
 ''/u01/app/oracle/oradata/cdbstby'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_recovery_file_dest =
 ''/u01/app/oracle/oradata/cdbstby'' comment=
 '''' scope=spfile";
   sql clone "alter system set  control_files =
 ''/u01/app/oracle/oradata/cdbstby/cdbstby.ctl'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_file_name_convert =
 ''/u01/app/oracle/oradata/CDB/datafile/'', ''/u01/app/oracle/oradata/cdbstby/'', ''/u01/app/oracle/oradata/CDB/EAF5D9665BD920EDE0436F38A8C0925F/datafile/'', ''/u01/app/oracle/oradata/cdbstby/'', ''/u01/app/oracle/oradata/CDB/EAF567FA97681A8CE0436F38A8C0EAC5/datafile'', ''/u01/app/oracle/oradata/cdbstby/'', ''/u01/app/oracle/oradata/CDB/EAE60779AFDD1833E0436F38A8C00627/datafile'', ''/u01/app/oracle/oradata/cdbstby/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_file_name_convert =
 ''/u01/app/oracle/oradata/CDB/onlinelog/'', ''/u01/app/oracle/oradata/cdbstby/'', ''/u01/app/oracle/oradata/CDB/standbylog'', ''/u01/app/oracle/oradata/cdbstby/'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_archive_max_processes =
 5 comment=
 '''' scope=spfile";
   sql clone "alter system set  fal_client =
 ''cdbstby'' comment=
 '''' scope=spfile";
   sql clone "alter system set  fal_server =
 ''cdb'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_archive_config =
 ''dg_config=(cdb,cdbstby)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_archive_dest_2 =
 ''service=cdb ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=cdb'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  audit_file_dest =  ''/u01/app/oracle/admin/cdbstby/adump'' comment= '''' scope=spfile
sql statement: alter system set  dispatchers =  ''(PROTOCOL=TCP) (SERVICE=cdbstbyXDB)'' comment= '''' scope=spfile
sql statement: alter system set  db_unique_name =  ''cdbstby'' comment= '''' scope=spfile
sql statement: alter system set  db_create_file_dest =  ''/u01/app/oracle/oradata/cdbstby'' comment= '''' scope=spfile
sql statement: alter system set  db_recovery_file_dest =  ''/u01/app/oracle/oradata/cdbstby'' comment= '''' scope=spfile
sql statement: alter system set  control_files =  ''/u01/app/oracle/oradata/cdbstby/cdbstby.ctl'' comment= '''' scope=spfile
sql statement: alter system set  db_file_name_convert =  ''/u01/app/oracle/oradata/CDB/datafile/'', ''/u01/app/oracle/oradata/cdbstby/'', ''/u01/app/oracle/oradata/CDB/EAF5D9665BD920EDE0436F38A8C0925F/datafile/'', ''/u01/app/oracle/oradata/cdbstby/'', ''/u01/app/oracle/oradata/CDB/EAF567FA97681A8CE0436F38A8C0EAC5/datafile'', ''/u01/app/oracle/oradata/cdbstby/'', ''/u01/app/oracle/oradata/CDB/EAE60779AFDD1833E0436F38A8C00627/datafile'', ''/u01/app/oracle/oradata/cdbstby/'' comment= '''' scope=spfile
sql statement: alter system set  log_file_name_convert =  ''/u01/app/oracle/oradata/CDB/onlinelog/'', ''/u01/app/oracle/oradata/cdbstby/'', ''/u01/app/oracle/oradata/CDB/standbylog'', ''/u01/app/oracle/oradata/cdbstby/'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_max_processes =  5 comment= '''' scope=spfile
sql statement: alter system set  fal_client =  ''cdbstby'' comment= '''' scope=spfile
sql statement: alter system set  fal_server =  ''cdb'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_config =  ''dg_config=(cdb,cdbstby)'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_dest_2 =  ''service=cdb ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=cdb'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    1386283008 bytes

Fixed Size                     2288248 bytes
Variable Size                469763464 bytes
Database Buffers             905969664 bytes
Redo Buffers                   8261632 bytes

contents of Memory Script:
{
   restore clone from service  'cdb' standby controlfile;
}
executing Memory Script

Starting restore at 18-NOV-13
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=7 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
output file name=/u01/app/oracle/oradata/cdbstby/cdbstby.ctl
Finished restore at 18-NOV-13

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/app/oracle/oradata/cdbstby/o1_mf_temp_981hg1cb_.tmp";
   set newname for tempfile  2 to
 "/u01/app/oracle/oradata/cdbstby/pdbseed_temp01.dbf";
   set newname for tempfile  3 to
 "/u01/app/oracle/oradata/cdbstby//o1_mf_temp_981hwh9j_.dbf";
   set newname for tempfile  4 to
 "/u01/app/oracle/oradata/cdbstby//o1_mf_temp_983jdkw5_.dbf";
   set newname for tempfile  5 to
 "/u01/app/oracle/oradata/cdbstby/o1_mf_temp_983l8f5w_.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to
 "/u01/app/oracle/oradata/cdbstby/o1_mf_system_981h995g_.dbf";
   set newname for datafile  3 to
 "/u01/app/oracle/oradata/cdbstby/o1_mf_sysaux_981h6mvg_.dbf";
   set newname for datafile  4 to
 "/u01/app/oracle/oradata/cdbstby/o1_mf_undotbs1_981hccop_.dbf";
   set newname for datafile  5 to
 "/u01/app/oracle/oradata/cdbstby/o1_mf_system_981hg83d_.dbf";
   set newname for datafile  6 to
 "/u01/app/oracle/oradata/cdbstby/o1_mf_users_981hcbl7_.dbf";
   set newname for datafile  7 to
 "/u01/app/oracle/oradata/cdbstby/o1_mf_sysaux_981hg839_.dbf";
   set newname for datafile  8 to
 "/u01/app/oracle/oradata/cdbstby//o1_mf_system_981htofg_.dbf";
   set newname for datafile  9 to
 "/u01/app/oracle/oradata/cdbstby//o1_mf_sysaux_981htog9_.dbf";
   set newname for datafile  10 to
 "/u01/app/oracle/oradata/cdbstby//o1_mf_users_981hwyh5_.dbf";
   set newname for datafile  11 to
 "/u01/app/oracle/oradata/cdbstby//o1_mf_system_983jbk2m_.dbf";
   set newname for datafile  12 to
 "/u01/app/oracle/oradata/cdbstby//o1_mf_sysaux_983jbk65_.dbf";
   set newname for datafile  13 to
 "/u01/app/oracle/oradata/cdbstby//o1_mf_users_983jf6w8_.dbf";
   set newname for datafile  14 to
 "/u01/app/oracle/oradata/cdbstby/o1_mf_system_983l5zj2_.dbf";
   set newname for datafile  15 to
 "/u01/app/oracle/oradata/cdbstby/o1_mf_sysaux_983l6pxq_.dbf";
   set newname for datafile  16 to
 "/u01/app/oracle/oradata/cdbstby/o1_mf_users_983l912g_.dbf";
   restore
   from service  'cdb'   clone database
   ;
   sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/cdbstby/o1_mf_temp_981hg1cb_.tmp in control file
renamed tempfile 2 to /u01/app/oracle/oradata/cdbstby/pdbseed_temp01.dbf in control file
renamed tempfile 3 to /u01/app/oracle/oradata/cdbstby//o1_mf_temp_981hwh9j_.dbf in control file
renamed tempfile 4 to /u01/app/oracle/oradata/cdbstby//o1_mf_temp_983jdkw5_.dbf in control file
renamed tempfile 5 to /u01/app/oracle/oradata/cdbstby/o1_mf_temp_983l8f5w_.dbf in control file

executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME

Starting restore at 18-NOV-13
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/cdbstby/o1_mf_system_981h995g_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:05
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/cdbstby/o1_mf_sysaux_981h6mvg_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:45
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/cdbstby/o1_mf_undotbs1_981hccop_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/cdbstby/o1_mf_system_981hg83d_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/cdbstby/o1_mf_users_981hcbl7_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/cdbstby/o1_mf_sysaux_981hg839_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:55
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/cdbstby//o1_mf_system_981htofg_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/cdbstby//o1_mf_sysaux_981htog9_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:55
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00010 to /u01/app/oracle/oradata/cdbstby//o1_mf_users_981hwyh5_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00011 to /u01/app/oracle/oradata/cdbstby//o1_mf_system_983jbk2m_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00012 to /u01/app/oracle/oradata/cdbstby//o1_mf_sysaux_983jbk65_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:55
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00013 to /u01/app/oracle/oradata/cdbstby//o1_mf_users_983jf6w8_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00014 to /u01/app/oracle/oradata/cdbstby/o1_mf_system_983l5zj2_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00015 to /u01/app/oracle/oradata/cdbstby/o1_mf_sysaux_983l6pxq_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:55
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00016 to /u01/app/oracle/oradata/cdbstby/o1_mf_users_983l912g_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 18-NOV-13

sql statement: alter system archive log current

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=9 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_system_98msfwwz_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_sysaux_98msj0o7_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=11 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_undotbs1_98msmb7s_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=12 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_system_98msmpz1_.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=13 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_users_98msnj2v_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=14 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_sysaux_98msnlkh_.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=15 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_system_98mspcq8_.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=16 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_sysaux_98msq3km_.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=17 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_users_98msrtlp_.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=18 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_system_98msrx23_.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=19 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_sysaux_98msspsx_.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=20 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_users_98msvf7v_.dbf
datafile 14 switched to datafile copy
input datafile copy RECID=21 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_system_98msvjkx_.dbf
datafile 15 switched to datafile copy
input datafile copy RECID=22 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_sysaux_98mswn1c_.dbf
datafile 16 switched to datafile copy
input datafile copy RECID=23 STAMP=831829284 file name=/u01/app/oracle/oradata/cdbstby/CDBSTBY/datafile/o1_mf_users_98msybc9_.dbf
Finished Duplicate Db at 18-NOV-13

RMAN>

Script :
--------
run {
duplicate target database for standby from active database
spfile
parameter_value_convert 'cdb','cdbstby'
set db_unique_name='cdbstby'
set db_create_file_dest='/u01/app/oracle/oradata/cdbstby'
set db_recovery_file_dest='/u01/app/oracle/oradata/cdbstby'
set control_files='/u01/app/oracle/oradata/cdbstby/cdbstby.ctl'
set db_file_name_convert='/u01/app/oracle/oradata/CDB/datafile/','/u01/app/oracle/oradata/cdbstby/','/u01/app/oracle/oradata/CDB/EAF5D9665BD920EDE0436F38A8C0925F/datafile/','/u01/app/oracle/oradata/cdbstby/','/u01/app/oracle/oradata/CDB/EAF567FA97681A8CE0436F38A8C0EAC5/datafile','/u01/app/oracle/oradata/cdbstby/','/u01/app/oracle/oradata/CDB/EAE60779AFDD1833E0436F38A8C00627/datafile','/u01/app/oracle/oradata/cdbstby/'
set log_file_name_convert='/u01/app/oracle/oradata/CDB/onlinelog/','/u01/app/oracle/oradata/cdbstby/','/u01/app/oracle/oradata/CDB/standbylog','/u01/app/oracle/oradata/cdbstby/'
set log_archive_max_processes='5'
set fal_client='cdbstby'
set fal_server='cdb'
set log_archive_config='dg_config=(cdb,cdbstby)'
set log_archive_dest_2='service=cdb ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=cdb'
;
}

10. Perform a log switch on the primary database and redo will start being sent to the standby
[oracle@dbnode bin]$ export ORACLE_SID=cdb
[oracle@dbnode bin]$ ./sqlplus /nolog
SQL*Plus: Release 12.1.0.1.0 Production on Mon Nov 18 16:03:00 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect sys/oracle@192.168.56.111:1521/cdb as sysdba
Connected.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     30
Next log sequence to archive   32
Current log sequence           32

SQL> alter system switch logfile;
System altered.

SQL> alter system switch logfile;
System altered.

SQL> select con_id,name,open_mode from v$pdbs;

    CON_ID NAME                           OPEN_MODE
---------- ------------------------------ ----------
         2 PDB$SEED                       READ ONLY
         3 PDB1                           MOUNTED
         4 PDB2                           MOUNTED
         5 PDB3                           MOUNTED

11. Start the managed recovery process in Physical Standby Database (cdbstby)
[oracle@dbnode bin]$ export ORACLE_SID=cdbstby
[oracle@dbnode bin]$ ./sqlplus "/ as sysdba"
SQL*Plus: Release 12.1.0.1.0 Production on Mon Nov 18 16:04:05 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> connect sys/oracle@192.168.56.111:1521/cdbstby as sysdba
Connected.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     32
Next log sequence to archive   0
Current log sequence           34

SQL> select con_id,name,open_mode from v$pdbs;

    CON_ID NAME                           OPEN_MODE
---------- ------------------------------ ----------
         2 PDB$SEED                       MOUNTED
         3 PDB1                           MOUNTED
         4 PDB2                           MOUNTED
         5 PDB3                           MOUNTED

SQL> alter database recover managed standby database using current logfile disconnect;
Database altered.

SQL> select con_id,name,open_mode from v$database;

    CON_ID NAME      OPEN_MODE
---------- --------- --------------------
         0 CDB       MOUNTED

SQL> select con_id,name,open_mode from v$pdbs;

    CON_ID NAME                           OPEN_MODE
---------- ------------------------------ ----------
         2 PDB$SEED                       MOUNTED
         3 PDB1                           MOUNTED
         4 PDB2                           MOUNTED
         5 PDB3                           MOUNTED

12. Switch archive logs in primary database (cdb)
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     32
Next log sequence to archive   34
Current log sequence           34

SQL> alter system switch logfile;
System altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     33
Next log sequence to archive   35
Current log sequence           35

13. Check in Physical Standby database (cdbstby)
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     33
Next log sequence to archive   0
Current log sequence           35

14. Start Data Guard Broker on Primary Database (cdb)
SQL> alter system set dg_broker_start=true;
System altered.

SQL> show parameter dg_

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
cell_offloadgroup_name               string
dg_broker_config_file1               string      /u01/app/oracle/product/12.1.0/dbhome/dbs/dr1cdb.dat
dg_broker_config_file2               string      /u01/app/oracle/product/12.1.0/dbhome/dbs/dr2cdb.dat
dg_broker_start                      boolean     TRUE

15. Start Data Guard Broker on Physical Standby Database (cdb)
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     33
Next log sequence to archive   0
Current log sequence           35

SQL> alter system set dg_broker_start=true;
System altered.

SQL> show parameter dg_

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
cell_offloadgroup_name               string
dg_broker_config_file1               string      /u01/app/oracle/product/12.1.0/dbhome/dbs/dr1cdbstby.dat
dg_broker_config_file2               string      /u01/app/oracle/product/12.1.0/dbhome/dbs/dr2cdbstby.dat
dg_broker_start                      boolean     TRUE

16. Enable Database Flashback on Primary Database (cdb)

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

SQL> connect sys/oracle as sysdba
Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1386283008 bytes
Fixed Size                  2288248 bytes
Variable Size             469763464 bytes
Database Buffers          905969664 bytes
Redo Buffers                8261632 bytes
Database mounted.

SQL> alter database flashback on;
Database altered.

SQL> alter database open;
Database altered.

SQL> select con_id,name,open_mode from v$pdbs;

    CON_ID NAME                           OPEN_MODE
---------- ------------------------------ ----------
         2 PDB$SEED                       READ ONLY
         3 PDB1                           MOUNTED
         4 PDB2                           MOUNTED
         5 PDB3                           MOUNTED

17. Enable Database Flashback on Physical Database (cdbstby)

SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

SQL> connect sys/oracle as sysdba
Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1386283008 bytes
Fixed Size                  2288248 bytes
Variable Size             469763464 bytes
Database Buffers          905969664 bytes
Redo Buffers                8261632 bytes
Database mounted.

SQL> alter database flashback on;
Database altered.

SQL> alter database open read only;
Database altered.

SQL> select con_id,name,open_mode from v$pdbs;

    CON_ID NAME                           OPEN_MODE
---------- ------------------------------ ----------
         2 PDB$SEED                       READ ONLY
         3 PDB1                           MOUNTED
         4 PDB2                           MOUNTED
         5 PDB3                           MOUNTED

Primary database:
============
SQL> alter system set log_archive_dest_2='';
System altered.

Standby Database:
=============
SQL> alter system set log_archive_dest_2='';
System altered.

18. Complete Data Guard configuration

[oracle@dbnode bin]$ export ORACLE_SID=cdb
[oracle@dbnode bin]$ ./dgmgrl
DGMGRL for Linux: Version 12.1.0.1.0 - 64bit Production
Copyright (c) 2000, 2012, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle
Connected as SYSDG.

DGMGRL> create configuration 'DGCONFIG' as primary database is 'cdb' connect identifier is cdb;
Configuration "DGCONFIG" created with primary database "cdb"

DGMGRL> add database 'cdbstby' as connect identifier is cdbstby;
Database "cdbstby" added

DGMGRL> enable configuration;
Enabled.

DGMGRL> show configuration;
Configuration - DGCONFIG

  Protection Mode: MaxPerformance
  Databases:
  cdb     - Primary database
    cdbstby - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> exit
[oracle@dbnode bin]$ ./sqlplus /nolog

SQL*Plus: Release 12.1.0.1.0 Production on Mon Nov 18 16:25:19 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect sys/oracle@192.168.56.111:1521/cdb as sysdba
Connected.

SQL> alter system set log_archive_dest_2='service=cdbstby async valid_for=(online_logfile,primary_role) db_unique_name=cdbstby';
System altered.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

19. Enabling Fast-Start Failover

[oracle@dbnode bin]$ export ORACLE_SID=cdb
[oracle@dbnode bin]$ ./dgmgrl

DGMGRL for Linux: Version 12.1.0.1.0 - 64bit Production
Copyright (c) 2000, 2012, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle
Connected as SYSDG.

DGMGRL> edit database cdb set property FastStartFailoverTarget=cdbstby;
Property "faststartfailovertarget" updated

DGMGRL> edit database cdbstby set property FastStartFailoverTarget=cdb;
Property "faststartfailovertarget" updated

DGMGRL> enable fast_start failover;
Enabled.

DGMGRL> show configuration;

Configuration - DGCONFIG

  Protection Mode: MaxPerformance
  Databases:
  cdb     - Primary database
    Warning: ORA-16819: fast-start failover observer not started

    cdbstby - (*) Physical standby database
      Warning: ORA-16819: fast-start failover observer not started

Fast-Start Failover: ENABLED

Configuration Status:
WARNING

20. Using Active Data Guard - edit database 'cdbstby' set state='apply-on'

[oracle@dbnode bin]$ export ORACLE_SID=cdbstby
[oracle@dbnode bin]$ ./dgmgrl

DGMGRL for Linux: Version 12.1.0.1.0 - 64bit Production
Copyright (c) 2000, 2012, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle
Connected as SYSDG.

DGMGRL> edit database 'cdbstby' set state='apply-off';
Succeeded.

DGMGRL> exit

[oracle@dbnode bin]$ export ORACLE_SID=cdbstby
[oracle@dbnode bin]$ ./sqlplus "/ as sysdba"

SQL*Plus: Release 12.1.0.1.0 Production on Mon Nov 18 16:30:58 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

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

SQL> connect sys/oracle@192.168.56.111:1521/cdbstby as sysdba
Connected.

SQL> select con_id,name,open_mode from v$pdbs;

    CON_ID NAME                           OPEN_MODE
---------- ------------------------------ ----------
         2 PDB$SEED                       READ ONLY
         3 PDB1                           MOUNTED
         4 PDB2                           MOUNTED
         5 PDB3                           MOUNTED

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

[oracle@dbnode bin]$ export ORACLE_SID=cdbstby
[oracle@dbnode bin]$ ./dgmgrl
DGMGRL for Linux: Version 12.1.0.1.0 - 64bit Production

Copyright (c) 2000, 2012, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle
Connected as SYSDG.

DGMGRL> edit database 'cdbstby' set state='apply-on';
Succeeded.

DGMGRL> exit
[oracle@dbnode bin]$

21. Starting the Observer & Open One More Terminal:

[oracle@dbnode datafile]$ export ORACLE_SID=cdb
[oracle@dbnode datafile]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome
[oracle@dbnode datafile]$ cd /u01/app/oracle/product/12.1.0/dbhome/bin
[oracle@dbnode bin]$ ./dgmgrl
DGMGRL for Linux: Version 12.1.0.1.0 - 64bit Production

Copyright (c) 2000, 2012, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle
Connected as SYSDG.

DGMGRL> start observer;
Observer started

22. After strating Observer check the status

[oracle@dbnode bin]$ ./dgmgrl
DGMGRL for Linux: Version 12.1.0.1.0 - 64bit Production

Copyright (c) 2000, 2012, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle
Connected as SYSDG.

DGMGRL> show configuration;

Configuration - DGCONFIG

  Protection Mode: MaxPerformance
  Databases:
  cdb     - Primary database
    cdbstby - (*) Physical standby database

Fast-Start Failover: ENABLED

Configuration Status:
SUCCESS

DGMGRL>

23. Shutting Down Of Physical Standby database (cdbstby) & Primary Database (cdb)

[oracle@dbnode bin]$ ps -ef | grep pmon
oracle    3749     1  0 10:36 ?        00:00:03 asm_pmon_+ASM
oracle    4483     1  0 16:15 ?        00:00:00 ora_pmon_cdb
oracle    4845     1  0 16:17 ?        00:00:00 ora_pmon_cdbstby
oracle    5636 27269  0 16:37 pts/3    00:00:00 grep pmon

[oracle@dbnode bin]$ export ORACLE_SID=cdbstby
[oracle@dbnode bin]$ ./sqlplus "/ as sysdba"
SQL*Plus: Release 12.1.0.1.0 Production on Mon Nov 18 16:37:11 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

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

SQL> connect sys/oracle@192.168.56.111:1521/cdbstby as sysdba
Connected.

SQL> shu immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

[oracle@dbnode bin]$ export ORACLE_SID=cdb
[oracle@dbnode bin]$ ./sqlplus /nolog
SQL*Plus: Release 12.1.0.1.0 Production on Mon Nov 18 16:37:40 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect sys/oracle@192.168.56.111:1521/cdb as sysdba
Connected.

SQL> shu immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.