Sponsored Content
Full Discussion: Postgresql Database Corrupt
Special Forums UNIX and Linux Applications High Performance Computing Postgresql Database Corrupt Post 302769379 by ahsanpmd on Tuesday 12th of February 2013 04:58:52 AM
Old 02-12-2013
Postgresql Database Corrupt

I am managing a linux cluster which has been build on Platform Cluster Manager PCM 1.2.1) from IBM Platform Computing. Unfortunately somebody deteled data files of postgresql from /var/lib directory. I somehow managed to start the postmaster service again, but all the administrative commands of cluster are not not working. like addhost

Code:
[root@pmd ~]# addhost
KusuDB: Operational Error occurred when connecting to the DB
       Most likely cause: insufficient permissions for user=nobody
FATAL:  database "kusudb" does not exist

ERROR:  Database query failed!  Make sure the database is available

[root@pmd ~]#

I dont want to rebuild cluster as it will lead to the loss of much effort which I did on installing certain applications and running them on the cluster.
Please help me !

Last edited by Scott; 02-12-2013 at 06:21 AM.. Reason: Code tags
 

9 More Discussions You Might Find Interesting

1. Cybersecurity

Security Databases are corrupt. HELP!!

Help! SCO Unix 5.05. A relatievely new system went down on me today. I got the dreaded error: Out of Space on Device (1/42). I was able to clear up some space in the /tmp directory, however, when I try to boot, the system prompts me to go into single user mode and I get the... (2 Replies)
Discussion started by: gseyforth
2 Replies

2. UNIX for Dummies Questions & Answers

I got a corrupt /etc/inittab file....what next?

Hi guys, For some reason a client has given us a Sun Netra T1 with Solaris 8 to administer for them. That's always good business. However, the other day we rebooted the machine and to our amazement, after doing the preliminary hardware tests, we got an error messgae saying that /etc/inittab was... (3 Replies)
Discussion started by: Ivo
3 Replies

3. UNIX for Dummies Questions & Answers

Causing a disk to be corrupt

Hmm, how to ask this without sounding too malicious... How might one go about causing a disk corruption in OS X specifically or via the command line in UNIX in general? Doesnt matter the severity of the problem, I just want to scare the person a little, then fix the problem for them. Any... (1 Reply)
Discussion started by: Yummator
1 Replies

4. HP-UX

Corrupt Member File

I have been fine adding/removing printers up until this week. Now when I go to add a new remote printer I get "corrupted member file". I go to /etc/lp/member and the byte count on the new printer name is 0. I VI the file and put /dev/null in to make it the correct size and it all looks fine and... (2 Replies)
Discussion started by: astout
2 Replies

5. Shell Programming and Scripting

Script to connect to PostgreSQL database

Hi All, Has anyone of you connected to a remote PostgreSQL database through a shell/perl script. Can you please let me know the steps involed? Thanks. Rahul. (0 Replies)
Discussion started by: rahulrathod
0 Replies

6. Solaris

How to corrupt a superblock?

I need to corrupt a superblock of a mounted device in a soalris m/c and check recovery from an alternate superblock. How can this be done? (2 Replies)
Discussion started by: sujathan
2 Replies

7. HP-UX

corrupt disk

Hallo Friends, I have application X running on hpux 11.11 and oracle 9i release 2. I recently had a hardware failure on disk /dev/dsk/c2t0d0 Below is the systemlog file : root@a7dmc:/var/adm/syslog > /opt/resmon/bin/resdata -R 155713541 -r /storage/events/enclosures/gazemon/0_1_1_0.0.0... (11 Replies)
Discussion started by: kekanap
11 Replies

8. Shell Programming and Scripting

Script causing database corrupt

Hi, Closing the thread (3 Replies)
Discussion started by: dbashyam
3 Replies

9. Shell Programming and Scripting

Setting up postgreSql database

