Hi Guys,
Below steps will be followed for taking back up of a database from command line for postgresql database.
1) Go to installation folder of postgres (postgres installed with jasper server).
2) Go up to the bin folder & and open the location with terminal with su(superuser) credentials.
(You can find file names like pg_dump, pg_dumpall and etc)
3)Execute below command for taking backup of particular database.
Let us assume student is the database we would want to take back up.
& the output .sql script file name is : student.sql( can give anyname).
[root@localhost bin]# ./pg_dump -U postgres -W -F p student > /home/sadha/student.sql
In the above command:
U = UserName
W=Prompt for password once you press enter
F=File Format
p=plain .sql file
t=tar file
Reference :
Backup:
http://www.postgresqltutorial.com/postgresql-backup-database/
Restore:
http://www.postgresqltutorial.com/postgresql-restore-database/
Thank you.
Sadakar
BI developer
Below steps will be followed for taking back up of a database from command line for postgresql database.
1) Go to installation folder of postgres (postgres installed with jasper server).
2) Go up to the bin folder & and open the location with terminal with su(superuser) credentials.
(You can find file names like pg_dump, pg_dumpall and etc)
3)Execute below command for taking backup of particular database.
Let us assume student is the database we would want to take back up.
& the output .sql script file name is : student.sql( can give anyname).
[root@localhost bin]# ./pg_dump -U postgres -W -F p student > /home/sadha/student.sql
In the above command:
U = UserName
W=Prompt for password once you press enter
F=File Format
p=plain .sql file
t=tar file
Reference :
Backup:
http://www.postgresqltutorial.com/postgresql-backup-database/
Restore:
http://www.postgresqltutorial.com/postgresql-restore-database/
Thank you.
Sadakar
BI developer
No comments:
Post a Comment