0

i'm new to Berkeley db, i have installed the version "db-4.8.30.NC.tar.gz" but now i would like to find the configuration information by using the configuration file.

I've read in the documentations that this file is named DB_CONFIG and it exists in the database home directory.

In my system, i have uzipped the tar file under /usr/db-4.8.30.NC but i still haven't found the DB_CONFIG file.

Well, i'm trying to find where the DB_CONFIG file is located in Unix, but i can't find it.

May you please help me?

Thanks, in advance

2
  • Voting to close, you should ask this on unix.stackexchange.com Commented Dec 4, 2011 at 9:24
  • @mghie: It sounds to me like programmer is trying to program an application using Berkeley DB. Commented Dec 4, 2011 at 9:55

1 Answer 1

2

You (or a system administrator) writes the DB_CONFIG file by hand to modify any of the DB_ENV environment variables that can be over-ridden at runtime.

The DB_CONFIG file is stored in the db_home directory; the docs/programmer_reference/env_naming.html file has full details, but you can either pass an explicit db_home parameter in the DB_ENV->open() call or rely on the DB_HOME environment variable to locate the DB_CONFIG file, if any exists. The environment variable approach might be nice if the system administrator would reasonably want to move the storage around as they wish; the specific path name approach might be nice if you don't want to bother your system administrators with details of managing your storage.

Sign up to request clarification or add additional context in comments.

12 Comments

Thanks for replying.When you say "you can either pass an explicit db_home parameter in the DB_ENV->open() call or rely on the DB_HOME environment variable to locate the DB_CONFIG file, if any exists". Where can i locate the db_home parameter (in which dir?) or how can i rely on the DB_HOME environment in order to locate the DB_CONFIG file?Shall i open a file and find these information? I'm sorry for making these questions but i'm a new user of Berkeley and i'm confused.
It really depends upon your application. You might construct the db_env parameter to DB_ENV->open() by concatenating getenv("HOME") with ".foo/". Or, if your application runs as a dedicated user, perhaps just pass getenv("HOME"). (Similar to squid, apache, ftpd, etc. using the home directory set for their dedicated user in /etc/passwd. Maybe you provide an Upstart configuration file for your users where you could set the DB_HOME environment variable.
Let's say that i would like to open the DB_CONFIG file. How can i open it?
vim /path/to/my/applications/data/directory/DB_CONFIG.
I can't understand the path. Isn't the DB_CONFIG file in the directory /usr/db-4.8.30.NC? Cause i don't know where the path you wrote me is. I'm sorry for asking these questions but i'm trying to find out how the system is organised. Also, i tried to type some commandes under the /usr/db-4.8.30.NC directory. e.g. dbenv->repmgr_set_ack_policy(dbenv, DB_REPMGR_ACKS_ONE); and i take the output "-bash: syntax error near unexpected token `('". Am i doing something wrong?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.