pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
A particular database to move to other drive
10+ messages / 8 participants
[nested] [flat]

* A particular database to move to other drive
@ 2017-11-25 19:38 nikhil raj <nikhilraj474@gmail.com>
  2017-11-25 23:56 ` Re: [EXTERNAL] A particular database to move to other drive Redmon, Bruce <bruce.redmon@team.neustar>
  2017-11-27 09:05 ` Re: A particular database to move to other drive Shreeyansh Dba <shreeyansh2014@gmail.com>
  2017-11-27 09:35 ` Re: A particular database to move to other drive Stéphane KANSCHINE <stephane@hexack.fr>
  2017-11-27 10:18 ` Re: A particular database to move to other drive Devrim Gündüz <devrim@gunduz.org>
  0 siblings, 4 replies; 10+ messages in thread

From: nikhil raj @ 2017-11-25 19:38 UTC (permalink / raw)
  To: pgsql-admin

Hi,
Any one can please help me out

I want to move a database to 'Y drive' because the size of that database is
large about so can I move only that database to because I got an alert of
low space is there any way
Currently it is on F drive I want to move to Y drive .

Thanks

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [EXTERNAL] A particular database to move to other drive
  2017-11-25 19:38 A particular database to move to other drive nikhil raj <nikhilraj474@gmail.com>
@ 2017-11-25 23:56 ` Redmon, Bruce <bruce.redmon@team.neustar>
  3 siblings, 0 replies; 10+ messages in thread

From: Redmon, Bruce @ 2017-11-25 23:56 UTC (permalink / raw)
  To: nikhil raj <nikhilraj474@gmail.com>; +Cc: pgsql-admin

How much down time can you afford?

Sent from my iPhone

On Nov 25, 2017, at 4:59 PM, nikhil raj <nikhilraj474@gmail.com<mailto:nikhilraj474@gmail.com>> wrote:

Hi,
Any one can please help me out

I want to move a database to 'Y drive' because the size of that database is large about so can I move only that database to because I got an alert of low space is there any way
Currently it is on F drive I want to move to Y drive .

Thanks

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: A particular database to move to other drive
  2017-11-25 19:38 A particular database to move to other drive nikhil raj <nikhilraj474@gmail.com>
@ 2017-11-27 09:05 ` Shreeyansh Dba <shreeyansh2014@gmail.com>
  2017-11-27 09:53   ` Re: A particular database to move to other drive Abhishek Gautam <abhishekgautam009@gmail.com>
  2017-11-27 16:19   ` RE: A particular database to move to other drive Runge, Steven <Steven.Runge@mastercard.com>
  3 siblings, 2 replies; 10+ messages in thread

From: Shreeyansh Dba @ 2017-11-27 09:05 UTC (permalink / raw)
  To: nikhil raj <nikhilraj474@gmail.com>; +Cc: pgsql-admin

On Sun, Nov 26, 2017 at 1:08 AM, nikhil raj <nikhilraj474@gmail.com> wrote:

> Hi,
> Any one can please help me out
>
> I want to move a database to 'Y drive' because the size of that database
> is large about so can I move only that database to because I got an alert
> of low space is there any way
> Currently it is on F drive I want to move to Y drive .
>
> Thanks
>

If we want to move a particular database from one drive to another drive
for this requires downtime. There are multiple options to move a database
like pg_dump & pg_restore or taking a physical copy, we may pick anyone
from these options depending on the size of the database.

