Posts

Redis user permissions (ACL) and python connection

 Recently, I was working on setting up a redis cluster along with separate users for readwrite and readonly. I setup the readonly user using the below privileges (ACLs):   user redisreadonly on >mySuperSecretPassword ~* resetchannels -@all +@read +ping +asking   Once this is setup, I wrote a simple program in python to connect to the redis cluster using the readonly credentials and print the number of keys.   #!/usr/bin/env python3 """ pip3 install redis """ from redis.cluster import RedisCluster, ClusterNode # ─────── Cluster connection ─────── startup_nodes = [ ClusterNode("redis_host_1", 6379), ClusterNode("redis_host_2", 6379), ClusterNode("redis_host_3", 6379) ] rc = RedisCluster(startup_nodes=startup_nodes,decode_responses=True,username='redisreadonly',password='mySuperSecretPassw...

PCP in Non-RAC Instances - Pitfalls -- Solutions?

In the last post, I had talked about the pitfalls in configuring PCP in non-RAC instances. I have figured out (is it really the solution? - only time will tell!) workarounds for the 2 pitfalls that I had listed. 1. How would the VNC server failover when using PCP with non-RAC? Ans: The best bet would be to start the vnc server using the virtual hostname instead of the physical hostname (thanks to my colleague Mansoor who suggested it). Once the VNC is started using the virtual hostname, set the display variable to this value and run autoconfig so that the changes are reflected in the concurrent manager and the report server startup scripts. So, when the VIP (and hence, the virtual host) fails over, the VNC would still be running. This solution needs to be tested thoroughly though. Below is the command that I can use: $ vncserver -name <VIRTUAL_HOSTNAME>:<PORT_NUMBER> 2. The web tier 806_ORACLE_HOME tnsnames.ora can be modified to include the FNDFS_<PHYSICAL_HOSTNAME>...

PCP in non-RAC instances - Pitfalls

It was a wonderful surprise when I stumbled upon Metalink Note ID: 743716.1 , which details steps for configuring PCP in non-RAC instances. This is very useful while using hardware or software clustering and not Oracle clustering (RAC). We are using Veritas clustering (software clustering) for server failover. We were recently testing server failover and there are two things that I am unable to figure out as of now and which necessitates manual intervention rendering the whole failover mechanism manual: 1. How would the VNC server failover when using PCP with non-RAC? Since, the hostname changes when the failover happens, the display variable would still be pointing to the failed server and not the failover server. The work around to the above problem is obviously to reset the display variable and run autoconfig, which would mean that the failover mechanism is no longer automatic. 2. As soon as the failover happens, we need to make a manual entry in the Web Tier $TNS_ADMIN/tnsnames.ora...

Find Tablespace Usage Percent

