Wednesday, December 28, 2011

Running wls_basic_audit.py - Weblogic BASIC license compliance

This script will help with verifying that WebLogic Server is being used in accordance with the WebLogic Server "Basic" license.

Reference: MOS note "WebLogic Server Basic License Audit Script [ID 885587.1]"

1. Set the environment from WL_SERVER_HOME/server/bin. Make sure to use below command to avoid "Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/WLST"

Two dots are important in case the "." is not specified in PATH variable.

. ./setWLSEnv.sh

2. java weblogic.WLST wls_basic_audit.py
$ java weblogic.WLST wls_basic_audit.py

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

===============
WLS Basic Audit
===============
12/28/11 4:31 PM
Please enter your username :weblogic
Please enter your password :
Please enter your server URL [t3://localhost:7001] :
Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'INB'.

Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.

===========
Domain Info
===========
Checking for administration port enabled: 
Checking for service migration: 
No errors detected
============
Cluster Info
============
Checking cluster type and overload actions: 
No errors detected
===========
Server Info
===========
Checking server mode and overload actions: 
No errors detected
======================
Singleton Service Info
======================
Checking for singleton services: 
No errors detected
======================
Service Migration Info
======================
Checking for service migration: 
No errors detected
========================
Global Work Manager Info
========================
Checking for global Work Managers: 
No errors detected
=============================
Application Work Manager Info
=============================
Checking for application-scoped Work Managers: 
No errors detected
===============
Deployment Info
===============
Checking for application versioning and ordering: 
License compliance failure:  Application reports version 11.1.1.2.0 uses version 11.1.1.2.0
License compliance failure:  Application formsapp version 11.1.1 uses version 11.1.1
Production redeployment strategy involves deploying a new version of an updated application alongside an older version of the same application. WebLogic Server automatically manages client connections so that only new client requests are directed to the new version. Clients already connected to the application during the redeployment continue to use the older version of the application until they complete their work, at which point WebLogic Server automatically retires the older application. This capability is supported by deploying the application in Administration mode, which makes it available only via a configured Administration channel.
In the license for WebLogic Server Basic, deploying any application that uses a version identifier is not permitted.
See the documentation:  http://download.oracle.com/docs/cd/E12839_01/web.1111/e13702/redeploy.htm#DEPGD281
2 error(s) detected
=========================
Application FastSwap Info
=========================
Checking whether FastSwap is enabled in an application: 
No errors detected
========
JMS Info
========
Checking for non-default Unit-of-Work Message Handling Policy: 
Checking for non-default Message Unit-of-Order: 
Checking for Message Store-and-Forward agents: 
No errors detected
=====================
Tuxedo Connector Info
=====================
Checking for WebLogic Tuxedo Connectors: 
No errors detected
=========
SNMP Info
=========
Checking for SNMP agents: 
No errors detected
=====================
Application Mode Info
=====================
Checking for application in Administration mode: 
Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainRuntime)

Location changed to serverRuntime tree. This is a read-only tree with ServerRuntimeMBean as the root.
For more help, use help(serverRuntime)

No errors detected
======================
Module Deployment Info
======================
Checking for deployment of standalone JMS, JDBC, or WLDF modules: 
No errors detected
===========================
HTTP Publish-Subscribe Info
===========================
Checking for HTTP Publish-Subscribe Server usage: 
No errors detected
==========================
Diagnostics Framework Info
==========================
Checking for WebLogic Diagnostics Framework usage: 
License compliance failure:  Diagnostics framework system resource is being used:  Module-FMWDFW
The WebLogic Diagnostic Framework (WLDF) is a monitoring and diagnostic framework that defines and implements a set of services that run within WebLogic Server processes and participate in the standard server life cycle. Using WLDF, you can create, collect, analyze, archive, and access diagnostic data generated by a running server and the applications deployed within its containers. This data provides insight into the run-time performance of servers and applications and enables you to isolate and diagnose faults when they occur.
In the license for WebLogic Server Basic, the use of WLDF is not permitted.
See the documentation:  http://download.oracle.com/docs/cd/E12839_01/web.1111/e13714/intro.htm#WLDFC108
1 error(s) detected
=======
Summary
=======
3 error(s) detected


Exiting WebLogic Scripting Tool.






I will post more posts on how to take care of these errors reported by compliance script.

Sungard Banner on Oracle 11g Middleware and Database


I have been working on this since last 8 months. The production is still at 10g iAS and Database. I am expecting it to get completed by first quarter of 2012.

The current strategy is to have:
1. Two separate domains for INB and SSB
2. INB would utilize Oracle PFR&D 11.1.1.4.0 + weblogic 10.3.4
3. SSB would utilize Oracle WebTier Utilities 11.1.1.4.0 + weblogic 10.3.4
4. Single installation of Oracle Weblogic 10.3.4
5. The domains are created in production mode
6. boot.properties is utilized to avoid prompting of username/password
7. Database is going to be upgraded to 11.2.0.2
8. Follow FAQ 1-XFTOI5 to take care of privileges for 11g database users.
5. Take care of creating ACLs - FAQ 1-648TQ0


Related FAQs from Sungard Support Center:
FAQ 1-BTZNOZ
FAQ 1-Z7JOUC
FAQ 1-XFTOI5
FAQ 1-648TQ0






Oracle VM on my laptop..

I haven't got the chance to upgrade RAM on my laptop. I should be able to do that this week and then no stopping (hopefully) to configure Oracle VM server on it..

Meanwhile I had asked if anyone has done it before on OTN forums:
https://forums.oracle.com/forums/message.jspa?messageID=10038738#10038738

Looks like it can be done on external drive without messing up internal drive. Also VM manager can be configured on one of the guest OSs.

More to come....

Tuesday, December 20, 2011

False ORA-19815 db_recovery_file_dest_size is 100.00% used

Another strange parameter change issue....

My db_recovery_file_dest_size was set to 52G. I decided to lower that value to 5G because I don't expect of using it or whatever...

After the change, restarted database and got below warning in the alert.log:
..
..
Tue Dec 20 12:09:47 2011
Errors in file /oracle/admin/diag/rdbms/rd11852/RD11852/trace/RD11852_m000_31348.trc:
ORA-19815: WARNING: db_recovery_file_dest_size of 5368709120 bytes is 100.00% used, and has 0 remaining bytes available.
************************************************************************
You have following choices to free up space from recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
   then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
   BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
   reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
   system command was used to delete files, then use RMAN CROSSCHECK and
   DELETE EXPIRED commands.
************************************************************************

..
..



Values for FRA related parameters:
SQL> show parameter recovery

NAME
------------------------------------
TYPE                                         VALUE
-------------------------------------------- ------------------------------
db_recovery_file_dest
string                                       /oracle/admin/fast_recovery_area
db_recovery_file_dest_size
big integer                                  5G
recovery_parallelism
integer                                      0


Checked for available space on OS:
$ cd /oracle/admin/fast_recovery_area/

$ df -k .
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vgsan-oracle
                      30963708  16639264  14324444  54% /oracle
 

$ ls -ltr
total 4
drwxr-s--- 3 oracle dba 4096 Oct 24 10:33 RD11852
 

oracle@strudel:/oracle/admin/fast_recovery_area[RD11852]
$ du -sk RD11852
16      RD11852
 

oracle@strudel:/oracle/admin/fast_recovery_area[RD11852]
$ du -sk .
20      .



That means enough free space was available at OS level.

Checking database views related to FRA:
SQL> select * from v$recovery_file_dest;

NAME
--------------------------------------------------------------------------------
SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES
----------- ---------- ----------------- ---------------
/oracle/admin/fast_recovery_area
 5368709120 1.1520E+10                 0               2


SQL> select * from v$flash_recovery_area_usage;

FILE_TYPE
--------------------------------------------------------------------------------
PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
------------------ ------------------------- ---------------
CONTROL FILE
                 0                         0               0

REDO LOG
                 0                         0               0

ARCHIVED LOG
                 0                         0               0

BACKUP PIECE
            214.58                         0               2


IMAGE COPY
                 0                         0               0

FLASHBACK LOG
                 0                         0               0

FOREIGN ARCHIVED LOG
                 0                         0               0


7 rows selected.


Strange that it showed two backup pieces consuming around 214.58% of FRA.

Decided to check using RMAN:
RMAN> list backup;

List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2       Full    10.72G     DISK        00:12:04     24-OCT-11     
        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20111024T134517
        Piece Name: /oracle/admin/fast_recovery_area/RD11852/backupset/2011_10_24/o1_mf_nnndf_TAG20111024T134517_7bc91gr2_.bkp
  List of Datafiles in backup set 2
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/system01.dbf
  2       Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/undo01.dbf
  3       Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/sysaux01.dbf
  4       Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/axiom01.dbf
  5       Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/banaq01.dbf
  6       Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/baniam01.dbf
  7       Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/banlob.dbf
  8       Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/devl01.dbf
  9       Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/devl02.dbf
  10      Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/devl03.dbf
  11      Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/devl04.dbf
  12      Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/devl05.dbf
  13      Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/devl06.dbf
  14      Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/devl07.dbf
  15      Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/devl08.dbf
  16      Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/devl09.dbf
  17      Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/devl10.dbf
  18      Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/tools01.dbf
  19      Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/users01.dbf
  20      Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/xdb01.dbf
  21      Full 7443640574332 24-OCT-11 /u02/oradata/RD11852/devl11.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3       Full    9.64M      DISK        00:00:01     24-OCT-11     
        BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20111024T134517
        Piece Name: /oracle/admin/fast_recovery_area/RD11852/backupset/2011_10_24/o1_mf_ncsnf_TAG20111024T134517_7bc9rf90_.bkp
  SPFILE Included: Modification time: 08-JUN-11
  Control File Included: Ckp SCN: 7443640574332   Ckp time: 24-OCT-11


Checked on OS if those backup pieces existed:

$ ls -ltr /oracle/admin/fast_recovery_area/RD11852/backupset/2011_10_24/o1_mf_nnndf_TAG20111024T134517_7bc91gr2_.bkp
/bin/ls: /oracle/admin/fast_recovery_area/RD11852/backupset/2011_10_24/o1_mf_nnndf_TAG20111024T134517_7bc91gr2_.bkp: No such file or directory


$ ls -ltr /oracle/admin/fast_recovery_area/RD11852/backupset/2011_10_24/o1_mf_ncsnf_TAG20111024T134517_7bc9rf90_.bkp
/bin/ls: /oracle/admin/fast_recovery_area/RD11852/backupset/2011_10_24/o1_mf_ncsnf_TAG20111024T134517_7bc9rf90_.bkp: No such file or directory


Decided to delete those backups using rman:
RMAN> crosscheck backup;

using channel ORA_DISK_1
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/oracle/admin/fast_recovery_area/RD11852/backupset/2011_10_24/o1_mf_nnndf_TAG20111024T134517_7bc91gr2_.bkp RECID=2 STAMP=765380718
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/oracle/admin/fast_recovery_area/RD11852/backupset/2011_10_24/o1_mf_ncsnf_TAG20111024T134517_7bc9rf90_.bkp RECID=3 STAMP=765381453
Crosschecked 2 objects


RMAN> delete backup;

using channel ORA_DISK_1

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
2       2       1   1   EXPIRED     DISK        /oracle/admin/fast_recovery_area/RD11852/backupset/2011_10_24/o1_mf_nnndf_TAG20111024T134517_7bc91gr2_.bkp
3       3       1   1   EXPIRED     DISK        /oracle/admin/fast_recovery_area/RD11852/backupset/2011_10_24/o1_mf_ncsnf_TAG20111024T134517_7bc9rf90_.bkp

Do you really want to delete the above objects (enter YES or NO)? YES
deleted backup piece
backup piece handle=/oracle/admin/fast_recovery_area/RD11852/backupset/2011_10_24/o1_mf_nnndf_TAG20111024T134517_7bc91gr2_.bkp RECID=2 STAMP=765380718
deleted backup piece
backup piece handle=/oracle/admin/fast_recovery_area/RD11852/backupset/2011_10_24/o1_mf_ncsnf_TAG20111024T134517_7bc9rf90_.bkp RECID=3 STAMP=765381453
Deleted 2 objects

Verifying database views:
SQL> select * from v$flash_recovery_area_usage;
FILE_TYPE
--------------------------------------------------------------------------------
PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
------------------ ------------------------- ---------------
CONTROL FILE
                 0                         0               0

REDO LOG
                 0                         0               0

ARCHIVED LOG
                 0                         0               0
 

BACKUP PIECE
                 0                         0               0


IMAGE COPY
                 0                         0               0

FLASHBACK LOG
                 0                         0               0
 

FOREIGN ARCHIVED LOG
                 0                         0               0


Now that showed "0".



Restarted database:

Database alert.log showed below now. ..
.. 
Tue Dec 20 12:38:21 2011
db_recovery_file_dest_size of 5120 MB is 0.00% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
..
..




Regards,
Vishal

ORA-00723 COMPATIBLE must be explicitly set


I was going through Reference book for Oracle 11gR2 for COMPATIBLE parameter at: http://docs.oracle.com/cd/E11882_01/server.112/e25513/initparams034.htm#REFRN10019

I have a database which was recently upgraded to 11.2.0.3. I had not changed the value of COMPATIBLE parameter and it was still pointing to "10.2.0.4".

I decided to make that change today and also realized that in the documentation of COMPATIBLE parameter for 11gR2 it says the default value is "11.2.0".

So I removed the COMPATIBLE parameter from my pfile and wanted to see if Oracle takes the default value i.e. 11.2.0.

Below is what happend:

SQL> startup
ORACLE instance started.

Total System Global Area  939495424 bytes
Fixed Size                  2233960 bytes
Variable Size             545261976 bytes
Database Buffers          385875968 bytes
Redo Buffers                6123520 bytes
ORA-00723: Initialization parameter COMPATIBLE must be explicitly set

I checked alert.log which shows:
..
..
Spfile /oracle/product/11.2.0.3/dbs/spfileRD11852.ora is in old pre-11 format and compatible >= 11.0.0; converting to new H.A.R.D. compliant format.
Tue Dec 20 12:06:01 2011
ALTER DATABASE   MOUNT
ORA-723 signalled during: ALTER DATABASE   MOUNT...
..
..


That tells me that Oracle tried to use the default value i.e. 11.2.0 but it failed while mounting which requires compatible to be set explicitly.


Strange....

Searched on MOS and found 287664.1:

Error:   ORA-00723  (ORA-723)
Text:   Initialization parameter COMPATIBLE must be explicitly set 
---------------------------------------------------------------------------
Cause: Oracle detected that the initialization parameter COMPATIBLE was 
 not explicitly specified, and the compatibility of the database is 
 lower than the default value of the COMPATIBLE parameter. In order 
 to use the new compatible setting, the intialization parameter 
 must be explicitly set by the user. 
Action: Explicitly set the value of COMPATIBLE parameter either in PFILE 
 or SPFILE, whichever is used.
 
 
Ahh, that's a relief. So that error was because i was changing the database
compatibility to 11.2.0 and the compatible was not explicitly set. That means if the
compatibility of the database is changing the parameter compatible has to be explicitly set. 
 
Ok.
 
I added compatible=11.2.0 to pfile and database opened. Alert.log showed:
..
.. 
ALERT: Compatibility of the database is changed from 10.2.0.4.0 to 11.2.0.0.0.
Increased the record size of controlfile section 4 to 520 bytes
Control file expanded from 612 blocks to 614 blocks
Increased the record size of controlfile section 14 to 200 bytes
Control file expanded from 614 blocks to 618 blocks
Increased the record size of controlfile section 16 to 736 bytes
Control file expanded from 618 blocks to 622 blocks
Increased the record size of controlfile section 20 to 928 bytes
Control file expanded from 622 blocks to 626 blocks
Increased the record size of controlfile section 21 to 124 bytes
Control file expanded from 626 blocks to 632 blocks
Increased the record size of controlfile section 22 to 900 bytes
The number of logical blocks in section 22 remains the same 
..
.. 
 
Now the compatibility of database is already upgraded to 11.2.0, so if I remove
COMPATIBLE parameter from pfile the instance should startup without ORA-00723...lets see...
 
 
AND THAT'S TRUE...database opened without ORA-00723 this time. COMPATIBLE is not set
explicitly...
 
SQL> select name, value, ISMODIFIED, isdefault from v$parameter where name='compatible';

NAME
--------------------------------------------------------------------------------
VALUE
--------------------------------------------------------------------------------
ISMODIFIED                               ISDEFAULT
---------------------------------------- ---------
compatible
11.2.0
FALSE                                    TRUE
 
 
 
 

Wednesday, December 14, 2011

Oracle VM on my laptop

I am planning to install Oracle VM on my personal laptop after adding additional 4G RAM to make it 8G.

My plan is to install Oracle VM on external USB drive which is of 500GB capacity. I don't want to mess up with my Windows on internal drive.

I do have recovery disk and intend to backup my laptop's internal drive before starting this install. I will keep posting my progress.

Regards,
Vishal

Friday, September 9, 2011

fast_recovery_area in 11gR2, its only in docs for windows

I am reading "Oracle® Database 2 Day DBA 11g Release 2 (11.2)".

Realized that FLASH RECOVERY AREA is renamed to FAST RECOVERY AREA.
Check here: http://download.oracle.com/docs/cd/E11882_01/server.112/e10897/install.htm#BABGFDAG

Many suggest that the reason behind this rename could be the confusion flash word causes with flashback feature.

Modifying the post to add:
I did 11gR2 install on windows. Below is what I see:
SQL> show parameter db_recovery_file_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      C:\oracle\flash_recovery_area
db_recovery_file_dest_size           big integer 3852M

Does that mean the name change of flash recovery area is done only in documentation?????

Then I went ahead and checked on Linux where I had done 11.2.0.2 install.
SQL> show parameter db_recovery_file_dest

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /oracle/admin/fast_recovery_area
db_recovery_file_dest_size           big integer 49920M

This means Oracle developer who was supposed to make that change for windows platform FORGOT to do it. :-)






Wednesday, June 29, 2011

ORA-01031: insufficient privileges (DBD ERROR: OCISessionBegin)


$ emctl status dbconsole     
OC4J Configuration issue. /oracle/product/11.2.0/oc4j/j2ee/OC4J_DBConsole_****.***.***.***_T11852 not found.

$ emctl start dbconsole
OC4J Configuration issue. /oracle/product/11.2.0/oc4j/j2ee/OC4J_DBConsole_*********_T11852 not found.

Then decided to reconfigure dbconsole.

First step is deconfigure and drop the repository already created.
$ ./emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Jun 29, 2011 3:44:46 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: T11852
Listener port number: 1521
Password for SYS user: 
Password for SYSMAN user: 
Password for SYSMAN user: 
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Jun 29, 2011 3:45:09 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/cfgtoollogs/emca/T11852/emca_2011_06_29_15_44_45.log.
Jun 29, 2011 3:45:09 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed. Some of the possible reasons may be:
 1) EM is configured with different hostname then physical host. Set environment variable ORACLE_HOSTNAME=<hostname> and re-run EMCA script
 2) ORACLE_HOSTNAME is set. Unset it and re-run EMCA script
Jun 29, 2011 3:45:09 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Jun 29, 2011 3:45:10 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /oracle/product/11.2.0/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx.xxx.xxx.xxx)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=T11852.xxx.xxx.usg_ons))) -repos_user SYSMAN -action drop -verbose -output_file /oracle/cfgtoollogs/emca/T11852/emca_repos_drop_2011_06_29_15_45_09.log
Jun 29, 2011 3:45:10 PM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error dropping the repository
Jun 29, 2011 3:45:10 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /oracle/cfgtoollogs/emca/T11852/emca_repos_drop_<date>.log for more details.
Jun 29, 2011 3:45:10 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Error dropping the repository
Refer to the log file at /oracle/cfgtoollogs/emca/T11852/emca_2011_06_29_15_44_45.log for more details.
Could not complete the configuration. Refer to the log file at /oracle/cfgtoollogs/emca/T11852/emca_2011_06_29_15_44_45.log for more details.
oracle@cookie:/oracle/product/11.2.0/bin[T11852]
$

Checked /oracle/cfgtoollogs/emca/T11852/emca_repos_drop_2011_06_29_15_45_09.log:
=================================================================================

[29-06-2011 15:45:10] Enter SYS user's password :
[29-06-2011 15:45:10]
[29-06-2011 15:45:10] Getting temporary tablespace from database...
[29-06-2011 15:45:10] Could not connect to SYS/(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=**********)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=T11852.******))): ORA-01031: insufficient privileges (DBD ERROR: OCISessionBegin)


I was not able to connect to db using "sqlplus sys@T11852 as sysdba". I was getting ORA-01031 error.

