Tuesday, April 30, 2013

Default User Name and Password

WebLogic Admin Console
https://www.goweekend.ca:7103/console/login/LoginForm.jsp
weblogic/welcome1
weblogic/weblogic1

Oracle Enterprise Manager Cloud Control 12c
https://www.goweekend.ca:7803/em
system/

WebSphere KeyStore and HTTP Server Key Store
default password: WebAS

Java CACERTS
changeit

WAS: Using Resource URL

WAS Version: 8.0.0.4

HTTP Server and WAS are hosted on same server
the application requires Authentication Virtual Host defined, and add 9443/9080/443 in alias.

Application A calls up Application B using URL (port 443), i.e. https://www.goweekend.ca/myauthentication/welcome.do

when user connected the application, the browser detected infinite loop, and refuse to work.

Cause:

seems, when application A calls up B, it skipped plugin to do SSL Handshake with application server directly.

Fix:

import HTTP Server Certificate into WAS trust store.

Monday, April 29, 2013

Oracle 11g : Duplicat from Active Database







Applies to:

Oracle Server - Enterprise Edition - Version 11.1.0.6 and later
Information in this document applies to any platform.

Details

You can create a duplicate database using the RMAN duplicate command. The duplicate database has a different DBID from the source database and functions entirely independently.Starting from 11g you can do duplicate database in 2 ways.
1. Active database duplication
2. Backup-based duplication
Active database duplication copies the live target database over the network to the auxiliary destination and then creates the duplicate database.Only difference is that you don't need to have the pre-existing RMAN backups and copies.The duplication work is performed by an auxiliary channel.This channel corresponds to a server session on the auxiliary instance on the auxiliary host.
As part of the duplicating operation, RMAN automates the following steps:

1. Creates a control file for the duplicate database
2. Restarts the auxiliary instance and mounts the duplicate control file
3. Creates the duplicate datafiles and recovers them with incremental backups and archived redo logs.
4. Opens the duplicate database with the RESETLOGS option

For the active database duplication, RMAN does one extra step .i.e. copy the target database datafiles over the network to the auxiliary instance
A RAC TARGET database can be duplicated as well. The procedure is the same as below. If the auxiliary instance needs to be a RAC-database as well, than start the duplicate procedure for to a single instance and convert the auxiliary to RAC after the duplicate has succeeded.
Scope of this note is restricted to Active database duplication . For the Backup-base duplication refer Note 259694.1 Oracle10G RMAN Database Duplication.

Basic Steps to  ACTIVE database duplication :

1. Prepairing the auxiliary instance :
1.1 Creating initialization Parameter file for the Auxiliary instance
If you are using SPFILE then only parameter required for the duplicate database is DB_NAME . Rest other parameters can be set in the DUPLICATE command itself.If you are not using the SPFILE technique, then you need to set initialization parameters to set in the initialization parameter file. Required parameters are :
DB_NAME
CONTROL_FILES
DB_BLOCK_SIZE
DB_FILE_NAME_CONVERT
LOG_FILE_NAME_CONVERT
DB_RECOVERY_FILE_DEST
In this bulletin for simplicity we are specifying all the required parameters in the pfile
1.2 Create an Oracle Password File for the Auxiliary Instance
Password file is must for the Active database duplication.A password file is not required for backup-based duplication. For Active database duplication it connects directly to the auxiliary instance using the password file with the same SYSDBA password as target database. In case you are using password file make sure to have same SYSDBA password as the target database.Also you can specify the PASSWORD FILE option on the DUPLICATE command.In this case, RMAN copies the source database password file to the destination host and overwrites any existing password file for the auxiliary instance.
In this bulletin we are using password file option in the duplicate command .
1.3 Establish Oracle Net Connectivity to the Auxiliary Instance
Auxiliary instance must be available through Oracle Net if you are duplicating  from an ACTIVE database.
 1.4 Start the Auxiliary instance from Sqlplus
Use SQL*Plus to connect to the auxiliary instance and start it in NOMOUNT mode.
STEP S
In Auxiliary server :
1. Create the parameter file . Look at the example :
initTEST.ora
------------
DB_NAME=TEST
diagnostic_dest='E:\oracle'
DB_FILE_name_CONVERT=('I:\app\apadhi\oradata\amar','E:\oracle\oradata\test')
LOG_FILE_NAME_CONVERT=( 'I:\app\apadhi\oradata\amar','E:\oracle\oradata\test')
SGA_TARGET=262144000
CONTROL_FILES='E:\oracle\oradata\TEST\control01.dbf'
COMPATIBLE= 11.1.0.0.0

2. Create the database service ( only for windows ) and password file . Look at the example :
% set ORACLE_SID=TEST
% set ORACLE_HOME=E:\oracle\product\11.1.0\db_1
% oradim -NEW -SID TEST
% orapwd FILE=E:\oracle\product\11.1.0\db_1\database\PWDTEST.ora PASSWORD=sys
For unix/Linux no need to create the service. Rest other steps are same.

3. Start the Auxiliary instance . Look at the example :
% sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Wed Aug 1 20:33:30 2007

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

Connected to an idle instance.

SQL> startup NOMOUNT pfile=E:\oracle\product\11.1.0\db_1\database\initTEST.ora
ORACLE instance started.

Total System Global Area  150667264 bytes
Fixed Size                  1331732 bytes
Variable Size              92278252 bytes
Database Buffers           50331648 bytes
Redo Buffers                6725632 bytes
SQL> exit

4. Create the necessary oracle NET connectivity in the listener.ora and the tnsnames.ora file. Look at the example :
Listener.ora (on the AUXILIARY host)
------------
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = TEST)
      (ORACLE_HOME = E:\oracle\product\11.1.0\db_1)
      (SID_NAME = TEST)
    )
  )


LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = apadhi-idc)(PORT = 1521))
  )
tnsname.ora (In the TARGET and AUXILIARY host)
-----------
## For the Auxiliary database TEST ##
TEST =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = apadhi-idc)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TEST)
    )
  )

## For the target database AMAR ##
AMAR =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 152.69.210.76)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = AMAR)
    )
  )
## Similary add entry for the catalog database ( Optional)
Confirm the connection to both the target and the auxiliary instance using  sqlplus. In this example we are creating the duplicate database from the Auxiliary server.
Execute on the TARGET and AUXILIARY host
% tnsping AMAR
% tnsping TEST


2. Start RMAN and Connect to the Database Instances
Start RMAN and connect to the source database as TARGET, the duplicate database instance as AUXILIARY, and, if applicable, the recovery catalog database.You can start the RMAN client on any host so long as it can connect to all of the database instances. If the auxiliary instance requires a text-based initialization parameter file, then this file must exist on the same host that runs the RMAN client application.
In this bulletin we are doing duplicate database from the auxiliary server. Look at the example :
% rman

Recovery Manager: Release 11.1.0.6.0 - Production on Wed Aug 1 21:06:49 2007
Copyright (c) 1982, 2007, Oracle. All rights reserved.

RMAN> connect TARGET sys / sys @ AMAR;   ## Target database ##
connected to target database: AMAR (DBID=1450838187)

RMAN> connect AUXILIARY sys / sys @ TEST ;  ## Auxiliary database ##
connected to auxiliary database: TEST (not mounted)

RMAN> connect CATALOG rman / rman @ CAT ; ## Catalog database .Optional ##
connected to recovery catalog database

3. Run the DUPLICATE database command :
The simplest case is to use active database duplication to duplicate the database to a different host and use the different directory structure.Look at the example :
This example assumes
This example assumes the following:

* Using a recovery catalog.
* The target database is on host1 and contains 4 datafiles.
* Duplicate the target to database TEST on the different  host having different file structure.
* Tablespace USERS in target is read-only tablespace.
* Running duplicate database from the Auxiliary site.
RMAN> DUPLICATE TARGET DATABASE 
      TO 'TEST'
      FROM ACTIVE DATABASE
      DB_FILE_NAME_CONVERT 'I:\app\apadhi\oradata\amar','E:\oracle\oradata\test';
 And this is what is going on:
Starting Duplicate Db at 02-AUG-07
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=97 device type=DISK

