Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Difference between SYNC and AFFIRM Oracle
  • Find Plan Hash value fphv.sql Oracle
  • sql_doing_fts.sql Oracle
  • newupload.html PHP/MYSQL/Wordpress
  • Space padding in korn shell Linux/Unix
  • SCRIPT TO LIST RECURSIVE DEPENDENCY BETWEEN OBJECTS UTLDTREE.sql Oracle
  • How to start CRS manually Oracle
  • good linux notes Linux/Unix
  • Locktree.sql Oracle
  • Clean up Oracle
  • Good notes for shared pool Oracle
  • Processes Parameter decision Oracle
  • Proc Compilation Oracle
  • On solaris 10, “S” link is not part of $ORACLE_HOME/bin/oracle as default. ( For 9.2.0.8) Oracle
  • How To Limit The Access To The Database So That Only One User Per Schema Are Connected (One Concurrent User Per Schema) Oracle

Author: Admin

Getting started with notebook

Posted on 30-Sep-202330-Sep-2023 By Admin No Comments on Getting started with notebook

# Databricks notebook source   %sqlcreate database if not exists abcdb   %sqluse abcdb   %sqlcreate table student (id int , name string)   %sqlinsert into studentselect 1 as id, ‘user1’ as name   %sqlselect * from student   spark.sql(“create database if not exists xyzdb”)spark.sql(“use xyzdb”)   # Use three double quotes (“””) if SQL…

Read More “Getting started with notebook” »

Python/PySpark

Read CSV file using PySpark

Posted on 30-Sep-202330-Sep-2023 By Admin No Comments on Read CSV file using PySpark

from pyspark.sql.functions import col   # File location and type file_location = “/FileStore/tables/sales_data_part1.csv” file_type = “csv” # CSV options infer_schema = “false” first_row_is_header = “true” delimiter = “,” # The applied options are for CSV files. For other file types, these will be ignored. df = spark.read.format(file_type)   .option(“inferSchema”, infer_schema)   .option(“header”, first_row_is_header)   .option(“sep”,…

Read More “Read CSV file using PySpark” »

Python/PySpark

Read CSV File using Python

Posted on 30-Sep-202330-Sep-2023 By Admin No Comments on Read CSV File using Python

# Databricks notebook source import pandas as pd # preapre dataframe df_h=pd.read_csv(“https://people.sc.fsu.edu/~jburkardt/data/csv/zillow.csv”) #Print dataframe df_h #define custom columns columns = [“Srno”, “SQFT”, “BR”, “Baths”, “Zipcode”, “YearBuilt”, “ListPrice”] df_h=pd.read_csv(“https://people.sc.fsu.edu/~jburkardt/data/csv/zillow.csv”, header=None, names=columns) #Print dataframe df_h # show top 10 rows df_h.head(10) # show last 10 rows df_h.tail(10) #Print dataframe df_h #Drop non-needed columns, column names are case…

Read More “Read CSV File using Python” »

Python/PySpark

Creating never expiring DB user accounts in Oracle

Posted on 14-Sep-202314-Sep-2023 By Admin No Comments on Creating never expiring DB user accounts in Oracle

DB Users are required to reset the password periodically for better security. For some service accounts,  we need to make sure the password does not expire and does not impact the application. For this purpose, we need to update that user’s Profile. Each Profile has multiple security settings that controls Password_life_time, password_reuse_time, password_reuse_max  settings. These…

Read More “Creating never expiring DB user accounts in Oracle” »

Oracle, SQL scripts

Convert multiple rows to single column

Posted on 13-Sep-202313-Sep-2023 By Admin No Comments on Convert multiple rows to single column

Converting rows to single column: create table emp ( empno number, empname varchar2(100), deptno number); insert into emp values( 1, ’emp1′, 10); insert into emp values( 2, ’emp2′, 20); insert into emp values( 3, ’emp3′, 30); insert into emp values( 4, ’emp4′, 10); insert into emp values( 5, ‘paresh’, 30); insert into emp values( 6,…

Read More “Convert multiple rows to single column” »

Oracle, SQL scripts

Find all users who have DML privileges

Posted on 05-Sep-202305-Sep-2023 By Admin No Comments on Find all users who have DML privileges

Run following query as sysdba. alter session set nls_date_format=’DD-MON-RRRR:HH24:MI:SS’; alter session set nls_date_format=’DD-MON-RRRR:HH24:MI:SS’; select username, created, account_status /* Users who granted role with DML privs */ from dba_users where oracle_maintained = ‘N’ and username in (select grantee from dba_role_privs where granted_role in (select role from dba_roles where role in (select GRANTEE from dba_tab_privs where privilege…

Read More “Find all users who have DML privileges” »

Oracle, SQL scripts

Oracle GoldenGate lag monitoring shell script

Posted on 12-Jun-202318-Jun-2023 By Admin No Comments on Oracle GoldenGate lag monitoring shell script

Following script will be useful for tracking Oracle GoldenGate replicat process and related lag. This script will generate output on standard screen.  You can redirect it using file redirection to logfile or other locations.  while true do <goldengate home directory>/ggsci <<EOF > test.out info all exit EOF lag=`cat test.out | grep TESTREPLICAT | awk ‘{print…

Read More “Oracle GoldenGate lag monitoring shell script” »

Linux/Unix, Oracle, shell

Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle

Posted on 11-Jun-202311-Jun-2023 By Admin No Comments on Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle
Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle

If you want exclusive lock on any table, you need to make sure that no other session is  accessing it. This happens when you want to run DDL or any ALTER statements, that internally needs exclusive lock. Following script will to find the blocker session and provide killing statement for clearing locks.  col owner format…

Read More “Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle” »

Oracle, SQL scripts

How to collect CPU usage on Linux using Shell script

Posted on 09-Jun-202309-Jun-2023 By Admin No Comments on How to collect CPU usage on Linux using Shell script

Following script will help to collect CPU based on on every SAMPLE_TIME. This will help to collect IDLE CPU our from “vmstat” and store them in a file. #Setup SAMPLE_TIME for cpu data collection interval SAMPLE_TIME=5 while true do x=`vmstat | grep -v procs | grep -v swpd | awk ‘{print $15}’` echo `date +”%m-%d-%y…

Read More “How to collect CPU usage on Linux using Shell script” »

Linux/Unix, shell

Move WordPress site from one hosting service to other.

Posted on 06-Jun-202306-Jun-2023 By Admin No Comments on Move WordPress site from one hosting service to other.

We need to follow the steps below for moving website from one hosting provider to other hosting provider. At Source Hosting   Take backup of existing website. This will take complete backup of all your WP files plus SQL file for database.  The final backup file will be in “.tar.gz” format.  At Target Hosting Create the…

Read More “Move WordPress site from one hosting service to other.” »

PHP/MYSQL/Wordpress

Posts pagination

Previous 1 2 3 … 56 Next

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (387)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (336)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024
  • Add new columns in dataframe30-Sep-2023

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Check_recovery.sh program to run sqlplus and return its values remotely. Linux/Unix
  • Temporary Tablespace Information and restriction. Oracle
  • _B_TREE_BITMAP_PLANS issue during 8.1.7 to 9.2.0.8 upgrade Oracle
  • Formatter Explain plan Output 1 Oracle
  • plan10g.sql Oracle
  • Handling LOB data in Oracle Oracle
  • Good notes for shared pool Oracle
  • OPENING A STANDBY DATABASE IN READ-ONLY MODE Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme