Tuesday, December 30, 2014

Installation of rsync on Solaris 10

Installation of rsync on Solaris 10

Go to http://www.sunfreeware.com/


Download
http://ftp.riken.jp/Sun/sunfreeware/sparc/10/rsync-3.0.9-sol10-sparc-local.gz
http://ftp.riken.jp/Sun/sunfreeware/sparc/10/libiconv-1.14-sol10-sparc-local.gz
http://ftp.riken.jp/Sun/sunfreeware/sparc/10/libgcc-3.4.6-sol10-sparc-local.gz

# pkgadd -G -d rsync-3.0.9-sol10-sparc-local
# pkgadd -G -d libiconv-1.14-sol10-sparc-local
# pkgadd -G -d libgcc-3.4.6-sol10-sparc-local

Monday, October 27, 2014

Oracle Table Fragmentation

What is Table fragmentation
When rows are not stored contiguously, or if rows are split onto more than one page, performance decreases because these rows require additional page accesses. Table fragmentation is distinct from file fragmentation.

When lots of DML operation apply on tables then tables is fragmented.
because DML is not release free space from table below HWM.

Hint: HWM is indicator for USED BLOCKS in database. Blocks below the high water mark (used blocks) have at least once contained data. This data might have been deleted.
Since Oracle knows that blocks beyond the high water mark don't have data, it only reads blocks up to the high water mark in a full table scan.

DDL statement always reset HWM.


How to find table fragmentation



SQL> select count(*) from big1;

1000000 rows selected.

SQL> delete from big1 where rownum <= 300000;

300000 rows deleted.

SQL> commit;

Commit complete.

SQL> update big1 set object_id = 0 where rownum <=350000;

342226 rows updated.

SQL> commit;

Commit complete.

SQL> exec dbms_stats.gather_table_stats('SCOTT','BIG1');

PL/SQL procedure successfully completed.


Table Size ( with fragmented)




SQL> select table_name,round((blocks*8),2)||'kb' "size"
2 from user_tables
3 where table_name = 'BIG1';

TABLE_NAME size
------------------------------ ------------------------------------------
BIG1 72952kb


Actual data in table


SQL> select table_name,round((num_rows*avg_row_len/1024),2)||'kb' "size"
2 from user_tables
3 where table_name = 'BIG1';

TABLE_NAME size
------------------------------ ------------------------------------------
BIG1 30604.2kb

Note= 72952 – 30604 = 42348 Kb is wasted space in table

The difference between two values is 60% and Pctfree 10% (default) so table is 50% extra space which is wasted because there is no data.

How to reset HWM / remove fragemenation

For that we need to reorganize fragmented table

We have four options to reorganize fragmented tables

1. alter table … move + rebuild indexes
2. export / truncate / import
3. create table as select ( CTAS)
4. dbms_redefinition


Option: 1 “alter table … move + rebuild indexes”



SQL> alter table BIG1 move;

Table altered.

SQL> select status,index_name from user_indexes
2 where table_name = 'BIG1';

STATUS INDEX_NAME
-------- ------------------------------
UNUSABLE BIGIDX

SQL> alter index bigidx rebuild;

Index altered.

SQL> select status,index_name from user_indexes
2 where table_name = 'BIG1';

STATUS INDEX_NAME
-------- ------------------------------
VALID BIGIDX


SQL> exec dbms_stats.gather_table_stats('SCOTT','BIG1');

PL/SQL procedure successfully completed.

SQL> select table_name,round((blocks*8),2)||'kb' "size"
2 from user_tables
3 where table_name = 'BIG1';

TABLE_NAME size
------------------------------ ------------------------------------------
BIG1 38224kb

SQL> select table_name,round((num_rows*avg_row_len/1024),2)||'kb' "size"
2 from user_tables
3 where table_name = 'BIG1';

TABLE_NAME size
------------------------------ ------------------------------------------
BIG1 30727.37kb



Option: 2 “Create table as select”




SQL> create table big2 as select * from big1;

Table created.

SQL> drop table big1 purge;

Table dropped.

SQL> rename big2 to big1;

Table renamed.

SQL> exec dbms_stats.gather_table_stats('SCOTT','BIG1');

PL/SQL procedure successfully completed.

SQL> select table_name,round((blocks*8),2)||'kb' "size"
2 from user_tables
3 where table_name = 'BIG1';

TABLE_NAME size
------------------------------ ------------------------------------------
BIG1 85536kb

SQL> select table_name,round((num_rows*avg_row_len/1024),2)||'kb' "size"
2 from user_tables
3 where table_name = 'BIG1';

TABLE_NAME size
------------------------------ ------------------------------------------
BIG1 68986.97kb

SQL> select status from user_indexes
2 where table_name = 'BIG1';

no rows selected

SQL> --Note we need to create all indexes.



Option: 3 “export / truncate / import”



SQL> select table_name, round((blocks*8),2)||'kb' "size"
2 from user_tables
3 where table_name = 'BIG1';

TABLE_NAME size
------------------------------ ------------------------------------------
BIG1 85536kb

SQL> select table_name, round((num_rows*avg_row_len/1024),2)||'kb' "size"
2 from user_tables
3 where table_name = 'BIG1';

TABLE_NAME size
------------------------------ ------------------------------------------
BIG1 42535.54kb

SQL> select status from user_indexes where table_name = 'BIG1';

STATUS
--------
VALID

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Pr
oduction
With the Partitioning, OLAP and Data Mining options

C:\>exp scott/tiger@Orcl file=c:\big1.dmp tables=big1

Export: Release 10.1.0.5.0 - Production on Sat Jul 28 16:30:44 2007

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table BIG1 468904 rows exported
Export terminated successfully without warnings.

C:\>sqlplus scott/tiger@orcl

SQL*Plus: Release 10.1.0.5.0 - Production on Sat Jul 28 16:31:12 2007

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

Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> truncate table big1;

Table truncated.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Pr
oduction
With the Partitioning, OLAP and Data Mining options

C:\>imp scott/tiger@Orcl file=c:\big1.dmp ignore=y

Import: Release 10.1.0.5.0 - Production on Sat Jul 28 16:31:54 2007

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.01.00 via conventional path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
. importing SCOTT's objects into SCOTT
. . importing table "BIG1" 468904 rows imported
Import terminated successfully without warnings.

C:\>sqlplus scott/tiger@orcl

SQL*Plus: Release 10.1.0.5.0 - Production on Sat Jul 28 16:32:21 2007

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

Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select table_name, round((blocks*8),2)||'kb' "size"
2 from user_tables
3 where table_name = 'BIG1';

TABLE_NAME size
------------------------------ ------------------------------------------
BIG1 85536kb

SQL> select table_name, round((num_rows*avg_row_len/1024),2)||'kb' "size"
2 from user_tables
3 where table_name = 'BIG1';

TABLE_NAME size
------------------------------ ------------------------------------------
BIG1 42535.54kb

SQL> exec dbms_stats.gather_table_stats('SCOTT','BIG1');

PL/SQL procedure successfully completed.

SQL> select table_name, round((blocks*8),2)||'kb' "size"
2 from user_tables
3 where table_name = 'BIG1';

TABLE_NAME size
------------------------------ ------------------------------------------
BIG1 51840kb

SQL> select table_name, round((num_rows*avg_row_len/1024),2)||'kb' "size"
2 from user_tables
3 where table_name = 'BIG1';

TABLE_NAME size
------------------------------ ------------------------------------------
BIG1 42542.27kb

SQL> select status from user_indexes where table_name = 'BIG1';

STATUS
--------
VALID

SQL> exec dbms_redefinition.can_redef_table('SCOTT','BIG1',-
> dbms_redefinition.cons_use_pk);

PL/SQL procedure successfully completed.



Option: 4 “dbms_redefinition”