contents of Memory Script:
{
   set newname for datafile  1 to "E:\ORACLE\ORADATA\TEST\SYSTEM01.DBF";
   set newname for datafile  2 to "E:\ORACLE\ORADATA\TEST\SYSAUX01.DBF";
   set newname for datafile  3 to "E:\ORACLE\ORADATA\TEST\UNDOTBS01.DBF";
   set newname for datafile  4 to "E:\ORACLE\ORADATA\TEST\USERS01.DBF";
   backup as copy reuse
   datafile  1 auxiliary format  "E:\ORACLE\ORADATA\TEST\SYSTEM01.DBF"  
   datafile  2 auxiliary format  "E:\ORACLE\ORADATA\TEST\SYSAUX01.DBF"  
   datafile  3 auxiliary format  "E:\ORACLE\ORADATA\TEST\UNDOTBS01.DBF"  
   datafile  4 auxiliary format  "E:\ORACLE\ORADATA\TEST\USERS01.DBF"   ;
   sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME

Starting backup at 02-AUG-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=123 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=I:\APP\APADHI\ORADATA\AMAR\SYSTEM01.DBF
output file name=E:\ORACLE\ORADATA\TEST\SYSTEM01.DBF tag=TAG20070802T114254 RECID=0 STAMP=0
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:08:22
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=I:\APP\APADHI\ORADATA\AMAR\SYSAUX01.DBF
output file name=E:\ORACLE\ORADATA\TEST\SYSAUX01.DBF tag=TAG20070802T114254 RECID=0 STAMP=0
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:05:59
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=I:\APP\APADHI\ORADATA\AMAR\UNDOTBS01.DBF
output file name=E:\ORACLE\ORADATA\TEST\UNDOTBS01.DBF tag=TAG20070802T114254 RECID=0 STAMP=0
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:57
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=I:\APP\APADHI\ORADATA\AMAR\USERS01.DBF
output file name=E:\ORACLE\ORADATA\TEST\USERS01.DBF tag=TAG20070802T114254 RECID=0 STAMP=0
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 02-AUG-07

sql statement: alter system archive log current
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TEST" RESETLOGS ARCHIVELOG 
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP  1 ( 'E:\ORACLE\ORADATA\TEST\REDO01.LOG' ) SIZE 50 M  REUSE,
  GROUP  2 ( 'E:\ORACLE\ORADATA\TEST\REDO02.LOG' ) SIZE 50 M  REUSE,
  GROUP  3 ( 'E:\ORACLE\ORADATA\TEST\REDO03.LOG' ) SIZE 50 M  REUSE
 DATAFILE
  'E:\ORACLE\ORADATA\TEST\SYSTEM01.DBF'
 CHARACTER SET AL32UTF8

contents of Memory Script:
{
   backup as copy reuse
   archivelog like  "I:\APP\APADHI\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001" auxiliary format 
 "E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001"   archivelog like 
 "I:\APP\APADHI\FLASH_RECOVERY_AREA\AMAR\ARCHIVELOG\2007_08_02\O1_MF_1_42_3C2YJNP7_.ARC" auxiliary format 
 "E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001"   ;
   catalog clone archivelog  "E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001";
   catalog clone archivelog  "E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001";
   switch clone datafile all;
}
executing Memory Script

Starting backup at 02-AUG-07
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=42 RECID=35 STAMP=629553646
output file name=E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001 RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=42 RECID=36 STAMP=629553646
output file name=E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001 RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 02-AUG-07

cataloged archived log
archived log file name=E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001 RECID=1 STAMP=629553800

cataloged archived log
archived log file name=E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001 RECID=2 STAMP=629553800

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=629553800 file name=E:\ORACLE\ORADATA\TEST\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=629553801 file name=E:\ORACLE\ORADATA\TEST\UNDOTBS01.DBF

contents of Memory Script:
{
   set until scn  833606;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 02-AUG-07
using channel ORA_AUX_DISK_1
datafile 4 not processed because file is read-only

starting media recovery

archived log for thread 1 with sequence 42 is already on disk as file E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001
archived log file name=E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001 thread=1 sequence=42
media recovery complete, elapsed time: 00:00:01
Finished recover at 02-AUG-07

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount ;
}
executing Memory Script

database dismounted
Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     263639040 bytes

Fixed Size                     1332544 bytes
Variable Size                 83888832 bytes
Database Buffers             171966464 bytes
Redo Buffers                   6451200 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TEST" RESETLOGS ARCHIVELOG 
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP  1 ( 'E:\ORACLE\ORADATA\TEST\REDO01.LOG' ) SIZE 50 M  REUSE,
  GROUP  2 ( 'E:\ORACLE\ORADATA\TEST\REDO02.LOG' ) SIZE 50 M  REUSE,
  GROUP  3 ( 'E:\ORACLE\ORADATA\TEST\REDO03.LOG' ) SIZE 50 M  REUSE
 DATAFILE
  'E:\ORACLE\ORADATA\TEST\SYSTEM01.DBF'
 CHARACTER SET AL32UTF8


contents of Memory Script:
{
   set newname for tempfile  1 to 
 "E:\ORACLE\ORADATA\TEST\TEMP01.DBF";
   switch clone tempfile all;
   catalog clone datafilecopy  "E:\ORACLE\ORADATA\TEST\SYSAUX01.DBF";
   catalog clone datafilecopy  "E:\ORACLE\ORADATA\TEST\UNDOTBS01.DBF";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to E:\ORACLE\ORADATA\TEST\TEMP01.DBF in control file

cataloged datafile copy
datafile copy file name=E:\ORACLE\ORADATA\TEST\SYSAUX01.DBF RECID=1 STAMP=629553825

cataloged datafile copy
datafile copy file name=E:\ORACLE\ORADATA\TEST\UNDOTBS01.DBF RECID=2 STAMP=629553826

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=629553825 file name=E:\ORACLE\ORADATA\TEST\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=629553826 file name=E:\ORACLE\ORADATA\TEST\UNDOTBS01.DBF

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened

contents of Memory Script:
{
   catalog clone datafilecopy  "E:\ORACLE\ORADATA\TEST\USERS01.DBF";
   switch clone datafile  4 to datafilecopy  "E:\ORACLE\ORADATA\TEST\USERS01.DBF";
#online the readonly tablespace
sql clone "alter tablespace  USERS online";
}
executing Memory Script

cataloged datafile copy
datafile copy file name=E:\ORACLE\ORADATA\TEST\USERS01.DBF RECID=3 STAMP=629553870

datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=629553870 file name=E:\ORACLE\ORADATA\TEST\USERS01.DBF

sql statement: alter tablespace  USERS online
Finished Duplicate Db at 02-AUG-07

References

Friday, April 26, 2013

Oracle 11g Streams: Capture state is showing 'WAITING FOR A SUBSCRIBER TO BE ADDED'

Problem: Capture state is showing  'WAITING FOR A SUBSCRIBER TO BE ADDED' 



select capture_name, state from gv$streams_capture;

You might also encounter sometimes the error ORA-26851 for the propagation process as well:

select propagation_name, error_message from dba_propagation;

Changes

The source or destination database was bounced.

Cause

This problem occurs when the Apply is restarted and the Capture re-connects to the new apply. However, the Capture then restarts because it detects a change in the queue subscribers. When the new Capture tries to connect to the Apply, it gets an error that the apply is already attached to another capture. This is because of unpublished bug 9115882.

Solution

Unpublished bug 9115882 has been fixed on RDBMS release 12.1 and patchset 11.2.0.2.

One possible workaround if you do not have the fix in place is to revert the Capture/Apply processes to the 10g behavior by disabling Combined-Capture-Apply (CCA) as follows:

$ sqlplus /nolog
conn / as sysdba

-- Stop current Propagation and Capture with Force => True, so we clean and pending flags:
exec dbms_propagation_adm.stop_propagation('<propagation_name>', true);
exec dbms_capture_adm.stop_capture('<capture_name>', true);

-- Disable CCA:
exec dbms_capture_adm.set_parameter('<capture_name>', '_DIRECT_APPLY', 'N');

-- Re-enable Propagation and Capture processes normally:
exec dbms_propagation_adm.start_propagation('<propagation_name>');
exec dbms_capture_adm.start_capture('<capture_name>');

Thursday, April 25, 2013

Install Oracle Internet Application Server 10g on Solaris 11

Reference:  http://databaseperformance.blogspot.ca/2010/03/opensolaris-is-not-solaris.html

Problem:
Exception java.lang.UnsatisfiedLinkError: /tmp/OraInstall2013-04-25_08-51-57AM/jre/1.4.2/lib/sparc/motif21/libmawt.so: ld.so.1: java: fatal: libdps.so.5: open failed: No such file or directory occurred..                                                                                
java.lang.UnsatisfiedLinkError: /tmp/OraInstall2013-04-25_08-51-57AM/jre/1.4.2/lib/sparc/motif21/libmawt.so: ld.so.1: java: fatal: libdps.so.5: open failed: No such file or directory                                               

Solution:

./runInstaller -IgnoreSysPrereqs -jreLoc /usr/app/oracle/product/11.2.0.3/jdk/jre

Oracle 11g: IMP hangs

Reference:  https://forums.oracle.com/forums/thread.jspa?threadID=689667

Check USED_UBLK and USED_UREC in V$TRANSACTION to see if an INSERT is really running (in which case these values would be increasing). 
select USED_UBLK , used_urec from v$transaction ;

monitor V$SESSION_WAIT for that import session to see what it is waiting on:
 
 

Wednesday, April 24, 2013

sQL: DDL/DML/DCL/TCL

Quoted from:  http://www.orafaq.com/faq/what_are_the_difference_between_ddl_dml_and_dcl_commands


DDL


Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:
  • CREATE - to create objects in the database
  • ALTER - alters the structure of the database
  • DROP - delete objects from the database
  • TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
  • COMMENT - add comments to the data dictionary
  • RENAME - rename an object

DML

Qutoted from: 

DML


Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:
  • SELECT - retrieve data from the a database
  • INSERT - insert data into a table
  • UPDATE - updates existing data within a table
  • DELETE - deletes all records from a table, the space for the records remain
  • MERGE - UPSERT operation (insert or update)
  • CALL - call a PL/SQL or Java subprogram
  • EXPLAIN PLAN - explain access path to data
  • LOCK TABLE - control concurrency

DCL


Data Control Language (DCL) statements. Some examples:
  • GRANT - gives user's access privileges to database
  • REVOKE - withdraw access privileges given with the GRANT command

TCL


Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.
  • COMMIT - save work done
  • SAVEPOINT - identify a point in a transaction to which you can later roll back
  • ROLLBACK - restore database to original since the last COMMIT
  • SET TRANSACTION - Change transaction options like isolation level and what rollback segment to use

Oracle 11g: find ADR root directory

Beginning with Release 11g of Oracle Database, the alert log is written as both an XML-formatted file and as a text file, as in earlier releases.Both these log files are stored inside the ADR home.The ADR root directory is known as ADR BASE.The Automatic Diagnostic Repository (ADR) is a directory structure that is stored outside of the database.This parameter is set by DIAGNOSTIC_DEST initialization parameter.
If this parameter is omitted or left null, the database sets DIAGNOSTIC_DEST upon startup as follows:
  • If environment variable ORACLE_BASE is set, DIAGNOSTIC_DEST is set to the directory designated by ORACLE_BASE.
  • If environment variable ORACLE_BASE is not set, DIAGNOSTIC_DEST is set to ORACLE_HOME/log.
    for e.g

    SQL> show parameter diagno

    NAME                          TYPE          VALUE
    --------------------------- ----------- ------------------------------
    diagnostic_dest             string      /u01/oracle/product/ora11g/log
The location of an ADR home is given by the following path, which starts at the ADR base directory:

<ADR_BASE>/diag/<product_type>/<product_id>/<instance_id>

For example,
 for a database with a SID and database name both equal to ora11g, the ADR home would be in the following location:
<ADR_BASE>/diag/rdbms/ora11g/ora11g/
Within the ADR home directory are subdirectories where the database instance stores diagnostic data.
Subdirectory NameContents
alert The XML-formatted alert log
trace Background and server process trace files and SQL trace files and text alert.log file
cdump Core files

XML formatted alert.log
-------------------------
The alert log is named log.xml and is stored in the alert subdirectory of ADR home.

To get the log.xml path

ADR_BASE/diag/product_type/product_id/instance_id/alert

from sqlplus

SQL> select value from v$diag_info where name ='Diag Alert';

ADRCI utility to view a text version of the alert log (with XML tags stripped)

Text formatted alert.log
-----------------------
The alert.log is named alertSID.log and is stored in the trace subdirectory of ADR home.

To view the text only alert.log file

<ADR_BASE>/diag/<product_type>/<product_id>/<instance_id>/trace

from sqlplus
SQL> select value from v$diag_info where name ='Diag Trace';
or
SQL>show parameter background_dump_dest

Open file alert_SID.log with a text editor

You can also use the ADR Client Interface called 'adrci' to view the alert.log


% adrci
ADRCI> show alert
       show alert -tail 50

The alert log of a database is a chronological log of messages and errors, including the following:
  • All internal errors (ORA-600), block corruption errors (ORA-1578), and deadlock errors (ORA-60) that occur
  • Administrative operations, such as the SQL statements CREATE/ALTER/DROP DATABASE/TABLESPACE and the Oracle Enterprise Manager or SQL*Plus statements STARTUP, SHUTDOWN, ARCHIVE LOG, and RECOVER
  • Several messages and errors relating to the functions of shared server and dispatcher processes
  • Errors during the automatic refresh of a materialized view

Oracle Database uses the alert log to keep a record of these events as an alternative to displaying the information on an operator's console. (Many systems also display this information on the console.) If an administrative operation is successful, a message is written in the alert log as "completed" along with a time stamp.

Friday, April 19, 2013

Thursday, April 18, 2013

Oracle 11g: tnsping failed

Message 3511 not found; product=network; facility=TNS

check values for ORACLE_HOME and PATH

TNS-03505: Failed to resolve name

means that the service name you are using in your connect string doesnt match what oracle is reading from the tnsnames.ora file.

Oracle 11g: Installation on Linux

append below entries in /etc/sysctl.conf

kernel.shmall = 2097152
kernel.shmmax = 2147483648 # Smallest of -> (Half the size of the physical memory) or (4GB - 1 byte)
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536 # 512 * PROCESSES
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=262144

fs.aio-max-nr = 1048576
fs.file-max = 6815744
net.core.wmem_max=1048586
net.ipv4.ip_local_port_range = 9000 65500
# sysctl -p

insert below entries into /etc/security/limits.conf

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

Wednesday, April 17, 2013

WAS 8: JVM Tuning on Solaris 11

Found applications on WAS 8.0  is slow, after researched and traced online, I found below parameters fix the issue.

In wasadmin console, Servers -> server types -> WebSphere Application Servers -> <your target server> -> Server Infrustructure -> Java and Process Management -> Process Definition -> Java Virtual Machine ->

In Generic JVM argument, append below parameters:

-XX:NewSize=256m -XX:MaxNewSize=356m -XX:PermSize=256m -XX:MaxPermSize=512m

Tuesday, April 16, 2013

IBM HTTP Server: redirect non https request to https


Listen 80

LoadModule rewrite_module modules/mod_rewrite.so

<VirtualHost *:80>
    ServerName myserver.goweekend.ca
    RewriteEngine on
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^/(.*)$ https://myserver.goweekend.ca/$1 [R]
    RewriteLogLevel 0
    RewriteLog logs/rewrite.log
</VirtualHost>


Problem:
Invalid command 'RewriteLog', perhaps misspelled or defined by a module not included in the server configuration
or
Invalid command 'RewriteLogLevel', perhaps misspelled or defined by a module not included in the server configuration

Since Apache httpd 2.4 mod_rewrite RewriteLog and RewriteLogLevel directives has been completely replaced by the new per-module logging configuration.

<VirtualHost *:80>
    ServerName myserver.goweekend.ca
    RewriteEngine on
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^/(.*)$ https://myserver.goweekend.ca/$1 [R]
    LogLevel alert rewrite:trace6
</VirtualHost>

IBM HTTP Server: Create IHS Key DB w/o ikeyman

cd  /opt/IBM/HTTPServer
mkdir etc
cd etc
../bin/gskcmd -keydb -create -db IHSKey.kdb -pw WebAS -type cms -expire 0 -stash 
../bin/gskcmd  -cert -create -db IHSKey.kdb -pw WebAS -size 1024 -dn "CN=biserver.goweekend.ca" -label IHScertificate -default_cert yes -expire 3065
../bin/gskcmd  -cert -setdefault -db IHSKey.kdb -pw WebAS  -label IHScertificate  
../bin/gskcmd -cert -list all -db IHSKey.kdb -pw WebAS
 ../bin/gskcmd -cert -getdefault -db IHSKey.kdb -pw WebAS

Oracle: change DB to archivelog mode

  1. Start a new instance and mount, but do not open, the database.
    STARTUP MOUNT
    
    To enable or disable archiving, the database must be mounted but not open.
  2. Change the database archiving mode. Then open the database for normal operations.
    ALTER DATABASE ARCHIVELOG;
    ALTER DATABASE OPEN;
    
  3. Shut down the database.
    SHUTDOWN IMMEDIATE
    
  4. Back up the database.
    Changing the database archiving mode updates the control file. After changing the database archiving mode, you must back up all of your database files and control file. Any previous backup is no longer usable because it was taken in NOARCHIVELOG mode.

Oracle 11g: Survive Commands.

Check user status:
SELECT username,account_status from dba_users where username='STRMADMIN';


Check DB TimeZone:
select DBTIMEZONE from dual;

Check DB status:
select * from v$instance;

time zones without repeating the time zone name for each abbreviation
SELECT UNIQUE TZNAME
FROM V$TIMEZONE_NAMES;
 
 
Converting a Datetime Value to Another Time Zone
SELECT FROM_TZ(CAST(TO_DATE('1999-12-01 11:00:00', 'YYYY-MM-DD HH:MI:SS') AS TIMESTAMP), 'America/New_York') AT TIME ZONE 'America/Los_Angeles' "West Coast Time" FROM DUAL;

 list of valid values for the TZR and TZD format elements, query the TZNAME and TZABBREV columns of the V$TIMEZONE_NAMES dynamic performance view
 select TZNAME, TZABBREV from V$TIMEZONE_NAMES;

Determine DB Unique Name:
SQL> SHOW PARAMETER db_unique_name;


SQL > var ORACLEHOME varchar2(100);
SQL > EXEC dbms_system.get_env('ORACLE_HOME', :ORACLEHOME) ;
SQL > PRINT ORACLEHOME

List all tablespace names
SQL> select tablespace_name from dba_tablespaces;

 SQL> select username from dba_users;
Will give you list of all users but all users may not have created objects in it.So we can not call them as schema.
SQL> select distinct owner from dba_objects;
Will give you the list of schemas available.

 Show current database: SELECT * FROM global_name;

Determine default table space for database:
select property_value from database_properties where property_name = 'DEFAULT_PERMANENT_TABLESPACE';

Determine default table space for user:
 SQL> select default_tablespace from dba_users where username = 'STRMADMIN';

DEFAULT_TABLESPACE
------------------------------
USERSPACE

Reference:
 http://www.orafaq.com/wiki/SQL*Plus_FAQ#What_is_the_difference_between_.26_and_.26.26.3F

https://blogs.oracle.com/opal/entry/sqlplus_101_substitution_varia
http://www.oracle-scripts.net/?p=281

Monday, April 15, 2013

Oracle 11g: Configure Enterprise Manager

$ cd $ORACLE_HOME/dbs

$ orapwd file=orapwV10MIG entries=10

Enter password for SYS:

$ ls -l
-rw-r-----   1 oracle   dba         2560 Apr 15 16:19 orapwV10MIG

$ emca -config dbcontrol db

STARTED EMCA at Apr 15, 2013 3:18:48 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: V10MIG
Listener port number: 1521
Listener ORACLE_HOME [ /usr2/app/oracle/product/11.2.0.3 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /usr2/app/oracle/product/11.2.0.3

Local hostname ................ blackswan
Listener ORACLE_HOME ................ /usr2/app/oracle/product/11.2.0.3
Listener port number ................ 1521
Database SID ................ V10MIG
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Apr 15, 2013 3:19:12 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /usr2/app/oracle/cfgtoollogs/emca/V10MIG/emca_2013_04_15_15_18_48.log.
Apr 15, 2013 3:19:17 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Apr 15, 2013 3:21:01 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Apr 15, 2013 3:21:02 PM oracle.sysman.emcp.ParamsManager getLocalListener
WARNING: Error retrieving listener for blackswan
Apr 15, 2013 3:21:03 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Apr 15, 2013 3:21:10 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Apr 15, 2013 3:21:11 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Apr 15, 2013 3:24:27 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /usr2/app/oracle/product/11.2.0.3/bin/emctl start dbconsole
Apr 15, 2013 3:24:27 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://blackswan:1158/em <<<<<<<<<<<
Apr 15, 2013 3:24:29 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /usr2/app/oracle/product/11.2.0.3/blackswan_V10MIG/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Apr 15, 2013 3:24:29 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING: Error starting Database Control.Execute the following command(s).

 1) Set the environment variable ORACLE_UNQNAME to Database unique name
 2) /usr2/app/oracle/product/11.2.0.3/bin/emctl start dbconsole


Error starting Database Control.Execute the following command(s).

 1) Set the environment variable ORACLE_UNQNAME to Database unique name
 2) /usr2/app/oracle/product/11.2.0.3/bin/emctl start dbconsole

 Disable secure
 $ emctl unsecure dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.
