business flex oracle database administrators guide · 2016-11-24 · procedures, triggers, and so...

23
Business FLEX 250.1 Oracle Database Administrators Guide Document ID: BFO-REF-250 Revision Date: September 2016

Upload: others

Post on 05-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Business FLEX 250.1

Oracle Database Administrators Guide

Document ID: BFO-REF-250

Revision Date: September 2016

Page 2: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Copyright, Notices, and Trademarks

Copyright, Notices, and Trademarks © Honeywell International Inc. 1998 – 2016. All Rights Reserved.

While this information is presented in good faith and believed to be accurate, Honeywell disclaims the implied warranties of merchantability and fitness for a particular purpose and makes no express warranties except as may be stated in its written agreement with and for its customer.

In no event is Honeywell liable to anyone for any indirect, special or consequential damages. The information and specifications in this document are subject to change without notice.

Honeywell, Experion, Uniformance and Business FLEX are registered trademarks of Honeywell International Inc.

Microsoft, Microsoft Access and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

Oracle is a registered trademark of Oracle Corporation.

Crystal Reports and Business Objects are trademarks or registered trademarks of Business Objects SA in the United States and/or other countries.

Adobe and Acrobat Reader are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.

OSIsoft and The PI System are either registered trademarks or trademarks of OSIsoft, Inc.

Adobe and Acrobat Reader are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.

All other brand and product names shown are trademarks of their respective owners.

About Business FLEX® Business FLEX® is a family of advanced applications that improve plant profitability by enabling plant staff to work more effectively and make better decisions. To learn more about Business FLEX and other Honeywell software solutions, contact your Honeywell account manager.

Visit us online at www.honeywell.com/ps, or contact us at 800-822-7673.

Honeywell, 1860 West Rose Garden Lane, Phoenix, Arizona, 85027, USA

Release Information Business FLEX 250: Release 250.1 Revision Date: September 2016 Business FLEX Database Version: BF250.0.00 Document ID: BFO-REF-250

ii • Business FLEX Oracle Database Administrators Guide

Page 3: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Contents

Contents About This Document 1

Overview 1 About this guide 1 Related documents 2 Contact us 2

Database Backup 3 Overview 3 Logical backups 4 Physical backups 6

Business FLEX Database and Backup Methods 11

Database Recovery 13 Overview 13 Recovery from exports 13 Recovery from offline backups 15 Recovery from online backups 16

Database Maintenance 17 Shrinking temporary tablespace 17

Business FLEX Oracle Database Administrators Guide • iii

Page 4: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Contents

This page is intentionally left blank

iv • Business FLEX Oracle Database Administrators Guide

Page 5: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

About This Document

About This Document

Overview Business FLEX TPI, or TotalPlant Information, is the home for many Business FLEX® applications and functions. It includes forms which support Plant Reference Model configuration, security configuration and common administration tasks. It also includes the forms required to support the individual Business FLEX applications.

The Business FLEX TPI Database Administration forms are the primary access point for all Business FLEX TPI administration and security functions.

About this guide This manual describes how to use the Business FLEX TPI Database Administration forms. It does not however provide details on how to install or configure the Business FLEX TPI on a target computer system. Please refer to the Business FLEX Installation Guide for details on installing the necessary desktop and background process components for TPI.

Conventions used in this guide The following typographic and stylistic conventions are used throughout this guide:

This… Indicates this…

Click To position the mouse over a topic, button, box, or window area and then click the left mouse button.

Double-click To position the mouse over a topic, button, box, or window area and then click the left mouse button twice in succession.

Right-click To position the mouse over a topic, button, box, or window area and then click the right mouse button.

Courier A command you type or a file or directory location.

Italics Another Business FLEX document.

Bold A button or menu command you click in a window.

Business FLEX Oracle Database Administrators Guide • 1

Page 6: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

About This Document

In addition, these symbols are used:

Symbol Definition

ATTENTION: Identifies information that requires special consideration.

TIP: Identifies advice or hints for the user, often in terms of performing a task.

CAUTION Indicates a situation which, if not avoided, may result in equipment or work (data) on the system being damaged or lost, or may result in the inability to properly operate the process.

Related documents Further information about Business FLEX TPI and related applications can be found in the following documents.

Document Title