SQL> create table TABLE1 (
2 no number,
3 name varchar2(20) default 'NONE',
4 ddate date default SYSDATE);

Table created.

SQL> alter table table1 add constraint pk_no primary key(no);

Table altered.

SQL> begin
2 for x in 1..100000 loop
3 insert into table1 ( no , name, ddate)
4 values ( x , default, default);
5 end loop;
6 end;
7 /

PL/SQL procedure successfully completed.

SQL> create or replace trigger tri_table1
2 after insert on table1
3 begin
4 null;
5 end;
6 /

Trigger created.

SQL> select count(*) from table1;

COUNT(*)
----------
100000

SQL> delete table1 where rownum <= 50000;

50000 rows deleted.

SQL> commit;

Commit complete.

SQL> exec dbms_stats.gather_table_stats('SCOTT','TABLE1');

PL/SQL procedure successfully completed.

SQL> select table_name, round((blocks*8),2)||'kb' "size"
2 from user_tables
3 where table_name = 'TABLE1';

TABLE_NAME size
------------------------------ ------------------------------------------
TABLE1 2960kb

SQL> select table_name, round((num_rows*avg_row_len/1024),2)||'kb' "size"
2 from user_tables
3 where table_name = 'TABLE1';

TABLE_NAME size
------------------------------ ------------------------------------------
TABLE1 822.69kb


SQL> --Minimum Privs required "DBA" role or "SELECT" on dbms_redefinition pkg
SQL> --First check table is condidate for redefinition.
SQL>
SQL> exec sys.dbms_redefinition.can_redef_table('SCOTT',-
> 'TABLE1',-
> sys.dbms_redefinition.cons_use_pk);

PL/SQL procedure successfully completed.

SQL> --After verifying that the table can be redefined online, you manually crea
te an empty interim table (in the same schema as the table to be redefined)
SQL>
SQL> create table TABLE2 as select * from table1 WHERE 1 = 2;

Table created.

SQL> exec sys.dbms_redefinition.start_redef_table ( 'SCOTT',-
> 'TABLE1',-
> 'TABLE2');

PL/SQL procedure successfully completed.

SQL> --This procedure keeps the interim table synchronized with the original tab
le.
SQL>
SQL> exec sys.dbms_redefinition.sync_interim_table ('SCOTT',-
> 'TABLE1',-
> 'TABLE2');

PL/SQL procedure successfully completed.

SQL> --Create PRIMARY KEY on interim table(TABLE2)
SQL> alter table TABLE2
2 add constraint pk_no1 primary key (no);

Table altered.

SQL> create trigger tri_table2
2 after insert on table2
3 begin
4 null;
5 end;
6 /

Trigger created.

SQL> --Disable foreign key on original table if exists before finish this proces
s.
SQL>
SQL> exec sys.dbms_redefinition.finish_redef_table ( 'SCOTT',-
> 'TABLE1',-
> 'TABLE2');

PL/SQL procedure successfully completed.

SQL> exec dbms_stats.gather_table_stats('SCOTT','TABLE1');

PL/SQL procedure successfully completed.

SQL> select table_name, round((blocks*8),2)||'kb' "size"
2 from user_tables
3 where table_name = 'TABLE1';

TABLE_NAME size
------------------------------ ------------------------------------------
TABLE1 1376kb

SQL> select table_name, round((num_rows*avg_row_len/1024),2)||'kb' "size"
2 from user_tables
3 where table_name = 'TABLE1';

TABLE_NAME size
------------------------------ ------------------------------------------
TABLE1 841.4kb

SQL> select status,constraint_name
2 from user_constraints
3 where table_name = 'TABLE1';

STATUS CONSTRAINT_NAME
-------- ------------------------------
ENABLED PK_NO1

SQL> select status ,trigger_name
2 from user_triggers
3 where table_name = 'TABLE1';

STATUS TRIGGER_NAME
-------- ------------------------------
ENABLED TRI_TABLE2

SQL> drop table TABLE2 PURGE;

Table dropped.

Sunday, October 26, 2014

How to Replace disk on freenas for CLI

[root@freenas] ~# camcontrol identify ada0 | grep LBA48
LBA48 supported       5860533168 sectors
[root@freenas] ~# camcontrol identify ada2 | grep LBA48
LBA48 supported       5860533168 sectors
[root@freenas] ~#
[root@freenas] ~# smartctl -a /dev/ada1 | grep "Serial"
Serial Number:    W1F390KB
[root@freenas] ~# smartctl -a /dev/ada2 | grep "Serial"
Serial Number:    WCC1T1236411
[root@freenas] ~# smartctl -a /dev/ada0 | grep "Serial"
Serial Number:    W1F3M4FP
[root@freenas] ~#


[root@freenas] ~# cat /etc/version
FreeNAS-8.3.2-RELEASE-x86 (r12686+70c2cb8)


[root@freenas] ~# camcontrol devlist sysctl kern.disks
          at scbus0 target 0 lun 0 (pass0,ada0)
          at scbus1 target 0 lun 0 (pass1,ada1)
        at scbus2 target 0 lun 0 (pass2,ada2)
          at scbus3 target 0 lun 0 (pass3,ada3)
          at scbus4 target 0 lun 0 (pass4,ada4)
          at scbus5 target 0 lun 0 (pass5,ada5)
    at scbus8 target 0 lun 0 (pass6,da0)

[root@freenas] ~#glabel status


                                      Name  Status  Components

gptid/55414a31-55c3-11e3-b6e3-4ce676286ed3     N/A  ada0p2

gptid/55ecb111-55c3-11e3-b6e3-4ce676286ed3     N/A  ada1p2

          gpt/Microsoft reserved partition     N/A  ada2p1

gptid/fa7d0f15-3dff-4dbb-87b4-2719b856d7ad     N/A  ada2p1

gptid/573cee31-55c3-11e3-b6e3-4ce676286ed3     N/A  ada3p2

gptid/57e5235e-55c3-11e3-b6e3-4ce676286ed3     N/A  ada4p2

gptid/5877a718-55c3-11e3-b6e3-4ce676286ed3     N/A  ada5p1

gptid/58928e16-55c3-11e3-b6e3-4ce676286ed3     N/A  ada5p2

                             ufs/FreeNASs3     N/A  da0s3

                             ufs/FreeNASs4     N/A  da0s4

                            ufs/FreeNASs1a     N/A  da0s1a

gptid/ef001e5f-03b8-4b2a-867d-30b9de1d8301     N/A  zvol/nas12t/lptrungp1


[root@freenas] ~# gpart show


=>        34  5860533101  ada0  GPT  (2.7T)

          34          94        - free -  (47k)

         128     4194304     1  freebsd-swap  (2.0G)

     4194432  5856338696     2  freebsd-zfs  (2.7T)

  5860533128           7        - free -  (3.5k)



=>        34  5860533101  ada1  GPT  (2.7T)

          34          94        - free -  (47k)

         128     4194304     1  freebsd-swap  (2.0G)

     4194432  5856338696     2  freebsd-zfs  (2.7T)

  5860533128           7        - free -  (3.5k)



=>        34  5860533101  ada2  GPT  (2.7T)

          34      262144     1  ms-reserved  (128M)

      262178  5860270957        - free -  (2.7T)



=>        34  5860533101  ada3  GPT  (2.7T)

          34          94        - free -  (47k)

         128     4194304     1  freebsd-swap  (2.0G)

     4194432  5856338696     2  freebsd-zfs  (2.7T)

  5860533128           7        - free -  (3.5k)



=>        34  5860533101  ada4  GPT  (2.7T)

          34          94        - free -  (47k)

         128     4194304     1  freebsd-swap  (2.0G)

     4194432  5856338696     2  freebsd-zfs  (2.7T)

  5860533128           7        - free -  (3.5k)



