Oracle 12c Online Database Move Datafile

After watching an Oracle R12c new features presentation at a recent conference somebody asked me what was my favourite Oracle R12c database feature, for me it was easy has to be ‘ALTER DATABASE MOVE DATAFILE’

Prior to Oracle 12c moving non-ASM data files required taking data files ‘offline’ and negotiating an outage with the business, with Oracle 12c this is no longer the case.

Storage Maintenance

You can use the ALTER DATABASE MOVE DATAFILE to move a data file to different location, disk or storage system. This provides a simple Online method of migrating to a new storage platform.

Online_Data_Move

The Oracle ALTER DATABASE MOVE DATAFILE does all the hard work for you including renaming or relocating the data file at operating system level and changing pointers in the Control Files.

Oracle also provide a way of monitor progress by using the V$SESSION_LONGOPS view, the reported bytes done will increment until the move is completed.

SQL> select file_name, tablespace_name from dba_data_files;

TABLESPACE_NAME      FILE_NAME
——————– ———————————————————–

TEST                /u01/app/oracle/oradata/PSTG/datafile/test.dbf

SQL> ALTER DATABASE MOVE DATAFILE ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ TO ‘/u01/app/oracle/oradata/PSTG/datafile/tester.dbf’;

SQL> select to_char(start_time,’DD-MON-YY hh24:mi:ss’),  timestamp, time_remaining, elapsed_seconds, message from V$SESSION_LONGOPS;

02-JUN-17 10:51:44   0 158
Online data file move: data file 4: 10737418240 out of 10737418240 bytes done

SQL>  select tablespace_name, file_name from dba_data_files;

TABLESPACE_NAME      FILE_NAME
——————– ———————————————————–

TEST               /u01/app/oracle/oradata/PSTG/datafile/tester.dbf

Please note before you begin make sure you have enough space on the source and target storage platforms as Oracle will allocate the required storage space on the target system and will not free any space up on the source until the move is complete.

If you specify the ‘KEEP’ parameter Oracle will copy the data file to the new location and retain the old datafile in the original location, it will be no longer reference in the control files and can be removed when no longer required.

SQL>  select tablespace_name, file_name from dba_data_files;

TABLESPACE_NAME      FILE_NAME
——————– ———————————————————–

TEST     /u01/app/oracle/oradata/PSTG/datafile/tester.dbf

SQL> ALTER DATABASE MOVE DATAFILE ‘/u01/app/oracle/oradata/PSTG/datafile/tester.dbf’ TO ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ KEEP;

Database altered.

SQL> select tablespace_name, file_name from dba_data_files;

TABLESPACE_NAME      FILE_NAME
——————– ———————————————————–

TEST     /u01/app/oracle/oradata/PSTG/datafile/test.dbf

[oracle@ol72-oraclepub datafile]$ ls -lh

-rw-r—–. 1 oracle oinstall  11G Jun  2 11:49 test.dbf
-rw-r—–. 1 oracle oinstall  11G Jun  2 11:49 tester.dbf

Please consult the Oracle R12.2 Docs for further details.

Code examples:

Rename:

ALTER DATABASE MOVE DATAFILE ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ TO ‘/u01/app/oracle/oradata/PSTG/datafile/tester.dbf’;

Relocate:

ALTER DATABASE MOVE DATAFILE ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ TO ‘/u02/app/oracle/oradata/PSTG/datafile/test.dbf’;

Copy:

ALTER DATABASE MOVE DATAFILE ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ TO ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ KEEP;

Move into ASM:

ALTER DATABASE MOVE DATAFILE ‘/u01/app/oracle/oradata/PSTG/datafile/test.dbf’ TO ‘+DATA/data/datafile/test.dbf’;

REUSE: overwrite data file with the same name
KEEP: copies the data file to a new location and retains original data file in old location

Oracle E-Business Suite R12.2.5 Fresh Install – Part III

Oracle EBS R12.2.5 Upgrade

In Part I of my Oracle R12.2.5 Fresh Install walkthrough I described the prepatory steps for the install.

In Part II we shared details on how to install Oracle EBS using the latest R12.2.5 media including Oracle 12cR1.

In this Blog post I walk provide details of how to upgrade your EBS environment from R12.2.0 to R12.2.5.

Current Configuration

SQL> select banner from v$version;
BANNER
——————————————————————————–
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
PL/SQL Release 12.1.0.2.0 – Production
CORE 12.1.0.2.0 Production
TNS for Linux: Version 12.1.0.2.0 – Production
NLSRTL Version 12.1.0.2.0 – Production

SQL> select release_name from apps.fnd_product_groups;
RELEASE_NAME
————————————————–
12.2.0

R12.2.5 Upgrade Process

If you have access to http://support.oracle.com refer to Oracle E-Business Suite Releases 12.2.5 Readme (Doc ID 1983050.1)

Apply Consolidated Seed Table Patch

