beautypg.com

Restoring data files for postgresql – HP Systems Insight Manager User Manual

Page 519

background image

Restoring data files for PostgreSQL

To restore the database from a saved copy:

1.

If performing a reinstallation of HP SIM, proceed as directed in the

http://h18013.www1.hp.com/

products/servers/management/hpsim/infolibrary.html

.

2.

If HP SIM is running, enter mxstop in the command line to stop the HP SIM daemons.

3.

To verify that all HP SIM mx processes have stopped, run:

ps -ef | grep mx

For HP-UX, proceed with step 4.

4.

For HP-UX:
a.

Uninstall the SysMgmtDB:

swremove -x enforce_dependencies=false SysMgmtDB

b.

Install Sys Managhement DB from HP SIM's Depot file:

swinstall -s /hpsim.depot SysMgmtDB

5.

For Linux:
a.

To edit the pg_hba.conf file, enter:

vi /var/lib/pgsql/data/pg_hba.conf

and add:

local insight_v1_0 mxadmin password

local all all trust

host insight_v1_0 root 127.0.0.1 255.255.255.255 trust

b.

Stop the postgreSQL service:

For SUSE Linux Enterprise Server 9 and SUSE Linux Enterprise Server 10

/etc/init.d/postgresql stop

For Red Hat Enterprise Linux (all versions)

/etc/rc.d/init.d/postgresql stop

c.

Shift the user : Login as postgres:

su postgres

d.

To delete the dabase, enter:

cd /usr/bin

and then run:

dropdb -p 5432 –h 127.0.0.1 –i –e insight_v1_0

6.

Create a database with the name insight_v1_0:

For HP-UX:

cd /opt/hpsmdb/pgsql/bin

./createdb -O hpsmdb -h 127.0.0.1 -p 50006 -U hpsmdb insight_v1_0

For Linux:

cd /usr/bin

./createdb –O postgres –h 127.0.0.1 –p 5432 –U postgres insight v1 0

Backing up and restoring the database 519