-- 
[image: http://www.shreeyansh.com] <http://www.shreeyansh.com;

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: A particular database to move to other drive
  2017-11-25 19:38 A particular database to move to other drive nikhil raj <nikhilraj474@gmail.com>
  2017-11-27 09:05 ` Re: A particular database to move to other drive Shreeyansh Dba <shreeyansh2014@gmail.com>
@ 2017-11-27 09:53   ` Abhishek Gautam <abhishekgautam009@gmail.com>
  2017-11-27 10:54     ` Re: A particular database to move to other drive nikhil raj <nikhilraj474@gmail.com>
  1 sibling, 1 reply; 10+ messages in thread

From: Abhishek Gautam @ 2017-11-27 09:53 UTC (permalink / raw)
  To: Shreeyansh Dba <shreeyansh2014@gmail.com>; +Cc: nikhil raj <nikhilraj474@gmail.com>; pgsql-admin

Hi,

May be creating new tablespace on new drives and then changing db tablespace from default to new one.

Beware there would be physical movement of data.

Haven’t done this for whole db but should work.

Sent from iPhone

Cheers,
Abhishek Gautam

> On 27-Nov-2017, at 2:35 PM, Shreeyansh Dba <shreeyansh2014@gmail.com> wrote:
> 
> 
> 
>> On Sun, Nov 26, 2017 at 1:08 AM, nikhil raj <nikhilraj474@gmail.com> wrote:
>> Hi,
>> Any one can please help me out 
>> 
>> I want to move a database to 'Y drive' because the size of that database is large about so can I move only that database to because I got an alert of low space is there any way 
>> Currently it is on F drive I want to move to Y drive .
>> 
>> Thanks
> 
> If we want to move a particular database from one drive to another drive for this requires downtime. There are multiple options to move a database like pg_dump & pg_restore or taking a physical copy, we may pick anyone from these options depending on the size of the database.
> 
> -- 
> 

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: A particular database to move to other drive
  2017-11-25 19:38 A particular database to move to other drive nikhil raj <nikhilraj474@gmail.com>
  2017-11-27 09:05 ` Re: A particular database to move to other drive Shreeyansh Dba <shreeyansh2014@gmail.com>
  2017-11-27 09:53   ` Re: A particular database to move to other drive Abhishek Gautam <abhishekgautam009@gmail.com>
@ 2017-11-27 10:54     ` nikhil raj <nikhilraj474@gmail.com>
  0 siblings, 0 replies; 10+ messages in thread

From: nikhil raj @ 2017-11-27 10:54 UTC (permalink / raw)
  To: Abhishek Gautam <abhishekgautam009@gmail.com>; +Cc: Shreeyansh Dba <shreeyansh2014@gmail.com>; pgsql-admin

Thanks a lot.

On Nov 27, 2017 3:23 PM, "Abhishek Gautam" <abhishekgautam009@gmail.com>
wrote:

Hi,

May be creating new tablespace on new drives and then changing db
tablespace from default to new one.

Beware there would be physical movement of data.

Haven’t done this for whole db but should work.

Sent from iPhone

Cheers,
Abhishek Gautam

On 27-Nov-2017, at 2:35 PM, Shreeyansh Dba <shreeyansh2014@gmail.com> wrote:



On Sun, Nov 26, 2017 at 1:08 AM, nikhil raj <nikhilraj474@gmail.com> wrote:

> Hi,
> Any one can please help me out
>
> I want to move a database to 'Y drive' because the size of that database
> is large about so can I move only that database to because I got an alert
> of low space is there any way
> Currently it is on F drive I want to move to Y drive .
>
> Thanks
>

If we want to move a particular database from one drive to another drive
for this requires downtime. There are multiple options to move a database
like pg_dump & pg_restore or taking a physical copy, we may pick anyone
from these options depending on the size of the database.

-- 
[image: http://www.shreeyansh.com] <http://www.shreeyansh.com;

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* RE: A particular database to move to other drive
  2017-11-25 19:38 A particular database to move to other drive nikhil raj <nikhilraj474@gmail.com>
  2017-11-27 09:05 ` Re: A particular database to move to other drive Shreeyansh Dba <shreeyansh2014@gmail.com>
@ 2017-11-27 16:19   ` Runge, Steven <Steven.Runge@mastercard.com>
  1 sibling, 0 replies; 10+ messages in thread

From: Runge, Steven @ 2017-11-27 16:19 UTC (permalink / raw)
  To: Shreeyansh Dba <shreeyansh2014@gmail.com>; nikhil raj <nikhilraj474@gmail.com>; +Cc: pgsql-admin

I believe you could use pg_repack to move your database to a new tablespace on your Y drive without downtime (minimal locking).

Steve Runge
Consultant
Database Engineering

from: Shreeyansh Dba [mailto:shreeyansh2014@gmail.com]
Sent: Monday, November 27, 2017 3:05 AM
To: nikhil raj <nikhilraj474@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: A particular database to move to other drive



On Sun, Nov 26, 2017 at 1:08 AM, nikhil raj <nikhilraj474@gmail.com<mailto:nikhilraj474@gmail.com>> wrote:
Hi,
Any one can please help me out

I want to move a database to 'Y drive' because the size of that database is large about so can I move only that database to because I got an alert of low space is there any way
Currently it is on F drive I want to move to Y drive .

Thanks

If we want to move a particular database from one drive to another drive for this requires downtime. There are multiple options to move a database like pg_dump & pg_restore or taking a physical copy, we may pick anyone from these options depending on the size of the database.

--
[http://www.shreeyansh.com]<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.shreeyansh.com&d=DwMFaQ&c=uc5ZRXl8dG...;
CONFIDENTIALITY NOTICE This e-mail message and any attachments are only for the use of the intended recipient and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient, any disclosure, distribution or other use of this e-mail message or attachments is prohibited. If you have received this e-mail message in error, please delete and notify the sender immediately. Thank you.


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: A particular database to move to other drive
  2017-11-25 19:38 A particular database to move to other drive nikhil raj <nikhilraj474@gmail.com>
@ 2017-11-27 09:35 ` Stéphane KANSCHINE <stephane@hexack.fr>
  2017-11-27 10:15   ` Re: A particular database to move to other drive Thomas Kellerer <spam_eater@gmx.net>
  3 siblings, 1 reply; 10+ messages in thread

From: Stéphane KANSCHINE @ 2017-11-27 09:35 UTC (permalink / raw)
  To: nikhil raj <nikhilraj474@gmail.com>; pgsql-admin

Le dim. 26 nov., vers 01:08, nikhil raj exprimait :

> Hi,

Hey !

> I want to move a database to 'Y drive' because the size of that database is
> large about so can I move only that database to because I got an alert of
> low space is there any way
> Currently it is on F drive I want to move to Y drive .

Just :
- shutdown your instance
- move data_directory to its new location
- upgrade data_directory to its new location in postgresql.conf
- restart your instance

Done.

Regards,
-- 
Stéphane KANSCHINE - http://www.hexack.fr./ - http://www.nuajik.com./
@ stephane@hexack.fr
  +33 6 64 31 72 52




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: A particular database to move to other drive
  2017-11-25 19:38 A particular database to move to other drive nikhil raj <nikhilraj474@gmail.com>
  2017-11-27 09:35 ` Re: A particular database to move to other drive Stéphane KANSCHINE <stephane@hexack.fr>
@ 2017-11-27 10:15   ` Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 0 replies; 10+ messages in thread

From: Thomas Kellerer @ 2017-11-27 10:15 UTC (permalink / raw)
  To: pgsql-admin

Stéphane KANSCHINE schrieb am 27.11.2017 um 10:35:
>> I want to move a database to 'Y drive' because the size of that database is
>> large about so can I move only that database to because I got an alert of
>> low space is there any way
>> Currently it is on F drive I want to move to Y drive .
> 
> Just :
> - shutdown your instance
> - move data_directory to its new location
> - upgrade data_directory to its new location in postgresql.conf
> - restart your instance
> 
> Done.

Note that this moves all databases to the new drive, not just one. 







^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: A particular database to move to other drive
  2017-11-25 19:38 A particular database to move to other drive nikhil raj <nikhilraj474@gmail.com>
@ 2017-11-27 10:18 ` Devrim Gündüz <devrim@gunduz.org>
  2017-11-27 10:53   ` Re: A particular database to move to other drive nikhil raj <nikhilraj474@gmail.com>
  3 siblings, 1 reply; 10+ messages in thread

From: Devrim Gündüz @ 2017-11-27 10:18 UTC (permalink / raw)
  To: nikhil raj <nikhilraj474@gmail.com>; pgsql-admin


Hi,

On Sun, 2017-11-26 at 01:08 +0530, nikhil raj wrote:
> I want to move a database to 'Y drive' because the size of that database is
> large about so can I move only that database to because I got an alert of
> low space is there any way
> Currently it is on F drive I want to move to Y drive .

First, create a new tablespace on Y drive:

https://www.postgresql.org/docs/current/static/sql-createtablespace.html

Then, move the database to that tablespace:

ALTER DATABASE dbname SET TABLESPACE to new_tablespace_name;

Regards,
-- 
Devrim Gündüz
EnterpriseDB: https://www.enterprisedb.com
PostgreSQL Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: A particular database to move to other drive
  2017-11-25 19:38 A particular database to move to other drive nikhil raj <nikhilraj474@gmail.com>
  2017-11-27 10:18 ` Re: A particular database to move to other drive Devrim Gündüz <devrim@gunduz.org>
@ 2017-11-27 10:53   ` nikhil raj <nikhilraj474@gmail.com>
  0 siblings, 0 replies; 10+ messages in thread

From: nikhil raj @ 2017-11-27 10:53 UTC (permalink / raw)
  To: Devrim Gündüz <devrim@gunduz.org>; +Cc: pgsql-admin

Thanks a lot.

On Nov 27, 2017 3:49 PM, "Devrim Gündüz" <devrim@gunduz.org> wrote:

>
> Hi,
>
> On Sun, 2017-11-26 at 01:08 +0530, nikhil raj wrote:
> > I want to move a database to 'Y drive' because the size of that database
> is
> > large about so can I move only that database to because I got an alert of
> > low space is there any way
> > Currently it is on F drive I want to move to Y drive .
>
> First, create a new tablespace on Y drive:
>
> https://www.postgresql.org/docs/current/static/sql-createtablespace.html
>
> Then, move the database to that tablespace:
>
> ALTER DATABASE dbname SET TABLESPACE to new_tablespace_name;
>
> Regards,
> --
> Devrim Gündüz
> EnterpriseDB: https://www.enterprisedb.com
> PostgreSQL Consultant, Red Hat Certified Engineer
> Twitter: @DevrimGunduz , @DevrimGunduzTR

^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2017-11-27 16:19 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-11-25 19:38 A particular database to move to other drive nikhil raj <nikhilraj474@gmail.com>
2017-11-25 23:56 ` Redmon, Bruce <bruce.redmon@team.neustar>
2017-11-27 09:05 ` Shreeyansh Dba <shreeyansh2014@gmail.com>
2017-11-27 09:53   ` Abhishek Gautam <abhishekgautam009@gmail.com>
2017-11-27 10:54     ` nikhil raj <nikhilraj474@gmail.com>
2017-11-27 16:19   ` Runge, Steven <Steven.Runge@mastercard.com>
2017-11-27 09:35 ` Stéphane KANSCHINE <stephane@hexack.fr>
2017-11-27 10:15   ` Thomas Kellerer <spam_eater@gmx.net>
2017-11-27 10:18 ` Devrim Gündüz <devrim@gunduz.org>
2017-11-27 10:53   ` nikhil raj <nikhilraj474@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox