Translate

Tuesday 19 May 2020

Python tip 2 : expandtabs() function

Let us discuss about the expandtabs() function in python. This is quite helpful when we have tabs specified in our strings and we need to specify faces. There is no way how much amount of space is to be left while using tabs hence this becomes quite handy in such scenarios.



By default the space is 8, however we can specify the number of spaces required. This is quite useful when a string variable is available and instead of formatting the tab spaces from scratch we can simply use this function to get our job done. 

Python tip 1: casefold() function

Python Case fold function is very useful when we have special alphabets from other languages. We can use casefold() function for caseless matching.

It is similar to the lower function available in Python. So now the question arises why should i use this?



Let us imagine we have a special character from a different language. For example let's imagine we have a letter in German and let us what difference does it make by using the case hold function.

If you notice the lower function only was able to modify the words in english from Upper to lowe case however casefold() uses strict policy to convert the uppercase to the corresponding lowercase value even though it is from a different language.
Hope this post was useful. 



Thursday 7 May 2020

AIOUG Webinars 2020

All India Oracle Users Group (a.k.a) AIOUG is the only user group in India who host a variety of  Oracle related User group events.  It has several local chapters which are wide spread in 10 different cities. Due to the global pandemic lock down AIOUG has started conducting webinars to motivate people to learn and share knowledge across the globe.

Participants receive updates about the weekly events through email, Twitter, Facebook and meetup.

The community is getting a overwhelming response for conducting sessions on weekly basis. Luck enough that i am part of this group as a volunteer as well as a participant. My learning has been improved a lot due to this global lock down.

AIOUG has so far conducted many tech days, ground breakers tour and Sangam which is the annual conference which happens every year during the month of December.

Coming to the webinar series AIOUG has got an overwhelming response from the participants. Below sessions have been conducted so far on Flashback, Compression, Database In memory, Oracle Real Application testing and Next Generation Oracle RAC. AIOUG continues to support learning during this tough situation.

After webinar is completed, Q & A sessions are conducted and the speakers answer to the questions raised by participants. Finally a Quiz is conducted to test the knowledge and the winners gets some gifts/credits from AIOUG.


You can listen to the recordings conducted for all these events in the youtube channel.


Follow  AIOUG 




Make use of it and update your skills. Thank you AIOUG, Oracle ACE Program and Oracle for motivating everyone to learn during this lock down. 


Oracle Cloud Certification Program - Free

Oracle certification is one of the most valued certification in the IT industry. With the current pandemic situation, oracle has been generous enough to provide its cloud certifications all free of cost. It was really a great initiative. I was fortunate enough to complete three certifications (Oracle Autonomous Database specialist, Oracle Cloud Foundations Associate 2020, Oracle Cloud Architect Associate 2019 in this lock down period. Make use of it and get certified.

Below link can be used to get certified.

https://www.oracle.com/corporate/blog/free-certifications-oracle-oci-autonomous-033020.html

Oracle cloud is the one enterprise cloud which offers better performance and at most security.

For those who are unable to get a slot Oracle has provided a way to get the slots. Refer to the below link.

https://www.oracle.com/in/education/


Click the verification name which is present in your left site Access Free Learning Paths



Click on the Title of the certification Name


You can then fill out the registration form and Oracle will get back to you.


#Thankyou Oracle University, Oracle ACE Program for this wonderful opportunity. I am proud to be Oracle certified.

Friday 20 July 2018

SED Examples

Today let us discuss about SED .

SED - Streams Editor

Scenario 1:

Replace a string with another string using sed

Syntax

sed 's/string/stringtoreplace/' filename.txt

Example

sed '/s/SQL/ORACLE/' db.txt

Output

Before









After

Tuesday 6 December 2016

Query Oracle Using Spark

Just for Testing
================

Prereqs
========
1. Install Java jdk 1.7 or later
2. Oracle Database Software & DB
3. Spark Software

Note : HDFS/Hadoop is not really required.

High Level Steps
=================
1. Make sure Oracle Database is up and running
2. Unzip the Spark Software
3. Launch the Spark in Stand alone mode
4. In the command prompt invoke the spark shell
5. Query Oracle Data from Spark Shell using JDBC

Oracle:
=======
create table spark.test (name varchar(20));

insert into spark.test values ('WELCOME TO SPARK');

commit;

Spark:
=======
java -version
export JAVA_HOME=/usr/java/jdk1.8.0_45
export PATH=$PATH:$JAVA_HOME/bin



echo $JAVA_HOME

export SPARK_CLASSPATH=/u01/app/oracle/product/12.1.0/dbhome_1/jdbc/lib/ojdbc7.jar

Start Spark:
============
cd $SPARK_HOME/sbin

./start-master.sh

./start-slave.sh spark://localhost:7077

Invoke Spark Shell:
===================
cd $SPARK_HOME/bin

val test = sqlContext.load ("jdbc", Map("url" -> "jdbc:oracle:thin:spark/spark@//localhost:1521/ORCL","dbtable" ->"test"))
test.count()
test.printSchema
test.show

Demo :