https://blackswan:1158/em/console/aboutApplication
Configuring DBConsole for HTTP...   Done.
DBCONSOLE already stopped...   Done.
Agent is already stopped...   Done.
Unsecuring dbconsole...   Started.
DBConsole is now unsecured...  Done.
Unsecuring dbconsole...  Sucessful.



Using EMCA When Database Host Name or IP Address Changes

When the database host name (including the domain name) or the IP address changes, deconfigure and then reconfigure the Database Console with the repository create command. Run the following command:
emca -deconfig dbcontrol db -repos drop
emca -config dbcontrol db -repos create
or
emca -deconfig dbcontrol db
emca -config dbcontrol db -repos recreate

Using EMCA When the TNS Configuration Is Changed

When the TNS configuration is changed, set the environment variable and then run the following command:
emca -config dbcontrol db

SuSE: reset root password

Select regular boot, tab down to the “Boot Options” box and type in the following:
init=/bin/bash if you are using GRUB Boot loader
linux init=/bin/bash if you are using LILO Boot Loader

Thursday, April 11, 2013

WAS: incorrect bootstrap address or unavailable name server

[4/11/13 10:40:08:999 EDT] 00000021 SystemOut     O [41618] DEBUG - com.cot.esd.servicelocator.EJBServiceLocator - Failed to setup ejb service repository
com.cot.esd.servicelocator.ejb.util.EJBUnavailable: {SRE1444230150} EJB client for jndi(ejb/ejbServiceLocator) failed 3 times; nested exception is javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context with the provider URL: "iiop://localhost:9810".  Make sure that any bootstrap address information in the URL is correct and that the target name server is running.  A bootstrap address with no port specification defaults to port 2809.  Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration.
javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context with the provider URL: "iiop://localhost:9810".  Make sure that any bootstrap address information in the URL is correct and that the target name server is running.  A bootstrap address with no port specification defaults to port 2809.  Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration. [Root exception is org.omg.CORBA.TRANSIENT: java.net.ConnectException: Connection refused:host=xxx,port=9810  vmcid: IBM  minor code: E02  completed: No]
        at com.ibm.ws.naming.util.WsnInitCtxFactory.mapInitialReferenceFailure(WsnInitCtxFactory.java:2372)
        at com.ibm.ws.naming.util.WsnInitCtxFactory.getWsnNameService(WsnInitCtxFactory.java:1527)
        at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:1040)
        at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:962)
        at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:614)
        at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:128)
        at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:765)
        at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164)
        at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
        at org.apache.aries.jndi.DelegateContext.lookup(DelegateContext.java:161)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at com.cot.esd.servicelocator.ejb.util.EJBCreator.getHome(EJBCreator.java:74)
        at com.cot.esd.servicelocator.ejb.util.EJBCreator.getInst(EJBCreator.java:162)
        at com.cot.esd.servicelocator.ejb.util.EJBCreator._getInstance(EJBCreator.java:120)
        at com.cot.esd.servicelocator.ejb.util.EJBCreator._getInstance(EJBCreator.java:154)
        at com.cot.esd.servicelocator.ejb.util.EJBCreator._getInstance(EJBCreator.java:154)
        at com.cot.esd.servicelocator.ejb.util.EJBCreator._getInstance(EJBCreator.java:154)
        at com.cot.esd.servicelocator.ejb.util.EJBCreator.create(EJBCreator.java:113)
        at com.cot.esd.servicelocator.EJBServiceLocator.setupAndTry0(EJBServiceLocator.java:150)

