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