Sunday, June 24, 2007

IBM DB2 HADR Example

Here is an HADR configuration example that I did when preparing for my DBA certification. It has being awhile when I performed these steps, so bear with me if there are any mistakes or errors in the description.


DB2(R) high availability disaster recovery (HADR) is a data replication feature that provides a high availability solution for both partial and complete site failures. HADR protects against data loss by replicating data changes from a source database, called the primary, to a target database, called the standby.


This practice assumes two DB2 instances, named DB2INST1 and DB2INST2 resides in the same physical machine.

For configuring HADR, you will need few pieces of information.

Update DB2 Registry Profile
DB2 Communication Protocol (DB2COMM)

Update Each Instance DBM Configuration
DB2 TCPIP Listening Port (SVCENAME)

Update Primary DB Archical Logging Configuration
Log Pages During Index Rebuild (LOGINDEXBUILD)
Index Creation Time (INDEXREC)
Retain Log (LOGRETAIN)

Update Each DB HADR Configuration
Local IP Address (HADR_LOCAL_HOST)
Local Service Name/Port (HADR_LOCAL_SVC)
Remote IP Address (HADR_REMOTE_HOST)
Remote Service Name/Port (HADR_REMOTE_SVC)
Remote DB2 Instance Name (HADR_REMOTE_INST)
Synchronization Mode (HADR_SYNCMODE)




For the intent of all purposes, I installed a fresh copy of DB2 ESE version 9 and chooose NOT to create the default DB2 instance. Windows environment is assumed.


Step 1: Create 2 DB2 Instances

Open up an instance of DB2 Command Window by typing "db2cmd" in Run dialog.

Create Instance 1 by typing "db2icrt DB2INST1"

Create Instance 1 by typing "db2icrt DB2INST2"


Step 2: Configure Instance 1

Type the following commands:

SET DB2INSTANCE=DB2INST1
db2set DB2COMM=tcpip
db2 update dbm cfg using SVCENAME 41001
db2start


Note: The TCPIP service port for this instance is 41001

Step 3: Configure Instance 2

Type the following commands:

SET DB2INSTANCE=DB2INST2
db2set DB2COMM=tcpip
db2 update dbm cfg using SVCENAME 42001
db2start

Note: The TCPIP service port for this instance is 42001


Step 4: Create the Primary DB in Instance 1

Type the following commands:

SET DB2INSTANCE=DB2INST1
db2 create db BANKFRS
db2 update db cfg for BANKFRS using LOGINDEXBUILD on
db2 update db cfg for BANKFRS using INDEXREC RESTART
db2 update db cfg for BANKFRS using LOGRETAIN on

Note: This step will turn the DB into archival logging mode


Step 5: Create a backup of Primary DB

Type the following commands:

db2 BACKUP DB BANKFRS TO C:\TEMP

Note: This step will backup the BANKFRS db into C:\TEMP


Step 6: Restore the backup BANKFRS as Standby database

Type the following commands:

SET DB2INSTANCE=DB2INST2
db2 RESTORE DB BANKFRS FROM C:\TEMP

Note: This step will restore the database as BANKFRS in the second DB2 instance and place it into roll forward pending state.

Note: If you roll forward the BANKFRS now, you will not be able to initialize it as the standby database.


Step 7: Configure the HADR settings for the Primary DB in DB2INST1

Type the following commands:

SET DB2INSTANCE=DB2INST1
db2 update alternate server for database BANKFRS using hostname localhost port 42001
db2 update db cfg for BANKFRS using hadr_local_host localhost
db2 update db cfg for BANKFRS using hadr_local_svc 41005
db2 update db cfg for BANKFRS using hadr_remote_host localhost
db2 update db cfg for BANKFRS using hadr_remote_svc 42005
db2 update db cfg for BANKFRS using hadr_remote_inst DB2INST2
db2 update db cfg for BANKFRS using hadr_syncmode SYNC
db2 update db cfg for BANKFRS using hadr_timeout 120

Note: Primary BANKFRS HADR service port will be 41005.
Note: Standby BANKFRS HADR service port will be 42005.
Warning: You cannot use the Instance TCPIP port (SVCENAME) or next port number (SVCENAME+1) as the HADR service port. This is by design.


Step 7: Configure the HADR settings for the Primary DB in DB2INST1

Type the following commands:

