What You See Is What You Get Element

How to Migrate Oracle Database from Oracle Solaris 8 to Oracle Solaris 11

by Orgad Kimchi

How to use the Oracle Solaris 8 P2V (physical to virtual) Archiver tool, which comes with Oracle Solaris Legacy Containers, to migrate a physical Oracle Solaris 8 system with Oracle Database 10.2 and an Oracle Automatic Storage Management file system into an Oracle Solaris 8 branded zone inside an Oracle Solaris 10 guest domain on top of an Oracle Solaris 11 control domain.


Published October 2012 (reprinted from The art of virtualization blog)

In this document I will demonstrate the migration of an Oracle Solaris 8 physical system with Oracle Database version 10.2.0.5 and an Oracle Automatic Storage Management file system located on SAN storage into an Oracle Solaris 8 branded zone inside an Oracle Solaris 10 guest domain on top of an Oracle Solaris 11 control domain.

Have some favorite sysadmin operations of your own that you'd like to share?   Become an OTN member and get paid for publishing your article on OTN.

In the first example, we will preserve the host information. In the second example, we will modify the host name.

The Oracle Automatic Storage Management file system is located on a LUN in SAN storage connected via a Fibre Channel HBA. During the migration, we use the same LUN on the source and target servers in order to avoid data migration.

The P2V Archiver tool successfully migrates the Oracle Solaris 8 physical system into the Oracle Solaris 8 branded zone, and the zone is able to access the Oracle Automatic Storage Management file system.

Architecture Layout

Figure 1 shows the architecture layout.

Architecture Layout

Figure 1. Architecture Layout

Source system used in these examples:

  • Hardware: Sun Fire V440 server with four UltraSPARC 3i CPUs (1593 MHz) and 8 GB of RAM
  • Operating system: Oracle Solaris 8 2/04 plus the latest recommended patch set

Target system used in these examples:

Example That Preserves Host Information

In this example, we will preserve the host information.

Setting Up the Control Domain

  1. Create a virtual console concentrator (vcc) service for use by the virtual network terminal server daemon (vntsd) and as a concentrator for all logical domain consoles:

    primary# ldm add-vcc port-range=5000-5100 primary-vcc0 primary
    
  2. Create a virtual disk server (vds) to allow importing virtual disks into a logical domain:

    primary# ldm add-vds primary-vds0 primary
    
  3. Determine the primary network interface, which will be used to create a virtual switch service (vsw).

    The following example shows the primary network interface on an Oracle Solaris 11 system. The system's primary network interface is net0, which is the generic name of the data link on igb0.

    primary# dladm show-phys
    LINK   MEDIA      STATE   SPEED   DUPLEX   DEVICE
    net0   Ethernet   up      1000    full     igb0
    net1   Ethernet   up      1000    full     igb1
    
  4. Create a virtual switch service (vsw) to enable networking between virtual network (vnet) devices in logical domains.

    primary# ldm add-vsw net-dev=net0 primary-vsw0 primary
    
  5. Verify that the services have been created by using the list-services subcommand, as shown in Listing 1.

    primary# ldm list-services primary
    VCC
    NAME         LDOM    PORT-RANGE
    primary-vcc0 primary 5000-5100
    VSW
    NAME LDOM MAC NET-DEV ID DEVICE LINKPROP DEFAULT-VLAN-ID PVID VID MTU MODE INTER-VNET-LINK
    primary-vsw0 primary 00:14:4f:fb:44:4d net0 0 switch@0 1 1 1500 on
    VDS
    NAME         LDOM VOLUME OPTIONS MPGROUP DEVICE
    primary-vds0 primary
    

    Listing 1. Example

  6. Determine whether you have cryptographic devices in the control domain.

    Note: Only Oracle's UltraSPARC T2, UltraSPARC T2+, and SPARC T3 platforms might have cryptographic devices.

    primary# ldm list -o crypto primary
    
  7. Assign cryptographic resources to the control domain, if applicable.

    primary# ldm set-mau 1 primary
    
  8. Assign virtual CPUs to the control domain:

    primary# ldm set-vcpu 8 primary
    
  9. Initiate a delayed reconfiguration on the control domain:

    primary# ldm start-reconf primary
    
  10. Assign memory to the control domain:

    primary# ldm set-memory 4G primary
    
  11. Add a logical domain machine configuration to the service processor (SP). For example, the following command adds a configuration called initial.

    primary# ldm add-config initial
    
  12. Verify that the configuration is ready to be used at the next reboot:

    primary# ldm list-config
    factory-default
    initial [next poweron]
    
  13. Reboot the system.

    primary# init 6
    

    After the system reboots, Oracle VM Server for SPARC is enabled and the system is configured with one domain: the control domain, primary. From the control domain, you can create and configure additional domains.

  14. Ensure that the Logical Domains Manager (ldmd) and the Virtual Network Terminal Server (vntsd) services are enabled.

    primary# svcadm enable ldmd
    primary# svcadm enable vntsd
    