Hi I have a small bash script which I want to run on an Amazon EC2 Ubuntu instance for setting up a postgreSQL database: #!/bin/bash USERNAME='postgres' start=$SECONDS TMP_DIR=/local/test/4g4d PORT=23456 rm -rf $TMP_DIR/db mkdir -p $TMP_DIR/ echo "creating database..."... (3 Replies)
Discussion started by: Helveticus
3 Replies
INITDB(1)						  PostgreSQL Server Applications						 INITDB(1)

NAME
initdb - create a new PostgreSQL database cluster SYNOPSIS
initdb [ options... ] --pgdata | -D directory DESCRIPTION
initdb creates a new PostgreSQL database cluster (or database system). A database cluster is a collection of databases that are managed by a single server instance. Creating a database system consists of creating the directories in which the database data will live, generating the shared catalog tables (tables that belong to the whole cluster rather than to any particular database), and creating the template1 database. When you create a new database, everything in the template1 database is copied. It contains catalog tables filled in for things like the built-in types. initdb initializes the database cluster's default locale and character set encoding. Some locale categories are fixed for the lifetime of the cluster, so it is important to make the right choice when running initdb. Other locale categories can be changed later when the server is started. initdb will write those locale settings into the postgresql.conf configuration file so they are the default, but they can be changed by editing that file. To set the locale that initdb uses, see the description of the --locale option. The character set encoding can be set separately for each database as it is created. initdb determines the encoding for the template1 database, which will serve as the default for all other databases. To alter the default encoding use the --encoding option. initdb must be run as the user that will own the server process, because the server needs to have access to the files and directories that initdb creates. Since the server may not be run as root, you must not run initdb as root either. (It will in fact refuse to do so.) Although initdb will attempt to create the specified data directory, often it won't have permission to do so, since the parent of the desired data directory is often a root-owned directory. To set up an arrangement like this, create an empty data directory as root, then use chown to hand over ownership of that directory to the database user account, then su to become the database user, and finally run initdb as the database user. OPTIONS
-D directory --pgdata=directory This option specifies the directory where the database system should be stored. This is the only information required by initdb, but you can avoid writing it by setting the PGDATA environment variable, which can be convenient since the database server (postmaster) can find the database directory later by the same variable. -E encoding --encoding=encoding Selects the encoding of the template database. This will also be the default encoding of any database you create later, unless you override it there. To use the encoding feature, you must have enabled it at build time, at which time you also select the default for this option. --locale=locale Sets the default locale for the database cluster. If this option is not specified, the locale is inherited from the environment that initdb runs in. --lc-collate=locale --lc-ctype=locale --lc-messages=locale --lc-monetary=locale --lc-numeric=locale --lc-time=locale Like --locale, but only sets the locale in the specified category. -U username --username=username Selects the user name of the database superuser. This defaults to the name of the effective user running initdb. It is really not important what the superuser's name is, but one might choose to keep the customary name postgres, even if the operating system user's name is different. -W --pwprompt Makes initdb prompt for a password to give the database superuser. If you don't plan on using password authentication, this is not important. Otherwise you won't be able to use password authentication until you have a password set up. Other, less commonly used, parameters are also available: -d --debug Print debugging output from the bootstrap backend and a few other messages of lesser interest for the general public. The bootstrap backend is the program initdb uses to create the catalog tables. This option generates a tremendous amount of extremely boring out- put. -L directory Specifies where initdb should find its input files to initialize the database system. This is normally not necessary. You will be told if you need to specify their location explicitly. -n --noclean By default, when initdb determines that an error prevented it from completely creating the database system, it removes any files it may have created before discovering that it can't finish the job. This option inhibits tidying-up and is thus useful for debugging. ENVIRONMENT
PGDATA Specifies the directory where the database system is to be stored; may be overridden using the -D option. SEE ALSO
postgres(1), postmaster(1), PostgreSQL Administrator's Guide Application 2002-11-22 INITDB(1)
All times are GMT -4. The time now is 02:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy