Thursday, February 2, 2017

ZFS basics

  •  Create a zpool named zonepool :
zpool create  zonespool c0t5000C5001D250C7Fd0   c0t5000C5001D207157d0
 zpool create -f oraclePool c0t5000C50007F554E3d0
  • Create a FS namely zones in that pool
zfs create zonepool/zones


  • Set a quota on files system

zfs set quota=10G zonepool/zones

  • Create a ZFS volume
zfs create -V 20gb zonepool/zones


  • Destroy zfs fs:

zfs destroy  zonepool/zones
  • List the disks of all the zpools
zpool status
  • List the file hierarchy
zfs list
root@T5-2-SDB-1:/# zfs list -r odsRoot
NAME                USED  AVAIL  REFER  MOUNTPOINT
odsRoot             103G  30.7G    31K  /odsRoot
odsRoot/zone1Root  51.6G  82.3G    16K  -
odsRoot/zone2Root  51.6G  82.3G    16K  -



  • Destroy the zpool

zpool destroy zonespool



  • Create Zvol from zpool :
 ZFS volume is a dataset that represents a block device. ZFS volumes are identified as devices in the /dev/zvol/{dsk,rdsk}/pool directory.



root@T5-2-SDB-1:/# zpool destroy zoneRoot
root@T5-2-SDB-1:/# zpool create -f odsRoot c0t5000CCA00089FA88d0
root@T5-2-SDB-1:/# zpool list
NAME        SIZE  ALLOC  FREE  CAP  DEDUP  HEALTH  ALTROOT
odsRoot     136G   126K  136G   0%  1.00x  ONLINE  -
oraclePool  136G    85K  136G   0%  1.00x  ONLINE  -
rpool       556G   340G  216G  61%  1.00x  ONLINE  -
root@T5-2-SDB-1:/# zfs create -v  50G oraclePool/zone1
invalid option 'v'
For more info, run: zfs help create
root@T5-2-SDB-1:/# zfs create -V  50G oraclePool/zone1
root@T5-2-SDB-1:/# zfs create -V 50G oraclePool/zone2
root@T5-2-SDB-1:/# zfs create -V 50G odsRoot/zone1Root
root@T5-2-SDB-1:/# zfs create -V 50G odsRoot/zone2Root
root@T5-2-SDB-1:/# ^C

root@T5-2-SDB-1:/# zfs list odsRoot
NAME     USED  AVAIL  REFER  MOUNTPOINT
odsRoot  103G  30.7G    31K  /odsRoot
root@T5-2-SDB-1:/# zfs list oraclePool
NAME        USED  AVAIL  REFER  MOUNTPOINT
oraclePool  103G  30.7G    31K  /oraclePool




Thursday, October 13, 2016

Oracle Database 12c does not acknowledge parallel_min_server value to be lower than default


When I changed the value of parallel_min_server from 512 to 256, the change did not take place Although parallel_min_servers was set to 256, Oracle continue to start 512 processes at startup.


SQL> show parameters parallel_min_servers ;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
parallel_min_servers                 integer     512



SQL> alter system set parallel_min_servers=256 ;

System altered.

SQL> show parameters parallel_min_servers;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
parallel_min_servers                 integer     256
SQL> shutdown
SQL> startup



However, the number of ora_p0* process continued to be 512

Even the system view showed the process count to be 512

SQL> set line 80
SQL> set tab off
SQL> col statistic for a30
SQL>
SQL> select * from v$px_process_sysstat where statistic like '%Server%';

STATISTIC                           VALUE     CON_ID
------------------------------ ---------- ----------
Servers In Use                          0          0
Servers Available                     512          0
Servers Started                       512          0
Servers Shutdown                        0          0
Servers Highwater                       0          0
Servers Cleaned Up                      0          0
Server Sessions                         0          0

7 rows selected.

SQL>


According to metalink note 1678111.1, this is a known/expected behaviour. In Oracle DB 12c ,there is no lower level permissible any longer that is lower than the default

Tuesday, October 7, 2014

ZFSSA: HCC, Clone a File System

  • Upgrade to or install 11.2.0.3
  • Install patch 13041324 or 11.20.3 Patch set update (PSU) 13343438 which contains 13041324. and Verify that the patch is installed.

-bash-4.1$ ./opatch lsinventory

  • Setup snmp service for the ZFS appliance.
Click on Configuration->Services->System Settings.
Click on SNMP.Set up the following info:
  • SNMP community name :public
  • Authorized network : 0.0.0.0/0
  • Appliance Contact: ritu.kamboj@oracle.com
  • Trap destination: 127.0.0.1
On right side, click on SNMP:Help to get help on the fields:
SNMP community nameThis is the community string that SNMP clients must provide when connecting
Authorized networkThe network which is allowed to query the SNMP server, in CIDR notation. To block all clients, use 127.0.0.1/8 (localhost only); to allow all clients, use 0.0.0.0/0
Appliance contactThe string served by MIB-II OID .1.3.6.1.2.1.1.4.0. Setting this to a person or department's name will help SNMP clients determine who is responsible for this appliance
Trap destinationsThe hostnames or IP addresses for sending SNMP traps to. Custom SNMP traps can be configured in the Alerts section. Set this to 127.0.0.1
Go back to services and restart the snmp service

On the server side, ensure that SNMP service is enabled:
# svcs | grep snmp
online         Jun_30   svc:/application/management/net-snmp:default
Issue the snmp get command to ensure that snmp services are operational.
$ /usr/bin/snmpget -v1 -c public 10.129.195.209 1.3.6.1.4.1.42.2.225.1.4.2.0
SNMPv2-SMI::enterprises.42.2.225.1.4.2.0 = STRING: "Sun ZFS Storage 7420"

Refer to ZFS snmp docs for additional info about installed MIB:
  •  Verify dNFS is configured by querying v$dnfs_servers
Refer to following DOC to configure DNFS
Step by Step - Configure Direct NFS Client (DNFS) on Linux (11g) (Doc ID 762374.1)

Check alert log file for the following message to ensure that dNFS is successfully configured :
grep -i nfs alert*
alert_hcc.log:Oracle instance running with ODM: Oracle Direct NFS ODM Library Ve