WAS: Performance Tunning


Tuning WebSphere Application Server V7 and V8 for performance


https://accounts.google.com/b/0/VerifiedPhoneInterstitial?continue=http%3A%2F%2Fwww.blogger.com%2Fhome&service=blogger&sarp=1

WAS: Diagnose



Diagnostic Data
This paper contains information about the diagnostic data that is available in
WebSphere Application Server V6. It contains information about the location of
the data, how it is collected, and configuration options.
It includes information about the following:

  • JVM logs (SystemOut and SystemErr)
  • Tr a c i n g
  • Collector tool
  • First Failure Data Capture (FFDC)
  • Process (native) logs
  • Service log (activity.log)
  • Installation logs
  • IBM HTTP Server and plug-in logs and traces
  • System management logs
  • WebSphere Rapid Deployment logs
 
 
Event type

The event type is a one character field that indicates the type of the message.
The possible values are:
– F - fatal message
– E - error message
– W - warning message
– A - audit message
– I - informational message
– C - configuration message
– D - detail message
– O - message that was written directly to System.out by an application or
internal components
– R - message that was written directly to System.err by the user application
or internal components
– Z - a placeholder to indicate that the type was not recognized

Wednesday, April 10, 2013

WAS: SystemErr R java.lang.OutOfMemoryError: PermGen space

