Soumya's Database Blog
1,681 FOLLOWERS
A blog related to Different Databases i.e. Oracle, SQL Server , Mysql , Postgresql , Mongodb , Hadoop.
Soumya's Database Blog
2w ago
Issue:- We had a situation for a customer where his server was shutdown abruptly due to power cut at datacenter. After resuming the power, when he tried to start his database he encountered following error“ORA-00742: Log read detects lost write in thread 1 sequence 5789 block 805653”
Environment :- Windows 2019
DB Version:- 12.2.0.1
Solution: -
Login to database and shutdown cleanly
D:\oracle\product\12.2.0\dbhome\bin>sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Mon Mar 11 10:26:27 2024
Copyright (c) 1982, 2016, Orac ..read more
Soumya's Database Blog
2M ago
In this comprehensive guide, we'll walk you through the process of converting a Non-CDB (Non-Container Database) to a Pluggable Database (PDB) using an existing CDB (Container Database). Follow these clear and concise steps for a seamless transformation:
Assumption: Before converting a Non-CDB oracle instance into CDB , it is assumed an oracle CDB instance is already running.
Step 1: Cleanly Shutdown the Non-CDB Database(orcl)
Execute the following commands to gracefully shut down the Non-CDB Database named "orcl":
Invoke environment for orcl
[oracle@ocisoumya ~]$ . oraenv ..read more
Soumya's Database Blog
2M ago
In this post I will be showing step by step guide to apply CPU patch on oracle database 19c. I will be applying CPU patch for December 2023(Patch no :- 35643107)
Activity Steps:
1. Check Opatch Tool Version:
Verify the current version of the Opatch tool. As per read me of Patch 35643107 , minimum required Opatch version should be 12.2.0.1.37 or later
2.Download Opatch Tool (if needed):
Upgrade the Opatch utility if the current version is outdated. Download Opatch latest version or as mentioned in patch readme. In this case I will be installing 12.2.0.1.40 (Patch no 6 ..read more
Soumya's Database Blog
3M ago
We often require to extract information such as User DDL and all privileges granted including roles, system and object privileges, tablespace quota etc. Using the following method we can extract it easily.
Create a .sql file and paste the following code inside.
Note:- While executing this sql make sure to enter the username in UPPERCASE.
vi info.sql
-- Connect to target database and execute with a user that has DBA privileges
-- Example for user "CRPDTA" - Make sure to put the username in uppercase.
SET LONGCHUNKSIZE 20000 PAGESIZE 0 FEEDBACK OFF VERIFY OFF TRIMPOOL ON
COLUMN ..read more
Soumya's Database Blog
4M ago
Oracle datapump error ORA-39077: unable to subscribe agent KUPC$A_1_083325450472000
Error Details:-
D:\oracle\product\19.3.0\dbhome_1\bin>impdp HOSPITAL/HOSPITAL@ORCL dumpfile=EXP_HOSPITAL_20231113140110_A.DMP logfile=IMP_HOSPITAL_20231113140110_A.LOG directory=dumps
Import: Release 19.0.0.0.0 - Production on Mon Nov 13 16:59:16 2023
Version 19.13.0.0.0
Copyright (c) 1982, 2021, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
ORA-31626: job does not exist
ORA-31638 ..read more
Soumya's Database Blog
6M ago
Hi Everyone,
Recently I came across an issue where oracle service on windows was getting stopped due to some reason. Since customer was not using any monitoring tool, it was very hard to track when the service was going down.
To mitigate the problem , I wrote a batch script which will monitor oracleservice and listener service on windows . The script will send a mail once notifying service has gone down and once service comes back it will send another notification on email with service is running message.
Save the following script in .bat format and schedule it as per your requirement in ta ..read more
Soumya's Database Blog
1y ago
Today I will show a scenario where a customer had a requirement to refresh their snapshot standby database. The setup was 1 primary database and 2 physical standby databases among which one standby database was always kept in physical standby mode but the other one was used by the developer and a daily refresh was the requirement.
Since they wanted to convert snapshot standby into physical standby for sync and later convert it back to snapshot standby I prepared two shell script to perform the entire activity.
· Shell script to convert physical ..read more
Soumya's Database Blog
1y ago
In the following post I will show you how to purge dba_recyclebin older than X number of days.
For e.g I want to purge recyclebin data older than 30 days
Oracle recommends not to use delete statement on dba_recyclebin as this doesn’t allow to delete data older than 7 days
SQL> Delete from dba_recylebin where droptime <sysdate -30;
ERROR at line 1:
ORA-01752: cannot delete from view without exactly one key-preserved table
Rather run the following script to generate a select sql and execute it to purge dba_recyclebin
SQL>set head off
SQL>s ..read more
Soumya's Database Blog
1y ago
Following command will validate the configuration of the specified database.
DGMGRL> validate database 'db_name';
DGMGRL> validate database proddr;
Database Role: Physical standby database
Primary Database: prod
Ready for Switchover: Yes
Ready for Failover: Yes (Primary Running)
Flashback Database Status:
prod : On
proddr: Off
Managed by Clusterware:
prod : NO
&nbs ..read more
Soumya's Database Blog
1y ago
Using following shell script we can easily purge diagnostic files such as trace, alert, cdump etc.
$ vi /home/oracle/adrci_purge.sh
#!/usr/bin/ksh
#
#
#
# Description
# Shell script to purge ADR contents using ADRCI utility.
#
###
LOCKFILE=/tmp/adrci_purge_.lck
###
######
# Start Of Functions
#
# tidyup . common fuction called if error has occured
tidyup () {
rm -f ${LOCKFILE}
echo "ERROR: Purge aborted at `date` with exit code ${ERR}"
  ..read more