Moneycontrol Brokerage Recos

Wednesday, February 14, 2018

[Oracle Cloud] - Checking version of Oracle Rest Data Services in Oracle Cloud



Checking version of Oracle Rest Data Services running in Oracle Cloud:

Here in this small walk-through, I want to show who to check the version of Oracle ORDS services running in your Oracle Cloud compute node.

1 - Login to the compute node hosting your DBAAS instance with opc user and switch to root user using "sudo -s" command.

Check if ords services are running using ps -ef | grep ords as following:

[root@RAJDB121 opc]# ps -ef | grep ords
oracle   27869     1  1 18:07 ?        00:00:08 /u01/app/oracle/product/java/jdk1.8.0_74/bin/java -jar /u01/app/oracle/product/ords/ords.war standalone
root     28477     1  0 18:11 pts/2    00:00:00 tail -f /u01/app/oracle/product/ords/log/ords.log
root     29076 28957  0 18:18 pts/3    00:00:00 grep ords
[root@RAJDB121 opc]#



2 - Use the below command to check the version of ORDS service running.


[root@RAJDB121 opc]# java -jar /u01/app/oracle/product/ords/ords.war version

Oracle REST Data Services 3.0.9.348.07.16





Below are some of the supported command options available with "java -jar ords.war" executable.


java -jar ords.war <COMMAND> [Options] [Arguments]  
 The following commands are available:  
         configdir     Set the value of the web.xml  
                  config.dir property  
         help       Describe the usage of this  
                  program or its commands  
         install      Installs Oracle REST Data  
                  Services  
         map-url      Map a URL pattern to the  
                  named database connection  
         nosqladd     Add NoSQL store configuration  
         nosqldel     Delete NoSQL store  
                  configuration  
         oam-config    Configure web.xml to support  
                  Oracle Access Manager  
                  Identity Asserter on Oracle  
                  WebLogic  
         plugin      Package one or more plugin  
                  jar files into ords.war  
         schema      Install or upgrades ORDS  
                  schema  
         set-properties  Edit the value of one or more  
                  configuration settings via  
                  the specified properties file  
         set-property   Edit the value of a single  
                  configuration setting  
         setup       Configure database connection  
         standalone    Launch Oracle REST Data  
                  Services in standalone mode  
         static      Generate a Web Application  
                  Archive (WAR) to serve Oracle  
                  Application Express static  
                  resources  
         uninstall     Uninstall ORDS_METADATA  
                  schema, proxy user and  
                  related database objects.  
         user       Create or update a user,  
                  specify its password and  
                  role. ORDS Administrator  
                  example: user ords_admin  
                  "Listener Administrator" ORDS  
                  Developer example: user  
                  ords_dev "SQL Developer"  
         validate     Validates Oracle REST Data  
                  Services  
         version      ORDS Version  
 To see instructions on how to use each of these commands, type help  
 followed by the command name, for example  
  java -jar ords.war help configdir  
 If no command is provided Oracle REST Data Services is started in  
 standalone mode  


3 - You can check the ords log to check its started date and timestamp.


[root@RAJDB121 opc]# tail -f /u01/app/oracle/product/ords/log/ords.log

Feb 05, 2018 6:07:54 PM
SEVERE: *** Pool: |apex|rt| is not correctly configured and will be ignored ***
config.dir
2018-02-05 18:07:54.522:INFO:/ords:main: INFO: Oracle REST Data Services initialized|Oracle REST Data Services version : 3.0.9.348.07.16|Oracle REST Data Services server info: jetty/9.2.z-SNAPSHOT|
2018-02-05 18:07:54.525:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@548e7350{/ords,null,AVAILABLE,@Secured}
2018-02-05 18:07:54.527:INFO:oejsh.ContextHandler:main: Started o.e.j.s.h.ContextHandler@e25b2fe{/,null,AVAILABLE,@Secured}
2018-02-05 18:07:54.586:INFO:oejs.ServerConnector:main: Started ServerConnector@59fa1d9b{HTTP/1.1}{0.0.0.0:8080}
2018-02-05 18:07:54.732:INFO:oejs.ServerConnector:main: Started Secured@4883b407{SSL-http/1.1}{0.0.0.0:8181}
2018-02-05 18:07:54.861:INFO:oejs.Server:main: Started @16019ms
^C
[root@RAJDB121 opc]#

Monday, February 12, 2018