I did below:
1.
SQL> show parameter remote_login_passwordfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile            string      EXCLUSIVE

2. There was no password file under $ORACLE_HOME/dbs

3. created password file using
orapwd file=$ORACLE_HOME/dbs/orapwT11852 password=u_pick_it force=y nosysdb>

4. Retried "sqlplus sys@T11852 as sysdba" and it connected.

5. then reran emca and it worked.

Environment variable ORACLE_UNQNAME not defined.

I have a new install of 11.2.0.2 and upgraded the 10.2.0.4 database to 11.2.0.2.

As I said in my last post that the EM configuration failed during the upgrade of database by using dbua.
I was looking to workaround that problem by running emca, before that I wanted to see what it would show for status of dbconsole.

$ emctl status dbconsole
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.

I went and looked in the documentation here:
http://download.oracle.com/docs/cd/E11882_01/server.112/e10897/em_manage.htm#ADMQS032

Note:
If you are prompted to set the ORACLE_UNQNAME environment variable, then set this variable and run the emctl command again. Set the variable to the database unique name (the value of the DB_UNIQUE_NAME database parameter). A typical value for DB_UNIQUE_NAME is orcl.

For RAC:
=======
In case of RAC the dbconsole service runs from a single host.
Let's say you have three node RAC cluster with ORCL database running on all 3 of them. orcl1, orcl2, and orcl3 are the instance names.

Assume that dbconsole is running from node1, in that case if you would have to set, below parameter before running emctl commands :


ORACLE_UNQNAME=orcl (i.e. db_unique_name) 

HTH. 

Tuesday, June 28, 2011

10.2.0.4 to 11.2.0.2 Standalone DB upgrade using dbua

Followed Complete checklist to upgrade the database to 11g R2 using DBUA [ID 870814.1]


1. Check dba_registry for correctness of status and version at the source 10.2.0.4 database. Take necessary steps to validate them.
2. Copy from 11g Env: $ORACLE_HOME/rdbms/admin/utlu112i.sql to some other location e.g. /tmp
3. From 10g Env:
cd /tmp
$ sqlplus '/ as sysdba'
SQL> spool upgrade_prereq.log
SQL> @utlu112i.sql
SQL> spool off

4. Review the upgrade_prereq.log and fix them.

I will put some lines from my log file where it suggested some changes:
..
..
Update Parameters: [Update Oracle Database 11.2 init.ora or spfile]                       
Note: Pre-upgrade tool was run on a lower version 64-bit database.
**********************************************************************                    

WARNING: --> "shared_pool_size" needs to be increased to at least 472 MB
WARNING: --> "db_cache_size" needs to be increased to at least 50331648 bytes
==> dbua would take care of this.

**********************************************************************
Obsolete/Deprecated Parameters: [Update Oracle Database 11.2 init.ora or spfile]
**********************************************************************
--> background_dump_dest         11.1       DEPRECATED   replaced by  "diagnostic_dest"   
--> user_dump_dest               11.1       DEPRECATED   replaced by  "diagnostic_dest"  
==> dbua would take care of this

**********************************************************************                    
Miscellaneous Warnings                                                                    
**********************************************************************                    
WARNING: --> Database is using a timezone file older than version 14.                     
.... After the release migration, it is recommended that DBMS_DST package                 
.... be used to upgrade the 10.2.0.4.0 database timezone version                          
.... to the latest version which comes with the new release.
==> Checked "Actions FOR DST Updates When Upgrading To Or Applying The 11.2.0.2 Patchset (Doc ID 1201253.1)" . Check step B.3b). It says we can skip the DST related upgrade instructions. dbua gives an option of upgrading the timezone version and TIMESTAMP WITH TIME ZONE data.
                              
WARNING: --> Database contains INVALID objects prior to upgrade.                          
.... The list of invalid SYS/SYSTEM objects was written to                                
.... registry$sys_inv_objs.                                                               
.... The list of non-SYS/SYSTEM objects was written to                                    
.... registry$nonsys_inv_objs.                                                            
.... Use utluiobj.sql after the upgrade to identify any new invalid                       
.... objects due to the upgrade.

WARNING: --> EM Database Control Repository exists in the database.                       
.... Direct downgrade of EM Database Control is not supported. Refer to the               
.... Upgrade Guide for instructions to save the EM data prior to upgrade.                 

