Posts

Showing posts with the label database size

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

Find the size of an Oracle database

A very common question in any interview is "How do you find the size of a database?" This question can be answered in numerous ways. For e.g., some might say that the size of the database is the sum of the size of each datafile. Some might add the size of the tempfiles to the afore mentioned answer. However, according to me, the size of the database can be calculated as below: Database size = size of datafiles + size of tempfiles + size of redologs + size of controlfiles The above formula can be put to use using the below mentioned SQL. set serveroutput on declare DB_SIZE number; dfsize number; tfsize number; rlsize number; cfsize number; begin select sum(bytes)/1024/1024 "DATA_FILE_SIZE" into dfsize from dba_data_files; select sum(bytes)/1024/1024 "TEMP_FILE_SIZE" into tfsize from dba_temp_files; select sum(bytes)/1024/1024 "REDO_LOG_SIZE" into rlsize from v$log; select (BLOCK_SIZE * (1 + FILE_SIZE_BLKS))/1024/1024 "CONTROL_FILE_SIZE" ...

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