[Oracle Cloud] - Stopping/Starting Oracle Rest Data Services in Oracle Cloud



Stopping/Starting ORDS - Oracle Rest Data Services:

Here in this article, I will walk you through quickly what all commands are available with ORDS (Oracle Rest Data Services) and how to use them.


Following commands are available with ords. You need to connect to Oracle Compute node of your oracle cloud service instance with root user to deal with ords utility and its commands. So, first connect to compute node as opc user and then switch to root user using "sudo -s"

 [root@RAJDB121 ords]# ./ords sub-commands  
 {start|stop|status|restart|log}  


 [root@RAJDB121 opc]# ps -ef | grep ords  
 oracle  27869   1 1 18:07 ?    00:00:08 /u01/app/oracle/product/java/jdk1.8.0_74/bin/java -jar /u01/app/oracle/product/ords/ords.war standalone  
 root   28454 26571 0 18:11 pts/2  00:00:00 /bin/bash ./ords log  
 root   28477 28454 0 18:11 pts/2  00:00:00 tail -f /u01/app/oracle/product/ords/log/ords.log  
 root   28967 28957 0 18:16 pts/3  00:00:00 grep ords  
 [root@RAJDB121 opc]#  


Navigate to ords home directory:

 [root@RAJDB121 ords]# pwd  
 /u01/app/oracle/product/ords 



Check the ords service status as oracle cloud compute node.


 [root@RAJDB121 ords]# ./ords status  
 INFO: Obtaining Oracle REST Data Services status...  
 INFO: Oracle REST Data Services is already running with PID 3090 


Stopping ords services.

 [root@RAJDB121 ords]# ./ords stop  
 INFO: Stopping Oracle REST Data Services...  
 INFO: Oracle REST Data Services stopped  


Validating if ords services have been stopped:

 [root@RAJDB121 ords]# ./ords status  
 INFO: Obtaining Oracle REST Data Services status...  
 WARNING: Oracle REST Data Services is not running  



Starting ords services:


 [root@RAJDB121 ords]# ./ords start  
 INFO: Starting Oracle REST Data Services...  
 INFO: Oracle REST Data Services bound to ports 8080,8181 27869  
 INFO: Oracle REST Data Services started with PID 27869  





 [root@RAJDB121 ords]# ./ords status  
 INFO: Obtaining Oracle REST Data Services status...  
 INFO: Oracle REST Data Services is already running with PID 27869  
 [root@RAJDB121 ords]#  


Check the log of ords services:


 [root@RAJDB121 ords]# ./ords log  
 Feb 05, 2018 6:07:54 PM  
 SEVERE: *** Pool: |apex|rt| is not correctly configured and will be ignored ***  
 config.dir  
 2018-02-05 18:07:54.522:INFO:/ords:main: INFO: Oracle REST Data Services initialized|Oracle REST Data Services version : 3.0.9.348.07.16|Oracle REST Data Services server info: jetty/9.2.z-SNAPSHOT|  
 2018-02-05 18:07:54.525:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@548e7350{/ords,null,AVAILABLE,@Secured}  
 2018-02-05 18:07:54.527:INFO:oejsh.ContextHandler:main: Started o.e.j.s.h.ContextHandler@e25b2fe{/,null,AVAILABLE,@Secured}  
 2018-02-05 18:07:54.586:INFO:oejs.ServerConnector:main: Started ServerConnector@59fa1d9b{HTTP/1.1}{0.0.0.0:8080}  
 2018-02-05 18:07:54.732:INFO:oejs.ServerConnector:main: Started Secured@4883b407{SSL-http/1.1}{0.0.0.0:8181}  
 2018-02-05 18:07:54.861:INFO:oejs.Server:main: Started @16019ms  

Friday, February 9, 2018

[AIOUG Tech Day] - RAC Internals and Machine Learning by Sandesh Rao


Meet with Oracle Rock Star







Sandesh Rao is a VP running the RAC Assurance Team within RAC Development at Oracle Corporation specializing in performance tuning , high availability , disaster recovery and architecting cloud based solutions using the Oracle Stack. With more than 14 years of experience working in the HA space and having worked on several versions of Oracle with different application stacks he is a recognized expert in RAC , Database Internals , PaaS , SaaS and IaaS solutions , solving Big Data related problems . Most of his work involves working with customers in the implementation of public and hybrid cloud projects in the financial , retailing , scientific , insurance , biotech and the tech space. His current position involves running a team that develops best practices for the Oracle Grid Infrastructure 12c including products like RAC (Real Application Clusters) , Storage (ASM , ACFS)More details athttp://bit.ly/1UCL46K