=>        34  5860533101  ada5  GPT  (2.7T)

          34          94        - free -  (47k)

         128     4194304     1  freebsd-swap  (2.0G)

     4194432  5856338696     2  freebsd-zfs  (2.7T)

  5860533128           7        - free -  (3.5k)



=>      63  30945217  da0  MBR  (14G)

        63   1930257    1  freebsd  [active]  (942M)

   1930320        63       - free -  (31k)

   1930383   1930257    2  freebsd  (942M)

   3860640      3024    3  freebsd  (1.5M)

   3863664     41328    4  freebsd  (20M)

   3904992  27040288       - free -  (12G)



=>      0  1930257  da0s1  BSD  (942M)

        0       16         - free -  (8.0k)

       16  1930241      1  !0  (942M)



=>     34  4194237  zvol/nas12t/lptrung  GPT  (2.0G)

       34     2014                       - free -  (1M)

     2048  4192223                    1  !aa31e02a-400f-11db-9590-000c2911d1b8  (2G)




[root@freenas] ~# zpool status


  pool: nas12t

 state: DEGRADED

status: One or more devices could not be opened.  Sufficient replicas exist for

    the pool to continue functioning in a degraded state.

action: Attach the missing device and online it using 'zpool online'.

   see: http://www.sun.com/msg/ZFS-8000-2Q

  scan: scrub repaired 0 in 651h3m with 0 errors on Sat Aug 30 03:03:53 2014

config:



    NAME                                            STATE     READ WRITE CKSUM

    nas12t                                          DEGRADED     0     0     0

      raidz1-0                                      DEGRADED     0     0     0

        gptid/55414a31-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0

        gptid/55ecb111-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0

        16889620854227218693                        UNAVAIL      0     0     0  was /dev/gptid/5694c48b-55c3-11e3-b6e3-4ce676286ed3
        gptid/573cee31-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0

        gptid/57e5235e-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0

        gptid/58928e16-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0



errors: No known data errors


[root@freenas] ~# zpool  replace nas12t /dev/gptid/5694c48b-55c3-11e3-b6e3-4ce676286ed3 ada2


[root@freenas] ~# zpool status


  pool: nas12t

 state: DEGRADED

status: One or more devices is currently being resilvered.  The pool will

    continue to function, possibly in a degraded state.

action: Wait for the resilver to complete.

  scan: resilver in progress since Sun Oct 26 06:09:47 2014

        180G scanned out of 9.47T at 110M/s, 24h32m to go

        30.0G resilvered, 1.86% done

config:



    NAME                                            STATE     READ WRITE CKSUM

    nas12t                                          DEGRADED     0     0     0

      raidz1-0                                      DEGRADED     0     0     0

        gptid/55414a31-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0

        gptid/55ecb111-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0

        replacing-2                                 UNAVAIL      0     0     0

          16889620854227218693                      UNAVAIL      0     0     0  was /dev/gptid/5694c48b-55c3-11e3-b6e3-4ce676286ed3

          ada2                                      ONLINE       0     0     0  (resilvering)

        gptid/573cee31-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0

        gptid/57e5235e-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0

        gptid/58928e16-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0



errors: No known data errors

Wait many hour => for complete

[root@freenas] ~# zpool status
  pool: nas12t
 state: DEGRADED
  scan: resilvered 1.58T in 14h28m with 0 errors on Sun Oct 26 20:38:20 2014
config:

        NAME                                            STATE     READ WRITE CKSUM
        nas12t                                          DEGRADED     0     0     0
          raidz1-0                                      DEGRADED     0     0     0
            gptid/55414a31-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0
            gptid/55ecb111-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0
            replacing-2                                 UNAVAIL      0     0     0
              16889620854227218693                      UNAVAIL      0     0     0  was /dev/gptid/5694c48b-55c3-11e3-b6e3-4ce676286ed3
              ada2                                      ONLINE       0     0     0
            gptid/573cee31-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0
            gptid/57e5235e-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0
            gptid/58928e16-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0

errors: No known data errors

[root@freenas] ~# zpool detach nas12t 16889620854227218693
[root@freenas] ~# zpool status
  pool: nas12t
 state: ONLINE
  scan: resilvered 1.58T in 14h28m with 0 errors on Sun Oct 26 20:38:20 2014
config:

        NAME                                            STATE     READ WRITE CKSUM
        nas12t                                          ONLINE       0     0     0
          raidz1-0                                      ONLINE       0     0     0
            gptid/55414a31-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0
            gptid/55ecb111-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0
            ada2                                        ONLINE       0     0     0
            gptid/573cee31-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0
            gptid/57e5235e-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0
            gptid/58928e16-55c3-11e3-b6e3-4ce676286ed3  ONLINE       0     0     0

errors: No known data errors
[root@freenas] ~#

Thursday, May 22, 2014

FreeBSD Fix bug not connect to USB

root@freenas] ~# camcontrol devlist
          at scbus0 target 0 lun 0 (ada0,pass0)
          at scbus1 target 0 lun 0 (ada1,pass1)
          at scbus2 target 0 lun 0 (ada2,pass2)
          at scbus3 target 0 lun 0 (ada3,pass3)
          at scbus4 target 0 lun 0 (ada4,pass4)
          at scbus5 target 0 lun 0 (ada5,pass5)
        at scbus8 target 0 lun 0 (pass6,da0)
       at scbus9 target 0 lun 0 (da1,pass7)
       at scbus10 target 0 lun 0 (da2,pass8)


[root@freenas] ~# usbconfig
ugen0.1: at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE
ugen1.1: at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen2.1: at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen3.1: at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen4.1: at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE
ugen4.2:

at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen0.2: at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON
ugen0.3: at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON
ugen4.3: at usbus4, cfg=255 md=HOST spd=HIGH (480Mbps) pwr=ON


[root@freenas] ~# usbconfig -u 4 -a 3 power_off
[root@freenas] ~# usbconfig
ugen0.1: at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE
ugen1.1: at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen2.1: at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen3.1: at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
ugen4.1: at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE
ugen4.2:
at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen0.2: at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON
ugen0.3: at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON
ugen4.3: at usbus4, cfg=255 md=HOST spd=HIGH (480Mbps) pwr=OFF

[root@freenas] ~# usbconfig -u 4 -a 3 power_on

[root@freenas] ~# camcontrol devlist
          at scbus0 target 0 lun 0 (ada0,pass0)
          at scbus1 target 0 lun 0 (ada1,pass1)
          at scbus2 target 0 lun 0 (ada2,pass2)
          at scbus3 target 0 lun 0 (ada3,pass3)
          at scbus4 target 0 lun 0 (ada4,pass4)
          at scbus5 target 0 lun 0 (ada5,pass5)
        at scbus8 target 0 lun 0 (pass6,da0)
       at scbus9 target 0 lun 0 (da1,pass7)
       at scbus10 target 0 lun 0 (da2,pass8)
        at scbus11 target 0 lun 0 (da3,pass9)
[root@freenas] ~#

Monday, April 21, 2014

Sun Storage Solaris Multipathing Software

MPxIO

Configuration files

For Solaris 10 and earlier
/kernel/drv/fp.confFiber channel port configuration file (For Fiber Channel Devices)
/kernel/drv/mpt.confmpt scsi/SAS HBA controller driver configuration file (For SAS Devices)
/kernel/drv/scsi_vhci.confMPXIO operation configuration file (Used to define loadbalancing and failback modes and configure 3rd party devices)
/kernel/drv/iscsi_confiSCSI MPxIO configuration file (For iSCSI devices)
For Solaris 11

In case of Solaris 11, files in the directory /kernel/drv/ and /etc/driver/drv are the sample default configuration files delivered with OS (not used by MPxIO). Do not edit these files. The location of the configuration files is /etc/driver/drv/. The 4 configuration files used in case of Solaris 11 are the same, performing the same task. Although the syntax may be different.