Setting Up the Guest Domain

After the control domain has been configured, create the guest domain, which hosts the Oracle Solaris 8 branded zone. The guest domain, ldg1, is initially created with the following resources:

  • Eight GB of memory
  • Twenty-four CPUs
  • One virtual network interface (vnet0) that is connected to the virtual switch, primary-vsw0
  • A second virtual network interface (vnet1) that will be used by the Oracle Solaris 8 branded zone using an exclusive IP address, which has its own IP-related state and one or more dedicated data links
  • One virtual disk that appears as c0d0 in the guest domain; the domain ldg1 uses disk c3t1d0 from the control domain

Note: Disks often appear with different names on different servers.

Run the following commands to set up the guest domain.

  1. Create a guest domain named ldg1.

    primary# ldm add-domain ldg1
    
  2. Add 24 virtual CPUs to guest domain ldg1.

    primary# ldm add-vcpu 24 ldg1
    
  3. Add 8 GB of memory to guest domain ldg1.

    primary# ldm add-memory 8G ldg1
    
  4. Add a virtual network device with the following specifics to guest domain ldg1.

    primary# ldm add-vnet vnet0 primary-vsw0 ldg1
    primary# ldm add-vnet vnet1 primary-vsw0 ldg1
    
  5. Specify the device to be exported by the virtual disk server as a virtual disk to the guest domain.

    primary# ldm add-vdsdev /dev/dsk/c3t1d0s2 vol1@primary-vds0
    
  6. Add a virtual disk to the guest domain.

    The following example adds a virtual disk to guest domain ldg1, where:

    • vdisk1 is the name of the virtual disk.
    • vol1 is the name of the existing volume to which to connect.
    • primary-vds0 is the name of the existing virtual disk server to which to connect.
    primary# ldm add-vdisk vdisk1 vol1@primary-vds0 ldg1
    
  7. Set the auto-boot? and boot-device variables for the guest domain.

    The following commands set auto-boot? to true and boot-device to vdisk1 for guest domain ldg1.

    primary# ldm set-var auto-boot\?=true ldg1
    primary# ldm set-var boot-device=vdisk1 ldg1
    
  8. After the domain is created, bind and start the guest domain from the control domain by using the following commands:

    primary# ldm bind-domain ldg1
    primary# ldm start-domain ldg1
    
  9. Determine the console port for the domain.

     primary# ldm ls ldg1
     NAME STATE  FLAGS  CONS VCPU MEMORY UTIL     UPTIME
     ldg1 active -n---- 5000 24   8G     0.0%     1h 1m
     
  10. Access the console of the ldg1 domain by using the telnet command.

    primary# telnet localhost 5000
    
  11. After the guest domain is started, ensure that the appropriate Oracle Solaris OS (we will use Oracle Solaris 10 08/11 for this example) and patches are installed in the guest domain.

    You can perform the installation over the network, from a DVD, or by using a DVD ISO image. Refer to the Oracle VM Server for SPARC 2.2 Administration Guide.

  12. Upon successful completion of the Oracle Solaris installation on the guest domain, verify that all the Oracle Solaris services on the guest domain are up and running using the svcs -xv command:

    guest# svcs -xv
    

    If all the services are up and running, the command should return nothing.

Installing Oracle Solaris Legacy Containers

The Oracle Solaris Legacy Containers product bundles together Oracle Solaris 8 Containers and Oracle Solaris 9 Containers. With Oracle Solaris Legacy Containers, it's easy to move existing Oracle Solaris 8 and Oracle Solaris 9 application environments onto new, cost-effective, and more powerful systems that run the Oracle Solaris 10 OS.

Oracle Solaris Legacy Containers provides the following:

  • The P2V (physical to virtual) Archiver tool, which automatically archives, converts, and moves the original image—either Oracle Solaris 8 or Oracle Solaris 9—to the target Oracle Solaris 10 system
  • Oracle Solaris 8 Containers and Oracle Solaris 9 Containers, which provide the runtime environment for the migrated applications
  • A perpetual license and premier support for one year

