Thursday, 6 June 2019

Quick start for npm under proxy [POC/Learning purpose only]


NPM (Node Package Manager) is the default package manager for Node.js. Setting up NPM for downloading packages, one common issue is working behind the corporate proxy. 

Below is a workable solution - 


Fire up your command line and type in the following:


npm config set proxy http://<proxy_user_id>:<password>@<proxy_url>:<proxy_port>


npm config set https-proxy https://<proxy_user_id>:<password>@<proxy_url>:
<proxy_port>




Note: For https_proxy url starts with https.



If you get error like "SSL routines:ssl3_get_record:wrong version number" then you have problem with the entry you made above for https_proxy.
  • If SSl not configured properly then try not to use https_proxy command above.

There is one file which maintains all entries related to npm - C:\Users\<account_id>\.npmrc See if you have proper entries inside of that. You can make the changes there as well.

Performance degradation after upgrading Oracle database from 11g to 12c for documentum applications

I faced major performance issues when I upgrade database environment for one of the system from 11g to12c (12.1.0.2.0). Front end application is Document D2.

Here is my analysis -

In Oracle 12.1 the adaptive optimizer features are controlled by the OPTIMIZER_ADAPTIVE_FEATURES parameter, which was set to TRUE by default.

This is introduced to better estimate statistics and optimize plans. In some system,  this lead to the performance issues.


SOLUTION -

I found the below tuning works for my environment

Use the following system setting to disable Adaptive Query Optimization:
ALTER SYSTEM SET OPTIMIZER_ADAPTIVE_FEATURES = FALSE SCOPE=BOTH; 


Also there are some tables which still contains statistics, so have to flush them out as well to get the better result. Contact your DBA team with these details.








Thursday, 28 February 2019

IMP-00010: not a valid export file, header failed verification - ERROR during oracle database schema import


Hi Everyone,

This is one of the error which I received while trying to import database dump exported from another oracle database version as part of migration activities. It took me some time to work out the things -

Error Received during import of schema: 

                          IMP-00010: not a valid export file, header failed verification

Schema dump exported from oracle version:

                          V12.01.00

Schema dump imported into oracle version:

                           V11.02.00

 From oracle note available in web:
                           If you are running Oracle Database 12c Release 1 (12.1.0.2) and specify VERSION=11.2 on an export, then the dump file set that is created can be imported into an Oracle 11.2 database.

It means I must redo the export again which I cannot afford due to some time constraints.

Quick and dirty resolution I work out which works:

 1. First I checked the content of the DMP file with the help of some commands, then I noticed there is one line with the version number inside of DMP file. If you can execute Unix commands, then try 
                       head -5 {dump_file_name}.DMP

Result shows like below -

                       gEXPORT:V12.01.00 

 2. I replaced the line with version of the target oracle instance by below command-

                       sed 's/gEXPORT:V12.01.00/gEXPORT:V11.02.00/' {dump_file_name}.DMP > {dump_file_name}_new.DMP


3. Then try to import the new DMP file i.e. {dump_file_name}_new.DMP and guess what?

It successfully imported into new schema. Do let me know if it helps you. 😊


Friday, 9 February 2018

Documentum D2 DQL Queries

In day to day life I think you will find below queries very helpful. Do not forget to like or post comment :-)


Execute D2 Core Method – for folder and security recalculation

execute do_method with method='D2CoreMethod', arguments='-docbase_name $DOCBASENAME -user $DOCBASEUSERID -dql_filter "select r_object_id from dm_sysobject(all) where r_modify_date BETWEEN DATE(''10/31/2011 11:30:00'',''mm/dd/yyyy hh:mm:ss'') AND DATE(NOW)" -naming false -autolink true -security true -apply_for_vd false -create false -transaction false'


Run D2UpdateChildACLMethod as per security config

EXECUTE do_method WITH method = 'D2UpdateChildACLMethod', arguments = '-user_name username -docbase_name docbasename -acl_config_name doc_approved_acl¬doc_draft_acl