AP-USR-250 Business FLEX Application Server User Guide

BF-INS-250 Overall System Installation Guide for Business FLEX

BFO-INS-250 Business FLEX Oracle Database Installation Guide

BFO-UPG-250 Business FLEX Oracle Database Upgrade Guide

BF-REF-250 Business FLEX Security Reference Guide

PRM-USR-250 Business FLEX Plant Reference Model User Guide

TPI-ADM-USR-250 Business FLEX TPI Administration User Guide

TPI-AEU-SYS-250 Business FLEX TPI Application Extensibility Utility System Guide

TPI-APM-USR-250 Business FLEX TPI Application Management User Guide

TPI-FRM-REF-250 Business FLEX TPI Form Personalization Reference Guide

TPI-HIS-REF-250 Business FLEX TPI Process History User Guide

TPI-MLC-USR-250 Business FLEX TPI Multi-Language Configuration User Guide

TPI-USR-250 Business FLEX TPI User Guide

For more information on the other Business FLEX applications see the documents included on the Business FLEX Software DVD. Refer to the Business FLEX Software Change Notice for a list of the documents that are supplied.

Contact us Please send any comments or questions to the Help Desk at [email protected]. Ensure that you type Business FLEX in the subject line of your e-mail.

2 • Business FLEX Oracle Database Administrators Guide

Page 7: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Database Backup

Database Backup

Overview Oracle database backups can be classified into two main categories – logical backups and physical backups. An export is a logical backup of the database. Offline (cold) backups and online (hot) backups are physical file backups.

The behavior of logical and physical backups can be defined in various ways. The backup methods described in the following sections must only be used as a basic guideline. Each Business FLEX Oracle database customer site should develop their own backup plan based on their specific requirements.

The examples provided in this document only demonstrate backup and recovery operations among local disks. Backup files must be copied to other external storage devices, such as tapes, for safekeeping.

The scripts described in this document are intended for use with Oracle 11g and Oracle 12c databases.

Honeywell recommends that backups be tested on a regular basis, by restoring the backup onto an offline system to test the validity of the backup.

ATTENTION:

THE FOLLOWING BACKUP METHODS ARE GIVEN AS AN EXAMPLE. Please consult your local Oracle Administrator on the items prior to implementing these procedures. It is the responsibility of your local Administrator to maintain good backups of the Oracle Database.

CUSTOMER HEREBY RELEASES AND AGREES TO INDEMNIFY AND HOLD HONEYWELL HARMLESS FOR ANY AND ALL LIABILITY AND DAMAGE RELATING DIRECTLY OR INDIRECTLY FROM THE USE AND/OR IMPLEMENTATION OF THE BACKUP/RESTORE METHODS CONTAINED HEREIN.

Administrators at each site are responsible for adjusting the backup frequency and general procedures to suit the site requirements.

Business FLEX Oracle Database Administrators Guide • 3

Page 8: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Database Backup

Logical backups