The download for Oracle Solaris Legacy Containers includes two versions of the product:

  • Oracle Solaris Legacy Containers 1.0.1, which is for Oracle Solaris 10 10/08 or later
  • Oracle Solaris Legacy Containers 1.0, which is for Oracle Solaris 10 08/07 or Oracle Solaris 10 05/08

Both product versions contain identical features. The 1.0.1 product depends on Oracle Solaris packages introduced in Oracle Solaris 10 10/08. The 1.0 product provides these packages to pre-10/08 versions of Oracle Solaris.

We will use the Oracle Solaris Legacy Containers 1.0.1 since we are using Oracle Solaris 10 08/11 for this example.

To install Oracle Solaris Legacy Containers 1.0.1, do the following:

  1. Download the Oracle Solaris Legacy Containers software bundle.

    The easiest way to find the download is to go to the Software Downloads page and then scroll down and click Solaris Legacy Containers.

  2. Unarchive and install the Oracle Solaris Legacy Containers 1.0.1 software package:

    guest# unzip solarislegacycontainers-solaris10-sparc.zip
    guest# cd solarislegacycontainers/1.0.1/Product
    guest# pkgadd -d `pwd` SUNWs8brandk
    

    Refer to the README file for further installation instructions, if necessary.

Starting the Migration

  1. On the source system, run the following command:

    sol8# su - oracle
    
  2. Shut down Oracle Database:

    sol8$ sqlplus "/as sysdba"
    SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 26 13:19:48 2012
    Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
    
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> shutdown immediate
    
  3. Shut down the Oracle Automatic Storage Management instance, as shown in Listing 2:

    sol8$ export ORACLE_SID=+ASM
    sol8$ sqlplus "/as sysdba" 
    
    SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 26 13:21:38 2012
    Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
    
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> shutdown
    ASM diskgroups dismounted
    ASM instance shutdown
    

    Listing 2. Shutting Down the Automatic Storage Management Instance

  4. Stop the listener:

    sol8$ lsnrctl stop
    LSNRCTL for Solaris: Version 10.2.0.5.0 - Production on 26-AUG-2012 13:23:49
    Copyright (c) 1991, 2010, Oracle. All rights reserved.
    
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    The command completed successfully
    

