Skip to main content
Delphix

Virtual database (VDB) provision to HPUX targets may fail with ORA-01157: cannot identify/lock data file

Issue

Provisioning of Oracle virtual databases (VDBs) on HPUX may fail with ORA-01157.

Oracle recommends tuning HPUX kernel values to optimize the performance of the system. In their recommendations for a single instance, Oracle suggests:

nprocs = 4096
nflocks = nprocs

Failure to adjust target systems appropriately as more virtual databases are created will inevitably lead to failure given the presence of at least one undersized kernel value. Please note that this document was compiled specifically to draw attention to nflocks, as DBA's frequently remember to increase shared memory and more frequently neglect nflocks.

Troubleshooting

Example alert log entry where nflocks is undersized:

ORA-00283: recovery session canceled due to errors 
ORA-01110: data file 1030: 
'/mnt/provision/myVDB2/datafile/oradata/myVDB/blaa.dbf' 
ORA-01157: cannot identify/lock data file 1030 - see DBWR trace file 
ORA-01110: data file 1030:

The key symptom in this case is "ORA-01157: cannot identify/lock data file"

The datafile number will be variable.

The key diagnostic is the kernel nflocks tunable during provision at or before failure. To check kernel parameters on HPUX inclusive nflocks:

# kcusage
Tunable Usage / Setting 
=============================================
filecache_max 5606596608 / 48936038400
maxdsiz 32239616 / 1073741824
maxdsiz_64bit 48398336 / 4294967296
maxfiles_lim 1997 / 63488
maxssiz 786432 / 134217728
maxssiz_64bit 1835008 / 1073741824
maxtsiz 9797632 / 100663296
maxtsiz_64bit 402653184 / 1073741824
maxuprc 878 / 3686
max_thread_proc 101 / 1200
msgmbs 0 / 8
msgmni 2 / 4096
msgtql 0 / 4096
nflocks 3128 / 4096
ninode 4778 / 862284
nkthread 2173 / 8416
nproc 1376 / 4200
npty 0 / 60
nstrpty 4 / 60
nstrtel 0 / 60
nswapdev 1 / 32
nswapfs 0 / 32
semmni 25 / 4096
semmns 4957 / 8192
shmmax 1073741824 / 1073741824
shmmni 92 / 4096
shmseg 28 / 512

Above we see 3128 file locks (nflocks). In this case provisioning an additional VDB failed as there was insufficient headroom based on the current nflocks setting.

Resolution

Configure nflocks and other HPUX kernel values appropriate to the workload required from the target system.

For example, in this instance doubling nflocks was sufficient:

# kctune nflocks=8196