Released April 22, 2009 Document Owner: Documentation Services This edition applies to Release 5.2 of the PowerSchool Premier software and to all subsequent releases and modifications until otherwise indicated in new editions or updates. The data and names used to illustrate the reports and screen images may include names of individuals, companies, brands, and products. All of the data and names are fictitious; any similarities to actual names are entirely coincidental. PowerSchool is a trademark, in the U.S. and/or other countries, of Pearson Education, Inc. or its affiliate(s). Copyright 2008 Pearson Education, Inc. or its affiliates. All rights reserved. All trademarks are either owned or licensed by Pearson Education, Inc. or its affiliates. Other brands and names are the property of their respective owners.
Contents
Introduction ........................................................................................................... 1 Terminology ....................................................................................................... 1 Backup and Restore Setup ..................................................................................... 2 Flash Recovery Area ............................................................................................ 2 How to Change the Flash Recovery Area Size ................................................ 2 Backup Retention Policies ..................................................................................... 3 How to Alter Retention for Full and Incremental Backups ................................ 3 How to Alter Retention for Flashback Recovery .............................................. 4 Backup Process ...................................................................................................... 6 How To Manually Perform a Full Backup........................................................ 7 Restore and Recovery ............................................................................................ 9 Restore and Recovery Scenarios....................................................................... 9 How to Restore and Recover from a Specific Backup Date and Time ................. 9 Restore and Recovery to a Test Server................................................................. 10 Preventing Database Lockout ......................................................................... 10 How to Unlock the Database ..................................................................... 11 Data Pump Directory .................................................................................... 11 How to Restore and Recover to a Different Server........................................ 12 Removing Previous Server Information............................................................ 13 How to Remove Previous Server Information on a Test Server ....................... 14 Modifying Oracle User Permissions....................................................................... 14
Contents
iii
Introduction
This guide describes the backup and recovery process and the steps necessary to restore the PowerSchool 5.2 database server from a database backup created within the previous seven days. For recoveries that require data older than seven days, or to restore data to a different server, contact PowerSchool Technical Support. This guide is intended for PowerSchool system administrators. To use this guide, you must be familiar with Mac OS X and/or Windows 2003 and the Oracle database. You must also have PowerSchool 5.2 installed and operating correctly. Please refer to the appropriate section for step-by-step instructions: Database Restore for Mac OS X Database Restore for Windows 2003
Terminology
The following table describes terminology used in this document. Term Flashback Full Backup Definition A technology supplied with Oracle used to back up, restore, and recover the database. An operation that backs up all database files. Files are backed up whether or not they have changed since the last backup. Note: Archive logs are included in the backup and are deleted each time a backup is created. Incremental Backup An operation that backs up only the database files that have changed since a previous backup. Oracle supports nine different incremental backup levels for file system backups. A differential incremental backup copies data that changed since an incremental backup at the same or lower level. The length of time that data in a backup set (a set being a full backup and all of its subsequent incremental backups) is not eligible to be overwritten.
Retention Policy
Introduction
Mac /u03/oradata/flash_recovery_area/
3. Press Enter/Return. 4. Enter ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=[new_size]; (where [new_size] is the size decided on using the formula above). For example: ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=580G; 5. Press Enter/Return. 6. Enter Exit. 7. Press Enter/Return. Mac 1. Open Terminal. 2. Enter sudo su oracle 3. Press Enter/Return. 4. Enter sqlplus / as sysdba 5. Press Enter/Return. 6. Enter ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=[new_size]; (where [new_size] is the size decided on using the formula above). For example: ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=580G; 7. Press Enter/Return. 8. Enter Exit.
5. Press Enter/Return. 6. Enter Exit. 7. Press Enter/Return. Mac 1. Open Terminal. 2. Enter sudo su oracle. 3. Press Enter/Return. 4. To log into SQLPLUS, enter sqlplus / as sysdba 5. Press Enter/Return. 6. Enter UPDATE PS_MGMT.RMAN_PROPERTIES SET PROPERTY_VALUE = [X] WHERE PROPERTY_NAME = 'rman_retention_window'; where [X] is the number of days you would like to retain your daily backups. For example, Update ps_mgmt.rman_properties set property_value = 7 where property_name = 'rman_retention_window'; 7. Press Enter/Return. 8. Enter Exit.
recovery area. The default is 10080 minutes, or 7 days. For example, ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320; 7. Press Enter/Return. 8. Enter Exit.
Backup Process
A full backup is performed automatically every Saturday at 1:15 a.m. An incremental backup runs nightly at 1:15 a.m. and will backup all data changed since the most recent full backup. Oracle keeps a running log, which allows the database to be fully restored to any point in time. The Oracle scheduler executes the backup scripts. An email notifies the designated administrator that a backup is completed and directs the administrator to check the log output. Log files are available in the Flash recovery area. The Flash recovery area location is based on the database layout configured during installation. For more information, see the Database Layout section of the PowerSchool Installation Guide or the Sybase to Oracle Migration Guide on the PowerSchool Customer Support Web site. The default recovery span is 31 days, which means that backups can be recovered up to 31 days in the past. Note: The steps outlined in this document address recoveries that require data from the past seven days. Any recoveries older than seven days may require PowerSchool Technical Supports intervention. There are several ways to back up PowerSchools associated database files. Online backups are created while PowerSchool is running and accessible. With PowerSchool and Oracle running there are several directories to backup to assure recovery in the event of disaster. Important: If other Oracle related files are backed up while PowerSchool and Oracle are online, possible data corruption can occur within Oracle tablespaces (datafiles) resulting in the need for server downtime while PowerSchool Technical Support repairs the database or recovers a backup from before the incident occurred. Offline backups, or cold backups, are created while PowerSchool is not running and not accessible. All files can be backed up in offline status. With both PowerSchool and Oracle not running, there are several directories to backup. By backing up these directories, a snapshot is taken of archive (redo) logs, flash recovery logs and the weekly and nightly backups that occur at 1 a.m. every morning. These directories are locked while Oracle is running and the operating system does not allow them to be backed up. When generating offline or online backups, it is recommended that you move the backups from the nightly volume to a separate storage area in case of a disaster. Pearson recommends moving a copy of the backup to a separate physical location such as an establishment that specializes in media storage. The following tables list the directory locations for backing up Oracle data:
Backup Process
Windows Directory Location oracle\product\10.2.0\db_1\network\admin oracle\product\10.2.0\db_1\database oradata\flash_recovery_area\[SID]\backupset oradata\flash_recovery_area\[SID] Note: [SID] is the SID entered during the Oracle installation (commonly and by default PSPRODDB). Mac Directory Location /u01/app/oracle/product/10.1.0/db_1/network/admin /u01/app/oracle/product/10.1.0/db_1/dbs /u03/oradata/flash_recovery_area/[SID]/backupset /u03/oradata/flash_recovery_area/[SID] Note: [SID] is the SID entered during the Oracle installation (commonly and by default PSPRODDB). Use the following procedure to manually perform a backup of the database. Online Backup Online Backup
Backup Process
Backup Process
How to Restore and Recover from a Specific Backup Date and Time
Windows 1. Open the Command Prompt. 2. Enter [drive]:, where [drive] is the drive on which the Oracle binaries are installed. 3. Press Enter/Return. 4. Enter cd \oracle\scripts. 5. Press Enter/Return. 6. Enter FlashbackToTime.bat [SID] yyyy-mm-dd hh:mm:ss where [SID] is the SID entered during the Oracle installation (commonly and by default PSPRODDB) and yyyy-mm-dd hh:mm:ss is the exact date and time you want to restore to. 7. Press Enter/Return. Mac 1. Open Terminal. 2. Enter sudo su oracle. 3. Press Enter/Return. 4. Enter cd scripts. 5. Press Enter/Return.
6. Enter ./FlashbackToTime.sh [SID] yyyy-mm-dd hh:mm:ss where [SID] is the SID entered during the Oracle installation (commonly and by default PSPRODDB) and yyyy-mm-dd hh:mm:ss is the exact date and time you want to restore to. 7. Press Enter/Return.
The three scripts listed below are included in the Oracle installer to simplify the import and export process. These scripts are located on the same drive on which the Oracle binaries are installed (Drive 1 or Volume 1). On a Mac, the scripts are located in the Oracle users home directory. Windows Mac /Users/oracle/scripts/Export.sh /Users/oracle/scripts/DropSchema.sh /Users/oracle/scripts/Import.sh [drive]:\oracle\scripts\Export.bat [drive]:\oracle\scripts\DropSchema.bat [drive]:\oracle\scripts\Import.bat
Two of the scripts execute the export or import of data. The DropSchema script deletes existing schema, which is necessary when importing into an Oracle database with an existing dataset.
o o
Enter the current PowerSchool database user password when prompted. Enter a new password when prompted, type gen to generate a random password, or enter the same password again.
Mac The volume location is dependent on the database layout selected during installation. If one volume was selected for the database installation, the directory is located on that volume in the following directory: [volume]:/u02/oradata/PSPRODDB/data_pump_dir If two or more volumes were selected for the database installation, the data pump directory is located on the second volume in the same path listed above.
19. Reinstall Oracle Jobs. Mac 1. On the server that contains the latest backup, open Terminal. 2. Enter sudo su oracle. 3. Press Enter/Return. 4. Enter cd scripts. 5. Press Enter/Return. 6. Enter ./Export.sh [SID] [Filename]. 7. Press Enter/Return. Note: SID is the name of the Oracle instance on the server; in most cases it is PSDRODDB. The filename is the name you provide for the file that includes the export dataset. 8. Navigate to /u02/oradata/[SID]/data_pump_dir. 9. Copy the export file and paste it to /u02/oradata/[SID]/data_pump_dir on the other server. Note: For more information, see Data Pump Directory. 10. On the test server, stop Tomcat and the PowerSchool application. For more information, see Knowledgebase Article 5919: Stop and Start Tomcat on the PowerSchool Customer Support Web site. 11. On the test server, open Terminal and enter sudo su oracle. 12. Press Enter/Return. 13. Enter cd scripts. 14. Press Enter/Return. 15. If this server currently has a PowerSchool database installed, enter ./DropSchema.sh [SID] and press Enter/Return. If this is the first time a PowerSchool database is installed, continue to the next step. 16. Enter ./Import.sh [SID] [Filename]. 17. Press Enter/Return. 18. On the test server, start Tomcat and the PowerSchool application. For more information, see Knowledgebase Article 5919: Stop and Start Tomcat on the PowerSchool Customer Support Web site. 19. Reinstall Oracle Jobs.
Windows 1. Open the Command Prompt. 2. Enter sqlplus / as sysdba 3. Press Enter/Return. 4. Enter ALTER USER [username] identified by [password]; where [username] is the name of the user you are changing and [password] is the password you are changing it to. For example, ALTER USER PS identified by PS_SUPPORT; 5. Press Enter/Return. 6. Enter Exit 7. Press Enter/Return. Mac 1. Open Terminal. 2. Enter sudo su oracle. 3. Press Enter/Return. 4. Enter sqlplus / as sysdba 5. Press Enter/Return. 6. Enter ALTER USER [username] identified by [password]; where [username] is the name of the user you are changing and [password] is the password you are changing it to. For example, ALTER USER PS identified by PS_SUPPORT; 7. Press Enter/Return. 8. Enter Exit.
15
www.PearsonSchoolSystems.com