SET DB2INSTANCE=DB2INST1
db2 update alternate server for database BANKFRS using hostname localhost port 41001
db2 update db cfg for BANKFRS using hadr_local_host localhost
db2 update db cfg for BANKFRS using hadr_local_svc 42005
db2 update db cfg for BANKFRS using hadr_remote_host localhost
db2 update db cfg for BANKFRS using hadr_remote_svc 41005
db2 update db cfg for BANKFRS using hadr_remote_inst DB2INST1
db2 update db cfg for BANKFRS using hadr_syncmode SYNC
db2 update db cfg for vusing hadr_timeout 120

Note: Primary BANKFRS HADR service port will be 41005.
Note: Standby BANKFRS HADR service port will be 42005.
Warning: You cannot use the Instance TCPIP port (SVCENAME) or next port number (SVCENAME+1) as the HADR service port. This is by design.





Now, you are ready to test the configuration.


Step 8: Start HADR on Standby DB IN DB2INST2

SET DB2INSTANCE=DB2INST2
db2 START HADR ON DB BANKFRS AS STANDBY


Step 9: Start HADR on Primary DB IN DB2INST1

SET DB2INSTANCE=DB2INST1
db2 START HADR ON DB BANKFRS AS PRIMARY


Step 10: Take over the Primary Role to Standby Instance

SET DB2INSTANCE=DB2INST2
db2 TAKEOVER HADR ON DB BANKFRS


Step 11: Take back the Primary Role from Standby Instance

SET DB2INSTANCE=DB2INST1
db2 TAKEOVER HADR ON DB BANKFRS

Step 12: Stop the HADR service on Primary DB

SET DB2INSTANCE=DB2INST1
db2 STOP HADR ON DB BANKFRS


Step 13: Stop the HADR service on Standby DB

SET DB2INSTANCE=DB2INST2
db2 deactivate db BANKFRS
db2 STOP HADR ON DN BANKFRS



General Notes:

You can invoke the HADR wizard from the DB2 Control Center by right clicking on the specific database and select "High Availability and Disaster Recovery" -> Setup

You can monitor the HADR status on the database by using the database snapshot monitor. "db2 get snapshot for database on BANKFRS"

Saturday, June 23, 2007

Temasek plans sale of its 3 power gencos by 2009

Review:

Potential buyers includes TNB (Malaysia), YTLPower (Malaysia), Intergen (US) and Tokyo Eletrical (Japan).

YTL Power strong presence in regional operations and its' piled up cash reserves are very encouraging in acquiring the power plants.

However it should be noted that all the power plants in this context already reached their output capacity and thus their revenues are capped within a forecasted range. The buyers will focus on the ROI instead.

I call a BUY on YTLPower on a target price of RM3.00, a potential 25% upside based on the closing price of RM2.39 yesterday.



By Audrey Tan, Assistant Money Editor


Temasek Holdings will sell its three power generation companies (gencos) over the next 12 to 18 months in the biggest sale of Singapore's power assets since the liberalisation of the domestic energy market.


The three gencos - PowerSeraya, Senoko Power and Tuas Power - together account for 80 per cent of Singapore's power-generating capacity.


Each of the three gencos is worth about $2 billion, market estimates suggest.
All three companies are profitable, and both local and foreign potential buyers have expressed interest in buying the companies.


Temasek said in a statement yesterday that it was now 'timely' to sell its stakes.
Mr Wong Kim Yin, Temasek managing director of investments, said: 'We have seen a lot of interest from potential buyers since last year. At the same time, the Singapore economy is poised to grow strongly over the next few years.


'The conditions are conducive for the divestment of the gencos.'
Temasek is still open on how it will sell the three companies.
However, it is more inclined to sell them through a tender process, rather than through a public listing as some market watchers had expected.


It is also likely to sell the companies one at a time, rather than all at once.
A direct sale through a tender means that Temasek would not have to hold any residual stake in the gencos, which it may have to if it listed the companies.


'A straightforward sale through a tender will better meet the objectives of creating a liberalised electricity market in an orderly fashion,' Temasek said.
There is no limit on foreign ownership of the companies, although there are restrictions on the three gencos holding stakes in each other.


This long-anticipated sale comes after years of progressive steps to liberalise Singapore's previously state-dominated energy market.


Tuas Power was carved out of the Public Utilities Board in 1995, and Senoko Power and PowerSeraya from Singapore Power in 2001.


Ownership was transferred to Temasek, on the understanding that it would eventually sell all three companies.


The aim was to introduce competition into the contestable parts of the energy market, such as retail and power generation.


Privately owned gencos should support a competitive market that can expect more players as Singapore's power needs grow, the Government said when announcing the changes in 2000.
Besides the three Temasek-owned gencos, the other gencos in the market are SembCorp Cogen and Keppel Merlimau Cogen.