/etc/driver/drv/fp.conf
/etc/driver/drv/mpt.conf
/etc/driver/drv/scsi_vhci.conf
/etc/driver/drv/iscsi_conf
 
It is best practice to edit these files using the stmsboot utility, rather than editing them manually.

Enabling/Disabling MPxIO

The syntax of the command stmsboot used to enable/disable MPxIO is :
stmsboot [-D fp|mpt] [-d | -e | -u | -L | -l controller_number]

where:
-D fp|mpt -> to select the protocol where you want to enable/disable mpxio
-e -> to enable STMS on all HBA
-d -> to disable STMS on all HBA
-u -> to update vfstable and dump config after manual file configuration
-l or -L unchanged - see the manpage of stms for a full description.
Few examples of using stmsboot command are :
# stmsboot -eTo enable MPxIO or all devices (globally)
# stmsboot -D fp -eTo enable MPxIO for fiber channel devices
# stmsboot -dTo disable MPxIO for all devices (globally)

How to confirm MPxIO is enabled

To make sure that MPxIO is enabled for a LUN, simply run the format command and check for the /scsi_vhci in the logical path of the LUN.

# format
4. c6t60060E800561CF00000061CF00000002d0 
          /scsi_vhci/ssd@g60060e800561cf00000061cf00000002
Another way is to check the “mpxio-disable” parameter in the configuration files :

Solaris 7,8,9
# egrep "^mpxio-disable=" /kernel/drv/*.conf
/kernel/drv/scsi_vhci.conf:mpxio-disable="no";
 
Solaris 10
# egrep "^mpxio-disable=" /kernel/drv/*.conf
/kernel/drv/fp.conf:mpxio-disable="no";
 
Solaris 11
# egrep "^mpxio-disable=" /etc/driver/drv/*.conf
/etc/driver/drv/fp.conf:mpxio-disable="no";
For Solaris 10 and 11, MPxIO is enabled by default on X86 platforms.

Verifying that the scsi_vhci module is loaded

scsi_vhci is the virtual host controller interconnect driver used to manage path of storage LUN. If you find that the scsi_vhci module is not loaded, then most likely MPxIO is not enabled.
Solaris[TM] 7,8,9,10,11
# modinfo -c |grep scsi_vhci
 21          1 scsi_vhci                        LOADED/INSTALLED

Verifying Health of paths

We can check the multiple paths to the storage array LUNs by using mpathadm or luxadm command. The various states for the paths are :