rsion 3.0
alert_hcc.log:Direct NFS: channel id [0] path [10.129.195.209] to filer [10.129.
195.209] via local [] is UP
alert_hcc.log:Direct NFS: channel id [1] path [10.129.195.209] to filer [10.129.
195.209] via local [] is UP


Additonal info:

  

./opatch[103]: whereis: not found [No such file or directory]
Invoking OPatch 11.2.0.1.7
Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation.  All rights reserved.
Oracle Home       : /oraclePool/11g/u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /oraclePool/12c/u01/app/oraInventory
   from           : /var/opt/oracle/oraInst.loc
OPatch version    : 11.2.0.1.7
OUI version       : 11.2.0.3.0
Log file location : /oraclePool/11g/u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2012-07-12_18-44-26PM.log
Lsinventory Output file location : /oraclePool/11g/u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2012-07-12_18-44-26PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g                                                  11.2.0.3.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch  13343438     : applied on Thu Jul 05 16:53:14 GMT-08:00 2012
Unique Patch ID:  14273862
Patch Description:  "Database Patch Set Update : 11.2.0.3.1 (13343438)"
   Created on 30 Dec 2011, 03:13:30 hrs PST8PDT
   Bugs fixed:
     12847466, 13499128, 12718090, 12917230, 13035804, 12938841, 13528551
     12861463, 12620823, 12950644, 13466801, 13041324, 12998795, 13343438
     13492735, 13362079, 9873405, 12797765, 12834027, 9703627, 12905058
--------------------------------------------------------------------------------
OPatch succeeded.

-








  • On ZFSSA there exist a project named oracle. It has a FS named test which is mounted as /export/test. Follow the following step to create a snapshot of /export/test and clone that snapshot



  • Create a new project named clone. (Shares->Project->Clone)
  • Snapshot the project that you need to clone. (Shares->Shares->Edit oracle Project->Create a snapshot snap1)
  • Promote the snapshot to a clone (Shares->Shares->Edit Oracle/test->Snapshot->Edit snap1 ->Select Clone snapshot as a new share)
  • Mount the new FS


Creation of CDB

The following blog explains how to create a CDB named cdbtest containing 1 PDB  named pbdtest
  • export ORACLE_SID=cdbtest
  • To be authenticated with a password file create a password file
  • Create the initialization parameter file
  • Connect to the instance
  • Create a server parameter file
  • Start the instance with nomount option
  • Issue the create database

The create database command has following additional clause to indicate that it is CDB

enable pluggable database
seed file_name_convert=('/u01/app/oracle/oradata/testcdb', '/u01/app/oracle/oradata/pdbseed')

Enable pluggable database clause creates a CDB with a root and a seed

The seed file_name_convert generates file names for the seed's file in /u01/app/oracle/oradata/pbdseed directoru using filenames in the /u01/app/oracle/oradata/testcdb directory.

After you create a CDB it consist of the root and the seed.

  • Create additional tablespaces if required
  • Run scripts to build data dictionary views

The following three scripts needs to be run:
catalog.sql
catproc.sql
pubbld.sql

  • Create PDBs to store user data,.
You can create a PDB from the seed using the create pluggable database statement.
create pluggable database testpdb admin user testpdb identified by test123 file_name_convert=('/test1/bench/pdbseed','/test1/bench/testpdb' );
  • PDB is now in mount state, modify its mode to OPEN
alter pluggable database testpdb open ;

  •  Set the current session to point to PDB
alter session set container=testpdb ;
  • Create a local user which will own the schema
create user test identified by test;
grant dba to test;
  • Clone a pbd from existing pdb.