You learn Oracle RAC and try your hard to understand its architecture, functionalities and tools developed inside it, right? 
What if I say, do you wanna meet Oracle RockStar who works behind those RAC internals?
Excited?   
Don't miss this rare opportunity to learn and interact with him.
Yes, meet Mr. Sandesh Rao who works in developing the Oracle RAC and its tools in Oracle Corporation. 
Yes, he is coming all the way to Gurgaon from United States to offer a full day Tech Event on 18th Feb 2018, Sunday. 

Dare to miss this wonderful Tech Day?

No? right?

Then BOOK your calendar for below date and time to attend this wonderful Tech Day.



AIOUG-NIC Tech Day (RAC Internals and Machine Learning by Sandesh Rao)











AGENDA

Session 1: Diagnostics and details on RAC internals
Session 2: Top 10 new diagnostic features in the 12.2 database product.
Session 3: Machine learning in general and different frameworks available, the algorithms we use. 
Session 4: Artificial Intelligence





Book your seat here - https://www.meraevents.com/event/aioug-nic-tech-day-feb2018?ucode=organizer






About AIOUG  - All India Oracle Users Group

AIOUG is a non profit organization started by like minded users who think such a community is required in India where the amount of Oracle user base is humongous. The idea of this group is to share what the Oracle users have learned from using Oracle technology over the years with fellow users who have similar interest.

AIOUG provides Oracle technology and database professionals the opportunity to enhance their productivity and influence the quality, usability, and support of Oracle technology. The AIOUG is composed of Oracle professionals committed to helping fellow IT professionals develop solutions to their business challenges.

Click Here to get to know more about AIOUG.


AIOUG Tech Days:


AIOUG's TechDay with a focus on a specific technology area. It is an event filled with opportunities to learn and network.  AIOUG has been organizing these events across India over the last couple of years.  While our major maga event is Sangam, Techdays are organized as small one day workshops reaching out to the Oracle user community across India.


See you all there on 18th Feb 2018..... Please register, attend and get networked with Oracle Experts..!!

Thursday, February 8, 2018

[Oracle Cloud] - De-Installing TFA in Oracle Cloud environment using dbaascli




De-Installing TFA in Oracle Cloud using dbaascli


In the previous article[click here], we did look at how we install TFA on compute node in Oracle Cloud environment using dbaascli command line utility.

Here in this article, we will be de-installing TFA from Oracle cloud compute node using dbaascli command line utility.

First connect to compute node using opc user and then switch to root user. Check the current status of TFA.


[root@RAJDB121 opc]# ps -ef | grep tfa  
 root   2018   1 0 Feb03 ?    00:00:28 /bin/sh /etc/init.d/init.tfa run  
 root   14288   1 0 Feb03 ?    00:12:24 /var/opt/oracle/tfa/rajdb121/tfa_home/jre/bin/java -Xms128m -Xmx256m oracle.rat.tfa.TFAMain /var/opt/oracle/tfa/rajdb121/tfa_home  
 oracle  28260   1 0 18:54 ?    00:00:00 /usr/bin/perl /var/opt/oracle/misc/dbcsmonitor.pl /var/opt/oracle/tfa/rajdb121/tfa_home /var/opt/oracle/tfa/repository/suptools/rajdb121/dbcsmon /var/opt/oracle/tfa/repository/suptools/rajdb121/dbcsmon/oracle  
 root   28955 14288 0 18:59 ?    00:00:00 /bin/sh /var/opt/oracle/tfa/rajdb121/tfa_home/bin/tfactl rediscover -mode full -auto  
 root   28969 28955 35 18:59 ?    00:00:00 /u01/app/oracle/product/12.1.0/dbhome_1/perl/bin/perl /var/opt/oracle/tfa/rajdb121/tfa_home/bin/tfactl.pl rediscover -mode full -auto  
 root   29035 28800 0 18:59 pts/1  00:00:00 grep tfa  
 