Problem:

SystemErr     R java.lang.OutOfMemoryError: PermGen space

Solution:
-XX:NewSize=256m -XX:MaxNewSize=356m -XX:PermSize=256m -XX:MaxPermSize=356m

Reference:

 http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

WAS: unknown Oracle major version [11]

Problem:

 [4/9/13 11:53:03:219 EDT] 00000037 webapp        E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor]: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/data-access.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: unknown Oracle major version [11]

Solution:

in data-access.xml , add below entry:

<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>


Looks like below:
<property name="hibernateProperties">
<props>
<prop key="hibernate.query.factory_class">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
</props>
</property>

Tuesday, April 9, 2013

Sparc Virtualization: LDom Manager is not supported on any Mx000 servers (M4000/M5000/M8000/M9000)

No, LDom Manager is not supported on any Mx000 servers as there is no hardware hypervisor that is required for LDom Manager to be implemented.

The hardware hypervisor only exists on the CoolThreads architecture, which includes the Tx000 servers, the T5xx0 servers, the T6xx0 blades, T3 servers, T4 servers, T5 servers, and the new M5 servers (which are based on the T5 CPUs).

The Mx000 and the new M10 servers specifically support physical domains, not logical domains.

Oracle 11g R2: Oracle 11.2.0.3 installation on Solaris 11 11.1

Prerequisites

Operating System Requirements