ONLINE/primary
ONLINE/secondary
STANDBY/secondary
OFFLINE/*
UNAVAILABLE/*
 
mpathadm (supported for FC/SAS/iSCSI) [Works on Solaris 10, 11]
luxadm (supported on FC only) [Works on Solaris 7,8,9,10,11]

# mpathadm list LU
        /dev/rdsk/c9t60080E50001C0300000006464D8C9044d0s2
                Total Path Count: 2 
                Operational Path Count: 2
To check the health of the paths using mpathadm :
# mpathadm show LU  /dev/rdsk/c9t60080E50001C0300000006464D8C9044d0s2

Logical Unit:  /dev/rdsk/c9t60080E50001C0300000006464D8C9044d0s2
        mpath-support:  libmpscsi_vhci.so
        Vendor:  SUN     
        Product:  LCSM100_F
        Revision:  0777
        Name Type:  unknown type
        Name:  60080e50001c0300000006464d8c9044
        Asymmetric:  yes
        Current Load Balance:  round-robin
        Logical Unit Group ID:  NA
        Auto Failback:  on
        Auto Probing:  NA

        Paths:  
                Initiator Port Name:  210000e08b07922c
                Target Port Name:  203d0080e51c2cc4
                Override Path:  NA
                Path State:  OK
                Disabled:  no

                Initiator Port Name:  210000e08b07f32c
                Target Port Name:  203e0080e51c2cc4
                Override Path:  NA
                Path State:  OK
                Disabled:  no
.........
To check health of paths using luxadm :
# luxadm probe
                Found Fibre Channel device(s):
                  ......
                Logical Path:/dev/rdsk/c6t60060E800561CF00000061CF00000002d0s2
                Node WWN:203e0080e51c2cc4  Device Type:Disk device
                   ......
# luxadm display 203e0080e51c2cc4
DEVICE PROPERTIES for disk: 203e0080e51c2cc4
  Vendor:               SUN     
  Product ID:           LCSM100_F ------------> this is a 2540 or 2540-M2 array
  Revision:             0777
  Serial Num:           SV04720931      
  Unformatted capacity: 5120.000 MBytes
  Write Cache:          Enabled
  Read Cache:           Enabled
    Minimum prefetch:   0x3
    Maximum prefetch:   0x0
  Device Type:          Disk device
  Path(s):

  /dev/rdsk/c9t60080E50001C0300000006464D8C9044d0s2
  /devices/scsi_vhci/ssd@g60080e50001c0300000006464d8c9044:c,raw
   Controller           /devices/pci@1d,700000/SUNW,qlc@1/fp@0,0
    Device Address              203d0080e51c2cc4,0
    Host controller port WWN    210000e08b07922c
    Class                       primary
    State                       ONLINE
   Controller           /devices/pci@1c,600000/SUNW,qlc@1/fp@0,0
    Device Address              203e0080e51c2cc4,0
    Host controller port WWN    210000e08b07f32c
    Class                       secondary
    State                       ONLINE

Load Balancing policies

MPxIO also provides the load balancing capability to the I/O. There are basically 3 options to configure load balancing :
Round RobinSelects all paths in a round robin way.
Logical BlockI/Os within the range specified by range_size parameter would go on the same path. Improves performance on some storage arrays which have per path caching of data.
NoneNo load balancing – only one path is used.
The load balancing policy can be set in the configuration file /kernel/drv/scsi_vhci.conf for solaris 10 and earlier or in the /etc/driver/drv/scsi_vhci.conf file for solaris 11.
load-balance="round-robin";

Auto-failback policy

Auto-failback policy enables the re-enable the failed path after it has recovered from the failure. By default the auto-failback is enabled. There are 2 ways to enable the auto-failback :
Non-persistent way
By this method, the auto-failback option does not persist across reboots.
# mpathadm modify mpath-support --autofailback on libmpscsi_vhci.so
# mpathadm modify mpath-support -a on libmpscsi_vhci.so
Persistent way
For the changes to persist across reboots set the auto-failback parameter in the configuration file /kernel/drv/scsi_vhci.conf for solaris 10 and earlier or in the /etc/driver/drv/scsi_vhci.conf file for solaris 11. This requires a reconfiguration reboot.
auto-failback="enable";
Verifying auto-failback
To confirm that the auto-failback is enabled use :
# mpathadm show mpath-support libmpscsi_vhci.so | grep -i failback
           Supported Auto Failback Config:  1
           Auto Failback:  on  <--- 0="" current="" failback="" max="" polling="" pre="" rate="">


========================================================


bash-3.2# egrep "^mpxio-disable=" /kernel/drv/*.conf
/kernel/drv/fp.conf:mpxio-disable="yes"; => change to no/kernel/drv/iscsi.conf:mpxio-disable="no";
/kernel/drv/mpt.conf:mpxio-disable="yes"; => change to no
/kernel/drv/mpt_sas.conf:mpxio-disable="no";

bash-3.2# mpathadm list lu
        /dev/rdsk/c6t20000018620E6681d0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c6t20000018620E42AFd0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c6t20000018620E400Bd0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c6t20000018620E4155d0s2
                Total Path Count: 1
                Operational Path Count: 1
        /scsi_vhci/ses@g5080020000284028
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c6t600A0B800018B3CA000052F6534DB0C5d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c6t600A0B800018B3CA000052EF534DB005d0s2
                Total Path Count: 2
                Operational Path Count: 2

           

bash-3.2# fcinfo hba-port
HBA Port WWN: 210000144f415c2a
        OS Device Name: /dev/cfg/c1
        Manufacturer: QLogic Corp.
        Model: 2200
        Firmware Version: 02.01.145
        FCode/BIOS Version: ISP2200 FC-AL Host Adapter Driver: 1.15 04/03/22
        Serial Number: not available
        Driver Name: qlc
        Driver Version: 20120717-4.01
        Type: L-port
        State: online
        Supported Speeds: 1Gb
        Current Speed: 1Gb
        Node WWN: 200000144f415c2a
HBA Port WWN: 10000000c9c25df0
        OS Device Name: /dev/cfg/c4
        Manufacturer: Emulex
        Model: LP11000-S
        Firmware Version: 2.82a4 (B3D2.82A4)
        FCode/BIOS Version: Boot:5.02a1 Fcode:1.50a9
        Serial Number: 0999BT0-1121000JC2
        Driver Name: emlxs
        Driver Version: 2.80.8.0 (2012.09.17.15.45)
        Type: L-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 20000000c9c25df0
HBA Port WWN: 10000000c9c25d6f
        OS Device Name: /dev/cfg/c5
        Manufacturer: Emulex
        Model: LP11000-S
        Firmware Version: 2.82a4 (B3D2.82A4)
        FCode/BIOS Version: Boot:5.02a1 Fcode:1.50a9
        Serial Number: 0999BT0-1121000J8Z
        Driver Name: emlxs
        Driver Version: 2.80.8.0 (2012.09.17.15.45)
        Type: L-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 20000000c9c25d6f
       
       
       
bash-3.2# mpathadm list mpath-support
mpath-support:  libmpscsi_vhci.so


bash-3.2# mpathadm list initiator-port
Initiator Port:  210000144f415c2a
Initiator Port:  10000000c9c25df0
Initiator Port:  10000000c9c25d6f
Initiator Port:  iqn.1986-03.com.sun:01:00144f415c2a.5354dd03,4000002a00ff




bash-3.2# mpathadm show initiator-port 10000000c9c25df0
Initiator Port:  10000000c9c25df0
        Transport Type:  Fibre Channel
        OS Device File:  /devices/pci@9,600000/SUNW,emlxs@1/fp@0,0
bash-3.2# mpathadm show initiator-port 10000000c9c25d6f
Initiator Port:  10000000c9c25d6f
        Transport Type:  Fibre Channel
        OS Device File:  /devices/pci@9,600000/SUNW,emlxs@2/fp@0,0
       
       
bash-3.2# mpathadm show lu /dev/rdsk/c6t600A0B800018B3CA000052F6534DB0C5d0s2
Logical Unit:  /dev/rdsk/c6t600A0B800018B3CA000052F6534DB0C5d0s2
        mpath-support:  libmpscsi_vhci.so
        Vendor:  SUN    
        Product:  CSM100_R_FC    
        Revision:  0660
        Name Type:  unknown type
        Name:  600a0b800018b3ca000052f6534db0c5
        Asymmetric:  yes
        Current Load Balance:  round-robin
        Logical Unit Group ID:  NA
        Auto Failback:  on
        Auto Probing:  NA

        Paths: 
                Initiator Port Name:  10000000c9c25df0
                Target Port Name:  200400a0b81ffbef
                Override Path:  NA
                Path State:  OK
                Disabled:  no

                Initiator Port Name:  10000000c9c25d6f
                Target Port Name:  200500a0b81ffbef
                Override Path:  NA
                Path State:  OK
                Disabled:  no

        Target Port Groups: 
                ID:  6
                Explicit Failover:  yes
                Access State:  standby
                Target Ports:
                        Name:  200400a0b81ffbef
                        Relative ID:  0

                ID:  7
                Explicit Failover:  yes
                Access State:  active
                Target Ports:
                        Name:  200500a0b81ffbef
                        Relative ID:  0
                     
=================================
Test multipath

bash-3.2# fcinfo hba-port

HBA Port WWN: 10000000c9c25df0
        OS Device Name: /dev/cfg/c4
        Manufacturer: Emulex
        Model: LP11000-S
        Firmware Version: 2.82a4 (B3D2.82A4)
        FCode/BIOS Version: Boot:5.02a1 Fcode:1.50a9
        Serial Number: 0999BT0-1121000JC2
        Driver Name: emlxs
        Driver Version: 2.80.8.0 (2012.09.17.15.45)
        Type: L-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 20000000c9c25df0
HBA Port WWN: 10000000c9c25d6f
        OS Device Name: /dev/cfg/c5
        Manufacturer: Emulex
        Model: LP11000-S
        Firmware Version: 2.82a4 (B3D2.82A4)
        FCode/BIOS Version: Boot:5.02a1 Fcode:1.50a9
        Serial Number: 0999BT0-1121000J8Z
        Driver Name: emlxs
        Driver Version: 2.80.8.0 (2012.09.17.15.45)
        Type: L-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 20000000c9c25d6f

bash-3.2# luxadm -e forcelip /dev/cfg/c4


$ luxadm -e forcelip /dev/cfg/c4

bash-3.2# tail -f /var/adm/messages

[ID 349649 kern.info] [ 5.06C6]emlxs1: NOTICE: 730: Link reset. (Resetting link...)
[ID 349649 kern.info] [ 5.03DD]emlxs1: NOTICE: 710: Link down.
[ID 349649 kern.info] [ 5.0715]emlxs1: NOTICE: 730: Link reset.
[ID 349649 kern.info] [ 5.061B]emlxs1: NOTICE: 720: Link up. (2Gb, loop, initiator)


[ID 349649 kern.info] [ 5.06C6]emlxs0: NOTICE: 730: Link reset. (Resetting link...)
[ID 349649 kern.info] [ 5.03DD]emlxs0: NOTICE: 710: Link down.
[ID 349649 kern.info] [ 5.0715]emlxs0: NOTICE: 730: Link reset.
[ID 349649 kern.info] [ 5.061B]emlxs0: NOTICE: 720: Link up. (2Gb, loop, initiator)




Thursday, April 17, 2014

Mac OS enable X11 Forwarding with SSH

Installation of the third-party software XQuartz.

$ if [ -z $DISPLAY ]; then export DISPLAY=:0.0; fi
$ ssh -X -Y oracle@10.151.100.247
$ ssh -X -Y oracle@10.151.100.247

Sun Sparc Install solaris with DHCP on Mac OS

Step 1:  Prepare File System

$ hdiutil create -size 1g -type SPARSE -fs HFSX -volname "install" install
$ hdiutil attach install.sparseimage -mountpoint /install


Step 2: Open file ISO

$ open sol-10-u8-ga-x86-dvd.iso

$ df -h
/dev/disk3     2.1Gi  2.1Gi    0Bi   100%        0        0  100%   /Volumes/SOL_10_811_SPARC

Step 3: NFS config

$ sudo vi /etc/exports

/install                  -alldirs -maproot=root
/Volumes/SOL_10_811_X86  -alldirs -maproot=root


Start NFS 
$ sudo nfsd checkexports && sudo nfsd disable
$ sudo nfsd checkexports && sudo nfsd enable


Check export 

$ showmount -e
Exports list on localhost:
/Volumes/SOL_10_811_SPARC             Everyone
/install                            Everyone

Step 4, TFTP

$ sudo vi /System/Library/LaunchDaemons/tftp.plist


[...]
    ProgramArguments
    
        /usr/libexec/tftpd
        -i
        -s
        /install/tftpboot
    
[...]


$ mkdir /install/tftpboot
$ sudo launchctl unload -w /System/Library/LaunchDaemons/tftp.plist
$ sudo launchctl load -w /System/Library/LaunchDaemons/tftp.plist

Test tftp
echo "testing" >/install/tftpboot/testfile
printf "verbose\ntrace\nget testfile\n" | tftp localhost
rm /install/tftpboot/testfile


Step 5 rsync

$ rsync -av /Volumes/SOL_10_811_SPARC/Solaris_10/Tools/Boot/platform
/install/tftpboot/boot_sparc/



View file  
 
TRUNGs-MacBook-Pro:tam lptrung$ cd
/install/tftpboot/boot_sparc/platform/
TRUNGs-MacBook-Pro:platform lptrung$ ls
sun4u    sun4us    sun4v
TRUNGs-MacBook-Pro:platform lptrung$ cd sun4u
TRUNGs-MacBook-Pro:sun4u lptrung$ ls -ltr
total 2584
-rw-r--r--  1 root  wheel  1092272 Aug 23  2011 wanboot
-rw-r--r--  1 root  wheel   221584 Aug 23  2011 inetboot
lrwxrwxrwx  1 root  wheel       34 Aug 23  2011 boot_archive -> ../../../../../boot/sparc.miniroot


Step 6 Config network server

$ ifconfig -a

en1: flags=8863 mtu 1500
    ether 4c:8d:79:e0:59:ac
    inet6 fe80::4e8d:79ff:fee0:59ac%en1 prefixlen 64 scopeid 0x4
    inet 192.168.100.1 netmask 0xffffff00 broadcast 192.168.100.255
    media: autoselect
    status: active
 

Step 7, DHCP with ISC DHCP

$ cat /etc/dhcpd.conf
option domain-name "example.com";
option domain-name-servers 192.168.100.1;
option subnet-mask 255.255.255.0;

ddns-update-style none;
authoritative;
default-lease-time 43200;
max-lease-time 86400;
server-name "servername";

###########SOLARIS SPARC 10 ######################

subnet 192.168.100.0 netmask 255.255.255.0 {
  pool {range 192.168.100.5 192.168.100.254;}
  option routers 192.168.100.1;
}


option space SUNW;
option SUNW.root-mount-options code 1 = text;
option SUNW.root-server-ip-address code 2 = ip-address;
option SUNW.root-server-hostname code 3 = text;
option SUNW.root-path-name code 4 = text;
option SUNW.swap-server-ip-address code 5 = ip-address;
option SUNW.swap-file-path code 6 = text;
option SUNW.boot-file-path code 7 = text;
option SUNW.posix-timezone-string code 8 = text;
option SUNW.boot-read-size code 9 = unsigned integer 16;
option SUNW.install-server-ip-address code 10 = ip-address;
option SUNW.install-server-hostname code 11 = text;
option SUNW.install-path code 12 = text;
option SUNW.sysid-config-file-server code 13 = text;
option SUNW.JumpStart-server code 14 = text;
option SUNW.terminal-name code 15 = text;
option SUNW.root-mount-options "rsize=32768";

group {

        filename "/boot_sparc/platform/sun4u/inetboot";

        vendor-option-space SUNW;

        next-server 192.168.100.1;

        option SUNW.JumpStart-server "191.168.100.1:/Volumes/SOL_10_811_SPARC/Solaris_10/";
        option SUNW.install-server-hostname "191.168.100.1";
        option SUNW.install-server-ip-address 191.168.100.1;
        option SUNW.install-path "/Volumes/SOL_10_811_SPARC";
        option SUNW.root-server-hostname "191.168.100.1";
        option SUNW.root-server-ip-address 191.168.100.1;
        option SUNW.root-path-name "/Volumes/SOL_10_811_SPARC/Solaris_10/Tools/Boot/";

        host v445 {
                hardware ethernet  00:14:4f:a0:c0:dc;
                fixed-address 192.168.100.10;
                option host-name "TT4-V445-A";
                option SUNW.sysid-config-file-server "191.168.100.1:/install/jumpstart";
        }

}


#########END SOLARIS SPARC 10 ################################

subnet 192.168.2.0 netmask 255.255.255.0 {
        option broadcast-address 192.168.2.255;
        option subnet-mask 255.255.255.0;
        option routers 192.168.2.1;
        pool { range 192.168.2.116 192.168.2.254; }
}

host client3 {
  filename "/boot/grub/pxegrub";
  server-name "servername";
  next-server 192.168.2.166;
  hardware ethernet 00:1C:42:C4:CF:1D;
  fixed-address 192.168.2.100;
}
----------------------------------------------------------------------------------------------------

 Test DHCP
$ sudo dhcpd
Listening on BPF/en1/4c:8d:79:e0:59:ac/192.168.100.0/24
Sending on   BPF/en1/4c:8d:79:e0:59:ac/192.168.100.0/24

$sudo /opt/local/sbin/dhcpd -q -f$ ps -ef |grep dhcp
    0   187     1   0  2:25PM ??         0:00.56 /opt/local/sbin/dhcpd -q -f
  501  1815   990   0 10:03AM ttys001    0:00.00 grep dhcp

Note: if dhcpd not start, You can kill -9 ID DHCP and start it

Step 8: Boot Server V890 and boot net dhcp
Testing /pci@8,600000/network@1
Testing /pci@8,600000/SUNW,qlc@2
Testing /pci@9,700000/ebus@1/i2c@1,2e
Testing /pci@9,700000/ebus@1/i2c@1,30
Testing /pci@9,700000/ebus@1/i2c@1,50002e 
  


- Send break load ok mode
  
ok show-nets
ok cd /pci@8,600000/network@1
ok .properties  => find search mac address
ok device-end
ok boot /pci@........:dhcp

Step 9: After install config network ipmp
$ dladm show-dev

$ vi /etc/hostname.bge0
10.151.100.240 netmask + broadcast + group ipmp0 up

$ vi /etc/hostname.bge1
group ipmp0 standby up

$vi /etc/netmasks
10.151.100.192  255.255.255.192

$vi /etc/defaultrouter
10.151.100.193

$ svcadm restart network/physical

After ping test network, if not run please reboot and test ipmp


Step 10: Enable SSH for root
$ vi /etc/ssh/sshd_config
You can change PermitRootLogin yes

$svcadm restart svc:/network/ssh:default

Step 11: Map disk from SAN to server and scan device create ZFS

$echo | format

Use the command to find the newly created drive and load its drivers.
$devfsadm

Check port
luxadm -e port
prtconf -vp | grep wwn
fcinfo hba-port


Install oracle 11g silent

Copy from Oracle sample file: /database/response/db_install.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/oracle/OraInventory
ORACLE_HOME=/oracle/product/11.2.0/template
ORACLE_BASE=/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
DECLINE_SECURITY_UPDATES=true

2) Silent installation
./runInstaller -silent -noconfig -responseFile /u01/download/db11ginstall.rsp


Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 22753 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3817 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-06-17_09-02-07PM. Please wait ..
$ You can find the log of this install session at:
 /oracle/OraInventory/logs/installActions2011-06-17_09-02-07PM.log
The following configuration scripts need to be executed as the "root" user.
 #!/bin/sh
 #Root scripts to run

/oracle/product/11.2.0/template/root.sh
To execute the configuration scripts:
         1. Open a terminal window
         2. Log in as "root"
         3. Run the scripts
         4. Return to this window and hit "Enter" key to continue

Successfully Setup Software.
 
 
 
 
Example:
 
####################################################################
## Copyright(c) Oracle Corporation 1998,2011. All rights reserved.##
##                                                                ##
## Specify values for the variables listed below to customize     ##
## your installation.                                             ##
##                                                                ##
## Each variable is associated with a comment. The comment        ##
## can help to populate the variables with the appropriate        ##
## values.         ##
##                                                                ##
## IMPORTANT NOTE: This file contains plain text passwords and    ##
## should be secured to have read permission only by oracle user  ##
## or db administrator who owns this installation.                ##
##                                                                ##
####################################################################

#------------------------------------------------------------------------------
# Do not change the following system generated value. 
#------------------------------------------------------------------------------
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

#------------------------------------------------------------------------------
# Specify the installation option.
# It can be one of the following:
# 1. INSTALL_DB_SWONLY
# 2. INSTALL_DB_AND_CONFIG
# 3. UPGRADE_DB
#-------------------------------------------------------------------------------
oracle.install.option=INSTALL_DB_SWONLY

#-------------------------------------------------------------------------------
# Specify the hostname of the system as set during the install. It can be used
# to force the installation to use an alternative hostname rather than using the
# first hostname found on the system. (e.g., for systems with multiple hostnames 
# and network interfaces)
#-------------------------------------------------------------------------------
ORACLE_HOSTNAME=TT4-V890-B

#-------------------------------------------------------------------------------
# Specify the Unix group to be set for the inventory directory.  
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME=oinstall

#-------------------------------------------------------------------------------
# Specify the location which holds the inventory files.
# This is an optional parameter if installing on
# Windows based Operating System.
#-------------------------------------------------------------------------------
INVENTORY_LOCATION=/u01/app/oraInventory

#-------------------------------------------------------------------------------
# Specify the languages in which the components will be installed.             
# 
# en   : English                  ja   : Japanese                  
# fr   : French                   ko   : Korean                    
# ar   : Arabic                   es   : Latin American Spanish    
# bn   : Bengali                  lv   : Latvian                   
# pt_BR: Brazilian Portuguese     lt   : Lithuanian                
# bg   : Bulgarian                ms   : Malay                     
# fr_CA: Canadian French          es_MX: Mexican Spanish           
# ca   : Catalan                  no   : Norwegian                 
# hr   : Croatian                 pl   : Polish                    
# cs   : Czech                    pt   : Portuguese                
# da   : Danish                   ro   : Romanian                  
# nl   : Dutch                    ru   : Russian                   
# ar_EG: Egyptian                 zh_CN: Simplified Chinese        
# en_GB: English (Great Britain)  sk   : Slovak                    
# et   : Estonian                 sl   : Slovenian                 
# fi   : Finnish                  es_ES: Spanish                   
# de   : German                   sv   : Swedish                   
# el   : Greek                    th   : Thai                      
# iw   : Hebrew                   zh_TW: Traditional Chinese       
# hu   : Hungarian                tr   : Turkish                   
# is   : Icelandic                uk   : Ukrainian                 
# in   : Indonesian               vi   : Vietnamese                
# it   : Italian                                                   
#
# all_langs   : All languages
#
# Specify value as the following to select any of the languages.
# Example : SELECTED_LANGUAGES=en,fr,ja
#
# Specify value as the following to select all the languages.
# Example : SELECTED_LANGUAGES=all_langs  
#------------------------------------------------------------------------------
SELECTED_LANGUAGES=en

#------------------------------------------------------------------------------
# Specify the complete path of the Oracle Home.
#------------------------------------------------------------------------------
ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/dbhome_1

#------------------------------------------------------------------------------
# Specify the complete path of the Oracle Base. 
#------------------------------------------------------------------------------
ORACLE_BASE=/u01/app/oracle

#------------------------------------------------------------------------------
# Specify the installation edition of the component.                        
#                                                             
# The value should contain only one of these choices.        
# EE     : Enterprise Edition                                
# SE     : Standard Edition                                  
# SEONE  : Standard Edition One
# PE     : Personal Edition (WINDOWS ONLY)
#------------------------------------------------------------------------------
oracle.install.db.InstallEdition=EE

#------------------------------------------------------------------------------
# This variable is used to enable or disable custom install and is considered
# only if InstallEdition is EE.
#
# true  : Components mentioned as part of 'optionalComponents' property
#         are considered for install.
# false : Value for 'optionalComponents' is not considered.
#------------------------------------------------------------------------------
oracle.install.db.EEOptionsSelection=false

#------------------------------------------------------------------------------
# This variable is considered only if 'EEOptionsSelection' is set to true. 
#
# Description: List of Enterprise Edition Options you would like to enable.
#
#              The following choices are available. You may specify any
#              combination of these choices.  The components you choose should
#              be specified in the form "internal-component-name:version"
#              Below is a list of components you may specify to enable.
#        
#              oracle.oraolap:11.2.0.3.0 - Oracle OLAP
#              oracle.rdbms.dm:11.2.0.3.0 - Oracle Data Mining
#              oracle.rdbms.dv:11.2.0.3.0 - Oracle Database Vault
#              oracle.rdbms.lbac:11.2.0.3.0 - Oracle Label Security
#              oracle.rdbms.partitioning:11.2.0.3.0 - Oracle Partitioning
#              oracle.rdbms.rat:11.2.0.3.0 - Oracle Real Application Testing
#------------------------------------------------------------------------------
oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.3.0,oracle.oraolap:11.2.0.3.0,oracle.rdbms.dm:11.2.0.3.0,oracle.rdbms.dv:11.2.0.3.0,oracle.rdbms.lbac:11.2.0.3.0,oracle.rdbms.rat:11.2.0.3.0

###############################################################################
#                                                                             #
# PRIVILEGED OPERATING SYSTEM GROUPS                                         #
# ------------------------------------------                                  #
# Provide values for the OS groups to which OSDBA and OSOPER privileges       #
# needs to be granted. If the install is being performed as a member of the   #  
# group "dba", then that will be used unless specified otherwise below.       #
#                                                                             #
# The value to be specified for OSDBA and OSOPER group is only for UNIX based #
# Operating System.                                                           #
#                                                                             #
###############################################################################

#------------------------------------------------------------------------------
# The DBA_GROUP is the OS group which is to be granted OSDBA privileges.
#------------------------------------------------------------------------------
oracle.install.db.DBA_GROUP=dba

#------------------------------------------------------------------------------
# The OPER_GROUP is the OS group which is to be granted OSOPER privileges.
# The value to be specified for OSOPER group is optional.
#------------------------------------------------------------------------------
oracle.install.db.OPER_GROUP=dba

#------------------------------------------------------------------------------
# Specify the cluster node names selected during the installation.
# Example : oracle.install.db.CLUSTER_NODES=node1,node2
#------------------------------------------------------------------------------
oracle.install.db.CLUSTER_NODES=

#------------------------------------------------------------------------------
# This variable is used to enable or disable RAC One Node install.
#
# true  : Value of RAC One Node service name is used.
# false : Value of RAC One Node service name is not used.
#
# If left blank, it will be assumed to be false
#------------------------------------------------------------------------------
oracle.install.db.isRACOneInstall=false

#------------------------------------------------------------------------------
# Specify the name for RAC One Node Service. 
#------------------------------------------------------------------------------
oracle.install.db.racOneServiceName=

#------------------------------------------------------------------------------
# Specify the type of database to create.
# It can be one of the following:
# - GENERAL_PURPOSE/TRANSACTION_PROCESSING             
# - DATA_WAREHOUSE                                
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

#------------------------------------------------------------------------------
# Specify the Starter Database Global Database Name. 
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.globalDBName=utility

#------------------------------------------------------------------------------
# Specify the Starter Database SID.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.SID=utility

#------------------------------------------------------------------------------
# Specify the Starter Database character set.
#                                              
# It can be one of the following:
# AL32UTF8, WE8ISO8859P15, WE8MSWIN1252, EE8ISO8859P2,
# EE8MSWIN1250, NE8ISO8859P10, NEE8ISO8859P4, BLT8MSWIN1257,
# BLT8ISO8859P13, CL8ISO8859P5, CL8MSWIN1251, AR8ISO8859P6,
# AR8MSWIN1256, EL8ISO8859P7, EL8MSWIN1253, IW8ISO8859P8,
# IW8MSWIN1255, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE,
# KO16MSWIN949, ZHS16GBK, TH8TISASCII, ZHT32EUC, ZHT16MSWIN950,
# ZHT16HKSCS, WE8ISO8859P9, TR8MSWIN1254, VN8MSWIN1258
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.characterSet=AL32UTF8

#------------------------------------------------------------------------------
# This variable should be set to true if Automatic Memory Management 
# in Database is desired.
# If Automatic Memory Management is not desired, and memory allocation
# is to be done manually, then set it to false.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.memoryOption=true

#------------------------------------------------------------------------------
# Specify the total memory allocation for the database. Value(in MB) should be
# at least 256 MB, and should not exceed the total physical memory available 
# on the system.
# Example: oracle.install.db.config.starterdb.memoryLimit=512
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.memoryLimit=4096

#------------------------------------------------------------------------------
# This variable controls whether to load Example Schemas onto
# the starter database or not.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.installExampleSchemas=false

#------------------------------------------------------------------------------
# This variable includes enabling audit settings, configuring password profiles
# and revoking some grants to public. These settings are provided by default. 
# These settings may also be disabled.    
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.enableSecuritySettings=false

###############################################################################
#                                                                             #
# Passwords can be supplied for the following four schemas in the       #
# starter database:                  #
#   SYS                                                                       #
#   SYSTEM                                                                    #
#   SYSMAN (used by Enterprise Manager)                                       #
#   DBSNMP (used by Enterprise Manager)                                       #
#                                                                             #
# Same password can be used for all accounts (not recommended)         #
# or different passwords for each account can be provided (recommended)       #
#                                                                             #
###############################################################################

#------------------------------------------------------------------------------
# This variable holds the password that is to be used for all schemas in the
# starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.ALL=sys236

#-------------------------------------------------------------------------------
# Specify the SYS password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYS=

#-------------------------------------------------------------------------------
# Specify the SYSTEM password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYSTEM=

#-------------------------------------------------------------------------------
# Specify the SYSMAN password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYSMAN=

#-------------------------------------------------------------------------------
# Specify the DBSNMP password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.DBSNMP=

#-------------------------------------------------------------------------------
# Specify the management option to be selected for the starter database. 
# It can be one of the following:
# 1. GRID_CONTROL
# 2. DB_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.control=DB_CONTROL

#-------------------------------------------------------------------------------
# Specify the Management Service to use if Grid Control is selected to manage 
# the database.      
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=

###############################################################################
#                                                                             #
# SPECIFY BACKUP AND RECOVERY OPTIONS                                        #
# ------------------------------------                                #
# Out-of-box backup and recovery options for the database can be mentioned    #
# using the entries below.            # 
#                                                                             #
###############################################################################

#------------------------------------------------------------------------------
# This variable is to be set to false if automated backup is not required. Else 
# this can be set to true.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.automatedBackup.enable=false

#------------------------------------------------------------------------------
# Regardless of the type of storage that is chosen for backup and recovery, if 
# automated backups are enabled, a job will be scheduled to run daily to backup 
# the database. This job will run as the operating system user that is 
# specified in this variable.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.automatedBackup.osuid=

#-------------------------------------------------------------------------------
# Regardless of the type of storage that is chosen for backup and recovery, if 
# automated backups are enabled, a job will be scheduled to run daily to backup 
# the database. This job will run as the operating system user specified by the 
# above entry. The following entry stores the password for the above operating 
# system user.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.automatedBackup.ospwd=

#-------------------------------------------------------------------------------
# Specify the type of storage to use for the database.
# It can be one of the following:
# - FILE_SYSTEM_STORAGE
# - ASM_STORAGE
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE

#-------------------------------------------------------------------------------
# Specify the database file location which is a directory for datafiles, control
# files, redo logs.         
#
# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM_STORAGE 
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/u01/oradata

#-------------------------------------------------------------------------------
# Specify the backup and recovery location.
#
# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM_STORAGE 
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=

#-------------------------------------------------------------------------------
# Specify the existing ASM disk groups to be used for storage.
#
# Applicable only when oracle.install.db.config.starterdb.storage=ASM_STORAGE
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.diskGroup=

#-------------------------------------------------------------------------------
# Specify the password for ASMSNMP user of the ASM instance.                  
#
# Applicable only when oracle.install.db.config.starterdb.storage=ASM_STORAGE 
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.ASMSNMPPassword=

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username.
#
#  Example   : MYORACLESUPPORT_USERNAME=abc@oracle.com
#------------------------------------------------------------------------------
MYORACLESUPPORT_USERNAME=abc@oracle.com

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username password.
#
# Example    : MYORACLESUPPORT_PASSWORD=password
#------------------------------------------------------------------------------
MYORACLESUPPORT_PASSWORD=123

#------------------------------------------------------------------------------
# Specify whether to enable the user to set the password for
# My Oracle Support credentials. The value can be either true or false.
# If left blank it will be assumed to be false.
#
# Example    : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true
#------------------------------------------------------------------------------
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

#------------------------------------------------------------------------------
# Specify whether user doesn't want to configure Security Updates.
# The value for this variable should be true if you don't want to configure
# Security Updates, false otherwise. 
#
# The value can be either true or false. If left blank it will be assumed
# to be false.
#
# Example    : DECLINE_SECURITY_UPDATES=false
#------------------------------------------------------------------------------
DECLINE_SECURITY_UPDATES=true

#------------------------------------------------------------------------------
# Specify the Proxy server name. Length should be greater than zero.
#
# Example    : PROXY_HOST=proxy.domain.com 
#------------------------------------------------------------------------------
PROXY_HOST=

#------------------------------------------------------------------------------
# Specify the proxy port number. Should be Numeric and atleast 2 chars.
#
# Example    : PROXY_PORT=25 
#------------------------------------------------------------------------------
PROXY_PORT=

#------------------------------------------------------------------------------
# Specify the proxy user name. Leave PROXY_USER and PROXY_PWD 
# blank if your proxy server requires no authentication.
#
# Example    : PROXY_USER=username 
#------------------------------------------------------------------------------
PROXY_USER=

#------------------------------------------------------------------------------
# Specify the proxy password. Leave PROXY_USER and PROXY_PWD  
# blank if your proxy server requires no authentication.
#
# Example    : PROXY_PWD=password 
#------------------------------------------------------------------------------
PROXY_PWD=

#------------------------------------------------------------------------------
# Specify the proxy realm. This value is used if auto-updates option is selected.
#
# Example    : PROXY_REALM=metalink 
#------------------------------------------------------------------------------
PROXY_REALM=

#------------------------------------------------------------------------------
# Specify the Oracle Support Hub URL. 
# 
# Example    : COLLECTOR_SUPPORTHUB_URL=https://orasupporthub.company.com:8080/
#------------------------------------------------------------------------------
COLLECTOR_SUPPORTHUB_URL=

#------------------------------------------------------------------------------
# Specify the auto-updates option. It can be one of the following:
# a.MYORACLESUPPORT_DOWNLOAD
# b.OFFLINE_UPDATES
# c.SKIP_UPDATES
#------------------------------------------------------------------------------
oracle.installer.autoupdates.option=SKIP_UPDATES
#------------------------------------------------------------------------------
# In case MYORACLESUPPORT_DOWNLOAD option is chosen, specify the location where
# the updates are to be downloaded.
# In case OFFLINE_UPDATES option is chosen, specify the location where the updates 
# are present.
oracle.installer.autoupdates.downloadUpdatesLoc=
#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username which has the patches download privileges  
# to be used for software updates.
#  Example   : AUTOUPDATES_MYORACLESUPPORT_USERNAME=abc@oracle.com
#------------------------------------------------------------------------------
AUTOUPDATES_MYORACLESUPPORT_USERNAME=

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username password which has the patches download privileges  
# to be used for software updates.
#
# Example    : AUTOUPDATES_MYORACLESUPPORT_PASSWORD=password
#------------------------------------------------------------------------------
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=