[root@RAJDB121 opc]# cd /var/opt/oracle/tfa/rajdb121/tfa_home/bin  

 [root@RAJDB121 bin]# ./tfactl status  
 .-------------------------------------------------------------------------------------------------.  
 | Host   | Status of TFA | PID  | Port | Version  | Build ID       | Inventory Status |  
 +----------+---------------+-------+-------+------------+----------------------+------------------+  
 | rajdb121 | RUNNING    | 14288 | 59017 | 12.2.1.1.1 | 12211120170612181835 | COMPLETE     |  
 '----------+---------------+-------+-------+------------+----------------------+------------------'  
 [root@RAJDB121 bin]#  



Now, invoke dbaascli command line utility and run the tfa uninstall sub-command of dbaascli to de-install TFA from the compute node on which you are logged in.

 [root@RAJDB121 opc]# dbaascli  
 DBAAS CLI version 1.0.0  



 DBAAS>tfa uninstall  
 Executing command tfa uninstall  
 Deinstalling TFA  
 Removing TFA repository  
 Successfully uninstalled TFA  
 DBAAS>  



Once, TFA uninstall is done then exit from dbaascli utility, you would see a shell error as highlighted below(if your current working directory were TFA HOME before invoking dbaascli utility), that means when you uninstall TFA from the compute node then that also removes all related binaries and folders from the compute node. TFA HOME gets dropped.

 DBAAS>q  
 Exiting Command Line Interface  
 shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory  
 [root@RAJDB121 bin]# pwd  
 /var/opt/oracle/tfa/rajdb121/tfa_home/bin  
 [root@RAJDB121 bin]# ls  



[root@RAJDB121 ~]# cd /var/opt/oracle/tfa/rajdb121/tfa_home  
 bash: cd: /var/opt/oracle/tfa/rajdb121/tfa_home: No such file or directory 

Monday, February 5, 2018

[Oracle Cloud] - Installing TFA in Oracle Cloud environment using dbaascli



Installing TFA in Oracle Cloud using dbaascli


Here I would be demonstrating how we can install Oracle Trace File Analyzer(TFA) in Oracle Cloud environment using dbaascli utility in just a single hit. You have got so much simplicity provided by Oracle public cloud to play with database deployments by using Oracle provided cloud tooling.

TFA - Oracle Trace File Analyzer, collects all diagnostics data(which is composed of logs and traces referencing the problem or incident that we are supposed to diagnose) related to the problem or incident and combines all those diagnostic data in a single compressed zip file to upload to Oracle support service request to analyse the issue by Oracle support engineer.

If you are using Oracle Real Application Cluster then TFA will automatically collect all diagnostic data from both Grid and Oracle RDBMS Home that are related to the incident.

There are lots of things TFA does but those are not in scope of this article to discuss here so we will be concentrating on just installing it in Oracle cloud environment using dbaascli utility :-)


Following the are the sub-commands available with DBAAScli to work the TFA.

 DBAAS>tfa -help  
 Executing command tfa -help  
 Valid Subcommands:  
   install  
   uninstall 



Now, let go ahead and install TFA on compute node of our oracle cloud database deployment. In order to install it, you must be connect as root user, so first to connect to compute node with opc user and switch to root user as follows:

1 - Switch to root user once you are connected to compute node of oracle cloud database deployment.

 [opc@RAJDB121 ~]$ sudo -s  
 [root@RAJDB121 opc]# dbaascli  
 DBAAS CLI version 1.0.0  


2 - Please make a note that TFA is installed on Oracle cloud compute nodes and if you try to install it then it will just re-install the TFA or update it if latest TFA bundle is available.


 DBAAS>tfa install  
 Executing command tfa install  
 tfa.pm: WARNING: TFA already enabled. Reinstalling. <<<<< Already installed hence re-installing it
 Installing TFA.  
 Stopping dbcsmon  
 tfa.pm: INFO dbcsmon status is:  
 Stopping OSWatcher  
 tfa.pm: INFO OSWatcher status is:  
 Setting TFA's repository size to 300 MB  
 Enabling TFA auto startup  
 Enabling TFA auto collection  
 Setting TFA's minimal space for RTScan  
 Adding dbaastools log directories  
 Adding APEX log directories  
 Running tfactl stop command  
 Successfully installed TFA  
 Running tfactl start command  
 Starting dbcsmon  
 tfa.pm: INFO dbcsmon status is:  
 DBAAS>  



