$ uname -a
HP-UX myhost B.11.11 U 9000/800 2155931687 unlimited-user license
$ netstat -i
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lo0 4136 loopback localhost 2531982 0 2531982 0 0
lan902 1500 10.1.22.0 qhus019nas 268978790 0 220114906 0 0
lan901 1500 10.1.18.0 qhus019afe 302001865 0 72493411 18 0
lan900 1500 10.1.20.0 qhus019adm 136182939 0 192680026 0 0
$ lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
0/3/1/0/5/0 0x001185C88445 3 UP lan3 snap3 3 ETHER Yes 119
0/3/1/0/6/0 0x001185C88446 4 UP lan4 snap4 4 ETHER Yes 119
0/3/1/0/7/0 0x001185C88447 5 UP lan5 snap5 5 ETHER Yes 119
0/4/1/0/4/0 0x001185C8A3D0 6 UP lan6 snap6 6 ETHER Yes 119
0/4/1/0/5/0 0x001185C8A3D1 7 UP lan7 snap7 7 ETHER Yes 119
0/4/1/0/6/0 0x001185C8A3D2 8 UP lan8 snap8 8 ETHER Yes 119
0/4/1/0/7/0 0x001185C8A3D3 9 UP lan9 snap9 9 ETHER Yes 119
0/2/1/1 0x0012799E7FA3 2 UP lan2 snap2 11 ETHER Yes 119
LinkAgg0 0x0013217CD2E5 900 UP lan900 snap900 15 ETHER Yes 119
LinkAgg1 0x001185C88444 901 UP lan901 snap901 16 ETHER Yes 119
LinkAgg2 0x0012799E7FA2 902 UP lan902 snap902 17 ETHER Yes 119
LinkAgg3 0x000000000000 903 DOWN lan903 snap903 18 ETHER Yes 119
LinkAgg4 0x000000000000 904 DOWN lan904 snap904 19 ETHER Yes 119
$ lanadmin -x 0
Speed = 1000 Full-Duplex.
Autonegotiation = On.
$ lanadmin -x 1
Current Config = 100 Half-Duplex AUTONEG
$ lanadmin -x 6
Current Config = 100 Full-Duplex MANUAL
$ ioscan -fnkClan
Class I H/W Path Driver S/W State H/W Type Description
========================================================================
lan 0 0/1/2/0 igelan CLAIMED INTERFACE HP PCI 1000Base-T Core
lan 20 0/2/1/0 iether CLAIMED INTERFACE HP A7012-60001 PCI/PCI-X 1000Base-T Dual-port Adapter
lan 2 0/2/1/1 iether CLAIMED INTERFACE HP A7012-60001 PCI/PCI-X 1000Base-T Dual-port Adapter
lan 1 0/3/1/0/4/0 btlan CLAIMED INTERFACE HP A5506B PCI 10/100Base-TX 4 Port
/dev/diag/lan1 /dev/ether1 /dev/lan1
lan 3 0/3/1/0/5/0 btlan CLAIMED INTERFACE HP A5506B PCI 10/100Base-TX 4 Port
/dev/diag/lan3 /dev/ether3 /dev/lan3
lan 4 0/3/1/0/6/0 btlan CLAIMED INTERFACE HP A5506B PCI 10/100Base-TX 4 Port
/dev/diag/lan4 /dev/ether4 /dev/lan4
lan 5 0/3/1/0/7/0 btlan CLAIMED INTERFACE HP A5506B PCI 10/100Base-TX 4 Port
/dev/diag/lan5 /dev/ether5 /dev/lan5
lan 6 0/4/1/0/4/0 btlan CLAIMED INTERFACE HP A5506B PCI 10/100Base-TX 4 Port
/dev/diag/lan6 /dev/ether6 /dev/lan6
lan 7 0/4/1/0/5/0 btlan CLAIMED INTERFACE HP A5506B PCI 10/100Base-TX 4 Port
/dev/diag/lan7 /dev/ether7 /dev/lan7
lan 8 0/4/1/0/6/0 btlan CLAIMED INTERFACE HP A5506B PCI 10/100Base-TX 4 Port
/dev/diag/lan8 /dev/ether8 /dev/lan8
lan 9 0/4/1/0/7/0 btlan CLAIMED INTERFACE HP A5506B PCI 10/100Base-TX 4 Port
/dev/diag/lan9 /dev/ether9 /dev/lan9
lan 10 0/6/1/0 iether CLAIMED INTERFACE HP A7012-60001 PCI/PCI-X 1000Base-T Dual-port Adapter
lan 11 0/6/1/1 iether CLAIMED INTERFACE HP A7012-60001 PCI/PCI-X 1000Base-T Dual-port Adapter
Saturday, October 28, 2006
Saturday, October 21, 2006
SFTP Scripting
SFTP has the expanded features of ftp, with the security of scp.
The typical ssh keygen and authorized_keys file are needed to set up a remote login without a password prompt. Configuring and testing login without password can be done with ssh or scp or sftp.
When sftp is able to log in without a password prompt, it is then time to create a batch file. The batch file contains sftp commands. In the batch file, a leading hyphen "-" instructs sftp to ignore an error.
The command is:
The typical ssh keygen and authorized_keys file are needed to set up a remote login without a password prompt. Configuring and testing login without password can be done with ssh or scp or sftp.
When sftp is able to log in without a password prompt, it is then time to create a batch file. The batch file contains sftp commands. In the batch file, a leading hyphen "-" instructs sftp to ignore an error.
$ cat sftp.batch
-rm /u001/testfile.Z
put /u001/testfile.Z
ls -l /u001/testfile.Z
The command is:
/bin/sftp -bsftp.batch ftpuser@ftphost
Monday, September 18, 2006
HP-UX top
It can be useful to read the changes document that accompanies each new software version. On HP-UX, a flag was added to the top command to not display individual CPU utilization metrics. This can be useful for allowing more process lines to be displayed on machines that have many CPUs.
From the HP example:
From the HP example:
Once a 2 processor system, executing top displays individual CPU statistics:
System: 2wide Tue Apr 20 16:15:08 1
999
Load averages: 0.50, 0.51, 0.85
101 processes: 96 sleeping, 4 running, 1 zombie
Cpu states:
CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0 1.00 91.1% 0.0% 0.8% 8.1% 0.0% 0.0% 0.0% 0.0%
1 0.00 0.0% 0.0% 0.0% 100.0% 0.0% 0.0% 0.0% 0.0%
--- ---- ----- ----- ----- ----- ----- ----- ----- -----
avg 0.50 45.5% 0.0% 0.4% 54.1% 0.0% 0.0% 0.0% 0.0%
Memory: 125556K (101488K) real, 140160K (121952K) virtual, 14404K free Pag
e# 1/3
.
.
.
Once the same 2 processor system, executing top -h displays the average CPU statistics:
System: 2wide Tue Apr 20 16:15:59 1
999
Load averages: 0.50, 0.51, 0.84
101 processes: 96 sleeping, 4 running, 1 zombie
Cpu states: (avg)
LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0.50 49.6% 0.0% 1.2% 49.2% 0.0% 0.0% 0.0% 0.0%
Memory: 131488K (107388K) real, 146016K (127172K) virtual, 8460K free Page
# 1/3
.
.
.
Sunday, September 17, 2006
Oracle OCI Error
Recently a PC user was able to use most functionality of an application. One part of the application would consistently encounter ORA-01036: illegal variable name/number. In this case, the issue was an incorrect version of Oracle networking on the PC. The issue was resolved with removal of the more recent Oracle networking version, and installation of the correct version.

