Oracle EBS R12.2.6 on Virtual Box Pt2

If you followed my previous post Oracle E-Business Suite R12.2.6 on Virtual Box you will have already downloaded the 19 required zip files, and be ready to go.

Ok, change directory to the location of the downloaded files, unzip and concatenate them into a single OVA file using the following:

$ unzip ‘V*.zip’

$ cat Oracle-E-Business-Suite-12.2.6_VISION_INSTALL.ova.* > Oracle-E-Business-Suite-12.2.6_VISION_INSTALL.ova

Getting started – Virtual Box

Start Virtual Box and navigate to File -> Import Appliance

Click on ‘Expert Mode’ and edit the ‘Virtual Disk Image’ path to a location with adequate space (~500GB), in this example I am using my Samsung Portable SSD T1 1TB dive mounted at ‘/Volumes/Samsung_T1’

OVA_import

Click ‘Import’, go to lunch or grab a coffee and watch the progress bar if you prefer, the remaining time will re-calulate periodically.

Importing

Once complete, start up your new Oracle EBS R12.2.6 VM from within Oracle VirtualBox

Oracle E-Business Suite R12.2.6

inital_boot

The initial boot will prompt you to change the ‘root’, ‘oracle’ and ‘applmgr’ passwords, the process will continue to start and configure an Oracle 12.1.0.2 database called ‘EBSDB’.

VISION

Use ifconfig -a’ to determine your VM’s IP address from you VirtualBox console before using SSH from your host to connect using your preferred client.

Add the IP address to your local ‘/etc/host’ file so your browser can resolve your Oracle EBS VISION sandbox environment. e.g.

#
192.168.0.23 apps.example.com apps
#

Change directory to ‘/u01/install/APPS/scripts’ to access the database and application stop / start scripts and run ‘startdb.sh’ and ‘startapps.sh’

  • startdb.sh
  • stopdb.sh
  • startapps.sh
  • stopapps.sh

Shell

[oracle@apps scripts]$ ./startdb.sh
Logfile: /u01/install/APPS/12.1.0/appsutil/log/EBSDB_apps/addlnctl.txt

You are running addlnctl.sh version 120.4

Starting listener process EBSDB …

LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 15-AUG-2017 07:42:19

Copyright (c) 1991, 2014, Oracle. All rights reserved.

Starting /u01/install/APPS/12.1.0/bin/tnslsnr: please wait…

TNSLSNR for Linux: Version 12.1.0.2.0 – Production
System parameter file is /u01/install/APPS/12.1.0/network/admin/EBSDB_apps/listener.ora
Log messages written to /u01/install/APPS/12.1.0/admin/EBSDB_apps/diag/tnslsnr/apps/ebsdb/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=apps.example.com)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=apps.example.com)(PORT=1521)))
STATUS of the LISTENER
————————
Alias EBSDB
Version TNSLSNR for Linux: Version 12.1.0.2.0 – Production
Start Date 15-AUG-2017 07:42:19
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/install/APPS/12.1.0/network/admin/EBSDB_apps/listener.ora
Listener Log File /u01/install/APPS/12.1.0/admin/EBSDB_apps/diag/tnslsnr/apps/ebsdb/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=apps.example.com)(PORT=1521)))
Services Summary…
Service “EBSDB” has 1 instance(s).
Instance “EBSDB”, status UNKNOWN, has 1 handler(s) for this service…
The command completed successfully

addlnctl.sh: exiting with status 0

addlnctl.sh: check the logfile /u01/install/APPS/12.1.0/appsutil/log/EBSDB_apps/addlnctl.txt for more information …

You are running addbctl.sh version 120.1

Starting the database EBSDB …

SQL*Plus: Release 12.1.0.2.0 Production on Tue Aug 15 07:42:19 2017

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Connected to an idle instance.
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 2147483648 bytes
Fixed Size 2926472 bytes
Variable Size 1308625016 bytes
Database Buffers 822083584 bytes
Redo Buffers 13848576 bytes
Database mounted.
Database opened.
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

addbctl.sh: exiting with status 0