If TFA is not already install then it simply install it with latest version available as follows and it doesn't write any warning.

 DBAAS>tfa install  
 Executing command tfa install  
 Installing TFA.  
 Stopping dbcsmon  
 tfa.pm: INFO dbcsmon status is:  
 Stopping OSWatcher  
 tfa.pm: INFO OSWatcher status is:  
 Setting TFA's repository size to 300 MB  
 Enabling TFA auto startup  
 Enabling TFA auto collection  
 Setting TFA's minimal space for RTScan  
 Adding dbaastools log directories  
 Adding APEX log directories  
 Running tfactl stop command  
 Successfully installed TFA  
 Running tfactl start command  
 Starting dbcsmon  
 tfa.pm: INFO dbcsmon status is:  
 DBAAS>  



3 - Once, TFA is installed on compute node of Oracle database deployment of oracle cloud then you can validate its running status as follows:



 [root@RAJDB121 opc]# ps -ef | grep tfa  
 root   2018   1 0 18:52 ?    00:00:00 /bin/sh /etc/init.d/init.tfa run  
 root   14288   1 4 18:54 ?    00:00:06 /var/opt/oracle/tfa/rajdb121/tfa_home/jre/bin/java -Xms128m -Xmx256m oracle.rat.tfa.TFAMain /var/opt/oracle/tfa/rajdb121/tfa_home  
 oracle  14507   1 0 18:54 ?    00:00:00 /usr/bin/perl /var/opt/oracle/misc/dbcsmonitor.pl /var/opt/oracle/tfa/rajdb121/tfa_home /var/opt/oracle/tfa/repository/suptools/rajdb121/dbcsmon /var/opt/oracle/tfa/repository/suptools/rajdb121/dbcsmon/oracle  
 root   15965 26343 0 18:56 pts/1  00:00:00 grep tfa 


From above output, you can identify TFA HOME as /var/opt/oracle/tfa/rajdb121/tfa_home


Validate the status of TFA components by status sub-command of tfactl command line utility as follows:

 [root@RAJDB121 bin]# ./tfactl  
 tfactl> status  
 .-------------------------------------------------------------------------------------------------.  
 | Host   | Status of TFA | PID  | Port | Version  | Build ID       | Inventory Status |  
 +----------+---------------+-------+-------+------------+----------------------+------------------+  
 | rajdb121 | RUNNING    | 14288 | 59017 | 12.2.1.1.1 | 12211120170612181835 | COMPLETE     |  
 '----------+---------------+-------+-------+------------+----------------------+------------------'  
      

Saturday, February 3, 2018

[Oracle Cloud] : Creating On-Demand Backup using bkup_api utility



Creating On-Demand Backup : Oracle Database Cloud Service


In this article, I will be demonstrating one way of taking On-Demand backup of Oracle Database Cloud Service Database Deployment in Oracle Public Cloud. You can create on-demand backup of single instance Oracle Cloud database deployment using bkup_api utility. We will talk about taking on-demand backup of Oracle Real Application(RAC) database in Oracle Cloud in another article.

It might be required to take on-demand backup of your oracle cloud database deployment in case if you have not configured automatic Oracle Database deployment backup while creating the database deployment in oracle cloud or before any maintenance operations going to happen in your database deployment.

Note - You can't configure an automatic backup for an existing Oracle Database Deployment in oracle cloud once that is created with  Backup option "none" to not automatically backup the Oracle cloud database deployment during service creation time, you would have to configure the backups manually and set it via cron jobs / or use bkup_api automated cloud backup utility.

Here we will be using the bkup_api oracle cloud backup utility to backup our single instance Oracle cloud database deployment to Oracle Storage Cloud Container(You should have Oracle Database Backup Cloud Service already activate and cloud storage container created in order to take database deployment backup to oracle cloud storage) 



1 - Connect to the Compute Node of DBaaS instance as opc user.


2 – Switch to root user to run bkp_api utility as it requires root privilege to run otherwise you would get following self-explanatory error if backup attempt is made with opc user.

[opc@RAJDB121 ~]$ /var/opt/oracle/bkup_api/bkup_api i bkup_start

API::ERROR Api requires root rights or sudoer


Switch to root user as below.

[opc@RAJDB121 ~]$ sudo -s
[root@RAJDB121 opc]#


3 – Run the bkup_api utility with bkup_start option to start taking backup of the Oracle cloud database deployment.


[root@RAJDB121 opc]# /var/opt/oracle/bkup_api/bkup_api bkup_start

DBaaS Backup API V1.5 @2016 Multi-Oracle home

DBaaS Backup API V1.5 @2015 Multi-Oracle home

-> Action : bkup_start

