Skip to main content

Posts

Showing posts from June, 2016

LPAR Architecture

System Requirements and Recommendations

Standby is maintained as a mirror image of the primary. Many aspects of the primary and standby databases need to be the same. Primary and standby must have the  same DB2 major version . For example, both on V10.1. Standby database fix pack level must be same or higher than that of the primary (otherwise, primary could generate log records the standby cannot replay). Same fix pack level is recommended on primary and standby, to minimize compatibility risk. Different primary and standby fix pack levels usually only occur during rolling update Primary and standby must have the  same platform . "Platform" here is defined as the combination of OS type (software) and machine architecture (hardware). For example, the followings are considered distinct platforms: Windows-x86, AIX-power, HP-IA, Solaris-Sparc, Solaris-x86, Linux-PPC, Linux-Z, Linux-390, Linux-x86, Primary and standby must have the same endian (both big endian, or both small endian). This requirement is usua

What's replicated, what's not?

Logged operations are replicated. These include, but are not limited to: DDL DML Create/alter table space Create/alter storage group Create/alter buffer pool XML data. Logged LOBs Not logged operations are not replicated. These include, but are not limited to: Database configuration parameters (this allows primary and standby databases to be configured differently). "Not logged initially" tables Not logged LOBs UDF (User Defined Function) libraries. UDF DDL is replicated. But the libraries used by UDF (such as C or Java libraries)  are not replicated, because they are not stored in the database. Users must manually copy the libraries to the standby. Note: You can use database configuration parameter  BLOCKNONLOGGED  to block not logged operations on the primary.

How does HADR work?

Let explain this way.  HADR is based on log replay.  Initialize the standby with a backup or split mirror image of the primary.  You then configure and start HADR on the primary and standby databases.  The primary ships its transaction log data to the standby via a TCP connection.  The standby continuously replays the log records to keep itself in sync with the primary. If the primary fails, you issue a "takeover HADR by force" command on the standby to make the standby the new primary. A single command does it all. For planned maintenance, you issue a "takeover HADR" (without "by force" option) command to switch primary and standby's roles. HADR management is so simple. There are only 3 commands: Start HADR, stop HADR, and takeover HADR.

What is DB2 HADR?

DB2® High Availability Disaster Recovery (HADR) uses database logs to replicate data from the primary database to the standby database.  Non-logged operations are allowed on the primary database, but not replicated to the standby database. If you want non-logged operations, such as updates to the history file, to be reflected in the standby database, you must take extra steps to cause this to happen. The following are examples of cases in which operations on the primary database are not replicated to the standby database: Tables created with the NOT LOGGED INITIALLY option specified are not replicated. Attempts to access such tables after an HADR standby database takes over as the primary database will result in an error. All logged LOB columns are replicated. Non-logged LOB columns are not replicated. However, the space for them will be allocated on the standby database using binary zeroes as the value for the column. Updates to database configuration using the UPDATE DAT

Error: could not find function "read.xlsx" while reading .xlsx file in R

Got this during the execution of following command in R > dat <- colindex="colIndex," endrow="23," file="NGAP.xlsx" header="TRUE)</p" read.xlsx="" sheetindex="1," startrow="18,"> Error: could not find function "read.xlsx" Tried following command > install.packages("xlsx", dependencies = TRUE) Installing package into ‘C:/Users/amajumde/Documents/R/win-library/3.2’ (as ‘lib’ is unspecified) also installing the dependencies ‘rJava’, ‘xlsxjars’ trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/rJava_0.9-8.zip' Content type 'application/zip' length 766972 bytes (748 KB) downloaded 748 KB trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/xlsxjars_0.6.1.zip' Content type 'application/zip' length 9485170 bytes (9.0 MB) downloaded 9.0 MB trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/xlsx_0.5.7.zip&

Error: could not find function "read.xlsx" while reading .xlsx file in R

Got this during the execution of following command in R > dat <- colindex="colIndex," endrow="23," file="NGAP.xlsx" header="TRUE)</p" read.xlsx="" sheetindex="1," startrow="18,"> Error: could not find function "read.xlsx" Tried following command > install.packages("xlsx", dependencies = TRUE) Installing package into ‘C:/Users/amajumde/Documents/R/win-library/3.2’ (as ‘lib’ is unspecified) also installing the dependencies ‘rJava’, ‘xlsxjars’ trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/rJava_0.9-8.zip' Content type 'application/zip' length 766972 bytes (748 KB) downloaded 748 KB trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/xlsxjars_0.6.1.zip' Content type 'application/zip' length 9485170 bytes (9.0 MB) downloaded 9.0 MB trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/xlsx_0.5.7.zip&

Error: could not find function "read.xlsx" while reading .xlsx file in R

Got this during the execution of following command in R > dat <- colindex="colIndex," endrow="23," file="NGAP.xlsx" header="TRUE)</p" read.xlsx="" sheetindex="1," startrow="18,"> Error: could not find function "read.xlsx" Tried following command > install.packages("xlsx", dependencies = TRUE) Installing package into ‘C:/Users/amajumde/Documents/R/win-library/3.2’ (as ‘lib’ is unspecified) also installing the dependencies ‘rJava’, ‘xlsxjars’ trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/rJava_0.9-8.zip' Content type 'application/zip' length 766972 bytes (748 KB) downloaded 748 KB trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/xlsxjars_0.6.1.zip' Content type 'application/zip' length 9485170 bytes (9.0 MB) downloaded 9.0 MB trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/xlsx_0.5.7.zip&

Error : .onLoad failed in loadNamespace() for 'rJava', details:

Getting following error during > library(rJava) Error : .onLoad failed in loadNamespace() for 'rJava', details:   call: fun(libname, pkgname)   error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures. Error: package or namespace load failed for ‘rJava’ The architecture of Java you get for install from the regular Java download web page depends on the architecture of browser you’re using (32-bit or 64-bit) when you download it. This happens without any fanfare. We need the Java manual download page, select the 64-bit version of Java for your OS, install it, and then (after restarting R) try your R packages again. *** Make sure we need 64 bit Java version to download WHY? R is 64 bit Source: https://java.com/en/download/manual.jsp#sol > library(rJava) Error : .onLoad failed in loadNamespace() for 'rJava', details:   call: inDL(x, as.logical(local), as.logical(now),

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :

While executing the following command got this error: > dat <- colindex="colIndex," endrow="23," file="NGAP.xlsx" header="TRUE)</b" read.xlsx="" sheetindex="1," startrow="18,"> Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  :   java.util.zip.ZipException: invalid code -- missing end-of-block Got this problem with a file downloaded from the internet using R command line, for an online course. Actually found that apparently the download mode needs to be set properly as write-binary (wb) since xlsx is basically a binary file (zip). In that case we have to download again > download.file (url=URL3, destfile="NGAP.xlsx", mode='wb') > dat <- colindex="colIndex," endrow="23," file="NGAP.xlsx" header="TRUE)</b" read.xlsx="" sheetindex="1," startrow="18