[oracle@apps scripts]$ ./startapps.sh 
Starting the Oracle E-Business Suite Application Tier Services
You are running adstrtal.sh version 120.24.12020000.11

All enabled services for this node are started.

adstrtal.sh: Exiting with status 0

adstrtal.sh: check the logfile /u01/install/APPS/fs1/inst/apps/EBSDB_apps/logs/appl/admin/log/adstrtal.log for more information …

Before you can logon you will need to enable SYSADMIN and the Demo accounts, Oracle have provided scripts to do this  e.g.

[oracle@apps scripts]$ ./enableSYSADMIN.sh

This script will let you set a new password for the SYSADMIN EBS Applications User, the default password most likely was “sysadmin”, so pick a different one now.

Enter new password for SYSADMIN:
Re-enter password for SYSADMIN:
Changing password for SYSADMIN
Log filename : L7583909.log
Report filename : O7583909.out
[oracle@apps scripts]$

[oracle@apps scripts]$ ./enableDEMOusers.sh

Enter a new password for the EBS Applications Users, the default password
most likely was “welcome”, so pick a different one now…

Enter new password for DEMO users:
Re-enter password for DEMO users:
Setting password for DEMO users…
Log filename : L7583911.log

[oracle@apps scripts]$

Oracle EBS R12 Dashboard

You should now be able to logon as ‘SYSADMIN’ or explore your Oracle EBS R12.2.6 VISION sandbox environment using the Demo users (see below) and the password defined above at: http://apps.example.com:8000/

“AFENG”, “AMARLIN”, “AMILLER”, “APOTTER”, “BPALMER”, “BWEBB”
“CBROWN”, “CONMGR”, “CONTMGR”, “CSADM”, “DBAKER”, “EBUSINESS”
“FBRAMER”, “HRMS”, “ILANG”, “ISUPPORTADMIN”, “JFROST”
“KJONES”, “LJONES”, “MFG”, “MGRMKT”, “MNT”, “OPERATIONS”
“PHENRY”, “PIMMGR”, “PLMMGR”, “PROCESS_OPS”, “PROJMFG”
“PSTOCK”, “RBATES”, “SCRIPTUSER”, “SERVICES”, “SFM”
“SPAIN”, “SVYADMIN”, “TRADEMGR”

Sales_Dashboard
Sales Dashboard – LJONES

Docker, Oracle 12c and Persistent Storage

Introduction

If you have read my previous posts on Docker you may have already installed Docker and have an Oracle 12c database running in a Docker container, if not you may want to read my first post on Docker – Running Oracle 12.2.01 on Docker

However, since I wrote the above post Oracle have published Docker images for many of their products, these can be found at the Docker Store. The Oracle images on the Docker Store are not just a great resource and help accelerate adoption, but are also certified and supported by Oracle.

Before continuing with this post you need to check-out my posts on using the new Oracle 12c Docker images and the Pure Storage Docker plugin as this post can be considered the ‘Return of the Jedi’  in the series.

Oracle 12c with Persistent Storage

In this post I will create a Docker container running an Oracle 12c database called PSTG using 4 mount points /u01, /u02, /u03 & /u04 mounted from a Pure Storage FlashArray.

Database environment Layout

/u01 – OraInventory and Oracle 12c product directories
/u02 – Oracle Datafile
/u03 – Fast Recovery Area
/u04 – RedoLog files.

The 4 mount points will all be using persistent All Flash Storage providing low latency performance, space efficient crash consistent snapshots and requiring no local storage.

First, confirm that you have installed the Oracle 12c image using the the following:

$ docker images list

docker_imagesYou should be able see the store/oracle/database-enterprise 12.1.0.2 Docker Image, if missing you need to read my previous post.

Ok, copy the db_env.dat file created in the previous post to a new environment file $ORACLE_SID_env.dat and update database name and password e.g.