United States-owned Island Power is also building a $1 billion power station on Jurong Island.
However, its project has been delayed for years as it has been unable to bring in its own gas supply through the Sumatra-Singapore gas pipeline.


But recent amendments to the Gas Act gave the regulator, the Energy Market Authority, the power to open the national gas pipeline grid to all players.


Temasek yesterday also pointed to this regulatory change as a reason for the timing of its divestment.


The regulatory framework governing competitive wholesale supply of gas and power is now complete, it said.


'These developments have set the stage for a competitive, yet stable, power generation market to operate in Singapore,' Mr Wong added.


Over the past few years, Temasek has organised the gencos into three independent firms, each with its own board and management, he said.


Market watchers say that because the gencos have operated independently of each other, a change of ownership should not affect electricity prices.


Latest publicly available data shows that in its last financial year, PowerSeraya made a $129.7 million profit. It has a licensed capacity of 3,100MW and offers retail services through a subsidiary, Seraya Energy.


Profits for Senoko Power were $131 million in its last financial year. The genco has generation assets totalling 3,300MW and has a retail arm, Senoko Energy Supply.


Tuas Power, which owns assets totalling 2,670MW, made $177.2 million in profits in its latest financial year. It also has a retail arm, Tuas Power Supply.


Morgan Stanley and Credit Suisse are the financial advisers for the divestment, which is expected to begin in the second half of this year.


The entire process should be completed by the end of next year or early 2009.


Separately, the union that represents workers in the three gencos has put out a reassurance.
In a statement late last night, the Union of Power and Gas Employees said it recently concluded collective agreements with the gencos that will be binding on the new owners for the next three years.


'Workers' interests under the existing terms and conditions of the collective agreements will thus be safeguarded in the event of any sale,' it said, adding that if there were to be any layoffs, the union will ensure that workers are compensated fairly.

Friday, June 22, 2007

Malaysia urged to expand Islamic Banking to Bosnia

Malaysia urged to expand Islamic Banking to Bosnia

By CHOI TUCK WO

SARAJEVO: Malaysia has been urged to expand its Islamic banking to Bosnia and Herzegovina due to the rising interest in such products and services, according to the countrys first Islamic bank CEO.

Amer Bukvic of Bosna Bank International made an impassioned plea to Datuk Seri Abdullah Ahmad Badawi to encourage Malaysian banks to capitalise on their expertise in Islamic financial banking and invest here.

He said Europes big financial groups were slowly moving towards that direction but they did not have the expertise and experience compared with Malaysia.

"And this is where Malaysia has the edge. You should move fast to benefit from the increasing interest in Islamic banking," he said when elaborating on his question to the Prime Minister during the Malaysia-Bosnia and Herzegovina Business Forum on Thursday.

Apart from Islamic banking, issues ranging from as diverse as terrorism and barter trade to halal and mineral water and health spa products were raised during Abdullahs dialogue with more than 700 Malaysian and Bosnian businessmen and captains of industry.

Bukvic said Malaysia was, in fact, indirectly represented in the country as his bank was established by the Islamic Development Bank of which the Malaysian government was among the owners.

However, he said, Malaysian banks should expand directly to the Bosnian market since it had a well established Islamic financial system covering banking, insurance, Takaful and other products.

The Malaysian Prime Minister, Dato Seri Abdullah Ahmad Badawi, right,shakes hands with his Bosnian counterpart Nikola Spiric,left, during his visit to Bosnian capital of Sarajevo on Thursday. (AP Photo/Hidajet Delic) He noted that there were 34 European banks in Bosnia and Herzegovina, all of which were making huge profits as the financial sector was well regulated..

Their investments are in excess of one billion euros as the top few banks alone are worth around 100 million euros each, said Bukvic, who is an alumni of the International Islamic University in Petaling Jaya.

He added the state faculty was establishing an MBA in Islamic finance due to the rising interest in such products.

In his response earlier, Abdullah urged the Malaysian delegation to take note of Bukvics remarks about the prospects of expanding Islamic banking services to the country.

The prime minister stressed that Islamic banking was not exclusively for Muslims but for non-Muslims too.

He added that Malaysias commercial and foreign banks had Islamic windows while some Islamic banks specifically set up by businessmen or banks from the Middle East were doing very well.

Their support, he added, came not only from Muslims but non-Muslims as well as they wanted to take advantage of the Islamic banking and financial services.