Thread: Can we have 2 databases on same server

Can we have 2 databases on same server

From
"Suresh Gupta VG"
Date:

Hi Team,

 

I have Solaris 9 machine with Pgsql 7.4 and want to upgrade to 8.2.5. I don’t want to disturb the first version now. I want to install second one separately and need to test with my application. If it works fine, I will activate only the latest one and other version 7.4 will be discarded. This is my idea.

 

1)       Can I please know, if we can run 2 databases on the same server with out any conflicts?

2)       If it is so, at what stage we are need to configure the 2 databases? Pls provide links or docs if available.

3)       If we had a front end application and have the options like switching the database, the 2 databases are compulsory, right?(Thinking only one server is available.)

 

Can you pls advice on this.

 

Regards,

G. V. Suresh Gupta

---------------------------------------------------------------------------------------------------------------------------------

Innovative Technology Solutions(ITS), Zensar Technologies

Zensar Knowledge Park, Plot#5, MIDC IT Tower,

Kharadi, Off Nagar Road, Pune – 411014

Landline :  +91-20-66453471           | +91-9890898688                

Email     :   suresh.g@zensar.com    | website:  www.zensar.com

 

 

 

 

 

           

DISCLAIMER:
This email may contain confidential or privileged information for the intended recipient(s) and the views expressed in the same are not necessarily the views of Zensar Technologies Ltd. If you are not the intended recipient or have received this e-mail by error, its use is strictly prohibited, please delete the e-mail and notify the sender. Zensar Technologies Ltd. does not accept any liability for virus infected mails.

Attachment

Re: Can we have 2 databases on same server

From
Chris
Date:
> 1)       Can I please know, if we can run 2 databases on the same server
> with out any conflicts?

You can as long as they are installed in separate locations.

That is:

db1: /usr/local/pgsql/7.4
db2: /usr/local/pgsql/8.1

The main reason is so your app doesn't pick up the wrong binary and use
that and cause all sorts of weird and wonderful errors :)

> 2)       If it is so, at what stage we are need to configure the 2
> databases? Pls provide links or docs if available.

http://www.postgresql.org/docs/8.2/static/install-procedure.html (look
at the --prefix stuff).

http://www.postgresql.org/docs/8.2/static/creating-cluster.html

and
http://www.postgresql.org/docs/8.2/static/install-upgrading.html

for how to copy your data into the new system.


They will also need to run on different ports. Edit the postgresql.conf
file on the new install and change the port=5432 line to another
(unused) number.

--
Postgresql & php tutorials
http://www.designmagick.com/

Re: [ADMIN] Can we have 2 databases on same server

From
"Gregory Williamson"
Date:

Suresh Gupta asked:

>
> I have Solaris 9 machine with Pgsql 7.4 and want to upgrade to 8.2.5. I
> don't want to disturb the first version now. I want to install second
> one separately and need to test with my application. If it works fine, I
> will activate only the latest one and other version 7.4 will be
> discarded. This is my idea.
>
> 1)       Can I please know, if we can run 2 databases on the same server
> with out any conflicts?

Absolutely. We have one server with 8.1.x, 8.2.x and 8.3RC2 one it. We don't push more than one of them hard at any given time though, but we probably could (disk contention would be the biggest issue). As others pointed out, make different directories for the software and data.

> 2)       If it is so, at what stage we are need to configure the 2
> databases? Pls provide links or docs if available.

Before firing up the new instance, make sure you have enough shared memory allocated for *both* instances. Read the relevant docs pointed out in another response and make sure you specify the correct directories and ports etc. when running initdb to create the new 8.2 database. Make sure you point the logs to different files as well.

<...>

HTH,


Greg Williamson
Senior DBA
GlobeXplorer LLC, a DigitalGlobe company

Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information and must be protected in accordance with those provisions. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

(My corporate masters made me say this.)


Re: Can we have 2 databases on same server

From
Chander Ganesan
Date:
Hello Suresh,

Suresh Gupta VG wrote:

Hi Team,

 

I have Solaris 9 machine with Pgsql 7.4 and want to upgrade to 8.2.5. I don’t want to disturb the first version now. I want to install second one separately and need to test with my application. If it works fine, I will activate only the latest one and other version 7.4 will be discarded. This is my idea.

 

1)       Can I please know, if we can run 2 databases on the same server with out any conflicts?

It looks like you already got the answer on this one.. however, your terminology is a bit off.  Unlike Oracle (where we think in terms of "databases"), in PostgreSQL we think in terms of "clusters", where a cluster (often used interchangeably with the word "server") is a collection of databases.  A cluster listens on a single port, has a single "data" directory, and manages a single list of roles (accounts and groups) that span all of the databases that are managed by the cluster.

Hope that helps.  When you read the documentation you will see references to "Clusters", not databases...
-- 
Chander Ganesan
Open Technology Group, Inc.
One Copley Parkway, Suite 210
Morrisville, NC  27560
919-463-0999/877-258-8987
http://www.otg-nc.com
Ask me about Expert PostgreSQL & PostGIS Training Delivered Worldwide.