A PDB namely testpdb exist. We need to clone this pbd and call the cloned PDB as clonePDB
Open source pdb in read-only mode
create pluggable database clonepdb from testpdb file_name_convert=('/testpbd,'clonepdb') ;
; change the mode to open


  • Is it a CDB or a non-CDB database
select cdb from V$database

  • What does the various con_id stand for:

con_id        desc
0                    the data pertains to entire PDB
1                     the data pertains to the root (oracle metadata)
2                    the data pertains to the seed
3                    the data pertains to the PDB


  • How many tablespace do I have after I create a CDB containing 1 PDB:

SQL> select name,con_id from v$tablespace;

NAME                               CON_ID
------------------------------ ----------
SYSTEM                                  1
SYSAUX                                  1
UNDOTBS1                                1
USERS                                   1
TEMP                                    1
SYSTEM                                  2
SYSAUX                                  2
TEMP                                    2
SYSTEM                                  3
SYSAUX                                  3
TEMP                                    3

NAME                               CON_ID
------------------------------ ----------
USERS                                   3


The root ,seed and PDB has system, sysaux and temp tablespace each.

Additionally , the root container has UNDO tablespace . Root and PDB conainters also has user tablespace.


  • What is my user and con_id and con_name

SQL> show user;
USER is "SYS"
SQL> show con_id;

CON_ID
------------------------------
1
SQL> show con_name

CON_NAME
------------------------------


  • How many PDBs are exist in a given CDB


cdb_pdbs or dba_pdbs
How many containers does it have:

Getting started with AWR

  • Do I have license to enable AWR reports:
 Enterprise editions have license for AWR and tuning packs. Check Control_management_pack_access parameter to figure out which server manageability pack is active.The following packs are available:
  • The DIAGNOSTIC pack includes AWR, ADDM, and so on.
  • The TUNING pack includes SQL Tuning Advisor, SQLAccess Advisor, and so on.
The default value for this parameter in Enterprise Edition is  DIAGNOSTIC+TUNING and for all other editions is none.
SQL> show parameters control_management%;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_management_pack_access       string      DIAGNOSTIC+TUNING



  • Is AWR enabled on my server:
Gathering database statistics using the AWR is enabled by default and is controlled by the STATISTICS_LEVEL parameter. The statistics_level paramter should be set to TYPICAL or ALL to enable statistics gathering by the AWR
In the following example, AWR reporting is disabled.
SQL> show parameters statistics_level ;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
statistics_level                     string      BASIC
You can enable it with the following statement :
  • alter system set statistics_level='ALL';




  • How often are AWR reports generated:
By default , snapshots are captured once every hour and retained in the database for 8 days.

SQL> SQL> col retention format a20
SQL>  col snap_interval format a20
SQL> select dbid, snap_interval, retention from dba_hist_wr_control;

   DB Id    SNAP_INTERVAL        RETENTION
----------- -------------------- --------------------
 1622729499 +00000 01:00:00.0    +00008 00:00:00.0

 You can adjust the interval  and retention of snapshot generation by issuing the following command:
EXECUTE DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS(
  interval  =>  60,
  retention =>  20160);


Interval is specified in minutes

The following script manually generates AWR report:
if [[ $# -lt 1 ]]
then
  echo "runawr.sh  <DELAY(RUNTIME)> "
  exit 1
fi
RUNTIME=$1
sqlplus / as sysdba << !
execute dbms_workload_repository.create_snapshot();
!
sleep $RUNTIME
sqlplus / as sysdba << !
var  endSnapshot number ;
var startSnapshot number;
var startSnapshot number;
var myDbid number ;
var myInst      number;
execute select dbms_workload_repository.create_snapshot() into :endSnapshot from dual ;
execute select :endSnapshot - 1  into :startSnapshot from dual;
show user ;
execute select dbid into :myDbid from v\$database;
execute select instance_number into :myInst from v\$instance;
print :endSnapshot ;
print :startSnapshot ;
print :myDbid ;
print :myInst;
spool awr_report.txt
select * from table (dbms_workload_repository.awr_report_text(:myDbid,:myInst,:startSnapshot,:endSnapshot));
!

Wednesday, January 15, 2014

Pluggable Database Concepts

An Oracle Database instance is combination of SGA and group of background processes. An Oracle database is a group of files that contain data. In a single instance db, there  is a 1 to 1 relationship between an instance and a database. In a RAC environment, there are many to 1 relationship between instance and DB.

To have multiple DB on the same machine, you need to run multiple DB instance. So, in a single instance DB, if you have 3 mounted DB, you will need 3 DB instances. With PDB, the idea is to remove this duplication of resources and to share one DB instance with multiple DBs now referred to as CDBs.


A container Database (CDB) contains Plugable database (PDB)

A container database consists of following three components each of which is called a container
  • the root container (CDB$ROOT) which contains metadata for Oracle supplied objects
  • Seed PDB (PBD$SEED) which contains metadata for user supplied objects
  • PDBs which are generated by cloning seed PBD and assigned a unique ID upon creation.


At a physical level, the CDB has a database instance and database files, just as a non-CDB does.

The following files exist only in root container:
  • The redo log files
    • The redo log files are common for the whole CDB and therefore the information it contains is annotated with the identity of the PDB where a change occurs. All PDBs in a CDB share the ARCHIVELOG mode of the CDB
  • The control file
    • The control files are also common for the whole CDB. The control files are updated to reflect any additional tablespaces and datafiles of plugged PDBs.
    • Add info about undo tbsp ??
Following files exist either  in  both root container and user container or in one of them(PDBs and seed PDBs together form user container)
  • Temporary tbsp (required in root ;optional in user container):
    • A temporary tbsp is required in the root container.  This tbsp is optional in PDB. Each PDB can hold its own temporary tbsp for its own local users.
  • System and SysAux tablespace (required in both containers)
    • Each container has its own data dictionary stored in its proper SYSTEM tbsp ,containing its own metadata and a SYSAUX tbsp.
  • User tablespace (only in user container)
    • The PDBs can create their tbsp according to its application needs
Each datafile is associated with a specific container , named CON_ID.



There are four ways to provision a PDB:
  • Create a new PDB from seed PDB
  • Plug in a non-CDB as a PDB
  • Clone a PDB from another PDB (in same or another CDB)
  • Plug a unplugged PDB into another CDB. (However, a PDB can be plugged into only one CDB at a time)
You can plug or unplug a PDB from a CDB. A PDB can be plugged into only one CDB at a time.A CDB has a common users which can log in as root and adminster the PDB.You can create a CDB by either DBCA tool or by create database sql.

When you create a CDB, you can specify how many PDBs it will contain. Once the CDB is created, you can use DBCA to plug and unplug PDBs

When you create a CDB using a CREATE DATABASE sql statement, you must enable PDBs (by specifying enable PLUGGABLE DATABASE clause) and specify the names and locations of the seed's files.



Backup and Recovery:
  • Backup :
RMAN will support backup and recovery of a CDB that contains zero or more PDBs. All RMAN operations will be performed while connected as root of a CDB. An individual PDB is not a valid RMAN target  db. New syntax, namely Pluggable Database, is introduced to allow backup of CDB.
  • Recovery:
On a CDB, the recovery can be done for the entire CDB, for a PDB, a tbsp, a datafile or even a block.
If the files in the root container are lost (namely redo log file, control files, temp tbsp, ...)the only possible  recovery is once CDB is in a mounted state.





Wednesday, January 8, 2014

How to create “Cold” RMAN Backup

 

This blog entry describes how to take rman backup of a database with NOARCHIVELOG mode. The only option you have to take backup of a NOARCHIVELOG mode database is to take consistent whole database backup.

The characteristic of a consistent backup is as under:

  • All read/write datafiles and control files are checkpointed with the same system change number (SCN)
  • A consistent backup does not need recovery after it is restored as all files in the backup are guaranteed to contain all changes up to the same SCN.

The steps involved in taking consistent backup as as under:

  • Make sure the database is shutdown properly.
    • If the database is not shut down consistently, for example, an instance fails or you issue a “shutdown abort” statement, then the datafiles are always inconsistent and hence your restore will fail. The script is shutting down the database twice as to ensure that the datafiles are in consistent state.
  • Startup the database in mount option
  • Configure the location where you need to take the backup
    • The script is backing up the database on an disk at ‘backupPool/backup’ directory
  • Configure autobackup of controlfile and specify a location where control file will be backed up.
  • Backup the complete database

Here is the script to take cold rman backup:

#!/bin/sh
echo "Taking backup of $ORACLE_SID\n"
#rman target /  log=backupbench.log << !


shutdown immediate ;
startup  pfile=p_build.ora force dba;
shutdown immediate;
startup pfile=p_build.ora mount ;


configure device type disk parallelism 15 backup type to  backupset ;
configure channel device type disk format '/backupPool/backup/ora_df%t_s%s_s%p' ;
configure controlfile autobackup on ;
configure controlfile autobackup format for device type  disk to  '/backupPool/backup/cf_%F' ;

backup database tag 'JGD_create';
alter database open;
exit
!

Wednesday, July 10, 2013

Pluggable Database : An Introduction


What is PDB:


Pluggable database , also referred to as Multitenancy, is the new option of Oracle Database 12c that enables dense database consolidation, rapid provisioning and rapid cloning as well as rapid patching and upgrades. It enables the administrators to manage many databases as one and allows resource management between databases.

In 12c, you can create two types of database: container database and non container database. Container database, referred to as CDB, is the database that can contain several PDBs. Non-container database, referred to as non-CDB, is the regular database that existed prior to 12c.

Multitenacy is  just a deployment choice. When you create a database, you choose whether you want to create a CDB or a non-CDB. Once you make that choice and create the  database, nothing else changes. The way you connect to database and the way you interact with database remains the same for both CDB and non-CDB.


Business challenges that PDB address:


Prior to 12c , database consolidation would happen through one of the following two ways:

1) Server or OS consolidation: You would start several database instances on a single server. Each instance would be on a server virtualized environment like  LDOMs or on an OS virtualized environment such as Solaris Containers.The advantages of this approach is that it provides complete isloation and maximum security. No two distinct database users can ever meddle with each other..as there are usually that many instances as the number of databases. This form of database consolidation cannot provide very dense consolidation as it is not sharing any of the database resources: there are as many copies of Oracle background process and SGA as there are databases so the system very soon exhaust its CPU and memory.

2) Consolidation in the database : You would enable schema based consolidation where each database is represented as a schema in a single monolithic database instance.In this approach, you can consolidate lot of database (schema) into one database instance thereby attaining dense database consolidation. However, the disadvantages are its weak or no name space isolation and very weak security model. A database user can view/change data of another database schema.

Pluggable database provides database consolidation within the database. In a way, it is  a supported version of schema based consolidation with all disadvantages of schema based consolidation removed. Additionally,  it also provides additional features like pluggability and rapid cloining.

 Introduction to Multitenancy architecture:

 

At a higher level, an Oracle Database consist of Oracle Database Instance and Oracle Database. The instance consist of group of Oracle background process and a shared memory. The database consist of group of data files; some of which contain the user data and some contain Oracle system data. When you start an Oracle database, you essentially have a bunch of Oracle background processes, a bunch of shared memory and data files for storing the data. And this gets replicated for each database that is created. So, each database needs additional shared memory and series of Oracle database process....which quickly consumes the available server resources.

With multitenant architecture you can create an empty container database and then plug in the databases as PDBs. Now you are using just one SGA and one set of Oracle database processing thereby saving the system resources to enable dense database consolidation

By consolidating existing databases as PDBs, administrators can manage many databases as one. For example, tasks such as backup and disaster recovery are performed at the level of the CDB. The multitenant architecture also provides the flexibility to take backups and perform point-in-time recovery at the PDB level, if required. 

At a physical level Oracle database consist of a bunch of files: data files as well as bootstrap files like control files, spfile and so on. The physical data files implements the logical entity tablespace which in turn implements tables. Tables hold only three kinds of data

1) metadata that describes the oracle System
2) Metadata that describes the user schema
3) Actual user data .