Export A logical backup of the database involves saving a set of database objects (tables, procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database backup. The Oracle Import utility, however, is used for recovering the database using the file generated from an export. In a recovery, you can selectively restore any database object or restore the entire database from the export file.

Maintaining data consistency is very important during a logical backup. To ensure consistency in your exports, the database needs to be restarted in restrict mode and perform a full export. This implies all background jobs must be terminated before shutting down the database and only DBAs can be logged on while the export is running.

Since the file created by a full export does not include grants on SYS’s objects, a separate back up must be taken of all the privileges that were granted by SYS in the database.

A command file, exp_backup.cmd, is provided on the Business FLEX Software DVD to perform this kind of backup. Executing this command file generates a full export dump file, an export log file and sys_grants.sql that contains the SQL statements for recreating all privileges granted by SYS.

The exp_backup.cmd requires several input parameters.

ATTENTION:

All Business FLEX applications that use Oracle require the 32-bit Oracle client, even on 64-bit operating systems.

If the Database server machine is of 64-bit, and if Oracle Server Software installed is 64-bit and Oracle Client installed is of 32-bit, then there could be some issues while creating Business FLEX database in the same server. Please follow the below steps in this scenario.

1. In the Server machine, remove the Oracle client path from ENVIRONMENT VARIABLE “PATH”.

2. Export the database dump using call_exp_backup.cmd.

3. Include the Oracle client path to the ENVIRONMENT VARIABLE “PATH” removed in step 1 above.

Step 1: Modify the variable definitions in call_exp_backup.cmd and settings.cmd

In settings.cmd

1. BfxDir Path of the Business FLEX backup scripts, for example,

BfxDir=d:\BFX_DB

4 • Business FLEX Oracle Database Administrators Guide

Page 9: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Database Backup

2. Verify the Instance Identifier (SID) of the database

set ORACLE_SID=PRD

In call_exp_backup.cmd

3. BAKDIR Parent directory where subdirectories are created using the current backup date, in the format of ‘yyyymmdd’. All the generated backup files are kept in the subdirectory. The parent directory must exist prior to running the backup scripts. This backup directory must be located on a disk separate from the production disk. Otherwise, a failure of the production disk may also affect your backups. For example,

c:\backup\prd

4. BAKFILE Export file name, for example,

backup.dmp

5. BAKLOG Export log file name, for example,

backup.log

6. OUTFILE Name of the output file where messages generated by the command file are captured. It is temporarily placed in the BAKDIR directory. When the backup is complete, it is moved to the subdirectory in BAKDIR. Always check this file for error messages after each backup. For example,

backup.out

7. BAKMODE Backup mode RESTRICT - shutdown and startup database in restrict mode and run full export. UNRESTRICT - run export using the consistent=y parameter when the database is open

Step 2: Run call_exp_backup Open a command prompt window, change to the directory where the backup scripts are stored. By default, this is d:\BFX_db, and type -

call_exp_backup

In addition, you can schedule the execution of this command file. For example, to schedule a run at midnight every Sunday, from the command prompt, type –

at 00:00 /every:su d:\BFX_db\call_exp_backup.cmd

A full file path must be specified when using the ‘at’ command.

Business FLEX Oracle Database Administrators Guide • 5

Page 10: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Database Backup

For more details of the ‘at’ command, refer to your Microsoft Windows operating system manual.

Physical backups

Offline backups Offline backups, also known as cold backups, are physical backups of the database files. It must be done whenever there is a major database change. This type of backup must be made after the database has been shut down normally. Never perform an offline backup after a shutdown abort. While the database is offline, backup the following files –

• All datafiles

• All control files (also backed up as ASCII trace file in USER_DUMP_DEST)

• The init.ora file and/or spfile.ora (optional but recommended)

• The password file (optional but recommended)

It is not necessary to backup the redo logs and temporary files. However, taking a copy of them simplifies the recovery procedure incase the entire database needs to be restored. Thus, these files are included in the backup procedure described in the following section.

A command file, offline_backup.cmd is provided on the Business FLEX Software DVD to automate this process. It first shuts down the database, copies the database files to the backup directory, creates a file_restore.cmd for the recovery process and then starts up the database. It assumes the database is running in NOARCHIVELOG mode.

The offline_backup.cmd requires several input parameters.

Step 1: Modify the variable definitions in call_offline_backup.cmd and settings.cmd

In settings.cmd

1. BfxDir Path of the Business FLEX backup scripts, for example,

BfxDir=d:\BFX_db

2. ORACLE_SID

To connect without the using the ‘database alias’, you first have to set the ORACLE_SID environment variable to the value used by the Business FLEX database in the settings.cmd. By default this value is PRD.

3. Set OraSysPwd and OraDbAlias for Business FLEX database

set OraSysPwd=CHANGE_ON_INSTALL

set OraDbAlias=TOTALPLANT

6 • Business FLEX Oracle Database Administrators Guide

Page 11: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Database Backup

In call_offline_backup.cmd

4. BAKDIR Parent directory where subdirectories are created using the current backup date, in the format of ‘yyyymmdd’. All backup database files and file_restore.cmd are kept in the subdirectory. The parent directory must exist prior to running the backup scripts. This backup directory must be located on a disk separate from the production disk. Otherwise, a failure of the production disk may also affect your backups. For example,

c:\backup\prd

5. FILE_LIST This script automatically detects a list of data files, control files and temporary files for backup. If there are additional files, for example, init.ora, init<SID>.ora, pwd<SID>.ora, and so on. that require backup, specify the file paths here. File paths must be enclosed in double quotes and separated by spaces, for example,

“%ORA_BASE%\admin\%ORACLE_SID%\pfile\*.* %ORA_HOME%\database\*prd.ora”

6. OUTFILE Name of the output file where messages generated by the command file are captured. It is temporarily placed in the BAKDIR directory. When the backup is complete, it is moved to the subdirectory in BAKDIR. Always check this file for error messages after each backup. For example,

backup.out

Step 2: Run call_offline_backup

Open a command prompt window. Change to the directory where the backup scripts are stored. By default, this is d:\BFX_db, and type -

call_offline_backup

You can also schedule the execution of this command file. For example, to schedule a run at midnight every Sunday, from the command prompt, type –

at 00:00 /every:su d:\BFX_db\call_offline_backup.cmd

A full file path must be specified when using the ‘at’ command.

For more details of the ‘at’ command, refer to your Microsoft Windows operating system manual.

Business FLEX Oracle Database Administrators Guide • 7

Page 12: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Database Backup

Online backups Online backups, also known as hot backups, are physical backups of the database files while the database is open and running in ARCHIVELOG mode. This enables you to restore the database to its status at any point in time.

When a database is in ARCHIVELOG mode, each filled online redo log is archived to the archive log destination directory. If the destination directory runs out of disk space, the archiving process stops and the database stops automatically. To resolve this, reclaim the disk space by backing up the existing archive log files and removing them.

ATTENTION:

Never delete archive log files until you have backed them up.

Perform the following steps to place the database in ARCHIVELOG mode:

Step 1: Edit init.ora.

The location of the archived redo log files is determined by the following parameters (with sample values) in init.ora –

log_archive_dest = d:\oracle\oradata\prd\archive log_archive_format = "LOG%t_%s_%r.arc"

Uncomment these lines in init.ora and modify them accordingly. The archive log destination directory must exist before performing the next step.

Step:2: Place database in ARCHIVELOG mode.

From the command prompt, start sqlplus and connect to the database as sysdba.

Set Oracle_sid=prd

sqlplus “sys/<password> as sysdba” shutdown immediate startup mount alter database archivelog; alter database open;

To display the current ARCHIVELOG status of the database, connect to the database as sysdba and type –

archive log list;

8 • Business FLEX Oracle Database Administrators Guide

Page 13: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Database Backup

After the database is in ARCHIVELOG mode, you can backup the database when it is open and available to users. The process is as follows –

1. Place a tablespace in backup mode.

2. The data files that make up the tablespace are copied to the backup directory.

3. Restore the tablespace to its normal mode.

4. Repeat 1 to 3 for all other tablespaces.

5. Copy the archive redo log files to the archive log backup directory.

6. Backup the control file to a trace file that is stored in the USER_DUMP_DEST directory. This trace file contains the ‘create controlfile’ command for the database, which can be used in a recovery that requires recreating the control file.

7. Backup the control file to a binary file in the backup directory.

A command file, online_backup.cmd is provided on the Business FLEX Software DVD to automate this process. It requires several input parameters.

Step 1: Modify the variable definitions in call_online_backup.cmd and settings.cmd

In settings.cmd

1. BfxDir Path of the Business FLEX backup scripts, for example,

BfxDir = d:\BFX_db

2. ORACLE_SID

To connect without the using the ‘database alias’, you first have to set the ORACLE_SID environment variable to the value used by the Business FLEX database in the settings.cmd. By default this value is PRD.

Set OraSysPwd and OraDbAlias for Business FLEX database

set OraSysPwd=CHANGE_ON_INSTALL

set OraDbAlias=TOTALPLANT

In call_online_backup.cmd

3. BAKDIR Parent directory where subdirectories are created, using the current backup date, in the format of ‘yyyymmdd’. All backup database files and control files are kept in the subdirectory. The parent directory must exist prior to running the backup scripts. This backup directory must be located on a disk separate from the production disk. Otherwise, a failure of the production disk may affect the backups. For example,

c:\backup\prd

Business FLEX Oracle Database Administrators Guide • 9

Page 14: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Database Backup

4. LOGDIR Directory where the backup archive log files are kept. This directory must exist prior to running the backup scripts. This backup directory must be located on a disk separate from the production disk. Otherwise, a failure of the production disk may also affect your backups. For example,

c:\backup\prd\archivelog

5. OUTFILE Name of the output file where messages generated by the command file are captured. It is temporarily placed in the BAKDIR directory. When the backup is performed, it is moved to the subdirectory in BAKDIR. Always check this file for error messages after each backup. For example,

backup.out

Step 2: Run call_online_backup

Open a command prompt window, change to the directory where the backup scripts are stored. By default, this is d:\BFX_db. Type

call_online_backup

You can also schedule the execution of this command file. For example, to schedule a run at midnight every Sunday, from the command prompt, type –

at 00:00 /every:su d:\BFX_db\call_online_backup.cmd

A full file path must be specified when using the ‘at’ command.

For more details of the ‘at’ command, refer to your Microsoft Windows operating system manual.

10 • Business FLEX Oracle Database Administrators Guide

Page 15: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Business FLEX Database and Backup Methods

Business FLEX Database and Backup Methods Characteristics of the Business FLEX database usage determine which backup method or combination of backup methods used. The following chart summarizes some of their advantages and disadvantages in relation to the database type.

Database Type Online Backup Offline Backup Export

Lots of database updates.

Must be available all the time.

More complicated to setup and maintain.

Can be run while database is open.

Can recover database to any point in time.

Simple setup.

Quick recovery time.

Database must be taken offline.

Can only recover to the time of the last shutdown if database is in NOARCHIVELOG mode and redo log file has been overwritten since last backup.

Simple setup.

Can be run while database is open.

Backup and recovery time for large database may be extensive.

Can only recover to the time of the last export.

Can recover objects selectively.

Mostly read-only.

Downtime is acceptable.

May be overly complicated for this type of database.

Simple setup.

Quick recovery time.

Can only recover to the time of the last shutdown if database is in NOARCHIVELOG mode and redo log file has been overwritten since last backup.

Simple setup.

Quick recovery time, except for large databases.

Can recover objects selectively.

Can only recover to the time of the last export.

A good backup strategy normally includes both logical and physical backups. Oracle recommends that customers do not rely solely on Exports as a backup mechanism. Customers are advised to always implement a proper physical backup strategy for databases.

Database Administrators at each site are responsible for adjusting the backup frequency and general procedures to suit the site requirements. The following are examples of backup frequencies:

Database Type Online Backup Offline Backup Export

Mostly read-only Not done Weekly Nightly

Lots of database updates. Downtime is not acceptable.

Nightly Not done Weekly

Business FLEX Oracle Database Administrators Guide • 11

Page 16: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Business FLEX Database and Backup Methods

This page is intentionally left blank

12 • Business FLEX Oracle Database Administrators Guide

Page 17: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Database Recovery

Database Recovery

Overview Database recovery is required whenever part of the database or the entire database is lost. If the database was running in ARCHIVELOG mode and a valid online or offline backup is available, the database can be recovered completely. If only exports and/or offline backups are done in NOARCHIVELOG mode, the database can normally be restored to the last complete backup.

There are numerous recovery situations, depending on the cause of the database failure. This document only illustrates a few sample recovery procedures. These recovery procedures are defined based on the assumption that the backup methods in the previous section Database Backup are used.

ATTENTION

THE FOLLOWING RESTORE METHODS ARE GIVEN AS AN EXAMPLE. Please consult your local Oracle Administrator on the items prior to implementing these procedures. It is the responsibility of your local Administrator to maintain good backups of the Oracle Database.

CUSTOMER HEREBY RELEASES AND AGREES TO INDEMNIFY AND HOLD HONEYWELL HARMLESS FOR ANY AND ALL LIABILITY AND DAMAGE RELATING DIRECTLY OR INDIRECTLY FROM THE USE AND/OR IMPLEMENTATION OF THE BACKUP/RESTORE METHODS CONTAINED HEREIN.

Recovery from exports If your current database is corrupted and unusable, you can still recover the database. Remove the database, recreate a new one and populate it using the file generated by the Export backup procedure. This restores the database to the state when the export was run. The steps are as follows:

ATTENTION:

All Business FLEX applications that use Oracle require the 32-bit Oracle client, even on 64-bit operating systems.

If the Database server machine is of 64-bit, and if Oracle Server Software installed is 64-bit and Oracle Client installed is of 32-bit, then there could be some issues while creating Business FLEX database in the same server. Please follow the below steps in this scenario.

1. In the Server machine, remove the Oracle client path from ENVIRONMENT VARIABLE “PATH”

2. Create the database and import the backup.

Business FLEX Oracle Database Administrators Guide • 13

Page 18: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Database Recovery

3. Include the Oracle client path to the ENVIRONMENT VARIABLE “PATH” removed in step 1 above.

1. Remove database From a command prompt window, change to the directory where the Business FLEX scripts are stored, by default, this is d:\BFX_db. Edit the setenv.cmd file. Verify the ORA_BASE, ORA_HOME, ORACLE_SID and BFX_DB values to reflect the database files location and instance name that is going to be removed. Then run the following command -

removedb

2. Create a new database Follow the instructions in the Business FLEX Oracle Database Installation Guide to create the Business FLEX Database.

3. Modify the variable definition in bfxdbinstall.cmd.

Set CreateDBonly=YES.

A new database structure is now recreated with all tablespaces, excluding users and users objects.

4. Modify the variable definitions in call_exp_recovery.cmd CONNSTR Connect string (user must be able to login as sysdba), for example,

sys/change_on_install

BAKDIR Directory where backup export files are located, for example,

c:\backup\20040218

BAKFILE Name of the backup export file, for example,

backup.dmp

5. Import data into database From a command prompt window, change to the directory where the Business FLEX scripts are stored. By default, this is d:\BFX_db. Type the following:

call_exp_recovery

This script assumes a FULL database import. It generates an output log file called restore.log. If call_exp_recovery exits with error messages, resolves these errors before continuing.

6. Remove running jobs If jobs were submitted and running when the export was run, these jobs are restored after the import is complete. Ensure you terminate all jobs before running the next step. To list all jobs, change to the directory where the Business FLEX scripts are stored. By default, this is d:\BFX_db. Run the following:

14 • Business FLEX Oracle Database Administrators Guide

Page 19: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Database Recovery

sqlplus totalplant/<password>@totalplant @list_jobs.sql

To kill jobs, change to the directory where the Business FLEX scripts are stored. By default, this is d:\BFX_db. Then logon to sqlplus as the owner of the job. For example:

sqlplus totalplant/<password>@totalplant

then run

@kill_job <job name>

7. Restore SYS grants From a command prompt window, change to the directory where the export files are located. This is BAKDIR as defined in step 2. Type the following:

sqlplus “sys/<password>@totalplant as sysdba” @sys_grants.sql

A log file called sys_grants.lst is created. Check this log file for error messages.

8. Recompile objects From a command prompt window, change to the directory where the Business FLEX scripts are stored. By default, this is d:\BFX_db. Run the following:

sqlplus totalplant/<password>@totalplant @invalid_obj_fix.sql

Recovery from offline backups If a valid offline backup is available, you can restore the entire database to the point of the shutdown. The following example assumes the offline backup was taken from a database in NOARCHIVELOG mode. Any updates made after the offline backup must be entered again manually.

Perform the following steps to recover the complete database:

1. Shutdown database If the database is open, shut it down. For example,

Set oracle_sid=prd

sqlplus “sys/change_on_install as sysdba” shutdown immediate exit

2. Restore a full set of database files If the offline backup procedure described in the previous Database Backup section is used, a command file called file_restore.cmd is generated and stored in each backup directory. This file contains commands to copy the database files from the backup directory to their original location. Examine this file to validate the file paths. The full set of database files must be restored to their exact location at the time of the backup. To run this command file, open a command prompt window and type the following:

Business FLEX Oracle Database Administrators Guide • 15

Page 20: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Database Recovery

file_restore

3. Startup database After all files are copied, start the database. For example,

Set oracle_sid=prd

sqlplus “sys/change_on_install as sysdba” startup exit

Recovery from online backups If a data file is lost due to media failure, you can restore a copy of the affected data file from the online backups.

1. Shutdown database Shut down the database if it is open. For example,

Set oracle_sid=prd

sqlplus “sys/change_on_install as sysdba” shutdown immediate exit

2. Restore the desired data file from backup For example,

copy c:\backup\20040218\<file name> d:\oracle\oradata\prd

3. Restore archive log files from backup Restore the archive log files required by the recovery process if they have been removed from the LOG_ARCHIVE_DEST directory. For example,

copy c:\backup\prd\archivelog\*.* d:\oracle\oradata\prd\archive

4. Mount and recover the database Oracle automatically applies the required archived logs. After the logs are applied, you can open the database. For example,

Set oracle_sid=prd

sqlplus “sys/change_on_install as sysdba” startup mount recover automatic database alter database open;

The above is only a simple example in restoring a missing or corrupted data file. For more details on other types of media recovery, such as control files, redo logs and so on, refer to the Oracle11g User-Managed Backup and Recovery Guide.

16 • Business FLEX Oracle Database Administrators Guide

Page 21: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Database Maintenance

Database Maintenance

Shrinking temporary tablespace Temporary tablespaces are used by the database to sort out the data that it cannot do in memory. For example, if you join two very large tables that exceed the memory capacity, Oracle uses the temporary tablespace to perform the sorting operation in the database.

Perform the following steps to create a new temporary tablespace.

Create a new temporary tablespace. SQL> CREATE TEMPORARY TABLESPACE temp02 TEMPFILE 'C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\ORADATA\BF250\temp02.dbf' SIZE 5M REUSE AUTOEXTEND ON NEXT 1M MAXSIZE unlimited EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;

Make the new tablespace as a default temporary tablespace. SQL> alter database default temporary tablespace temp02;

Verify the default temporary tablespace by using the below query. SQL> select property_name,property_value from database_properties where property_name='DEFAULT_TEMP_TABLESPACE'; PROPERTY_NAME PROPERTY_VALUE ------------------------ --------------------- DEFAULT_TEMP_TABLESPACE TEMP02

Find the temporary tablespace in the database. SQL> SELECT TABLESPACE_NAME FROM DBA_TABLESPACES WHERE CONTENTS='TEMPORARY'; TABLESPACE_NAME ---------------- TEMP TEMP02

Restart the machine. Sql> shutdown immediate Sql> Startup

Drop the temporary tablespace which is not in use. SQL> DROP TABLESPACE TEMP INCLUDING CONTENTS AND DATAFILES;

Note: The same steps can be used for Oracle 12c.

Business FLEX Oracle Database Administrators Guide • 17

Page 22: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

Notices

Documentation feedback

You can find the most up-to-date documents on the Honeywell Process Solutions support website at:

http://www.honeywellprocess.com/support

If you have comments about Honeywell Process Solutions documentation, send your feedback to:

[email protected]

Use this email address to provide feedback, or to report errors and omissions in the documentation. For immediate help with a

technical problem, contact your local Honeywell Process Solutions Customer Contact Center (CCC) or Honeywell Technical Assistance

Center (TAC) listed in the “Support and other contacts” section of this document.

How to report a security vulnerability

For the purpose of submission, a security vulnerability is defined as a software defect or weakness that can be exploited to reduce the

operational or security capabilities of the software.

Honeywell investigates all reports of security vulnerabilities affecting Honeywell products and services.

To report a potential security vulnerability against any Honeywell product, please follow the instructions at:

https://honeywell.com/pages/vulnerabilityreporting.aspx

Submit the requested information to Honeywell using one of the following methods:

Send an email to [email protected].

or

Contact your local Honeywell Process Solutions Customer Contact Center (CCC) or Honeywell Technical Assistance Center (TAC)

listed in the “Support and other contacts” section of this document.

Support and other contacts

For support and other contact details, go to http://www.honeywell.com/ps .

World Wide Web

Honeywell Process Solutions website:

http://www.honeywellprocess.com/support

Elsewhere

Contact your nearest Honeywell office.

Page 23: Business FLEX Oracle Database Administrators Guide · 2016-11-24 · procedures, triggers, and so on) to a file. The Export utility in Oracle is used for performing this type of database

For more information

To learn more about Honeywell’s products or

solutions visit www.honeywellprocess.com or

contact your Honeywell account manager.

Honeywell Process Solutions

1250 West Sam Houston Parkway South

Houston, TX 77042

Honeywell House, Skimped Hill Lane

Bracknell, RG12 1EB

Shanghai City Centre, 100 Junyi Road

Shanghai, China 20051

www.honeywellprocess.com