NLS_LENGTH_SEMANTICS & ORA-01450



NLS_LENGTH_SEMANTICS setting allows us to specify the length of a column in 'characters' or 'bytes' and 'byte' is it's default value.

Had one index creation failure today during a OBIEE install with ORA-01450 and this is in a Unicode AL32UTF8 database with 'nls_length_semantics=char' set.

A quick check of dba_tab_columns reveal the data_length being 4x the size of the column that's being defined due to the UNICODE characterset and the nls_length_semantics value of 'CHAR'.

SQL> select COLUMN_NAME, DATA_TYPE,DATA_LENGTH, CHAR_LENGTH,CHAR_USED      from dba_tab_columns
     where table_name='MDS_COMPONENTS';

COLUMN_NAME             DATA_TYPE       DATA_LENGTH     CHAR_LENGTH  C
-------------------------- ----------- ----------- ----------------------
COMP_COMMENT             VARCHAR2         4000               4000    C
COMP_ID                  VARCHAR2         3200                800    C
COMP_VALUE               VARCHAR2         4000               4000    C
COMP_LOCALNAME           VARCHAR2         3200                800    C
COMP_PREFIX              VARCHAR2          508                127    C
COMP_NSID                  NUMBER           22                  0
.....
.....

10 rows selected.

and a desc mds_components shows the columns being defined as VARCHAR2 (800 CHAR) due to the above settings. 



COMP_PREFIX VARCHAR2(127 CHAR)
COMP_LOCALNAME VARCHAR2(800 CHAR)
COMP_VALUE VARCHAR2(4000 CHAR)
COMP_ID VARCHAR2(800 CHAR)
COMP_COMMENT VARCHAR2(4000 CHAR)


However more interestingly an 'alter system set nls_length_semantics=BYTE scope=both' doesnt actually come into effect until the instance is restarted, though it allows 'both' in scope.

Anyway, changing the nls_length_semantics=byte finally fixed the issue with the index failure.



Deploying OEM 12c Management agents








OEM 12c agents can be deployed using a few options and here's the simple procedure for the 'silent install' option using the response file method.

  • Extract the Management agent software from the OMS for your platform.
                (asssuming the OMS_HOME is "/u01/app/middleware/oms")

             /u01/app/middleware/oms/bin/emcli login -username=sysman
             /u01/app/middleware/oms/bin/emcli sync
             /u01/app/middleware/oms/bin/emcli get_supported_platforms

Here's the command used to extract the binaries for Linux x86_64 bit (by default OMS host will have the agent binaries for the platform on which OMS is rnning)

/u01/app/middleware/oms/bin/emcli get_agentimage -destination="/tmp/agent_Linux_x86_64" -platform="Linux x86-64" -version=12.1.0.1.0

This will generate the "12.1.0.1.0_AgentCore_226.zip" zip file under /tmp.
  • Copy this zip file to a temporary location to the Host where the agent need to be installed.
  • unzip the file and update the response file as below.
               OMS_HOST="OMS Server"
               EM_UPLOAD_PORT="4889"
               AGENT_REGISTRATION_PASSWORD="xxxxxx"
               #AGENT_INSTANCE_HOME=
               AGENT_PORT=3872
               b_startAgent=true
               ORACLE_HOSTNAME="Host where Management Agent need to be installed"
               s_agentHomeName="agent12c"



  • Deploy the agent as below
/tmp/agentDeploy.sh AGENT_BASE_DIR=/u00/app/oracle/product/11.2.0/agent12c RESPONSE_FILE=/tmp/agent.rsp

Pls ensure AGENT_BASE_DIR is NOT a parent directory of any other Oracle software installation directories. This will cause serious issues if you try to uninstall in future for any reason as the entire 'agent_base_dir' directory will be removed after the deinstallation of the agent software.

Once the agent installation is complete, it'll prompt you to run the root.sh and that'll complete the agent setup and the uploads will commence immediately.


 

OEM 12c, Advanced Installation



Just finished an advanced install of OEM 12c (Bundle Patch 1) 12.1.0.1 and it's been much easier than I expected.

For those of you planning to install OEM12c, there's new Bundle patch version (12.1.0.1) available on otn download page which is the newest patchset available after the October 2011 product release.

*This post was first written in Dec, 2012 however the new OEM12c Release 2 is already out in Feb, 2013 and if you're planning to install or upgrade now, it's recommended to go to the newest release ...
"Oracle Enterprise Manager Cloud Control 12c Release 2 Plug-in Update 1 (12.1.0.2) New!"


Here's a quick summary of the installation steps that I've followed.
  • Install Oracle Database Server 11.2.0.3(with PSU January 2012)
  • Create a database for EM repository
  • Download the OEM 12c (12.1.0.1) software enterprise-manager/downloads and unpack into a temporary folder
  • After the usual 'support credentials' and 'search for updates' section, the installer will prompt you to choose the type of installation 'Simple or Advanced'.
  • Once you select 'Advanced' and provide the 'middleware home' location say '/u01/app/middleware', it moves into "select plug-in's" section
  • In this section by default, 'Oracle Database, Oracle Fusion Middleware, Oracle Exadata, Oracle MOS(My Oracle Support) are selected.
  • Next section is the Weblogic Configuration where you set a password for weblogic admin user and Node Manager accounts and also provide the OMS Instance Base location which is '/u01/app/middleware/gc_inst'
  • Next Section is the Database details, usual Host, Service, port and sys password for repository setup
  • After this point, the installer will perform will perform a few db configuration checks and might ask you to disable the 'automatic statistics collection job' and also increase the open cursors etc.
  • Next section will ask you choose the 'sysman' and agent registration passwords and also the tablespace/datafile details in the repository database.
  • The final screen is the port configuration section where  you can go with the default ports or modify as per  your standards.
    The important one's here are the EM upload http and https ssl   ports which are             usually 4889     and 1159 and also the Management agent port 3872.
Once you review the summary page and continue, the install will begin and after the usual root.sh, the OEM 12c installation finished within an hour and OEM 12c is ready for monitoring the managed targets.