Prior to 12c, the metadata that describes Oracle system and the metadata that describes user schema were stored collectively in a set of tables that are referred to as data dictionary. This data dictionary tables were stored in dedicated tablespace namely System and Sysaux.


Initially when you create the database, the data dictionary tables only have Oracle system related metadata. Later on when user creates its own data, the data dictionary tables contain user and system metadata. And the user tablespace contains only user data.

Now, if you want to transport a user tablespace from one database to another, you can simply copy the data files containing the tablespace from database location to another . However, you will have to go through the data dictionary view to find out user metadata information and then transport it. If the user metadata information was stored seperately from the Oracle sytem metadata,  than you could simply copy user's tablespace metadata  from one location to another to transport a tablespace.

Hence , in 12c the data dictionary tables got horizontally partitioned;  one partition containing Oracle System metadata is stored in CDB$root container  and another  partition container user data related metadata is stored in the PDB. Now, transporting a tablespace from one database to another means copy the data files as well as files containing the metadata information of user schema. The user related metadata is stored in SYSTEM and SYSAUX tablespaces of PDB and the Oracle metadata is stored in SYSTEM and SYSAUX tablespaces of CDB$root

In other words, each data dictionary table now occurs twice, once for Oracle System and once for the user schema. Every query against a data dictionary table is now a union between the two occurrences of that table.

The primary physical difference between CDB’s and non-CDB is the system data files. A non-CDB has only one set of system data files. In contrast the root and each PDB in a CDB has its own SYSTEM and SYSAUX tablespaces which has its own complete set of dictionary tables describing the objects in itself.

There are two ways for provisioning new PDBs in multitenant architecture.  One is by cloining and another is plug in an previously unplugged PDB.   You clone the PDB when you want an extra copy of that PDB and you plug in a PDB when you want to move the PDB from one CDB to another. When you create a new PDB with out explicitly stating the source PDB from which you want to clone, than Oracle creates the new PDB by cloning that PDB from pdb$seed container. In other words, creation of a PDB is internally a clone operation.


  These operations are done using SQL commands. which  can be executed from any client machine and, hence, access privileges to the server machine are not needed. In addition, the SQL commands can be run in parallel thereby reducing execution times. They can also be programmed in PL/SQL to automate the process of provisioning and cloning.


Thursday, January 17, 2013

Steps to create container for Oracle DB installation

  • Create a vnic named public1

dladm create-vnic public1 -l net0
  • Create a zone.template file as under:
create -b
set zonepath=/oraclePool/zones/test
set limitpriv=default,proc_priocntl
set max-shm-memory=50G
add net
 set physical=public1
end
  • Generate sysconfig.xml file for initial zone configuration
There are two ways to generate the sysconfig.xml file
  • Generate it from scratch by issuing the following command
