Thursday, September 6, 2018

What are Edge Nodes or Gateway Nodes in Hadoop?

Edge nodes are the interface between the Hadoop cluster and the outside network from which Hadoop user can store files in Hadoop cluster. It’s a gateway to the cluster, Hence some time we refer it as a gateway node as well.

Commonly, edge nodes are used to run cluster administration tools and client applications.  Edge-nodes are kept separate from the cluster nodes that contain HDFS, MapReduce, etc components in it, It mainly to keeps the computing resources separate from the outer world.

Edge nodes running within the cluster allow for centralized management of all the Hadoop configurations on the cluster nodes which helps to reduce the administration efforts needed to update the config files through cluster administrators. 
It’s a limited security within Hadoop itself, even if your Hadoop cluster operates in a LAN or WAN behind a security firewall. You may consider a cluster-specific firewall to fully protect non-public data of Hadoop cluster.

Sunday, August 12, 2018

How to change a non-partitioned table into a partitioned table in oracle along with indexes?

There are two ways to change the partitioned table into non-partitioned table.

1. We can use Oracle data pump (expdp/impdp) utilities with option PARTITION_OPTIONS=DEPARTITION.

CREATE OR REPLACE DIRECTORY TEST_DIR AS '/oracle/expimpdp/';
GRANT READ, WRITE ON DIRECTORY TEST_DIR TO MY_USER;

EXPDP MY_USER/MY_PWD@MYDB TABLES=T DIRECTORY=TEST_DIR PARALLEL=5 INCLUDE=TABLE_DATA,INDEX COMPRESSION=ALL DUMPFILE=T_DUMP.DMP LOGFILE=EXPDP_T_DUMP.LOG

IMPDP MY_USER/MY_PWD@MYDB tables=T DIRECTORY=TEST_DIR PARALLEL=5 INCLUDE=TABLE_DATA,INDEX CONTENT=ALL PARTITION_OPTIONS=DEPARTITION DUMPFILE=T_DUMP.DMP LOGFILE=IMPDP_T_DUMP.LOG

2.  we can use ALTER TABLE - "ONLINE" & optional "UPDATE INDEXES"  Clause as below.

ALTER TABLE EMP_PART_CONVERT MODIFY PARTITION BY RANGE (employee_id) INTERVAL (100) 

PARTITION P1 VALUES LESS THAN (100), 
PARTITION P2 VALUES LESS THAN (500) ) 
ONLINE UPDATE INDEXES 
(
IDX1_SALARY LOCAL, 
IDX2_EMP_ID GLOBAL PARTITION BY RANGE (employee_id) ( PARTITION IP1 VALUES LESS THAN (MAXVALUE)
)
);

Please note following things  - When using the UPDATE INDEXES clause:

  • This clause can be used to change the partitioning state of indexes and storage properties of the indexes being converted.
  • Indexes are maintained both for the online and offline conversion to a partitioned table.
  • This clause cannot change the columns on which the original list of indexes are defined.
  • This clause cannot change the uniqueness property of the index.
  • This conversion operation cannot be performed if there are domain indexes.
  • During conversion - All Bitmap indexes become local partitioned indexes, by default.



How to change partitioned table into non-partitioned table in oracle along with data and indexes?

There are three main ways to change the partitioned table into non-partitioned table.

1. We can use Oracle data pump (expdp/impdp) utilities with option PARTITION_OPTIONS=merge.

CREATE OR REPLACE DIRECTORY TEST_DIR AS '/oracle/expimpdp/';
GRANT READ, WRITE ON DIRECTORY TEST_DIR TO MY_USER;

EXPDP MY_USER/MY_PWD@MYDB TABLES=T DIRECTORY=TEST_DIR PARALLEL=5 INCLUDE=TABLE_DATA,INDEX COMPRESSION=ALL DUMPFILE=T_DUMP.DMP LOGFILE=EXPDP_T_DUMP.LOG

IMPDP MY_USER/MY_PWD@MYDB tables=T DIRECTORY=TEST_DIR PARALLEL=5 INCLUDE=TABLE_DATA,INDEX CONTENT=ALL PARTITION_OPTIONS=MERGE DUMPFILE=T_DUMP.DMP LOGFILE=IMPDP_T_DUMP.LOG

2. With simpler method as ALTER TABLE.
 
ALTER TABLE T1 MERGE PARTITIONS P1 TO P6 INTO P0;

3. Create a temporary copy of table along with data, drop the original table and rename the temp table name into the original and create index accordingly. (Considering that my table having not much huge data.)

CREATE TABLE T_TEMP AS
SELECT * FROM T;

RENAME T_TEMP TO T;

CREATE INDEX IDX_T AS T(ID);

Sunday, July 29, 2018

what is the difference between TLS & SSL?

SSL (Secure Sockets Layer) and TLS  (Transport Layer Security) are both cryptographic protocols that provide authentication and data encryption between servers, machines and applications operating over a network.

  • SSL used to transmit information privately along with message integrity and provides guarantee the server identity. 
  • SSL works mainly through using public/private key encryption on data.
  • SSL was originally developed by Netscape and first came onto the public in 1995 with SSL 2.0, SSL 1.0 was never released to the public. 
  • In 1996, SSL 2.0 was quickly replaced by SSL 3.0 after a number of vulnerabilities were found in it.

