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...

Oracle 12c Container views - CDB_ Views

Today, I did get an opportunity to research on Containers and pluggable databases - the "single instance, multiple databases" concept that's one of the new features of Oracle 12c. I was really curious to know where the container view data comes from, in other words, where does the data for the CDB_ views come from? Well, this is what I found: It is actually coming from a function: SQL> select name,user,cdb from v$database; NAME USER CDB --------- ------------------------------ --- MY12CDB SYS YES 1 row selected. SQL> select dbms_metadata.get_ddl ('VIEW','CDB_OBJECTS') from dual; DBMS_METADATA.GET_DDL('VIEW','CDB_OBJECTS') -------------------------------------------------------------------------------- CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "SYS"."CDB_OB JECTS" CONTAINER_DATA ("OWNER", "OBJECT_NAME", "SUBO...

Is my server physical or virtual?

Am I real or virtual? That is the question! That's the realm of philosophy and adhyatma . When and if I put this question to my server, it becomes technical and here's the answer. On Linux # dmidecode | more or dmidecode -s system-manufacturer Sample Output # dmidecode | more # dmidecode 2.9 SMBIOS 2.4 present. 364 structures occupying 17030 bytes. Table at 0x000E0010. Handle 0x0000, DMI type 0, 24 bytes BIOS Information         Vendor: Phoenix Technologies LTD         Version: 6.00         Release Date: 04/14/2014         Address: 0xEA050         Runtime Size: 90032 bytes         ROM Size: 64 kB         Characteristics:                 ISA is supported                 PCI is supported               ...

Set Hugepages for Oracle 11gR2 database

1. Execute the shell script provided in Note ID: 401749.1 to find out the ideal setting for the parameter vm.nr_hugepages, set it in /etc/sysctl.conf and reboot VM/Server. Script from Note 401749.1 -bash-3.2$ cat huge_pages_calc.sh #!/bin/bash # # hugepages_settings.sh # # Linux bash script to compute values for the # recommended HugePages/HugeTLB configuration # # Note: This script does calculation for all shared memory # segments available when the script is run, no matter it # is an Oracle RDBMS shared memory segment or not. # # This script is provided by Doc ID 401749.1 from My Oracle Support # http://support.oracle.com # Welcome text echo " This script is provided by Doc ID 401749.1 from My Oracle Support (http://support.oracle.com) where it is intended to compute values for the recommended HugePages/HugeTLB configuration for the current shared memory segments. Before proceeding with the execution please note following:  * F...

Modify retention period of workflow queues

Yesterday, there was a requirement to increase the retention period of WF_DEFERRED and WF_BPEL_Q so that the developers could troubleshoot issues involving business events. This can be done this way: 1. Check the retention period of existing workqueues. SQL> SELECT owner, name, retention FROM all_queues WHERE name LIKE 'WF%'; OWNER           NAME                                                RETENTION --------------- --------------------------------------------- ------------------------------ APPS                 WF_BPEL_Q                                                0 APPLSYS         WF_INBOUND_QUEUE              ...

Check if UTL_FILE and FND_FILE are working fine

Yesterday, while troubleshooting a vexing ORA-29280 error, I came across 2 useful PL/SQL anonymous blocks that can be used to test FND_FILE and UTL_FILE to find out whether they are indeed working fine. UTL_FILE set serveroutput on DECLARE file_location VARCHAR2(256) := '<first entry on utl_file_dir>'; file_name VARCHAR2(256) := 'utlfile1.lst'; file_text VARCHAR2(256) := 'THIS IS A TEST'; file_id UTL_FILE.file_type; BEGIN file_id := UTL_FILE.fopen(file_Location, file_name, 'W'); UTL_FILE.put_line(file_id, file_text); UTL_FILE.fclose(file_id); EXCEPTION WHEN UTL_FILE.INVALID_PATH THEN dbms_output.put_line('Invalid path ' || SQLERRM); WHEN OTHERS THEN dbms_output.put_line('Others '|| SQLCODE || ' ' || SQLERRM); END; / References: Metalink (MOS) Note ID: 261693.1 FND_FILE set serveroutput on exec FND_FILE.PUT_LINE(FND_FILE.LOG, 'THIS IS A TEST'); HTH....

Maximum number of Datafiles for an instance

I'm back after a long hiatus! Hopefully, with stuff that you will all appreciate and use, in your day to day activities. So, here goes. Objective To find the maximum number of datafiles for a given instance (instance = database, both are interchangeable, unless we are talking of RAC). Options 1. Using init file: Check the parameter db_files. e.g: SQL> show parameter db_files 2. Using control file: Check the parameter MAXDATAFILES after generating the controlfile trace. eg: CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS ARCHIVELOG MAXLOGFILES 64 MAXLOGMEMBERS 5 MAXDATAFILES 512 MAXINSTANCES 8 MAXLOGHISTORY 14607 3. Execute the below query in sqlplus: SQL> select records_total from v$controlfile_record_section where type='DATAFILE';

Alternatives to Flash version of My Oracle Support

I am sure you all know this but this is for those who do not! :) For those who think that the flash version of MOS is slow (including yours truly), Oracle provides the html version of MOS. For those who were accustomed to using the Metalink (when MOS was Metalink and George W Bush was the president of the US of A - not the father, I'm talking about the son) patch search and download page, do not fret. You can use the classic patches window to get the old page (and a lot of memories) back! To open any MOS note id, you can use this link . Only substitute Note ID 221211.1 with the note id that you want to open.

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