sysconfig create-profile -o sysconfig.xml
  • Update the hostname by searching system/identity and ip address by searching network/install on an existing sysconfig.xml file
A typical sysconfig.xml file is as under:
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="profile" name="sysconfig">
  <service version="1" type="service" name="system/config-user">
    <instance enabled="true" name="default">
      <property_group type="application" name="root_account">
        <propval type="astring" name="login" value="root"/>
        <propval type="astring" name="password" value="$5$Px97tHB0$X3mcS7MybV7fk
YTB7Z4NEDDwDJDBPEvIA41w.UmbRm."/>
        <propval type="astring" name="type" value="normal"/>
      </property_group>
    </instance>
  </service>
  <service version="1" type="service" name="system/timezone">
    <instance enabled="true" name="default">
      <property_group type="application" name="timezone">
        <propval type="astring" name="localtime" value="US/Eastern"/>
      </property_group>
    </instance>
  </service>
  <service version="1" type="service" name="system/environment">
    <instance enabled="true" name="init">
      <property_group type="application" name="environment">
        <propval type="astring" name="LANG" value="en_US.UTF-8"/>
      </property_group>
    </instance>
  </service>
  <service version="1" type="service" name="system/identity">
    <instance enabled="true" name="node">
      <property_group type="application" name="config">
        <propval type="astring" name="nodename" value="dat-zone1"/>
      </property_group>
    </instance>
  </service>
  <service version="1" type="service" name="system/keymap">
    <instance enabled="true" name="default">
      <property_group type="system" name="keymap">
        <propval type="astring" name="layout" value="US-English"/>
      </property_group>
    </instance>
  </service>
  <service version="1" type="service" name="system/console-login">
  <instance enabled="true" name="default">
      <property_group type="application" name="ttymon">
        <propval type="astring" name="terminal_type" value="vt100"/>
      </property_group>
    </instance>
  </service>
  <service version="1" type="service" name="network/physical">
    <instance enabled="true" name="default">
      <property_group type="application" name="netcfg">
        <propval type="astring" name="active_ncp" value="DefaultFixed"/>
      </property_group>
    </instance>
  </service>
  <service version="1" type="service" name="network/install">
    <instance enabled="true" name="default">
      <property_group type="application" name="install_ipv4_interface">
        <propval type="astring" name="address_type" value="static"/>
        <propval type="net_address_v4" name="static_address" value="10.129.195.211/24"/>
        <propval type="astring" name="name" value="public1/v4"/>
        <propval type="net_address_v4" name="default_route" value="10.129.195.1"/>
      </property_group>
      <property_group type="application" name="install_ipv6_interface">
        <propval type="astring" name="stateful" value="yes"/>
        <propval type="astring" name="stateless" value="yes"/>
        <propval type="astring" name="address_type" value="addrconf"/>
        <propval type="astring" name="name" value="public1/v6"/>
      </property_group>
    </instance>
  </service>
  <service version="1" type="service" name="system/name-service/switch">
    <property_group type="application" name="config">
      <propval type="astring" name="default" value="files"/>
      <propval type="astring" name="host" value="files dns"/>
      <propval type="astring" name="printer" value="user files"/>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
 <service version="1" type="service" name="system/name-service/cache">
    <instance enabled="true" name="default"/>
  </service>
  <service version="1" type="service" name="network/dns/client">
    <property_group type="application" name="config">
      <property type="net_address" name="nameserver">
        <net_address_list>
          <value_node value="130.35.249.41"/>
          <value_node value="130.35.249.52"/>
          <value_node value="144.20.190.70"/>
        </net_address_list>
      </property>
      <property type="astring" name="search">
        <astring_list>
          <value_node value="us.oracle.com oraclecorp.com oracle.com"/>
        </astring_list>
      </property>
    </property_group>
    <instance enabled="true" name="default"/>
  </service>
</service_bundle>
  • Execute the following script to configure, install and boot the zone
zoneName=test
zoneTemplate=zone.template
VNIC=public1
echo "zone template : ${zoneTemplate}

echo "Configuring the zone :${zoneName}
zonecfg -z ${zoneName} -f ${zoneTemplate}
echo "Verify that zone ${zoneName} has been configured"
zoneadm list -icv | grep ${zoneName}


echo " Install the zone : ${zoneName}"
zoneadm -z ${zoneName} install -c /tmp/sysconfig.xml
echo "Verify that zone ${zoneName} has been installed"
zoneadm list -icv | grep ${zoneName}


echo "Wait for a minute before booting the zone"
sleep 60
echo "Boot the zone : ${zoneName} "
zoneadm -z ${zoneName} boot
echo "Verify that zone ${zoneName} is running"
zoneadm list -icv | grep ${zoneName}

  • Verify if the smf services are up and running on the zone:
Issue : zlogin  test  ; svcs
If the smf services are not up, login to console for a couple of minutes and check again
zlogin -C test
  • Verify that zone is up and running

ping <zone-hostname> from global zone
ping <global-hostname> from local zone
Verify network is configured correctly in the local zone
zlogin  test
root@dat-zone1:~# dladm show-physroot@dat-zone1:~# dladm show-vnic
LINK                OVER         SPEED  MACADDRESS        MACADDRTYPE       VID
public1             ?            1000   2:8:20:af:91:c8   random            0
root@dat-zone1:~# ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
public1/v4        static   ok           10.129.195.211/24
lo0/v6            static   ok           ::1/128
public1/v6        addrconf ok           fe80::8:20ff:feaf:91c8/10
root@dat-zone1:~#


Add asm disk and the directory where the Oracle bits are available to zone and reboot the zone. 
Create a file named addtoZone.template

add device
        set match=/dev/rdsk/c2t8d3s2
        set allow-partition=true
        set allow-raw-io=true
end
add fs
   set dir=/installer
set special=/installer
set type=lofs
end
   

Reconfigure and reboot the zone


zonecfg -z test -f addtoZone.template
zonecfg -z test reboot
Prepare for Oracle installation. Install Oracle and asm