####################################################################
## Copyright(c) Oracle Corporation 1998,2016. All rights reserved.##
##                                                                ##
##                   Docker OL7 db12c dat file                    ##
##                                                                ##
####################################################################
##------------------------------------------------------------------
## Specify the basic DB parameters
##------------------------------------------------------------------
## db sid (name)
## default : ORCL
## cannot be longer than 8 characters
DB_SID=PSTG
## db passwd
## default : Oracle
DB_PASSWD=Oracle
## db domain
## default : localdomain
DB_DOMAIN=localdomain
## db bundle
## default : basic
## valid : basic / high / extreme 
## (high and extreme are only available for enterprise edition)
DB_BUNDLE=basic
## end

We will now create the 4 volumes using the docker volume create command and Pure Storage Docker plug-in providing name, size and label.

 docker volume create --driver=pure --opt size=20GB --name=PSTG-u01 --label=product
 docker volume create --driver=pure --opt size=100GB --name=PSTG-u02 --label=oradata
 docker volume create --driver=pure --opt size=200GB --name=PSTG-u03 --label=fast_recovery_area
 docker volume create --driver=pure --opt size=10GB --name=PSTG-u04 --label=redo

We can use the docker volume ls command with a filter to list the 4 database volumes we are interested in using the following syntax

$ docker volume ls -f name=environment

docker_vols

The Pure Storage Docker Plugin also supports docker volume inspect, from here we can see the labels which we defined earlier, great way to see where and what the mount is being used for.

$ docker volume inspect volume name

docker_inspect.png

Now that we have installed the Oracle 12c Docker image and created the 4 volumes we are ready to create our Oracle 12c container using the docker run command with -v to present our newly volumes to our container.

docker run -d –env-file ./PSTG_env.dat -p 1527:1521 -p 5507:5500 -it –name PSTG -v PSTG-u01:/u01 -v PSTG-u02:/u02 -v PSTG-u03:/u03 -v PSTG-u04:/u04 –shm-size=”8g” store/oracle/database-enterprise:12.1.0.2

Progress can be monitored using the docker logs command.

docker logs -f PSTG

Once the container has started we can now connect to it and check out our Oracle 12c environment using the docker exec command and container name

docker exec -it PSTG /bin/bash

From within our Oracle 12c ‘PSTG’ container we can see our Pure Storage volumes (/u01, /u02, /u03 & /u04) and the sizes we specified.

df.png

Now we are in our Docker container we can use SQLPlus to see data file locations, instance name, docker assigned hostname etc…

sqlplus

instance

Automate to avoid database cloning disasters.

“Accidentally destroyed production database on first day of a job”

Wow, that headline grabbed my attention.

Earlier this week you may have seen an article reported by The Register about a post in  reddit from a junior software developer going by the name of  “cscareerthrowaway567”, who on his/her first day destroyed a Production database and lost their job.

I was basically given a document detailing how to setup my local development environment. Which involves run a small script to create my own personal DB instance from some test data. After running the command i was supposed to copy the database url/password/username outputted by the command and configure my dev environment to point to that database. Unfortunately instead of copying the values outputted by the tool, i instead for whatever reason used the values the document had.

Unfortunately apparently those values were actually for the production database (why they are documented in the dev setup guide i have no idea). Then from my understanding that the tests add fake data, and clear existing data between test runs which basically cleared all the data from the production database. Honestly i had no idea what i did and it wasn’t about 30 or so minutes after did someone actually figure out/realize what i did.

Now, we can not be sure if the story by “cscareerthrowaway567” is true or not but it does provide an great example of the potential dangers of manual database cloning.

The story raises many issues around process, security, change management, training and not least why someone thought it was a good idea to include Production account details in a database cloning document ?

However, this could have easily been avoided through the use of Automation or a CDM (Copy Data Management) tools e.g. Catalogic, Actifio, Delphix etc..

Many modern All-Flash Arrays (AFA) provide powerful REST API’s which can be called from various programming and scripting languages e.g. Python, Java, Perl, PowerShell etc… to create custom solutions.

AFA Storage API’s can also be consumed by DevOPS Automation and Provisioning software e.g. Ansible, Chef, Puppet etc.. to provide full-stack or end-to-end Automation of Database Cloning, improving security and also removing the chance of human error.

Check out the Pure Storage Developer Community area for code examples.

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