Server Backup Script

When 5.2 was introduced using the Oracle Database, new management features where added. This included the ability to restore our own servers. The problem with this is there is no single file that can be copied directly off the server as a backup. Also due to the flashback technology of Oracle you may not be able to backup the Database by normal backup means because the files are in use.

What Pearson did give us is an easy to use export script that allows the automation of the exporting of data out of the Database. The included script allows you to maintain a week’s worth of backups to a location on your current server or a network share.

0
Your rating: None

Comments

Backup server

Hello Brian,

We installed the backup script on our servers last week. Thanks for posting this script!!

It has been working fine for us until it has to copy over the old file in the data_pump directory.

I think it is either the "erase" command or directory permissions perhaps???

IF EXIST PowerSchool-%DAY%.dmp erase PowerSchool-%DAY%.dmp /q

ANY THOUGHTS ON THIS???

We now get the following export log entry error:

;;;
Export: Release 10.2.0.3.0 - 64bit Production on Thursday, 20 May, 2010 3:00:05

Copyright (c) 2003, 2005, Oracle. All rights reserved.
;;;
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
ORA-39000: bad dump file specification
ORA-31641: unable to create dump file "C:\oradata\PSPRODDB\data_pump_dir\PowerSchool-Thu.dmp"
ORA-27038: created file already exists
OSD-04010: option specified, file already exists

Here is our script:

REM Start by setting the location to store the backup and the drive PowerSchool data resides on
SET POWERSCHOOL_SCRIPTS=C:
SET POWERSCHOOL_DRIVE=C:
SET POWERSCHOOL_BACKUP_FOLDER=\\ws050\C$\psbackup

IF NOT EXIST %POWERSCHOOL_BACKUP_FOLDER% MD %POWERSCHOOL_BACKUP_FOLDER%

REM Capture the 3-character name of today

SET DAY=Default
FOR /F "TOKENS=1" %%A IN ('DATE/T') DO SET DAY=%%A

REM Sets the drive letter

%POWERSCHOOL_DRIVE%
Cd oradata\psproddb\data_pump_dir\
IF EXIST PowerSchool-%DAY%.dmp erase PowerSchool-%DAY%.dmp /q
%POWERSCHOOL_SCRIPTS%
cd\
Cd oracle\scripts
call EXPORT PSProdDB PowerSchool-%DAY%
%POWERSCHOOL_DRIVE%
Cd\
Cd oradata\psproddb\data_pump_dir\
Copy PowerSchool-%DAY%.dmp %POWERSCHOOL_BACKUP_FOLDER% /Y

Re: Backup server

My guess is that you do not have delete permission to delete the old file.

Delete Permission

Hello Brain,

Finally found some time to look at this again. Thanks for your post. The server is logged in using the administrative login and password for the server. The administrator has full user permissions and can delete any file.

The administrator is part of the ora_dba group and thus has full permission to run Oracle scripts.

Who do you think does not have delete permission? The administrator? Or possibly the permissions in the ora_dba group? We are running win 2003. Are there any special folder permissions that need to be setup on the win server?

Any thoughts on this to help push us in the right direction to troubleshoot would be helpful.

It should be noted that the server was installed under a user name different than the administrator. I then had to add the administrator to the ora_dba group in order to run scripts. Could it be possible that the ora_dba delete permissions is not full activated when I added the administrator to the DBA? This really doesn't make sense to me because the file itself has nothing to do with the Oracle database. I would suspect it should have something to do with the win server 2003 folder setup.

Regards,

Peter

re: Delete Permission

Peter,

I was having the same problems as you when I recently set this script up as a scheduled task on several of my PowerSchool servers.  The script worked fine when running it from a command line, but the erase statement was not working in the batch file when running as a scheduled task.

The user set to run the scheduled task was a local administrator on the machine as well as an admin in the ora_dba group.

I was able to resolve the problem by setting the scheduled task's Start In property to C:\Windows\system32.  For some reason that was required so that the erase command in the batch file would work for the scheduled task.

Brent Johnson

PowerSchool Backup

Hello Brent,

The teachers are gone. Time for some catch up work.

Where do you have your script?

I have it C:\psbackup\psbackup.bat

I updated the Start In property as suggested to C:\Windows\system32 

Did you place the backup script in this folder??

Note: After updating the scheduled task, did you restart the Windows 2003 Server as well?

Peter

Web Server Properties

We are having issues with our test server not working each morning. There are a few settings we have to configure each morning to get it working. They are located under PowerSchool > Web Server Properties in the PowerSchool application. The IP address is always correct, but we have to put in 80 for the port and selected the desired check boxes. Is this issue caused by the backup script? Does anyone have any advice? Thanks!

Re: Web Server Properties

After you correct the setting on the test server, select "Export Web Settings" on your test server. This should fix your issue.

Brian Andle

scheduling the script

Brian,

First off... thank you for trolling the Powersource forums, finding my post and pointing me here.

Looking through this script I do not see that it will delete backups of any kind that were previously run. What could I add to this to keep say... 14 versions of the backup files and delete the oldest one?

I run nightly tapes that I will copy the .dmp to, but I do not want my server filling up with .dmp files and I do not want to have to manually delete files every few weeks.

Thanks-
Ryan

Re: scheduling the script

The script erases the oldest file for the current day of the week. So if it is Wednesday and there is a backup for last Wendesday it erases last Wednesday and creates a new file.

If i use this how do i

If i use this how do i restore the file?

I have been using backup exec but i can not for the life of me get the oracle agent on the powerschool server to access my oracle agent, even made a dedicated oracle user for it but it will not go through

Re: If i use this how do i

If you use this script, it's as simple as following the importing from another server on the Backup and Restore guide on PowerSource.

From Memory, stop Apache Tomcat, dropschema psproddb, import psproddb filecreatedbythisscript. You need to be in a specific location to run those command which is in the Oracle Backup and Restore Guide on PowerSource.

Brian Andle

Add timestamp to file name

I'm not a DOS expert and I was wondering if it would be possible to add a time stamp to the file name? That way, when I run multple times in a day, the file doesn't get over written.

backup script

Is it ok to test this script while Powerschool is running?

Re: backup script

Yes the backup script can be run at anytime.

Brian Andle

Mac OS Backup script?

Hi Jason. Has anyone provided a Mac OS server script for backups yet? If not, any chance you will have one?

Avron Stoloff
PowerSchool Admin
Mountain Lakes School District

I am going to try this script out.

Jacqueline J. M. Brzezinski

server backup script

Does anyone know of a server backup script for OS 10.4.11?

re: server backup script

I don't have one but if someone has one that works I'll upload it to the site.

Jason Treadwell
Custom Solutions Specialist
jason@powerdatasolutions.org
www.powerdatasolutions.org

I just posted the Mac OS X

I just posted the Mac OS X backup script to http://www.powerdatasolutions.org/content/mac-os-x-backup-script

Tim Scoff, tim@scoff.net

Syndicate content Syndicate content