Starting with Oracle Database 11g Release 2 (11.2.0.3), Oracle Database is also supported on the following operating system versions (or later):
  • Oracle Solaris 11 11.1 SPARC
http://docs.oracle.com/cd/E11882_01/install.112/e24346/pre_install.htm#BABFDCAB
Note:
No special kernel parameters, packages, or patches are required at the time of this release for Oracle Solaris 11.

Pre Installation



Increase ZFS swap space to 16GB
# zfs get volsize rpool/swap
NAME        PROPERTY  VALUE  SOURCE
rpool/swap  volsize   4G     local
# zfs set volsize=16g rpool/swap
# zfs get volsize rpool/swap
NAME        PROPERTY  VALUE  SOURCE
rpool/swap  volsize   16G    local

Installation

Login as oracle and set env variable AWT_TOOLKIT to XToolkit
$ export AWT_TOOLKIT=XToolkit
$ ./runInstaller
/usr2/app/oracle/product/11.2.0.3

Post Installation

add below entries to .profile or .bash_profile accordingly:

stty erase "^?" kill "^u" intr "^c" echoe -tabs hupcl
umask 022

TERM=vt100
export TERM

ORACLE_HOME=/usr2/app/oracle/product/11.2.0.3
export ORACLE_HOME

#ORACLE_BASE=/usr2/app
#export ORACLE_BASE

ORACLE_SID=V11SID
export ORACLE_SID

ORACLE_TERM=vt220
export ORACLE_TERM

PATH=/usr/bin:/bin:$ORACLE_HOME/bin:/usr/bin/X11:/usr/local/bin:/usr/lib/bsd-socket/usr/lib:/usr/lbin:/opt/bin
export PATH

ORACLE_DOC=$ORACLE_HOME/odoc
export ORACLE_DOC

TMPDIR=/tmp
export TMPDIR

LD_LIBRARY_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/JRE/lib/ptx/green_threads:/usr/lib/bsd-socket:/lib:/usr/lib:/usr/lib/X11
export LD_LIBRARY_PATH

LD_LIBRARY_PATH_64=$ORACLE_HOME/lib:$ORACLE_HOME/JRE/lib/ptx/green_threads:/usr/lib/bsd-socket:/lib:/usr/lib:/usr/lib/X11
export LD_LIBRARY_PATH_64

SHLIB_PATH=$ORACLE_HOME/lib32
export SHLIB_PATH

TNS_ADMIN=/var/opt/oracle
export TNS_ADMIN
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/product/jlib
export CLASSPATH
LD_RUN_PATH=$ORACLE_HOME/lib
export LD_RUN_PATH




Friday, April 5, 2013

Solaris 11: LDOM Configuration


Install the Oracle VM Server for SPARC 2.2 Software

Reference
http://docs.oracle.com/cd/E35434_01/html/E23807/newinstallldoms.html#manualinstallldomsandsst

Download
http://www.oracle.com/technetwork/server-storage/vm/downloads/index.html?ssSourceSiteId=ocomen


Solaris 11: Increase ZFS swap

# zfs get volsize rpool/swap
NAME        PROPERTY  VALUE    SOURCE
rpool/swap  volsize   517M     -
# zfs set volsize=2g rpool/swap
# zfs get volsize rpool/swap
NAME        PROPERTY  VALUE    SOURCE
rpool/swap  volsize   2G   

Thursday, April 4, 2013

WAS: SUN JVM Tunning

# pwd

/opt/IBM/WebSphere/AppServer/java/bin

# ./java -version

java version "1.6.0_37"

Java(TM) 2 Runtime Environment, Standard Edition (IBM J6_26 build 1.6.0_37-b06 24_Oct_2012_04_14 solaris sparcv9 (SR4))

Java HotSpot(TM) Server VM (build 20.12-b01, mixed mode)

IBM Java ORB build orb626-20121008.00

XML build XL TXE Java 1.0.29

XML build IBM JAXP 1.4.7

XML build XML4J 4.5.19

Java HotSpot(TM) Server VM (build 20.12-b01, mixed mode)
When you see the HotSpot VM, this means it is the Sun JVM wrapped with
IBM's implementation such as ORB, JAXP and etc. On IBM's implentation
of JVM you will not see this HotSpot information.

http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.doc%2Finfo%2Fae%2Fae%2Frprf_hotspot_parms.html

http://docs.oracle.com/cd/E19462-01/819-4673/gbpxm/index.html
https://blogs.oracle.com/sunabl/entry/solaris_network_tuning_for_websphere
https://blogs.oracle.com/sunabl/entry/websphere_tuning_tip_scalability_on
https://blogs.oracle.com/sunabl/entry/understanding_websphere_and_java_updates

Solaris 11: Mirror ZFS rpool

1. Duplicate source disk label to second disk

1.1 Dump source disk labels

# fmthard -i -n "" /dev/rdsk/c2t0d0s2 > d0
# cat d0
* /dev/rdsk/c2t0d0s2 default partition map
* Volume Name:  solaris
*
* Dimensions:
*     512 bytes/sector
*      625 sectors/track
*       20 tracks/cylinder
*     46875 cylinders
*     46873 accessible cylinders
*
* Flags:
*   1:  unmountable
*  10:  read-only
*

* Partition    Tag     Flag         First Sector    Sector Count
    0           2       00              12500           585900000
    2           5       01              0               585912500

1.2 Write disk labels to new harddisk


# fmthard -s d0 -n "" /dev/rdsk/c2t1d0s2
# format c2t1d0

2.  Attach a second disk to configure a mirrored root pool


# zpool attach rpool c2t0d0s0 c2t1d0s0
Make sure to wait until resilver is done before rebooting.

# zpool status
  pool: rpool
 state: DEGRADED
status: One or more devices is currently being resilvered.  The pool will
        continue to function in a degraded state.
action: Wait for the resilver to complete.
        Run 'zpool status -v' to see device specific details.
  scan: resilver in progress since Thu Apr  4 08:20:58 2013
    16.3G scanned out of 209G at 79.5M/s, 0h41m to go
    16.3G resilvered, 7.79% done