Log on to test container and execute the following script:
asmDisk=/dev/rdsk/c2t8d3s2
groupadd -g 201 dba
groupadd -g 200 oinstall
useradd -g oinstall -G dba -u 200 oracle
mkdir /export/home/oracle
chown -R oracle:oinstall /export/home/oracle
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chmod -R 775 /u01
echo "Enter password for Oracle"
passwd oracle
pkg install   SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWpool SUNWsprot SUNWtoo SUNWuiu8 SUNWfont-xorg-core SUNWfont-xorg-iso8859-1 SUNWmfrun SUNWxorg-client-programs SUNWxorg-clientlibs SUNWxwfsw  pkg://solaris/SUNWxwplt
chown oracle:oinstall ${asmDisk}
chmod 660 ${asmDisk}
Invoke grid installer and db installer to install ASM and Oracle DB.

V2V across servers : From non-global zone on one server to non-global zone on another server

I have a non-global zone, namely db1Zone, on server dat01. The following post explains the steps to migrate this zone to a non-global zone in another server dat02.

  • Create a archive of db1Zone that needs to be migrated:
zoneadm -z db1Zone shutdown
zoneadm -z db1Zone detach
zonecfg -z db1Zone export > db1Zone.cfg
zfs list -H -o name /zonespool/zones/db1Zone ; zoneroot can  be obtained from db1Zone.cfg
zfs snapshot -r zonespool/zones/db1Zone@migr
zfs send -rc zonespool/zones/db1Zone@migr > db1Zone.zfs

Detaching a zone is the first step in moving a zone from one step to anoter. Once the zone is detached,it is left in the configured state. If you try to install or clone to a configured zone that has been detached, you will receive an error message and install or clone process will fail.
  • Ensure that target server, dat02, is at the same OS patch level as source server, dat01.

  • Create the zone named db1Zone on target server
Copy db1Zone.cfg and db1Zone.zfs files to dat02 server
Make any required changes to db1Zone.cfg file. The network information will remain the same. Update any disk related info
Create the zone issuing the following command
zonecfg -z db1Zone -f db1Zone.cfg
Attach the source zone to this zone
  • zoneadm -z db1Zone attach -U -a /export/home/oracle/db1Zone.zfs
Additional info:
Errors

  • ERROR: Argument db1Zone.zfs is not a regular file
root@dat02:/export/home/oracle# zoneadm -z db2Zone attach -a db1Zone.zfs
ERROR: Argument db1Zone.zfs is not a regular file

Specify the complete path of the archive file. If the problem still exist, verify that target system is on the same OS patch level as the source system.


  • cannot receive: stream has unsupported feature, feature flags = 0

If the log file has the following info:

   Installing: This may take several minutes...
[Tue Jun  5 12:01:14 PDT 2012] gzcat /tmp/db1Zone.zfs.gz | zfs receive -F -u -x zoned rpool/zonespool/zones/db1Zone/installtmp/ds
cannot receive: stream has unsupported feature, feature flags = 0
[Tue Jun  5 12:01:14 PDT 2012] ERROR: Error: Command <zfs receive -F -u -x zoned rpool/zonespool/zones/db1Zone/installtmp/ds> exited with status 1

Verify that the target system is on the same OS patch level as the source system.

Monday, October 15, 2012

Script to find out space saving with HCC


The following scrips loops through a list of tables and displays estimated compression ratio for all the tables for all types of HCC compression :


set serveroutput on
spool all.out
declare
v_blkcnt_cmp pls_integer;
v_blkcnt_uncmp pls_integer;
v_row_cmp pls_integer;
v_row_uncmp pls_integer;
v_cmp_ratio number;
v_comptype_str varchar2(60);
type Str_Array is VARRAY(10) of VARCHAR2(50);
v_array Str_Array ;
begin
v_array:= Str_Array('lineitem','nation');
for i in v_array.first .. v_array.last loop
        dbms_output.put_line('hello ' || v_array(i));
end loop;
for i in v_array.first .. v_array.last
loop
for j in 1..5
loop
dbms_compression.get_compression_ratio(
scratchtbsname => upper('scratch1'),
ownname => upper('tpch'),
tabname => upper(v_array(i)),
partname => NULL,
comptype => power(2,j),
blkcnt_cmp => v_blkcnt_cmp,
blkcnt_uncmp => v_blkcnt_uncmp,
row_cmp => v_row_cmp,
row_uncmp => v_row_uncmp,
cmp_ratio => v_cmp_ratio,
comptype_str => v_comptype_str,
subset_numrows => -1) ;
dbms_output.put_line('OUTPUT FOR ' || v_comptype_str ||' FOR TABLE ' || v_array(i)) ;
dbms_output.put_line('Estimated Compression Ratio: '||to_char(v_cmp_ratio));
dbms_output.put_line('Blocks used by compressed sample: '||to_char(v_blkcnt_cmp));
dbms_output.put_line('Blocks used by uncompressed sample: '||to_char(v_blkcnt_uncmp));
end LOOP;
end LOOP;
end;
/
;

Friday, October 12, 2012

Cannot open database due to corrupt file

If you cannot open database due to some non-critical datafile being corrupt or not found and you do not have the backup either, you can offline the corrupt file and restart the database ....

Starting the database gave the following error:


SQL> SQL> ORACLE instance started.

Total System Global Area 1.4008E+11 bytes
Fixed Size                  2166320 bytes
Variable Size            5.3687E+10 bytes
Database Buffers         8.5899E+10 bytes
Redo Buffers              489947136 bytes
Database mounted.
ORA-01122: database file 166 failed verification check
ORA-01110: data file 166: '/test1/sf1000/scratch_ts'
ORA-01210: data file header is media corrupt


Login to the database and offline that particular datafile


-bash-4.1$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 28 14:38:51 2012

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


SQL> alter database datafile '/test1/sf1000/scratch_ts' offline for drop
  2  ;

Database altered.

SQL> alter database open;

Database altered.

Tuesday, September 25, 2012

iSCSIADM: Cannot see iSCSI luns on server side

On the storage side , the LUNs are created. However you cannot see them on the server side. This post explains the steps needed to debug and fix the issue.



Issue list command to see if you can see the LUNs on the server side:
  • iscsiadm list target -vS
If there are no LUNs listed, verify which discovery method is enabled
 