-> logfile: /var/opt/oracle/bkup_api/log/bkup_api.log

UUID 12eceb08-050f-11e8-a8f6-c6b062e43847 for this backup

** process started with PID: 1270

** see log file for monitor progress


4 – Once you start the backup job then you can monitor the backup progress using its log file - /var/opt/oracle/bkup_api/log/bkup_api.log .

[root@RAJDB121 opc]# tail -f /var/opt/oracle/bkup_api/log/bkup_api.log

Mon, 29 Jan 2018 16:11:51 -------------------------------------

Mon, 29 Jan 2018 16:11:51 12eceb08-050f-11e8-a8f6-c6b062e43847 -> Starting execution of backup log in background

Mon, 29 Jan 2018 16:11:51 12eceb08-050f-11e8-a8f6-c6b062e43847 STARTING BACKUP REQUEST

Mon, 29 Jan 2018 16:11:51 UUID 12eceb08-050f-11e8-a8f6-c6b062e43847 written with PID 1270

Mon, 29 Jan 2018 16:11:51 12eceb08-050f-11e8-a8f6-c6b062e43847 Checking if RCDB121 resource is available

Mon, 29 Jan 2018 16:11:51 12eceb08-050f-11e8-a8f6-c6b062e43847 has a lock RCDB121

Mon, 29 Jan 2018 16:11:51 12eceb08-050f-11e8-a8f6-c6b062e43847 The process is no longer running removing lock

Mon, 29 Jan 2018 16:11:51 12eceb08-050f-11e8-a8f6-c6b062e43847 registering request into the database

Mon, 29 Jan 2018 16:11:59 12eceb08-050f-11e8-a8f6-c6b062e43847 current backups 1904

Mon, 29 Jan 2018 16:11:59 12eceb08-050f-11e8-a8f6-c6b062e43847 command /var/opt/oracle/ocde/assistants/bkup/obkup



5 – Another way to monitor the currently running backup job with bkup_status option of bkup_api utility as below.


[root@RAJDB121 opc]# /var/opt/oracle/bkup_api/bkup_api bkup_status  
 DBaaS Backup API V1.5 @2016 Multi-Oracle home  
 DBaaS Backup API V1.5 @2015 Multi-Oracle home  
 -> Action : bkup_status  
 -> logfile: /var/opt/oracle/bkup_api/log/bkup_api.log  
  Warning: unable to get current configuration of: catalog  
 * Current backup settings:  
 * Last registered Bkup: 01-29 16:11 API::1270:: Starting dbaas backup process  
 * Bkup state: running  
 **************************************************  
 * API History: API steps  
  API:: NEW PROCESS 1270  
  API:: Starting dbaas backup process  
 *************************************************  
 * Backup steps  
  -> API:: Oracle database state is up and running  
  -> API:: DB instance: RCDB121  
  -> API:: Determining if the filesystem is not full  
  -> API:: ...... OK  
  -> API:: Validating the backup repository ......  
 *  
 * RETURN CODE:0  
 ##################################################  
 [root@RAJDB121 opc]# /var/opt/oracle/bkup_api/bkup_api bkup_status  
 DBaaS Backup API V1.5 @2016 Multi-Oracle home  
 DBaaS Backup API V1.5 @2015 Multi-Oracle home  
 -> Action : bkup_status  
 -> logfile: /var/opt/oracle/bkup_api/log/bkup_api.log  
  Warning: unable to get current configuration of: catalog  
 * Current backup settings:  
 * Last registered Bkup: 01-29 16:11 API::1270:: Starting dbaas backup process  
 * Bkup state: finished  
 **************************************************  
 * API History: API steps  
  API:: NEW PROCESS 1270  
  API:: Starting dbaas backup process  
  API:: Your new dbaas backup tag is TAG20180129T161948  
  API:: BKUP COMPLETE YOUR BKUP TAG TAG20180129T161948  
 *************************************************  
 * Backup steps  
  -> API:: Oracle database state is up and running  
  -> API:: DB instance: RCDB121  
  -> API:: Determining if the filesystem is not full  
  -> API:: ...... OK  
  -> API:: Validating the backup repository ......  
  -> API::   All backup pieces are ok  
  -> API:: Performing backup to local storage (primary backup)  
  -> API:: Executing rman instructions  
  -> API:: ...... OK  
  -> API:: Backup to local storage is completed  
  -> API:: Clean MOTD.  
  -> API:: Performing backup to cloud storage (secondary backup)  
  -> API:: Executing rman instructions  
  -> API:: ......OK  
  -> API:: Backup to cloud storage is completed  
  -> API:: Clean MOTD.  
  -> API:: Starting backup of config files  
  -> API:: Executing rman instructions  
  -> API:: at time: 2018-01-29:16:20:40  
  -> API:: Determining the oracle database id  
  -> API:: DBID: 3348210600  
  -> API:: Creating directories to store config files  
  -> API:: Determining the oracle database id  
  -> API:: DBID: 3348210600  
  -> API:: Compressing config files into tar files  
  -> API:: .... OK  
  -> API:: Uploading config files to cloud storage  
  -> API:: Completed at time: 2018-01-29:16:20:58  
  -> API:: at time: 2018-01-29:16:20:58  
  -> API:: Config files backup ended successfully  
  -> API:: Clean MOTD.  
  -> API:: All requested tasks are completed  
 *  
 * RETURN CODE:0  
 ##################################################  
 [root@RAJDB121 opc]#  