I have written a sql query which would output the usage percent of all the tablespaces in a given database. Although lots of tablespace usage queries are available, most of them, if not all, utilise dba_free_space view as the tool of measurement. It is well known that this view is inadequate when datafiles have autoextend feature turned on. I have tried to address this inadequacy in my query. Caveat : This query is not optimised for performance. Hence, you might observe slow performance. set linesize 100 set pagesize 10000 set feedback off verify off col tablespace_name format a18 col num_files format 999 col total_space format 9999999.99 col free_space format 9999999.99 col used_percent format 999.99 select /*+ parallel(tbs) */ tbs.tablespace_name, count(tbs.file_id) num_files, round(sum(TOTAL_SPACE),2) TOTAL_SPACE_MB, sum(FREE_SPACE) FREE_SPACE_MB, round(((sum(tbs.USED_SPACE)/sum(tbs.TOTAL_SPACE)) * 100),2) USED_PERCENT from (select ddf.file_id file_id, ddf.file_name, ddf.tablespace...

EXCEPTION_ACCESS_VIOLATION in Jinitiator and IE crashes

The Environment Apps Version : 11.5.10.2 Jinitiator Version : 1.3.1.26 Internet Explorer Version : 6 The Issue One of our end users was receiving a very strange error while using jinitiator. The Internet explorer window would crash (close by itself) after creating a file HS_ERR_PID .log on the desktop, where #### stands for the Process ID of the f60webmx session. This error is intermittent and not easily reproducible. Moreover, the user would have to redo his/her work and hence this issue was turning out to be very vexing indeed. The error log is as below: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D043D1AFunction name=Java_sun_java2d_loops_DefaultComponent_IntIsomorphicCopy Library=C:\Program Files\Oracle\JInitiator 1.3.1.26\bin\awt.dll Current Java thread: at sun.java2d.loops.DefaultComponent.IntIsomorphicCopy(Native Method) at sun.java2d.loops.IntRgbToIntRgb.OpaqueBlit(Unknown Source) at ...

java.lang.ExceptionInInitializerError while trying to Access login page

Today morning, we (the DBAs) were faced with a strange issue. On Saturday (the 14th of February - (St.) Valentine's day!!), the UNIX boxes hosting our critical test instance went down for scheduled maintenance without any prior information. So, we could not bring down our databases and applications. As soon as the unix box came up, we encountered this issue. Let me briefly describe the environment, the issue, the analysis performed and of course, the solution to this most vexing problem. Environment : Apps Version : 11.5.10.2 with ATG RUP 5 DB Version : 10.2.0.3 Architecture : Two Node instance with database + admin on one tier and web server on another. PS : Another instance (development) exists on the same server with the same configuration, which was working fine. Issue : When trying to access the login page of Oracle Apps, received the below error. Even OAM login page was throwing the same error. Request URI: /OA_HTML/AppsLocalLogin.jsp Exception: java.lang.ExceptionInIniti...

Flower brackets {} and variables in UNIX - A perfect match

When passing a variable in unix, the general convention is to use $variable . Although this does suffice in most cases but in some rare cases, it gives connotations totally different than what was originally intended, as shown in the below example. The requirement Copy all files ending with ver to ver_old. For example, suppose I have a file called formver, I would like to copy it to formver_old. The code below is the code that I wrote to achieve the above requirement. for i in `ls *ver` do cp -p $i $i_old done The pitfall A cursory glance at the code indicates that it should run smoothly like a river. But it doent' and herein lies the catch. Let's have a look at the error and figure out what exactly is wrong with the above code. __________________________________________________________________ $ for i in `ls *ver` > do > cp -p $i $i_old > done cp: Insufficient arguments (1) Usage: cp [-f] [-i] [-p] [-@] f1 f2 cp [-f] [-i] [-p] [-@] f1 ... fn d1 cp -r-R [-H-L-P] [-f] [...

11.5.9 & JDK 5 - Mutually exclusive

Apps Configuration Oracle Apps Version ==> 11.5.9 Node Type ==> Multi-node RAC ==> No OS & version ==> Sun SPARC Solaris (64-Bit) 10 (5.10) Issue Recently (last week, to be precise), I was researching an "Internal Server error" while opening Installed Base. The error log had error "client denied by server configuration" (not very helpful, I would say). The mod_jserv.log was much more informative and in fact, quite specific. Refer the note marked in red below. __________________________________________________________________ [28/01/2009 06:39:44:223] (ERROR) ajp12: Servlet Error: OracleJSP: oracle.jsp.provider.JspCompileException: <H3>Errors compiling$COMMON_TOP/_pages/_oa__html//_csiSwitchRespMain.java< /H3><TABLE BORDER=1 WIDTH=100%><TR><TH ALIGN=CENTER>Line #</TH><TH ALIGN=CENTER>Error</TH></TR><TR><TD WIDTH=7% VALIGN=TOP><P ALIGN=CENTER>990</TD><TD> as of release ...

Popular posts from this blog

EXCEPTION_ACCESS_VIOLATION in Jinitiator and IE crashes

Version of mod_security with EBS 11.5.10.2

Read a file and extract specific lines using Native Ansible Modules