Hello all, Now my Schedule is Running.....
The Steps i have taken are given below:- PgAgent for windows 1) Run PgAgent.sql script in maintenance database (Postgres database by default). 2) Install PgAgent service using the following command on command prompt - • "C:\Program Files\PostgreSQL\8.2\bin\pgAgent" INSTALL pgAgent -u postgres -p XXXX hostaddr= 127.0.0.1 dbname=postgres user=Postgres if the above command didnot work suceefully then u can use the following Command:---- go to the Diectory path("C:\Program Files\PostgreSQL\8.2\bin") and run the Command pgAgent INSTALL pgAgent -l 2 -u postgres -p XXXX hostaddr=127.0.0.1dbname=postgres user=postgres password=XXXX • Replace the path of pgAgent if you are not using default installation path of Postgres • Replace XXXX with the password of OS User Postgres (One given while installing Postgres on windows) • dbname=postgres (change if your maintenance database is different.) 3) Login using Postgres user account in windows. 4) Try to access pgAdmin III tool in that login. (These two steps are required to create pgpass.conf file under Postgres login account.) 5) Login back to your normal account. Edit the pgpass.conf File with the Following Line :---- localhost:PortNumber:myDBname:myUserName:myPassword *:*:*:*:Password in both the Account Postgres and your Local Login Account. The Pgpass.Conf File is located in %ApplicationData%/postgres/ 6) Start pgAgent service using the following command on command prompt • Net start pgAgent 7) Create a new job using PgAdmin III 8) Under step tab click Add to add new step. • Specify some name • Kind – SQL / Batch depending upon the kind of job to be performed. • Database on which the job is to be performed. • Definition tab would contain a SQL command if kind selected is SQL • Definition tab would contain path of Batch file if kind selected is Batch 9) Under Schedule tab in Job window click Add to add new schedule for the job • Specify some name • Specify the start date & time • Specify the end date and time • Specify days or weekdays, months when the task needs to be performed in days tab • Specify time hours & Minutes when you want the task to be performed. (Atleast One hour & minute to be selected.) • Specify exception if any when you do not want the task to be performed. 10) All set to work. Thanks for your support. On 9/24/07, Yogesh Arora <[EMAIL PROTECTED]> wrote: > > Thanks to all in the Group, > > Now my Schedule is Running..... > > The Steps i have taken are given below:- > > > PgAgent for windows > 1) Run PgAgent.sql script in maintenance database (Postgres database > by > default). > 2) Install PgAgent service using the following command on command > prompt - > • "C:\Program Files\PostgreSQL\8.2\bin\pgAgent" INSTALL pgAgent -u > postgres > -p XXXX hostaddr= 127.0.0.1 dbname=postgres user=Postgres > > if the above command didnot work suceefully then u can use the following > Command:---- > > go to the Diectory path("C:\Program Files\PostgreSQL\8.2\bin") and run > the Command > > pgAgent INSTALL pgAgent -l 2 -u postgres -p XXXX > hostaddr=127.0.0.1dbname=postgres > user=postgres password=XXXX > > • Replace the path of pgAgent if you are not using default > installation path > of Postgres > • Replace XXXX with the password of OS User Postgres (One given while > installing Postgres on windows) > • dbname=postgres (change if your maintenance database is different.) > 3) Login using Postgres user account in windows. > > 4) Try to access pgAdmin III tool in that login. (These two steps are > required to create pgpass.conf file under Postgres login account.) > > 5) Login back to your normal account. > > Edit the pgpass.conf File with the Following Line :---- > > localhost:PortNumber:myDBname:myUserName:myPassword > > *:*:*:*:Password > in both the Account Postgres and your Local Login Account. The > Pgpass.Conf File is located in > %ApplicationData%/postgres/ > > 6) Start pgAgent service using the following command on command > prompt > • Net start pgAgent > > 7) Create a new job using PgAdmin III > > 8) Under step tab click Add to add new step. > • Specify some name > • Kind – SQL / Batch depending upon the kind of job to be performed. > • Database on which the job is to be performed. > • Definition tab would contain a SQL command if kind selected is SQL > • Definition tab would contain path of Batch file if kind selected is > Batch > 9) Under Schedule tab in Job window click Add to add new schedule for > the > job > • Specify some name > • Specify the start date & time > • Specify the end date and time > • Specify days or weekdays, months when the task needs to be performed > in > days tab > • Specify time hours & Minutes when you want the task to be performed. > (Atleast One hour & minute to be selected.) > • Specify exception if any when you do not want the task to be > performed. > 10) All set to work. > > > > > > On 9/24/07, Yogesh Arora < [EMAIL PROTECTED]> wrote: > > > > Hello Kevin, > > >>>>Exactly what are you doing to try to schedule it? > > I am trying to schedule a database back up...using > > batch File....but it is not happening then i tried to schedule a SQL Script > > for creating a table on the Database. this is also not functioning.... > > > > >>>>How do you determine that it hasn't been scheduled? > > When i tried to back up the back up file is not created and > > in the case of Create table there is not any table in the database. > > > > > > On 9/21/07, Kevin Grittner < [EMAIL PROTECTED] > wrote: > > > > > > Please respond to the list as well as any individuals. This helps > > > make > > > the archive message thread useful for others who may have a similar > > > problem, and it may draw advice from others who can help. > > > > > > >>> On Thu, Sep 20, 2007 at 11:01 PM, in message > > > < [EMAIL PROTECTED]>, > > > "Yogesh Arora" > > > < [EMAIL PROTECTED]> wrote: > > > > Hello Kevin, > > > > First of all, Thanks for your response. > > > > The answer to your Questions > > > > > > > >>>>>What operating system? > > > > I am using the Windows 2003 operating System. > > > >>>>>What did you do to try to schedule these things? > > > > I have created a Batch File of a Command to take the Back of the > > > Database > > > > specified. When i run this file through command Prompt, its run > > > > successfully. But when i try to schedule it., It's not get scheduled > > > and > > > > does not show any errors. > > > > > > Exactly what are you doing to try to schedule it? > > > How do you determine that it hasn't been scheduled? > > > > > > > Then i tried to schedule the direct SQL command , but the same > > > result, not > > > > being scheduled. > > > >>>>What were you expecting to see as a result? > > > > Expecting the results of the above. > > > >>>>>>>What did you see, including exact error text, if any? > > > > There are not any Error to > > > show...................................... > > > > > > > > The Query in Batch File is :- > > > > > > > > @echo off > > > > "C:\Program FIles\PostgreSQL\8.2\bin\pg_dump" -U username -f > > > > D:\test\test.sql -F p -C -d -D postgres > > > > > > > > The Password related info is being stored in the PgPass.conffile....... > > > > > > > > > > > > > > > > > > -- > > Best Regards, > > Yogesh Arora > > Mobile: 09255123173 > > > > > > > -- > Best Regards, > Yogesh Arora > Asst. Software Engg. > Daffodil Software Pvt. Ltd., > Mobile: 09255123173 > Web : www.daffodildb.com -- Best Regards, Yogesh Arora Asst. Software Engg. Daffodil Software Pvt. Ltd., Mobile: 09255123173 Web : www.daffodildb.com