Again, you can review the bkup_api log file to check if backup has been succeeded.

 [root@RAJDB121 opc]# tail /var/opt/oracle/bkup_api/log/bkup_api.log  
 Mon, 29 Jan 2018 16:21:06 12eceb08-050f-11e8-a8f6-c6b062e43847@ backups after execution 1908  
 Mon, 29 Jan 2018 16:21:06 12eceb08-050f-11e8-a8f6-c6b062e43847 rman tag TAG20180129T162020  
 Mon, 29 Jan 2018 16:21:06 12eceb08-050f-11e8-a8f6-c6b062e43847 rman tag TAG20180129T162040  
 Mon, 29 Jan 2018 16:21:06 12eceb08-050f-11e8-a8f6-c6b062e43847 rman tag TAG20180129T162033  
 Mon, 29 Jan 2018 16:21:06 12eceb08-050f-11e8-a8f6-c6b062e43847 rman tag TAG20180129T161948  
 Mon, 29 Jan 2018 16:21:07 12eceb08-050f-11e8-a8f6-c6b062e43847 Backup succeded TAG20180129T161948  
 Mon, 29 Jan 2018 16:21:11 DBaaS Backup API V1.5 @2016 Multi-Oracle home  
 Mon, 29 Jan 2018 16:21:11 DBaaS Backup API V1.5 @2015 Multi-Oracle home  
 Mon, 29 Jan 2018 16:21:11 -> Action : bkup_status  
 Mon, 29 Jan 2018 16:21:11 -> logfile: /var/opt/oracle/bkup_api/log/bkup_api.log  
 [root@RAJDB121 opc]#  


Hope you would find it informative........keep reading......


[Oracle Cloud] - Creating SSH Tunnel to Oracle Cloud Compute Node using PuTTY on Windows




Creating SSH Tunnel to Oracle Cloud Compute Node using PuTTY on Windows


In this blog post, I would demonstrate the steps and SSH client configuration details to enable access to Oracle Public Cloud compute node where your Oracle Database Deployment is running.

First of all, you should note down the Oracle Compute Cloud Node's IP for your target database deployment you want to connect to. Go to Oracle Database Cloud Service service page and click on the Database Deployment service name you have created, now on the Database deployment details page, you would find the IP address of its compute node.

Second, you must have the private key saved in .ppk format locally on your client machine that you downloaded while creating the database deployment or the one you might have generated on your own and equivalent to the public key used during database deployment service creation.



  • Run the PuTTY SSH client program on your local machine and enter the Public IP address of the compute Node as depicted below. Make sure you have select SSH in the connection Type region of this page.



































In category tree at left panel of the page, expand the Connection and click on Data. you would be depicted the following page. In Login Details section, you can enter oracle as a user or leave it blank if you want to enter the username at connection time over PuTTY console. Make sure you have selected "Prompt" radio box under "When username is not specified" section so that it asks for username during the SSH connection request to the compute node.



































In category tree at left panel, expand SSH and click on "Auth" , following page appears then.


Click on the Browse button under Private Key file for authentication and select the private key file(.ppk format) which is equivalent to the public key of your target cloud Compute Node.















Now, in category tree at left panel, click on the "Tunnels", following page appears. I am giving here an example of port 22. In the "Add new forwarded Port" enter 22 for "Source Port" and enter the IP Address following port number in the "Destination" box in format "ip-address:port_number and click on Add.