root@dat01:/# iscsiadm list discovery
Discovery:
        Static: disabled
        Send Targets: enabled
        iSNS: disabled
 
Verify which address is enabled in send targets discovery
 
 iscsiadm list discovery-address
Discovery Address: 10.129.195.209:3260
 
 
If the discovery-address is correct and you  you cannot still see the luns, do the following:
 
Check /var/adm/messages for any error message
Restart the iscsi service on storage side
Readd the address to send targets discovery as under:
iscsiadm remove discovery-address  10.129.195.209
root@dat01:/var/adm# iscsiadm list discovery-address
root@dat01:/var/adm# iscsiadm add discovery-address 10.129.195.209
root@dat01:/var/adm# iscsiadm list discovery-address
Discovery Address: 10.129.195.209:3260

Monday, August 13, 2012

Installing Oracle Database on Solaris 11 : Issue resoution

While installing the Oracle 11gR2 (11.2.0.1) grid infrastructure software on Solaris 11 , I got the following errors:

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-11-10_06-23-31PM. Please wait ...oracle@len01:~/download/grid$ You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2011-11-10_06-23-31PM.log
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/jdk/jre/lib/sparcv9/server/libjsig.so: Invalid argument
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/jdk/jre/lib/sparc/client/libjsig.so: Invalid argument
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/jdk/jre/lib/sparcv9/libjdgaSUNWafb.so: Invalid argument
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/jdk/jre/lib/sparcv9/server/libjsig_g.so: Invalid argument
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/jdk/jre/lib/sparc/libjvm.so: Invalid argument
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/jdk/jre/lib/sparc/libjdgaSUNWafb.so: Invalid argument
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/jdk/jre/javaws/javaws: Invalid argument
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/jdk/jre/lib/sparc/server/libjsig_g.so: Invalid argument
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/jdk/jre/lib/sparc/client/libjsig_g.so: Invalid argument
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/jdk/jre/lib/sparc/server/libjsig.so: Invalid argument
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/lib/libocci.so: No such file or directory
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/bin/lbuilder: Invalid argument
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/lib/libagtsh.so: No such file or directory
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/lib/libodm11.so: No such file or directory
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/lib/libodm11.so: No such file or directory
Error in checking existance of the link, errno:11:/u01/app/oracle/product/11.2.0/grid/JRE: No such file or directory


In the error message where it says invalid argument, the installer copies the file instead of creating a link. And for the error message that states No such file or directory, the corresponding file does not get copied over.

And then the ASM install fails with the error : ORACLE not available.

I got the similar message for Oracle database install as well.

It turns out 11.2.0.1 is not supported on Solaris11. 11.2.0.3 and beyond are supported on S11. Installing 11.2.0.3 resolved the issue.

Installing Oracle database in Solaris Container: Issue resolution

I was trying to install Oracle clusterware on 11.2.0.2 on Solaris container. I got the following error:

Adding daemon to inittab
ACFS-9459: ADVM/ACFS is not supported on this OS version: 'Solaris Container: Solaris 10 update 10'
ACFS-9201: Not Supported
ACFS-9459: ADVM/ACFS is not supported on this OS version: 'Solaris Container: Solaris 10 update 10'
CRS-2672: Attempting to start 'ora.mdnsd' on 'dszone1'
CRS-2676: Start of 'ora.mdnsd' on 'dszone1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'dszone1'
CRS-2676: Start of 'ora.gpnpd' on 'dszone1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'dszone1'
CRS-2672: Attempting to start 'ora.gipcd' on 'dszone1'
CRS-2676: Start of 'ora.cssdmonitor' on 'dszone1' succeeded
CRS-2676: Start of 'ora.gipcd' on 'dszone1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'dszone1'
CRS-2672: Attempting to start 'ora.diskmon' on 'dszone1'
CRS-2676: Start of 'ora.diskmon' on 'dszone1' succeeded
CRS-2674: Start of 'ora.cssd' on 'dszone1' failed
CRS-2679: Attempting to clean 'ora.cssd' on 'dszone1'
CRS-2681: Clean of 'ora.cssd' on 'dszone1' succeeded
CRS-2673: Attempting to stop 'ora.diskmon' on 'dszone1'
CRS-2677: Stop of 'ora.diskmon' on 'dszone1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'dszone1'
CRS-2677: Stop of 'ora.gipcd' on 'dszone1' succeeded
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'dszone1'
CRS-2677: Stop of 'ora.cssdmonitor' on 'dszone1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'dszone1'
CRS-2677: Stop of 'ora.gpnpd' on 'dszone1' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on 'dszone1'
CRS-2677: Stop of 'ora.mdnsd' on 'dszone1' succeeded
CRS-5804: Communication error with agent process
CRS-4000: Command Start failed, or completed with errors.
The exlusive mode cluster start failed, see Clusterware alert log for more information
Initial cluster configuration failed.  See /u01/app/11.2.0/grid/cfgtoollogs/crsconfig


The alert log under /u01/app/11.2.0/grid/log/<nodename> has the following error:



[cssd(8886)]CRS-1656:The CSS daemon is terminating due to a fatal error; Details at (:CSSSC00011:) in /u01/app/11.2.0/grid/
log/dszone1/cssd/ocssd.log

And the ocssd.log has following error:

2012-08-07 06:06:57.599: [    CSSD][1]clssscSetPrivEnv: Setting priority to 4
2012-08-07 06:06:57.607: [    CSSD][1]clssscSetPrivEnv: unable to set priority to 4
2012-08-07 06:06:57.607: [    CSSD][1]SLOS: cat=-2, opn=scls_set_priority_realtime, dep=1, loc=setsched
unable to escalate to real time
2012-08-07 06:06:57.607: [    CSSD][1](:CSSSC00011:)clssscExit: A fatal error occurred during initialization

Restarting the container with following privileges fixed the issue:

set limitpriv="default,proc_priocntl,proc_clock_highres,sys_time"
Refer to metalink note ID 1340694.1 for detailed information.

Oracle Database Listener Service Registration

  • I do not have listener.ora file. How is service registration working:
