Sunday, August 31, 2008

Using RMAN to backup R12

I am using linux on this backup procedure. I will create a weekly full backup (incremental level 0) and daily backup (incremental level 1). Change file location as needed.
First step is login as oracle user.
Next create a script for weekly backup and save as weekly_full.rman
Copy this script below:
#*** Weekly RMAN Script weekly_full.rman
CONNECT TARGET /

#*** Weekly full controlfile backup
BACKUP AS COPY
DEVICE TYPE DISK
TAG = 'WEEKLY_CONTROLFILE'
FORMAT '/oracle/ITB/db/apps_st/rman_backup/weekly_controlfile_%d_t%t_s%s_p%p'
CURRENT CONTROLFILE;

#*** Weekly full spfile backup
BACKUP AS COPY
DEVICE TYPE DISK
TAG = 'WEEKLY_SPFILE'
FORMAT '/oracle/ITB/db/apps_st/rman_backup/weekly_spfile_%d_t%t_s%s_p%p'
SPFILE;

#*** Weekly full database plus archivelog backup
BACKUP CHECK LOGICAL
AS COMPRESSED BACKUPSET
INCREMENTAL LEVEL = 0
DEVICE TYPE DISK
TAG = 'WEEKLY_DATABASE'
FORMAT '/oracle/ITB/db/apps_st/rman_backup/weekly_database_%d_t%t_s%s_p%p'
DATABASE;

#*** Weekly full archivelog backup
change archivelog all validate;
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';

BACKUP CHECK LOGICAL
AS COMPRESSED BACKUPSET
INCREMENTAL LEVEL = 0
DEVICE TYPE DISK
TAG = 'WEEKLY_ARCHIVELOG'
FORMAT '/oracle/ITB/db/apps_st/rman_backup/weekly_archivelog_%d_t%t_s%s_p%p'
ARCHIVELOG FROM TIME 'SYSDATE-7';

#*** Remove old backups and archivelogs
#DELETE BACKUP COMPLETED BEFORE 'SYSDATE-10' DEVICE TYPE DISK;
#DELETE NOPROMPT ARCHIVELOG UNTIL TIME 'SYSDATE-30';

#*** Maintenance steps
CROSSCHECK COPY;
CROSSCHECK BACKUP;
CROSSCHECK ARCHIVELOG ALL;
REPORT OBSOLETE;
DELETE NOPROMPT OBSOLETE;
DELETE NOPROMPT EXPIRED COPY;
DELETE NOPROMPT EXPIRED BACKUP;
DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;

EXIT;
##***End of weekly_full.rman

Then create a script file for daily backup and save as daily_incremental.rman
This is the script:
#*** Daily RMAN Script daily_incremental.rman
CONNECT TARGET /

#*** Daily full controlfile backup
BACKUP AS COPY
DEVICE TYPE DISK
TAG = 'DAILY_CONTROLFILE'
FORMAT '/oracle/ITB/db/apps_st/rman_backup/daily_controlfile_%d_t%t_s%s_p%p'
CURRENT CONTROLFILE;

#*** Daily full spfile backup
BACKUP AS COPY
DEVICE TYPE DISK
TAG = 'DAILY_SPFILE'
FORMAT '/oracle/ITB/db/apps_st/rman_backup/daily_spfile_%d_t%t_s%s_p%p'
SPFILE;

#*** Daily full database backup
BACKUP CHECK LOGICAL
AS COMPRESSED BACKUPSET
INCREMENTAL LEVEL = 1
DEVICE TYPE DISK
TAG = 'DAILY_INCREMENTAL_DATABASE'
FORMAT '/oracle/ITB/db/apps_st/rman_backup/daily_incremental_database_%d_t%t_s%s_p%p'
DATABASE;

#*** Daily full archivelog backup
change archivelog all validate;
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';

BACKUP CHECK LOGICAL
AS COMPRESSED BACKUPSET
INCREMENTAL LEVEL = 1
DEVICE TYPE DISK
TAG = 'DAILY_INCREMENTAL_ARCHIVELOG'
FORMAT '/oracle/ITB/db/apps_st/rman_backup/daily_incremental_archivelog_%d_t%t_s%s_p%p'
ARCHIVELOG FROM TIME 'SYSDATE-1';

#*** Maintenance steps
REPORT OBSOLETE;
DELETE NOPROMPT OBSOLETE;
DELETE NOPROMPT EXPIRED COPY;
DELETE NOPROMPT EXPIRED BACKUP;
DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;

EXIT;
##***End of daily_incremental.rman