Thursday, September 07, 2006
Generate Oracle ReGrants "WITH GRANT OPTION"
Oracle user "tableowner" owns tables.
User tableowner grants SELECT to user "reportowner".
Report owner creates view "V" and grants SELECT on V to role "reportrole".
Role "reportrole" is granted to user "enduser".
The reportowner is able to create and select from the views. Enduser receives permission errors when selecting from reportowner's views. To resolve this issue, grant select WITH GRANT OPTION to the selectrole.
In this case the SELECT grants were already in place, and they needed be upgraded to include "WITH GRANT OPTION". This SQL will generate a SQL script that can be run to apply the "WITH GRANT OPTION".
User tableowner grants SELECT to user "reportowner".
Report owner creates view "V" and grants SELECT on V to role "reportrole".
Role "reportrole" is granted to user "enduser".
The reportowner is able to create and select from the views. Enduser receives permission errors when selecting from reportowner's views. To resolve this issue, grant select WITH GRANT OPTION to the selectrole.
In this case the SELECT grants were already in place, and they needed be upgraded to include "WITH GRANT OPTION". This SQL will generate a SQL script that can be run to apply the "WITH GRANT OPTION".
$ cat gen_grantSelect.sql
set lines 90
set pages 0
set feedback off
spool grantSelect.sql
prompt spool grantSelect
select 'grant ' || privilege || ' on ' || owner || '.' || table_name || ' to ' || 'REPORTOWNER with grant option;'
from dba_tab_privs
where grantor='TABLEOWNER' and grantee = 'REPORTOWNER'
order by 1
/
spool off
Tuesday, September 05, 2006
Oracle Archive Log Mode
Follow these steps to take an Oracle database out of archive log mode.
Log in to sqlplus as sysdba.
-- shutdown the instance.
shutdown
startup mount exclusive
alter database noarchivelog
alter database open
-- check alert.log for archiving messages.
Follow these steps to put an Oracle database into archive log mode.
SQL> startup mount
ORACLE instance started.
Total System Global Area 5554802160 bytes
Fixed Size 744944 bytes
Variable Size 2164260864 bytes
Database Buffers 3388997632 bytes
Redo Buffers 798720 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> select log_mode from v$database;
LOG_MODE
------------
ARCHIVELOG
SQL> show parameter log_archive_start;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_start boolean TRUE
SQL> alter system switch logfile;
System altered.
From alert.log:
Tue Aug 8 22:09:10 2006
Thread 1 advanced to log sequence 4224
Current log# 4 seq# 4224 mem# 0: /u111/oradata/KANQA/redo04a.log
Current log# 4 seq# 4224 mem# 1: /u110/oradata/KANQA/redo04b.log
Tue Aug 8 22:09:10 2006
ARC0: Evaluating archive log 6 thread 1 sequence 4223
ARC0: Beginning to archive log 6 thread 1 sequence 4223
Creating archive destination LOG_ARCHIVE_DEST_2: '/u116/oraarchive/KANQA/arch4223.arc'
ARC0: Completed archiving log 6 thread 1 sequence 4223
Verify the archived log file has been created.
$ ls -l /u116/oraarchive/KANQA
total 2656
-rw-rw---- 1 oracle dba 1352704 Aug 8 22:09 arch4223.arc
Log in to sqlplus as sysdba.
-- shutdown the instance.
shutdown
startup mount exclusive
alter database noarchivelog
alter database open
-- check alert.log for archiving messages.
Follow these steps to put an Oracle database into archive log mode.
SQL> startup mount
ORACLE instance started.
Total System Global Area 5554802160 bytes
Fixed Size 744944 bytes
Variable Size 2164260864 bytes
Database Buffers 3388997632 bytes
Redo Buffers 798720 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> select log_mode from v$database;
LOG_MODE
------------
ARCHIVELOG
SQL> show parameter log_archive_start;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_start boolean TRUE
SQL> alter system switch logfile;
System altered.
From alert.log:
Tue Aug 8 22:09:10 2006
Thread 1 advanced to log sequence 4224
Current log# 4 seq# 4224 mem# 0: /u111/oradata/KANQA/redo04a.log
Current log# 4 seq# 4224 mem# 1: /u110/oradata/KANQA/redo04b.log
Tue Aug 8 22:09:10 2006
ARC0: Evaluating archive log 6 thread 1 sequence 4223
ARC0: Beginning to archive log 6 thread 1 sequence 4223
Creating archive destination LOG_ARCHIVE_DEST_2: '/u116/oraarchive/KANQA/arch4223.arc'
ARC0: Completed archiving log 6 thread 1 sequence 4223
Verify the archived log file has been created.
$ ls -l /u116/oraarchive/KANQA
total 2656
-rw-rw---- 1 oracle dba 1352704 Aug 8 22:09 arch4223.arc
Saturday, August 26, 2006
Thursday, August 03, 2006
Oracle SQLNet Client Tracing
Enabling sql*net client tracing can be useful for tracking down issues such as disconnects. Server-side tracing (alter session set sql_trace=true) is usually easier to interpret and includes statement execution time. If there are connection problems, then client-side tracing is appropriate.
How to implement on unix:
$ cd $ORACLE_HOME/network/admin
$ cp sqlnet.ora .sqlnet.ora.previous
$ echo "trace_level_client=16" >> sqlnet.ora
$ echo "trace_unique_client=yes >> sqlnet.ora
$ echo "trace_file_client=sqlnet.trc >> sqlnet.ora
$ echo "trace_directory_client=/u001/oracle >> sqlnet.ora
Ensure the trace file directory is world writable.
The trace files will be named sqlnet_PID.trc, where PID is the unix process ID.
Trace level 16 will create a large log file.
How to implement on unix:
$ cd $ORACLE_HOME/network/admin
$ cp sqlnet.ora .sqlnet.ora.previous
$ echo "trace_level_client=16" >> sqlnet.ora
$ echo "trace_unique_client=yes >> sqlnet.ora
$ echo "trace_file_client=sqlnet.trc >> sqlnet.ora
$ echo "trace_directory_client=/u001/oracle >> sqlnet.ora
Ensure the trace file directory is world writable.
The trace files will be named sqlnet_PID.trc, where PID is the unix process ID.
Trace level 16 will create a large log file.
Subscribe to:
Posts (Atom)