Stop all Application services other than the WebLogic AdminServer on the run file system.

$ cd $ADMIN_SCRIPTS_HOME
$ ./adstpall.sh apps/apps

$ ./adadminsrvctl.sh start

Apply the patch using the new adop tool, adpatch no longer required.

$ cd ../VIS/fs_ne/EBSapps/patch
$ unzip p17204589.zip
$ unzip p21900871
$ adop phase=apply patches=17204589,21900871 merge=yes hotpatch=yes

Start all AppsTier services

$ cd $ADMIN_SCRIPTS_HOME
$ ./adstral.sh apps/apps

Enter Weblogic password when prompted.

Apply R12.2.5 Release Update Pack

Source the run edition environment variables

$. <INSTALL_BASE>EBSapps.env. run

Stop the Weblogic AdminServer and Node Manager services

$ cd $ADMIN_SCRIPTS_HOME
$ ./adadminsrvctl.sh stop
$ ./adnodemgrctl.sh stop

Set the 12c database parameter optimizer_adaptive_features to false

optimizer_adaptive_features=false

Apply previously downloaded patch 19676458

$ cd ../VIS/fs_ne/EBSapps/patch
$ unzip p19676458.zip
$ adop phase=apply apply_mode=downtime patches=19676458

Reset the 12c database parameter optimizer_adaptive_features back to true

optimizer_adaptive_features=true

Re-Start all AppsTier services

$ cd $ADMIN_SCRIPTS_HOME
$ ./adstral.sh apps/apps

Perform adop clean-up
$ adop phase=cleanup

Synchronise the file systems using atop as below, this will copy the new run edition code and configuration to the other file system.
$ adop phase=fs_clone

Updated Configuration

As you can see from below we have now a running Oracle EBS R12.2.5 environment on a 12c database.

R12.2.5 OAM

EBS_Release_Name

Oracle E-Business Suite R12.2.5 Fresh Install – Part II

Oracle EBS R12.2.5 Installation

Navigate to ../startCD/Disk1/rapidwiz an launch rapidwiz

As you can see from below the installation is going to include Oracle 12cR1 RDBMS.

Welcome

Review and click ‘Next’

Wizard1

Select ‘Install Oracle E-Business Suite Release R12.2.0’, click ‘Next’

config_choice

Select ‘Create a new configuration’, click ‘Next’

global_settings

Update Port Pool if required, click ‘Next’

database_node

Update Database Node Configuration, click ‘Next’

primary_app_node

Update Application Node Configuration, click ‘Next’

App_user_info

Update Application User Information, click ‘Next’

node_info

Review node information, click ‘Next’

validation

Review ‘Validate System Configuration’, click ‘Next’

review

Review summary, click ‘Next’

Installing

Click ‘Next’ to start install

Missing Java library

rw-50004

The above failure is due to a missing java library file, this can be fixed with the below.

$ORACLE_HOME/javavm/jdk/jdk7/lib/libjavavm12.a lib to $ORACLE_HOME/lib/

If your quick you can copy it whilst rapidwiz is installing the Oracle Home, otherwise you will have to clean-up the oraInventory and star rapidwiz again.

RMAN failure

The installer will try to restore the data files using RMAN, previous releases just unzipped the files, the installer will continue for a while until.

RMAN-04014: startup failed: ORA-01127: database name ‘OLDDBNAME’ exceeds size limit of 8 characters

This can be fixed by updating the RMANinit.ora file and restarting rapidwiz e.g.

/u01/oracle/VIS/12.1.0/dbs/RMANinit.ora
db_name=OLDDBNAME
to
db_name=VIS

Perl Segmentation fault

Another, problem you may encounter with your Oracle EBS R12.2.5 install is a perl ‘Segmentation fault’

$ pwd
/u01/oracle/VIS/12.1.0/perl/bin
$ ./perl -v
Segmentation fault

$ cd $ORACLE_HOME
$ mv perl/ perl.old/
$ mkdir perl

Change directory back to your downloaded version and re-compile.

$ cd
$ cd perl/perl-5.14.1
$./Configure -des -Dprefix=$ORACLE_HOME/perl -Doptimize=-O3 -Dusethreads -Duseithreads -Duserelocatableinc ; make clean ; make ; make install

$ cd $ORACLE_HOME/perl
$ rm -rf lib/ man/
$ cp -r ../perl.old/lib/ .
$ cp -r ../perl.old/man/ .
$ cp ../perl.old/bin/dbilogstrip bin/
$ cp ../perl.old/bin/dbiprof bin/
$ cp ../perl.old/bin/dbiproxy bin/
$ cp ../perl.old/bin/ora_explain bin/

Rapidwiz Completion

Once the installed is complete you can now confirm your EBS and database versions using the following:

SQL> select release_name from apps.fnd_product_groups;
SQL> select * from v$version;

In part III of this BLOG series I will share the steps to upgrade from R12.2.0 to R12.2.5