config:

        NAME          STATE     READ WRITE CKSUM
        rpool         DEGRADED     0     0     0
          mirror-0    DEGRADED     0     0     0
            c2t0d0s0  ONLINE       0     0     0
            c2t1d0s0  DEGRADED     0     0     0  (resilvering)

errors: No known data errors

Keep checking rpool status until "DEGRADED" is changed to "ONLINE"

# zpool status rpool
  pool: rpool
 state: ONLINE
  scan: resilvered 209G in 0h38m with 0 errors on Thu Apr  4 08:59:51 2013
config:

        NAME          STATE     READ WRITE CKSUM
        rpool         ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            c2t0d0s0  ONLINE       0     0     0
            c2t1d0s0  ONLINE       0     0     0

errors: No known data errors

3. Apply boot blocks to the second disk after resilvering is complete

Determine if needed from output of below command line.

 # installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c2t1d0s0

WARNING: target device /dev/rdsk/c2t1d0s0 has a versioned bootblock but no versioning information was provided.
bootblock version installed on /dev/rdsk/c2t1d0s0 is more recent or identical
Use -F to override or install without the -u option


4. Test mirror

Destroy 2nd disk

# dd if=/dev/random of=/dev/rdsk/c2t1d0s2



# zpool status -v
  pool: rpool
 state: DEGRADED
status: One or more devices are unavailable in response to persistent errors.
        Sufficient replicas exist for the pool to continue functioning in a
        degraded state.
action: Determine if the device needs to be replaced, and clear the errors
        using 'zpool clear' or 'fmadm repaired', or replace the device
        with 'zpool replace'.
  scan: resilvered 209G in 0h38m with 0 errors on Thu Apr  4 08:59:51 2013
config:

        NAME          STATE     READ WRITE CKSUM
        rpool         DEGRADED     0     0     0
          mirror-0    DEGRADED     0     0     0
            c2t0d0s0  ONLINE       0     0     0
            c2t1d0s0  UNAVAIL      0     0     0

device details:

        c2t1d0s0    UNAVAIL       cannot open
        status: ZFS detected errors on this device.
                The device was missing.
           see: http://support.oracle.com/msg/ZFS-8000-LR for recovery
Fix it
# fmthard -s d0 -n "" /dev/rdsk/c2t1d0s2

# zpool status -lx
  pool: rpool
 state: DEGRADED
status: One or more devices is currently being resilvered.  The pool will
        continue to function in a degraded state.
action: Wait for the resilver to complete.
        Run 'zpool status -v' to see device specific details.
  scan: resilver in progress since Thu Apr 11 14:20:56 2013
    5.28G scanned out of 248G at 118M/s, 0h35m to go
    5.28G resilvered, 2.13% done
config:

        NAME          STATE     READ WRITE CKSUM
        rpool         DEGRADED     0     0     0
          mirror-0    DEGRADED     0     0     0
            c2t0d0s0  ONLINE       0     0     0
            c2t1d0s0  DEGRADED     0     0     0  (resilvering)

errors: No known data errors

Reference:
http://docs.oracle.com/cd/E19253-01/819-5461/gkdep/index.html

Reference: http://www.hacktopia.net/wp/how-to-mirror-zfs-root-disk-on-a-sparc-system/

Wednesday, April 3, 2013

Create WAS Profile with response file

Response file for deployment manager (dmgr.rsp)
=================================================================
create
templatePath=/opt/IBM/WebSphere/AppServer/profileTemplates/cell/dmgr
nodeProfilePath=/opt/IBM/WebSphere/AppServer/profiles/AppSrv01
profileName=Dmgr01
cellName=autotestCell01
nodeName=autotestCellManager01
appServerNodeName=autotestNode01
adminUserName=wasadmin
adminPassword=think4me
enableAdminSecurity=true


Response file for application server (appsvr.txt)
==================================================================
create
templatePath=/opt/IBM/WebSphere/AppServer/profileTemplates/cell/default
dmgrProfilePath=/opt/IBM/WebSphere/AppServer/profiles/Dmgr01
portsFile=/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/properties/portdef.props
nodePortsFile=/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/properties/nodeportdef.props
profileName=AppSrv01
cellName=autotestCell01
nodeName=autotestCellManager01
appServerNodeName=autotestNode01
hostname=autotest
adminUserName=wasadmin
adminPassword=think4me
enableAdminSecurity=true

Run below command to create profiles:

/opt/IBM/WebSphere/AppServer/bin/manageprofiles.sh -response dmgr.rsp
/opt/IBM/WebSphere/AppServer/bin/manageprofiles.sh -response appsvr.rsp


Create/Configure Plugin and WebServer
# cd  /opt/IBM/WebSphere/Toolbox/WCT
./wctcmd.sh -tool pct -defLocPathname /opt/IBM/WebSphere/Plugins -defLocName aTestWebSvr01 -response /opt/IBM/SQLDBA/pctLocal.rsp

# cat  pctLocal.rsp
 configType=local_distributed
enableAdminServerSupport=true
enableUserAndPass=true
enableWinService=false
ihsAdminCreateUserAndGroup=true
ihsAdminPassword=xxxxxxxx
ihsAdminPort=8008
ihsAdminUnixUserGroup=root
ihsAdminUnixUserID=root
ihsAdminUserID=wasadmin
mapWebServerToApplications=true
profileName=aTestNode01
wasExistingLocation=/opt/IBM/WebSphere/AppServer
wasMachineHostName=sun.goweekend.ca
webServerConfigFile1=/opt/IBM/HTTPServer/conf/httpd.conf
webServerDefinition=aTestWebSvr01
webServerHostName=sun.goweekend.ca
webServerInstallArch=64
webServerPortNumber=80
webServerSelected=ihsconfigureaTestWebSvr01.sh
webServerType=IHS

# cd /opt/IBM/WebSphere/Plugins/bin
# ls -lrt
-rwxr-xr-x   1 root     root        2524 Apr 25 13:32 configureaTestWebSvr01.sh
# cp configureaTestWebSvr01.sh /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin
# cd  /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin
# ./configureaTestWebSvr01.sh