Creating the Archive

  1. Use the flarcreate command to create the system archive.

    In the following example:

    • -S specifies that we skip the disk space check and do not write archive size data to the archive. The result is a significant decrease in the time it takes to create an archive.
    • -n specifies the image name.
    sol8# flarcreate -S -n s8-system /export/home/s8-system.flar
    

    See the flarcreate(1M) for more advanced archive creation examples.

  2. Copy the archive to the target guest domain.
  3. On the target system, move the SAN storage and connect it to the target system.
  4. On the control domain, add the SAN storage LUN, which includes the Oracle Automatic Storage Management file system (c5t40d0s6) into the guest domain:

    primary# ldm add-vdsdev /dev/dsk/c5t40d0s6 oradata@primary-vds0
    primary# ldm add-vdisk oradata oradata@primary-vds0 ldg1
    
  5. On the guest domain, verify that you can access the LUN.

    The LUN appears as c0d2 in the guest domain and it is a LUN from the storage array (c5t40d0s6) added by the control domain.

    Note: LUNs often appear with different names on different servers.

    guest# format
    Searching for disks...done
    
    AVAILABLE DISK SELECTIONS:
    0. c0d0
    /virtual-devices@100/channel-devices@200/disk@0
    1. c0d2
    /virtual-devices@100/channel-devices@200/disk@2
    
  6. Verify that the guest domain has the second network interface (vnet1):

    guest# dladm show-dev vnet1
    
  7. Use the zonecfg command to set up the Oracle Solaris 8 branded zone, s8-zone, on the guest domain.

    Listing 3 shows the output of the zonecfg -z s8-zone info command after the configuration is complete.

    guest# zonecfg -z s8-zone info 
    zonename: s8-zone
    zonepath: /zones/s8-zone
    brand: solaris8
    autoboot: true
    bootargs:
    pool:
    limitpriv: default,proc_priocntl,proc_lock_memory
    scheduling-class: FSS
    ip-type: exclusive
    hostid:
    net:
            address not specified
            physical: vnet1
            defrouter not specified
    device
           match: /dev/rdsk/c0d2s0
    attr:
            name: machine
            type: string
            value: sun4u
    

    Listing 3. Setting Up the Branded Zone

  8. Install the Oracle Solaris 8 zone using the zoneadm command.

    In the following example:

    • -z specifies the zone name.
    • -p specifies that we preserve system identity.
    • -a specifies the archive location.
    guest# zoneadm -z s8-zone install -p -a /export/home/s8-system.flar
    
  9. Boot the Oracle Solaris 8 zone:

    guest# zoneadm -z s8-zone boot
    guest# zlogin -C s8-zone 
    sol8_zone# su - oracle
    
  10. Modify the Oracle Automatic Storage Management disk ownership:

    sol8_zone# chown oracle:dba /dev/rdsk/c0d2s0 
    
  11. Start the Oracle listener:

    sol8_zone$ lsnrctl start
    
  12. Start the Oracle Automatic Storage Management instance, as shown in Listing 4:

    sol8_zone$ export ORACLE_SID=+ASM
    sol8_zone$ sqlplus / as sysdba
    
    SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 26 14:36:44 2012
    Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
    
    Connected to an idle instance.
    
    SQL> startup
    ASM instance started
    
    Total System Global Area 130023424 bytes
    Fixed Size 2050360 bytes
    Variable Size 102807240 bytes
    ASM Cache 25165824 bytes
    ASM diskgroups mounted
    SQL> quit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    

    Listing 4. Starting the Oracle Automatic Storage Management Instance

  13. Start the database, as shown in Listing 5:

    sol8_zone$ export ORACLE_SID=ORA10
    sol8_zone$ sqlplus / as sysdba
    
    SQL*Plus: Release 10.2.0.5.0 - Production on Sun Aug 26 14:37:13 2012
    Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
    
    Connected to an idle instance.
    
    SQL> startup
    ORACLE instance started.
    
    Total System Global Area 1610612736 bytes
    Fixed Size 2052448 bytes
    Variable Size 385879712 bytes
    Database Buffers 1207959552 bytes
    Redo Buffers 14721024 bytes
    Database mounted.
    Database opened.
    

    Listing 5. Starting Oracle Database

Example That Changes Host Information

In the first example, we preserved the host information, which includes the host name, IP address, and name services configuration. Sometimes during P2V migration, we need to change the host information, for example, changing the IP address or host name.

In this second example, we will modify the host name. All the steps are the same as in the first example until you reach the point where you install the Oracle Solaris 8 zone. At that point, use the following steps instead.

  1. Run the following command:

    guest# zoneadm -z s8-zone install -u -a /net/server/s8_image.flar
    
  2. Boot the Oracle Solaris 8 zone:

    guest# zoneadm -z s8-zone boot
    
  3. Configure the zone with a new IP address and a new host name:

    guest# zlogin -C s8-zone
    
  4. Modify the Oracle Automatic Storage Management disk ownership:

    sol8_zone# chown oracle:dba /dev/rdsk/c0d2s0
    sol8_zone# cd $ORACLE_HOME/bin
    
  5. Reconfigure the Oracle Automatic Storage Management parameters, as shown in Listing 6:

    sol8_zone# ./localconfig delete
    
    Aug 27 05:17:11 s8-zone last message repeated 3 times
    Aug 27 05:17:28 s8-zone root: Oracle CSSD being stopped
    Stopping CSSD.
    Unable to communicate with the CSS daemon.
    Shutdown has begun. The daemons should exit soon.
    sol8_zone# ./localconfig add
    
    Successfully accumulated necessary OCR keys.
    Creating OCR keys for user 'root', privgrp 'other'..
    Operation successful.
    Configuration for local CSS has been initialized
    
    sol8_zone# su - oracle
    

    Listing 6. Reconfiguring Parameters

  6. Start the listener, Oracle Automatic Storage Management, and Oracle Database the same way you did in the first example.

See Also

For more information about installing Oracle Solaris on a guest domain, see the "Installing Oracle Solaris OS on a Guest Domain" section of the Oracle VM Server for SPARC 2.2 Administration Guide.

About the Author

Orgad Kimchi is a principle software engineer on the ISV Engineering team at Oracle (formerly Sun Microsystems). For 5 years he has specialized in virtualization and cloud computing technologies.

Revision 1.0, 10/10/2012

facebook banner twitter banner