Over the years, new versions of the protocols have been released to address vulnerabilities and support stronger, more secure cipher suites and algorithms.The Internet Engineering Task Force (IETF) created TLS as the successor to SSL .

  • In 1999, as a new version of SSL, intrduced as TLS 1.1. Currently we are working in TLS 1.2, Yet to come TLS v. 1.3, its in draft.
  • Currently all browsers support TLS 1.0 by default and may optionally support TLS 1.1 and 1.2.
  • The TLS protocol aims primarily to provide privacy and data integrity between two or more communicating computer applications.

In current, Hypertext Transfer Protocol Secure (HTTPS) “HTTP Secure” is an application-specific implementation that is a combination of the Hypertext Transfer Protocol (HTTP) with the SSL/TLS. HTTPS is used to provide encrypted communication with and secure identification of a Web server.

In addition to HTTPS, SSL/TLS can be used to secure other application-specific protocols such as FTP, SMTP, NNTP, etc.


What is the difference between the bad file and the discard file in SQL*Loader?

In Oracle, bad file and discard files both contain rejected rows, but they are rejected for different reasons:

Bad file: The bad file contains records which are rejected because of errors.  These errors might include bad datatypee, type conversions or any referential integrity constraints.


Discard file: The discard file contains rows that were discarded because they are filtered out due to filtering criteria's which yu have written in SQL*Loader control file.

Tuesday, February 16, 2016

What are big data tools used currently in market?

Big data is a broad term for data sets so large or complex that traditional data processing applications are inadequate.

Traditional SQL databases used for storing and retrieving data. It all depends on the use cases. In contrast, nonSQL databases are in-memory caches, full-text search engines, real-time streaming, graph databases, etc.

Cassandra: An open source distributed database management system originally developed at Facebook and designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure.

Redis: An open source (BSD licensed), in-memory data structure store, used as database, cache and message broker.

CouchBase: An open-source, distributed NoSQL document-oriented database that is optimized for interactive applications.

CouchDB: An open-source document-oriented NoSQL database that uses JSON to store data.

MongoDB: A popular, a cross-platform document-oriented database.

Elasticsearch: A distributed RESTful search engine built for the cloud.

Hazelcast: An open source in-memory data grid based on Java.

EHCache : A widely used open source Java distributed cache for general purpose caching, Java EE and light-weight containers.

Hadoop : An open-source software framework written in Java for distributed storage and distributed processing of very large data sets on computer clusters built from commodity hardware.

HBase : An open source, non-relational, distributed database modeled after Google's BigTable, written in Java and runs on top of HDFS.

Spark Spark : An open source cluster computing framework.

Memcached : A general-purpose distributed memory caching system.

Apache Hive : It provides an SQL-like layer on top of Hadoop.

Apache Kafka : A high-throughput, distributed, publish-subscribe messaging system originally developed at LinkedIn.

Akka: A toolkit and runtime for building highly concurrent, distributed, and resilient message-driven applications on the JVM.

Neo4j: An open-source graph database implemented in Java.

Solr: An open source enterprise search platform, written in Java, from the Apache Lucene project.

Apache Storm: An open source distributed realtime computation system.

Oracle Coherence: An in-memory data grid solution that enables organizations to predictably scale mission-critical applications by providing fast access to frequently used data.

Titan: A scalable graph database optimized for storing and querying graphs containing hundreds of billions of vertices and edges distributed across a multi-machine cluster.

Amazon DynamoDB: A fast and flexible fully managed NoSQL database service for all applications that need consistent, single-digit millisecond latency at any scale.

Amazon Kinesis: A platform for streaming data real-time on AWS.

Datomic: A fully transactional, cloud-ready, distributed database written in Clojure.


Monday, February 8, 2016

What is big file tablespace in oracle?

A big file tablespace is a single tablespace can have  very large  - up to 4G blocks in a data file. As compare to traditional tablespaces which can contain multiple data files, but the files cannot be as large.

Some benefits of its are as under:

  • A Bigfile tablespace with 8K/16K/32K blocks can contain a 32/64/128 TB data file. 
  • The maximum number of datafiles in an Oracle Database is limited to Max. 64K files. 
  • A Bigfile tablespace can significantly improve the storage capacity of the Database.
  • Bigfile tablespaces reduce the number of data files for a database, with this DB_FILES initialization parameter and MAXDATAFILES parameter of the CREATE DATABASE and CREATE CONTROLFILE statements can be adjusted by DBA to reduce the amount of SGA space required for data files and size of the control file.
  • Bigfile tablespaces simplify database management by providing data file transparency instead of using multiple data files.
  • It supports only for locally managed tablespaces with automatic segment space management, and it’s not used for locally managed undo tablespaces, temporary tablespaces and SYSTEM tablespace.
  • It is advised to use big file tablespaces in a database where Automatic Storage Management (ASM) configured or other logical volume managers that support striping or RAID, and dynamically extensible logical volumes.
  • Avoid creating big file tablespaces on a database that is not supporting striping because of negative implications for parallel query execution and RMAN backup parallelization.


If the default tablespace type is specified to BIGFILE at a time of database creation, you need not specify the keyword BIGFILE in the CREATE TABLESPACE statement. A big file tablespace is created by default.

CREATE BIGFILE TABLESPACE tbs_bigtable_ex1
DATAFILE '/u02/oracle/data/tbsbig01.dbf' SIZE 80G;

If the default tablespace type is specified to BIGFILE at a time of database creation, but you want to create a traditional - small file tablespace, then uses a CREATE SMALLFILE TABLESPACE statement to override the default tablespace type which creating database.

CREATE SMALLFILE TABLESPACE tbs_smalltable_ex1
DATAFILE '/u02/oracle/data/tbssmall01.dbf' SIZE 80G;