Service registration can happen dynamically or statically. By default, listener uses dynamic service registration before attempting static registration. For dynamic configuration, listener.ora file is not needed.
Dynamic service registration is configured in the database initialization file. It does not require any configuration in the listener.ora file.  For dynamic registration to work, you should set service_names and instance_names in init.ora. or it defaults to default value (INSTANCE_NAME is set to ORACLE_SID and service_names is set to global database name: DB_NAME +DB_DOMAIN). If your local listener is listening on a non-default port, you need to set LOCAL_LISTENER parameter and remote_listener ,typically used in RAC, needs to set with remote_listener parameter.
The static configuration reads information from listener.ora file to configure the services. An instance with status UNKNOWN is statically registered. For additional info check out the following:
  • How do I know which naming method is being used to connect:
Tnsping utility can be used to determine whether the listener for a service on an Oracle net network can be reached.
If you can ping the server host from client, use tnsping to test if client can reach Oracle net service. Tnsping also states the naming method which was used to connect.
Additional info:
http://edstevensdba.wordpress.com/2011/03/19/ora-12514/ ( look for all post under TNS category)

Setting swap on Solaris 11


  • After the system is installed, swap areas and swap files are listed in /etc/vfstab file
  • Create swap
    • zfs create -V 2G rpool/swap2
    • swap -a /dev/zvol/dsk/rpool/swap2
  • Increase the swap size to 40G
root@dat02:~# zfs get volsize rpool/swap
NAME        PROPERTY  VALUE  SOURCE
rpool/swap  volsize   4G     local


root@dat02:~# zfs set volsize=40G rpool/swap

root@dat02:~# zfs get volsize rpool/swap
NAME        PROPERTY  VALUE  SOURCE
rpool/swap  volsize   40G    local


  • Has the system previously swapped

Check if kthr:w has non-zero value in vmstat output. Refer to following blog for additional info:
http://ritukamboj.blogspot.com/2012/03/vmstat-shows-high-value-in-w-column.html

  • Is the system currently swapping

Check out the sr field of vmstat output

  • What is the total swap available

swap field of vmstat output as well swap -s displays the value of available swap

root@etchst8:~# vmstat 2
 kthr      memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr s3 s1 s1 s1   in   sy   cs us sy id
 0 0 0 169977852 94409120 1192 930 341 0 0 0 1064 6 2 0 2 2793 6433 3146 0 1 99
 0 0 0 175557112 93864204 29 44 0 0 0 0  0  0  0  0  1 2268 1540 1531  0  0 100
 0 0 0 175556024 93863128 0 4 0 0  0  0  0  0  0  0  0 2450 1411 1620  0  0 100
 0 0 0 175554632 93861728 0 1 0 0  0  0  0  1  0  0  0 2382 1385 1581  0  0 100
^C
root@etchst8:~# swap -s -h
total: 552M allocated + 217M reserved = 768M used, 167G available

 



  • Additional info:

http://www.solarisinternals.com/wiki/index.php/ZFS_Troubleshooting_Guide#Resizing_ZFS_Swap_and_Dump_Devices
https://blogs.oracle.com/observatory/entry/zone_swap_space
http://www.softpanorama.org/Solaris/Processes_and_memory/swap_space_management.shtml

Tuesday, July 24, 2012

Using DBCA to generate database creation scripts

Invoke dbca . Select "Create Database" and then Advanced Options. Select your options to create the DB.

Select <Custom Database template> on Database Template page  (If you do not use custom db template, all other templates will result in a script that does rman restore from a backup that comes with the product). Selecting 'custom database template' will result in scripts built around "Create database" sql statement

On the creation options page, deselect Create Database and select Generate DB creation Scripts before you finish. Note the directory name where scripts will be generated.

Friday, July 13, 2012

FC: Which storage/controller is HBA connected to

  • Get info about the HBA

The output below indicates that I have 2 HBAs and both of them are online.

root@dat01:~# fcinfo hba-port  | ggrep "HBA Port" root@dat01:~# fcinfo hba-port  | ggrep "State"
HBA Port WWN: 21000024ff30b222
HBA Port WWN: 21000024ff30b223
  • What remote device is the HBA connected to. Does it have SCSI target.


    The output below indicates that both the HBAs have SCSI targets.
root@dat01:~# fcinfo remote-port -p  21000024ff30b222 Remote Port WWN: 20360080e5249ad6
        Active FC4 Types:
        SCSI Target: yes
        Port Symbolic Name:
        Node WWN: 20060080e5249ad6
root@dat01:~# fcinfo remote-port -p 21000024ff30b223
Remote Port WWN: 20370080e5249ad6
        Active FC4 Types:
        SCSI Target: yes
        Port Symbolic Name:
        Node WWN: 20060080e5249ad6


The first HBA is connected to remote device 20360080e5249ad6 and the second HBA is connected to remote device 20370080e5249ad6
Both the remote devices have the same node WWN (20060080e5249ad6) which indicates that the remote device is probably a dual controller device.

  •  Get detailed info about the SCSI targets (Optional)
Detailed info about the SCSI targets can be obtained by following 2 commands:
  • fcinfo remote-port -sl -p 21000024ff30b223
  •  fcinfo lu -v 

  • Get WWNs from the storage

Storage has following WWN:
Node WWN: 20:06:00:80:E5:24:9A:D6
Array WWN: 60:08:0E:50:00:24:A7:7C:00:00:00:00:4E:CC:74:CF
It has two controllers:
Both the controllers have 4 ports out of which only 2 ports are enabled:

Controller A: port 1:
20:36:00:80:E5:24:9A:D6
20:06:00:80:E5:24:9A:D6

Controller A: port 2
20:46:00:80:E5:24:9A:D6
20:06:00:80:E5:24:9A:D6


Controller B: Port 1
20:37:00:80:E5:24:9A:D6
20:06:00:80:E5:24:9A:D6

Controller B: Port 2
20:47:00:80:E5:24:9A:D6
20:06:00:80:E5:24:9A:D6


Note that the node WWN for all ports is identical: 20060080E5249AD6 (which is the node WWN of the storage)
  • Find out which controller is connected to which HBA

Combining output from storage and fcinfo remote-port, we conclude that controller A port 1 is connected to first HBA and Controller B port 1 is connected to second HBA


        State: online
        State: online