DQL to get workflow history of document in D2 application (provide documents i_chronicle_id in red color section)
select a.r_object_id,a.audited_obj_id,a.event_name as event_name,a.object_name AS workflow_name ,doc.object_name AS document_name,ra.child_label AS document_version,a.owner_name As supervisor_name,w.tracker_state as task_state, w.start_date as date_sent,a.user_name AS task_performer,a.time_stamp AS task_completion_time,a.string_2 AS outcome,a.event_source AS event_source, a.string_3 AS delegation_from,a.string_4 AS delegation_to from dm_audittrail a ,d2c_workflow_tracker w , dm_relation ra, dm_sysobject doc where a.audited_obj_id in( select w.r_object_id from d2c_workflow_tracker w where r_object_id in (select distinct w.r_object_id from dm_relation r,d2c_workflow_tracker w where r.relation_name = 'D2_WF_TRACKER_DOCUMENT' and r.child_id = '$object$(i_chronicle_id)' and r.parent_id = w.r_object_id)) and a.audited_obj_id=w.r_object_id and ra.parent_id = w.r_object_id and a.audited_obj_id=ra.parent_id and ((a.event_name='d2_workflow_sent_task' and a.user_name not in ( select user_name from dm_audittrail b where b.event_name in ('d2_workflow_rejected_task','d2_workflow_forwarded_task','d2_delegation_delegated_task','d2_workflow_delegated_task') and b.audited_obj_id=a.audited_obj_id)) or (a.event_name in ('d2_workflow_rejected_task','d2_workflow_forwarded_task') and a.string_2 is not nullstring) or (a.event_name in ('d2_delegation_delegated_task','d2_workflow_delegated_task'))) and doc.i_chronicle_id=ra.child_id and ra.child_label NOT In ('CURRENT',' ')  order by 1 desc

Full Text Index Queue Summary

select min(date_sent) as minimum from dmi_queue_item where delete_flag = 0 and (task_state is NULL or task_state = ' ') and name IN (select queue_user from dm_ftindex_agent_config)
select count(*) as number from dmi_queue_item where delete_flag = 0 and task_state = 'warning' and name IN (select queue_user from dm_ftindex_agent_config)
select count(*) as number from dmi_queue_item where delete_flag = 0 and task_state in ('error','failed') and name IN (select queue_user from dm_ftindex_agent_config)
select count(*) as number from dmi_queue_item where delete_flag = 0 and (task_state is NULL or task_state = ' ') and name IN (select queue_user from dm_ftindex_agent_config)

Halted Workflows

select pr.object_name as process, wf.object_name as workflow, wf.supervisor_name, qi.name, wi.r_creation_date from dm_process pr, dm_workflow wf, dmi_workitem wi, dmi_queue_item qi where wf.r_runtime_state = 3 and pr.r_object_id = wf.process_id and wi.r_workflow_id = wf.r_object_id and qi.r_object_id = wi.r_queue_item_id and qi.delete_flag = 0 order by 1, 2

User Workflows

select pr.object_name as process, wf.object_name as workflow, qi.name, wf.r_runtime_state, wi.r_creation_date from dm_process pr, dm_workflow wf, dmi_workitem wi, dmi_queue_item qi where pr.r_object_id = wf.process_id and wi.r_workflow_id = wf.r_object_id and qi.r_object_id = wi.r_queue_item_id and qi.delete_flag = 0 AND wf.supervisor_name = USER order by 1, 2

Job Details

select r_object_id, object_name, title, subject, method_name, pass_standard_arguments, start_date, expiration_date, max_iterations, run_interval, run_mode, is_inactive, target_server, method_trace_level, a_continuation_interval, a_current_status, a_iterations, a_last_invocation, a_next_invocation, method_arguments from dm_job order by title, object_name

Number of Workflows by Supervisor