In the Left panel of Category tree, click on the SSH and make sure you have not selected "Don't start a shell or command at all" under Protocal options in case if you are tunneling for port 22, otherwise, you won't get a prompt to enter username and shell to play with compute Node. In case of tunneling for other ports i.e. 1521, 5500, 1158, you can check that box not to start the cell and you can access the applications running on the port.




Now, go back to the "Category" tree and click on the Sessions on the TOP, and save the SSH configuration session setting so that you won't have to do these all shit every time you want to connect to compute node or any application port.



Once you saved the SSH Tunnel configuration setting, click on "Open" button at the bottom to connect to the Compute Node, and there you are at DBAAS compute node box. 

Enter the username you want to connect with, in my case, I am connecting with oracle user.













Now, you can play with dbaascli and all other things on Oracle Public Cloud Compute Node.

Thursday, February 1, 2018

Automatic PDB startup after CDB Instance Bounce



Automatic PDB startup after CDB instance bounce:


In this article I will demonstrate that how we can preserve the PDBs state inside a Container database(CDB) which would enable PDBs to open in the same state upon CDB instance bounce. Earlier than patchset release 12.1.0.2, this feature was not available and we used to have our own scripts/database trigger to open all/required PDBs in read-write mode at next startup of container database.


In Oracle Database 12c Patchset (12.1.0.2), this new feature was introduced where we can save the current state of a PDB inside a CDB so that at next startup of CDB that Pluggable Database inside the CDB starts back automatically to the state that was preserved in.

By default, all PDBs(except PDB$SEED, this is a template pluggable database which remains in read-only mode and it is used to create a new pluggable database) inside the CDB start in MOUNT state upon Container Database Instance bounce.


Let's take a look at this new feature with following set of examples:

I have one container database, PROD1, running with one pluggable database, PDBORCL inside it.

c:\app\oracle\product\12.1.0\dbhome_3\BIN>sqlplus "/as sysdba"

SQL*Plus: Release 12.1.0.2.0 Production on Thu Feb 1 07:34:47 2018

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> set lines 300
SQL> select name, open_mode, database_role, cdb from v$database;

NAME      OPEN_MODE            DATABASE_ROLE    CDB
--------- -------------------- ---------------- ---
PROD1     READ WRITE           PRIMARY          YES


You can see that current Open-Mode of pluggable database, PDBORCL is in MOUNTED state.

SQL> show pdbs

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


Let's bounce the container database instance and check its status.

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


SQL> startup
ORACLE instance started.

Total System Global Area 1006632960 bytes
Fixed Size                  3053104 bytes
Variable Size             905972176 bytes
Database Buffers           92274688 bytes
Redo Buffers                5332992 bytes
Database mounted.
Database opened.


Here, you see that after container database instance bounce, PDBORCL pluggable database started in MOUNTED state by default, in real world, you may have a number of pluggable databases running inside a single container database instance and you would want all or some of them to be started in READ-WRITE mode upon container database instance bounce, otherwise you would have to open all of them after CDB restart.

SQL> show pdbs

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


Let's now use the new feature introduced in the 12.1.0.2 patchset, and remain a lazy DBA, so that our pluggable database starts back automatically in read-write mode after CDB instance bounce.

First, we will open the pluggable database PDBORCL and save its current state so that it starts back in read-write mode at next startup.


SQL> alter pluggable database pdborcl open;

Pluggable database altered.

SQL> show pdbs

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

Here we save the PDB current state i.e READ WRITE at the moment.

SQL> alter pluggable database pdborcl save state;

Pluggable database altered.

SQL>


Now, bounce the CDB instance.

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

SQL> startup
ORACLE instance started.

Total System Global Area 1006632960 bytes
Fixed Size                  3053104 bytes
Variable Size             905972176 bytes
Database Buffers           92274688 bytes
Redo Buffers                5332992 bytes
Database mounted.
Database opened.
SQL>


As expected, if you check the pluggable database state after container database instance bounce, then you would see that PDBORCL started back in READ WRITE mode automatically.

SQL> select name, open_mode, database_role, cdb from v$database;

NAME      OPEN_MODE            DATABASE_ROLE    CDB
--------- -------------------- ---------------- ---
PROD1     READ WRITE           PRIMARY          YES

SQL> show pdbs

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


Any feedback or comments would highly be appreciated....!!