Create a shell script to run rman script above.
For weekly, create a file named weekly.sh containing this script:
#! /bin/sh
source /oracle/ITB/db/tech_st/10.2.0/ITB_oracle.env
rman @/home/oracle/weekly_full.rman LOG /home/oracle/weekly_full.rman.log

For daily, create a file named daily.sh containing this script:
#! /bin/sh
source /oracle/ITB/db/tech_st/10.2.0/ITB_oracle.env
rman @/home/oracle/daily_incremental.rman LOG /home/oracle/daily_incremental.rman.log

Then login as root. Open /etc/crontab and add these lines to the end of file.
30 21 * * 0 oracle /home/oracle/weekly.sh &> /home/oracle/weekly.log
30 21 * * 1-6 oracle /home/oracle/daily.sh &> /home/oracle/daily.log

The daily_incremental.rman script will be executed automaticaly on Monday to Saturday 21:30. The weekly_full.rman script will be executed automaticaly on Sunday 21:30.


Wednesday, August 27, 2008

Oracle Applications R12: a beta software?

I think Oracle is releasing a beta software. I found so many bugs on R12. The worst thing is I have to pay a lot of money to get this beta software. To make it even worst, I have to pay to get the patch :(
Oracle should give the patch for free.

Friday, August 1, 2008

Using Forms Builders with Oracle Applications Release 12

First, source the Oracle Applications generated OracleAS 10.1.2 environment file. The environment file will be located under the 10.1.2 subdirectory of the Release 12 instance home. For example, assuming Release 12 is installed under /slot01/appmgr, and the instance name is "txk123", source the following file:

/slot01/appmgr/inst/apps/txk123/ora/10.1.2/txk123.env

 

The above could also be written as $ORACLE_CONFIG_HOME/txk123.env, or $INST_TOP/ora/10.1.2/txk123.env. You can look up $ORACLE_CONFIG_HOME in the Help->About Window of a Release 12 Forms session if you are not sure of the underlying directory structure. The Forms Help->About Window displays settings for the OracleAS 10.1.2 Oracle home.

 

Second, modify the environment variable FORMS_PATH, so the referenced forms can be found. Referenced forms are only required by the builder and compiler. The compiler merges in everything it needs from the referenced form when it generates the .fmx, so the referenced forms are not used at runtime; this is the reason they are not in the default FORMS_PATH.

FORMS_PATH=$FORMS_PATH:$AU_TOP/forms/US

export FORMS_PATH

 

This assumes you are working with the US English version of the form. For other languages, add the appropriate language subdirectory to FORMS_PATH in place of US. The referenced objects will then be in the correct language.

 

Launch the builder by running the following command:

frmbld.sh &

 

You must use the frmbld.sh script, under $ORACLE_HOME/bin. Do not run the executable standalone. After sourcing the 10.1.2 environment file, $ORACLE_HOME should be set to ~/apps/tech_st/10.1.2, and $ORACLE_HOME/bin should be included in $PATH.

Using Forms Builders with Oracle Applications Release 12

First, source the Oracle Applications generated OracleAS 10.1.2 environment
file. The environment file will be located under the 10.1.2 subdirectory of
the Release 12 instance home. For example, assuming Release 12 is installed
under /slot01/appmgr, and the instance name is "txk123", source the
following file:
/slot01/appmgr/inst/apps/txk123/ora/10.1.2/txk123.env

The above could also be written as $ORACLE_CONFIG_HOME/txk123.env, or
$INST_TOP/ora/10.1.2/txk123.env. You can look up $ORACLE_CONFIG_HOME in the
Help->About Window of a Release 12 Forms session if you are not sure of the
underlying directory structure. The Forms Help->About Window displays
settings for the OracleAS 10.1.2 Oracle home.

Second, modify the environment variable FORMS_PATH, so the referenced forms
can be found. Referenced forms are only required by the builder and
compiler. The compiler merges in everything it needs from the referenced
form when it generates the .fmx, so the referenced forms are not used at
runtime; this is the reason they are not in the default FORMS_PATH.
FORMS_PATH=$FORMS_PATH:$AU_TOP/forms/US
export FORMS_PATH

This assumes you are working with the US English version of the form. For
other languages, add the appropriate language subdirectory to FORMS_PATH in
place of US. The referenced objects will then be in the correct language.

Launch the builder by running the following command:
frmbld.sh &

You must use the frmbld.sh script, under $ORACLE_HOME/bin. Do not run the
executable standalone. After sourcing the 10.1.2 environment file,
$ORACLE_HOME should be set to ~/apps/tech_st/10.1.2, and $ORACLE_HOME/bin
should be included in $PATH.