select wf.supervisor_name, count(*) as number from dm_workflow wf where wf.r_runtime_state != 2 and wf.r_runtime_state != 4 group by supervisor_name order by supervisor_name

DQL – Check if index exists or successfully created

SELECT r_object_id,index_type,attribute,attr_count,data_space from dmi_index where index_type in (select r_object_id from dm_type where name=’dmi_workitem’)

DQL/API – Create Index

DQL:  Sample 1:
  EXECUTE make_index WITH type_name='dm_audittrail', attribute='chronicle_id',index_name='chronicle_id_index', use_id_col=true;
  Sample 2:
  EXECUTE make_index WITH type_name=’dm_sysobject’,attribute=’i_is_deleted’,index_name=’DM_SYSOBJECT_S_NI1?,index_space=’TEST_INDEX’,use_id_col=true,“UNIQUE”=true
API:  Sample 1:   apply,c,NULL,MAKE_INDEX,NAME,S,dm_sysobject,ATTRIBTUE,S,i_is_deleted,INDEX_NAME,S,DM_SYSOBJECT_S_NI1,INDEX_SPACE,S,TEST_INDEX,USE_ID_COL,B,true

 
Sample 2:   apply,c,NULL,MAKE_INDEX,NAME,S,dm_sysobject,ATTRIBTUE,S,i_is_deleted,INDEX_NAME,S,DM_SYSOBJECT_S_NI1,INDEX_SPACE,S,TEST_INDEX,USE_ID_COL,B,true,“UNIQUE”,B,true

DQL/API – Drop Index

DQL:  Syntax:
   EXECUTE drop_index [[FOR] dmi_index_id] [WITH name = index_name]
  Example:
   EXECUTE drop_index WITH name=’chronicle_id_index′ 
 
API:  Syntax:
   apply,session,dmi_index_id,DROP_INDEX [,NAME,S,index_name]
 Example:
   apply,session,dmi_index_id,DROP_INDEX,NAME,S,chronicle_id_index

Use of ESCAPE character

SELECT r_object_id FROM dm_document WHERE object_name LIKE '%\_%' ESCAPE '\'         [Note:Your LIKE predicate would look like this:
LIKE ’\%\_\\’ ESCAPE ’\’   escape character can escape itself]

Virtual Document / Assembly objects / D2C Snapshots

# get the associated assembly id from the virtual document root object
select distinct book_id from dm_assembly where parent_id='090eruhterh380586f30' ;


# get all the component under assembly object/d2csnapshot object using assembly id
select r_object_id,object_name,a_status,r_version_label,i_latest_flag from dm_document(all) where r_object_id in (select r_object_id from dm_sysobject(all) in assembly id('0800fdhdhd80586f34') descend);


# get D2CSnapshot objects for an virtual document using i_chronicle_id
select r_object_id,upper(object_name),object_name,r_object_type,a_content_type,r_is_virtual_doc,r_link_cnt,r_lock_owner,r_policy_id,r_assembled_from_id,r_immutable_flag,r_frozen_flag ,r_creation_date,title from d2c_snapshot where r_assembled_from_id in (select r_object_id from dm_sysobject(all) where i_chronicle_id = '0900gsgsts04fd9db') order by r_object_id;


[DM_CRYPTO_F_KEYSTORE_INIT]fatal: "Failed to initialize keystore" - during repository start

One fine day, I found that documentum repository was down and I am not able to access it anymore. I tried to start the services but found below error in repository log:


Error description in repository log:

[DM_CRYPTO_F_KEYSTORE_INIT]fatal:  "Failed to initialize keystore

RESOLUTION:

In LINUX environment, below shell script can be utilized :

#!/bin/bash

# Take the backup of the $DOCUMENTUM/dba/secure folder
cp -r $DOCUMENTUM/dba/secure $DOCUMENTUM/dba/secure_bkp
if [ -f $DM_HOME/bin/dm_crypto_manage_lockbox ]; then
  cd $DM_HOME/bin/
  chmod +x dm_crypto_manage_lockbox
  dm_crypto_manage_lockbox -lockbox <lockbox name .lb> -lockboxpassphrase -resetfingerprint
  dm_crypto_boot -all -passphrase