WARNING: --> Your recycle bin contains 93 object(s).                                      
.... It is REQUIRED that the recycle bin is empty prior to upgrading                      
.... your database.  The command:                                                    
             PURGE DBA_RECYCLEBIN                                                              
.... must be executed immediately prior to executing your upgrade.                        

WARNING: --> Database contains schemas with objects dependent on DBMS_LDAP package.       
.... Refer to the 11g Upgrade Guide for instructions to configure Network ACLs.           
==> This actually needs be done post upgrade. http://download.oracle.com/docs/cd/E11882_01/server.112/e17222/upgrade.htm#BABJHIHH

5. Gather dictionary stats prior to upgrade:
On 10g ENV:
sqlplus "/as sysdba"
EXECUTE dbms_stats.gather_dictionary_stats;

6. purge dba_recyclebin
7. Run dbua
==> I saw few errors during  oracle server upgrade but I could ignore those. May be because my 10g db had many invalid objects. As most of them were ORA-04063.
==>Also EM configuration failed. Will write another post for this one.

8. Change compatible.
I havent done this yet, as I would leave it to 10.2.0.4 for few days so that in case I want to downgrade it.

Clone 10g DB manually without RMAN & NID utility


This post assumes that you are cloning "prod" to "clone".

1. Take cold backup of database:
    a. select name from v$datafile;
    b. Shutdown the database
    c. copy the files from step 1a) to the destination server and location.
Note: We dont have to copy controlfiles and redolog files, these will be created fresh.

2. Copy and edit the init.ora. If using spfile, create pfile first.
copy the init.ora to destination $OH/dbs/initclone.ora and do :
modify db_name
modify path for adump, udump, cdump and bdump
modify path for control_files


3. After backup you can start the "prod" db and execute:
alter database backup controlfile to trace; ==> This will generate a trace file in udump of prod db. Find the trace.

4. Use the trace generated in step#3 to create a script to create controfile. e.g. recreatecontrol.sql
CREATE CONTROLFILE SET DATABASE "CLONE" RESETLOGS  NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 (
    '/u02/oralog/clone/redo01a.log',
    '/u04/oralog/clone/redo01b.log'
  ) SIZE 100M,
  GROUP 2 (
    '/u03/oralog/clone/redo02a.log',
    '/u04/oralog/clone/redo02b.log'
  ) SIZE 100M,
  GROUP 3 (
    '/u03/oralog/clone/redo03a.log',
    '/u04/oralog/clone/redo03b.log'
  ) SIZE 100M
-- STANDBY LOGFILE
DATAFILE
  '/u04/oradata/clone/system01.dbf',
  '/u04/oradata/clone/undo01.dbf',
  '/u04/oradata/clone/sysaux01.dbf',
  '/u04/oradata/clone/users01.dbf'
CHARACTER SET AL32UTF8
;

5. Set Oracle env for clone db
export ORACLE_HOME
export ORACLE_SID=clone
sqlplus /nolog
sql> conn / as sysdba
sql> startup nomount
SQL>@recreatecontrol

SQL>alter database open resetlogs;

6. Add tempfile to TEMP tablespace.

7. Restart clone db and monitor alert log to make sure everything is ok.

Monday, June 27, 2011

Missing AS Control from new installation of IAS 10.1.3.4

I had installed IAS 10.1.3.4 .

Today I decided to visit the AS control for that installation and I couldn't.
I got "HTTP 404 Not Found".

I was wondering what went wrong and restarted all components using opmnctl command. That did not help.

Thankfully I had taken screenshot of my install which showed below message at the end of installation in summary screen:
"Application Server Control Console is not running in this instance of Oracle Application Server. You can manage this instance remotely through another instance of Oracle Application Server that is configured to run Application Server Control Console."

Then searched more in the installation screens to see if I missed anything and found below.



I had NOT CHECKED "Configure this as an Administration OC4J instance"

Now that I found out my mistake, the next step was how to configure EM AS control. I searched MOS and found a wonderful doc 418395.1

Followed the same and issue was resolved.

To resolve it follow below link and step 1 (a to g) and then just do opmnctl stopall and opmnctl startall.
http://download.oracle.com/docs/cd/B31017_01/core.1013/b28940/em_app.htm#CEGEJCGA