Book Image

Developing Robust Date and Time Oriented Applications in Oracle Cloud

By : Michal Kvet
Book Image

Developing Robust Date and Time Oriented Applications in Oracle Cloud

By: Michal Kvet

Overview of this book

Proper date and time management is critical for the development and reliability of Oracle Databases and cloud environments, which are among the most rapidly expanding technologies today. This knowledge can be applied to cloud technology, on premises, application development, and integration to emphasize regional settings, UTC coordination, or different time zones. This practical book focuses on code snippets and discusses the existing functionalities and limitations, along with covering data migration to the cloud by emphasizing the importance of proper date and time management. This book helps you understand the historical background and evolution of ANSI standards. You’ll get to grips with data types, constructor principles, and existing functionalities, and focus on the limitations of regional parameters and time zones, which help in expanding business to other parts of the world. You’ll also explore SQL injection threats, temporal database architecture, using Flashback Technology to reconstruct valid database images from the past, time zone management, and UTC synchronization across regions. By the end of this book, you’ll be able to create and manage temporal systems, prevent SQL injection attacks, use existing functionalities and define your own robust solutions for date management, and apply time zone and region rules.
Table of Contents (26 chapters)
1
Part 1: Discovering Oracle Cloud
4
Part 2: Understanding the Roots of Date and Time
7
Part 3: Modeling, Storing, and Managing Date and Time
12
Part 4: Modeling Validity Intervals
17
Part 5: Building Robust and Secure Temporal Solutions
20
Part 6: Expanding a Business Worldwide Using Oracle Cloud

What this book covers

Chapter 1, Oracle Cloud Fundamentals, provides a description of the Oracle Cloud concepts, deployment models, and the terminology used in the Oracle Cloud environment. It will drive you through the Oracle Cloud registration process and how to provision an autonomous database. It will also describe the core elements of the database systems by focusing on the core memory structures and background processes, as well as the database system architectures on offer and mapping principles between the instance and database.

Chapter 2, Data Loading and Migration Perspectives, navigates you through the techniques of moving data to the database repositories using SQL Loader and server- and client-side imports and exports. Moreover, it provides various enhancements to optimize the migration process with practical examples of techniques to use.

Chapter 3, Date and Time Standardization Principles, deals with the roots of date and time management and the ISO 8601 standard reference. It describes the principles of date value management, time element modeling, and composite value definition. It also summarizes period-of-time modeling and representation.

Chapter 4, Concepts of Temporality, is mostly theoretical. It describes the term temporality and associates it with multiple temporal aspects, such as Daylight Saving Time or summer and winter time, by emphasizing time-zone shifts and leap years. It explains the differences between calendar models and introduces the concept of a leap second.

Chapter 5, Modeling and Storage Principles, provides you with a summary of existing data types for modeling date and time values in Oracle Database, as well as applied arithmetic. Equally, it describes constructor functions and the limitation of the concept of storing date values in a numerical format.

Chapter 6, Conversion Functions and Element Extraction, continues directly from the previous chapter by discussing the methods for converting values across data types. It also deals with element extraction techniques, focusing on reliability and integrity issues. Finally, it provides a discussion regarding conversion validation.

Chapter 7, Date and Time Management Functions, provides a general description of the methods for dealing with date and time values, such as identifying next Sunday or adding a specified number of months consistently. Understanding the existing methods significantly simplifies the development process, explicit data management, and definitions. Equally, the concept of identifying people using a date of birth is discussed.

Chapter 8, Delving into National Language Support Parameters, focuses on the regional principles, rules, and habits related to date and time management. By reading this chapter, you will gain knowledge of the overall parameters that influence the processing and outputs. Moreover, Oracle Database offers on-the-fly implicit data conversions. You will become familiar with the techniques of specifying default formats and date and time element mapping.

Chapter 9, Duration Modeling and Calculations, is responsible for teaching you the overall techniques of duration modeling and calculation. However, the validity of states is often unlimited in time. We simply do not know in advance when the state will change or even, if ever. Therefore, we will show you ways to model unlimited validity.

Chapter 10, Interval Representation and Type Relationships, leads on from the previous chapter’s introduction to duration modeling. In this chapter, the focus is on the interaction of states and the relationships between them. This chapter will also discuss how temporal validity is powered by defining periods. After reading the chapter, you will have learned how to identify period usage and some related limitations.

Chapter 11, Temporal Database Concepts, introduces temporal databases. First, it deals with temporal dimensions and categorization. Secondly, we define the temporal architectures and granularity used for processing, dealing with the object, attribute, and synchronization group levels.

Chapter 12, Building Month Calendars Using SQL and PL/SQL, analyzes how to build monthly calendars, either using SQL or PL/SQL. It aims at identifying the first day of the month, the weekday reference, and the number of days, taking leap years into account. Moreover, name day management is discussed.

Chapter 13, Flashback Management for Reconstructing the Database Image, focuses on getting historical data. Relational databases are transaction oriented, right? So, why not use those transaction logs to reconstruct the database as it existed in the past? Flashback technology allows you to use operating logs efficiently by introducing multiple techniques for this purpose.

Chapter 14, Building Reliable Solutions to Avoid SQL Injection, deals with security. I assume you don’t want anyone to have access to your data, do you? We will show how the date and time can be misused to attack the database through SQL injection. Naturally, the techniques to prevent this are proposed as well.

Chapter 15, Timestamp Enhancements, recognizes extensions of the TIMESTAMP data type. The focus of this chapter is on time-zone management, shift calculation, and overall date and time synchronization across multiple regions. Beyond that, it discusses TIMESTAMP value normalization techniques. Alongside the entire concept of time-zone management, we will emphasize the importance of UTC references.

Chapter 16, Oracle Cloud Time-Zone Reflection, is the last chapter. It deals with the process of moving local systems and spreading them across regions. It requires using client time-zone references instead of server references given that clients can be geographically distributed across multiple regions. We will show you how to dynamically reflect the time zone of a server’s location to the client.