else
    echo "$DM_HOME/bin/dm_crypto_manage_lockbox does not exist.. so issue can not be resolved"
    exit 1
fi
Note:In content server $DM_HOME/bin/dm_crypto_manage_lockbox should be already present for other version you need to place it manually.

# Execute like  : ./solveFingerprintlockboxIssue.sh

On other environment you can execute below commands :


dm_crypto_manage_lockbox -lockbox <lockbox name .lb> -lockboxpassphrase -resetfingerprintdm_crypto_boot -all -passphrase




Saturday, 4 February 2017

Quick start for Docker under proxy [POC/Learning purpose only]


Installation on Windows:


Preparation:
To get started you have to enable virtualization from your computer.
Start your computer and press ESC that will give you options to choose. In my case F10 key is responsible for BIOS setting. Go to system setting (Under Advanced section) and enable the virtualization setting and you are good to go.

Installation:
Installation is very straight forward. The easiest way to install Docker is to go to their website and follow the installation instructions for your Operating System.  
In my case I want install docker in my windows 7 machine so docker toll box needs to be installed. Refer the url here for docker toolbox https://www.docker.com/products/docker-toolbox

After Installation
Once you install docker you will see below Icons in you desktop





Click on Docker Quick start to get started.
Interesting part is that to make docker work under proxy you need to do some tweaks. After installation if you run the below command for testing docker, it will not work –
docker run hello-world
In my case I have not used the default docker machine. I have created one new docker machine with the below command –

docker-machine create -d virtualbox     --engine-env HTTP_PROXY=http://<your_proxy>:<port>     --engine-env HTTPS_PROXY=https://<your_proxy>:<port>  --engine-env NO_PROXY= localhost,127.0.0.1,<machine_ip>  test1


Above command will create the docker machine named test1 for you.

Once you execute the command you will see line like below

“Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this vi
rtual machine, run: C:\Program Files\Docker Toolbox\docker-machine.exe env test1

Then execute the below commands-
docker-machine ls
docker-machine env test1

then execute the eval command
eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env test1)


Then you can test the command –
docker run hello-world

This should work now….

Installation on Centos 7


Prerequisites:
Docker requires a 64-bit OS and version 3.10 or higher of the Linux kernel.
Check using below command
uname -r
Installation
Install with yum… first update all the packages using below command..
sudo yum update
Install the
sudo yum install docker-engine
sudo systemctl enable docker.service
sudo systemctl start docker

After Installation:
Create directory:
mkdir /etc/systemd/system/docker.service.d
Create one file called http-proxy.conf under /etc/systemd/system/docker.service.d



Content of the file is like below
[Service]
Environment="HTTP_PROXY=http://<username>:<password>@<proxy_name>:<proxy_port>/" "HTTP_PROXY=http:// <username>:<password>@<proxy_name>:<proxy_port>/" "NO_PROXY=localhost,127.0.0.1,<machine_ip>"

Upload the changes:
sudo systemctl daemon-reload

Restart the docker service
sudo systemctl restart docker

Now you are good to go. Go ahead to check the below command
sudo docker run hello-world


Hope this will be helpful... :-)


Note: Blogs which I have written are totally my personal view based on my personal experience.


Thursday, 15 December 2016

Documentum D2 4.7 is here

Documentum D2 4.7 is here with enhanced features-


1. Introduction of Java free client (Documentum Client Manager)..
2. Removal of D2 Lockbox  utility by D2Keystore
3. Property page advance view editor functionality is back..
4. Installers are available as Docker image as well..
and many more.... :-)

Make life easier — Git automation with single command file

Make life easier — Git automation with single command file Posted on medium #makelifeeasier series - Automation of git related activity...