BASIC SQL REFERENCE FOR ORACLE DBA

OVERVIEW OF SQL Please create the scott schema from the following GITHUB repository https://github.com/oracle/dotnet-db-samples/blob/master/schemas/scott.sql EXECUTING SELECT STATEMENT SQL> SELECT * FROM DEPT; DEPTNO DNAME LOC ———- ————– ————- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON HANDLING NULL VALUES SQL> SELECT EMPNO,ENAME,NVL(MGR,0) FROM EMP; EMPNO ENAME NVL(MGR,0) ———- ———- ———- 7369 SMITH 7902 7499 ALLEN […]

Error undefined symbol: JNU_ThrowByName during oracle 12c R2 installation

We faced this error during Oracle12cR2 installation. During our installation of oracle 12.2 in new home on existing Oracle 11g installation,we faced the error   LOG INFO: Executing [/opt/oracle/product/12.2.0.1/db1/bin/diagsetup, clustercheck=false, basedir=/opt/oracle/product, oraclehome=/opt/oracle/product/12.2.0.1/db1] /opt/oracle/product/12.2.0.1/db1/bin/diagsetup WARNING: java.lang.UnsatisfiedLinkError: /opt/oracle/product/12.2.0.1/db1/oui/lib/linux64/liboraInstaller.so: /opt/oracle/product/12.2.0.1/db1/oui/lib/linux64/liboraInstaller.so: undefined symbol: JNU_ThrowByName WARNING:        at java.lang.ClassLoader$NativeLibrary.load(Native Method) WARNING:        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) WARNING:        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824) WARNING:        at java.lang.Runtime.load0(Runtime.java:809) WARNING:        at java.lang.System.load(System.java:1086) WARNING:        at java.lang.ClassLoader$NativeLibrary.load(Native Method) […]

Add additional swap space in RHEL 7

This document describes process to add additional swap space in RHEL 7. 1.First partition your newly added disk [root@LinuxAcademy dev]# gdisk /dev/xvdf GPT fdisk (gdisk) version 0.8.10 Partition table scan: MBR: not present BSD: not present APM: not present GPT: not present Creating new GPT entries. Command (? for help): n Partition number (1-128, default 1): First sector (34-41943006, default […]

ORA-12545: Connect failed because target host or object does not exist using SERVICE_NAME in tnsnames.ora

Today I observed that we were getting following error when we were going to connect using SERVICE_NAME from (DR site) to new exadata server. The connection was working fine with SID in tnsnames.ora to individual instances. [oracle@XXX admin]$ sqlplus dba/XXX@PROD_CDV SQL*Plus: Release 12.1.0.2.0 Production on Mon Nov 27 09:08:38 2017 Copyright (c) 1982, 2014, Oracle. All rights reserved. ERROR: ORA-12545: […]

Restore Archivelog from particular sequence to another location using tape backup

Error in DR alert log:- FAL[client]: Failed to request gap sequence GAP – thread 2 sequence 9432-9473 DBID 2085418592 branch 924361120 FAL[client]: All defined FAL servers have been attempted. ———————————————————— Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization parameter is defined to a value that’s sufficiently large enough to maintain adequate log switch information to resolve archivelog gaps. ———————————————————— Now in Primary,do the […]

PSU patch Oracle 11gR2 oracle single instance HA

1.OPatch installation Copy the opatch binary using root user to $ORACLE_HOME and $GRID_HOME. Then please keep backup of old OPatch directory. Unzip the binary in the $ORACLE_HOME and $GRID_HOME. unzip -o -d $ORACLE_HOME /oracle/soft/p6880880_112000_Linux-x86-64.zip unzip -o -d $GRID_HOME /oracle/soft/p6880880_112000_Linux-x86-64.zip Change owner of the folder OPatch. chown -R oracle:oinstall $ORACLE_HOME/OPatch chown -R oracle:oinstall $GRID_HOME/OPatch 2.Stop EM DB console   [oracle@jminvgpdb01 ~]$ […]

Grid and Oracle PSU patching using OPatch 11gR2 RAC

1.Please download latest version of OPatch and install under $ORACLE_HOME and $GRID_HOE Copy the opatch binary using root user to $ORACLE_HOME and $GRID_HOME. Then please keep backup of old OPatch directory. Unzip the binary in the $ORACLE_HOME and $GRID_HOME. unzip p6880880_112000_Linux-x86-64.zip -d /u01/app/11.2.0/grid unzip p6880880_112000_Linux-x86-64.zip -d /u01/app/oracle/product/11.2.0/db_1 Change owner of the folder OPatch. chown -R oracle:oinstall $ORACLE_HOME/OPatch /u01/app/11.2.0/grid/OPatch/opatch version chown […]

Automated sql code deployment using Github and Jenkins DevOps

Install GitHub Download Git https://git-scm.com/download/win Installation Steps After finish,Please create repository where code will be saved   There is no code now I am creating sample code in c:\mygitrep directory     We need to again login to git from program and rescan. Now stage unchanged Now sign off Please commit now Now we will get this screen. Please create […]

Create new mount point using LVM in RHEL 7

First install gdisk utility (you may use old fdisk utility if LUN/drive size is less than 2 TB) -bash-4.1$ yum install gdisk Loaded plugins: fastestmirror, security You need to be root to perform this command. -bash-4.1$ su Password: [root@LinuxAcademy linuxacademy]# yum install gdisk Loaded plugins: fastestmirror, security Setting up Install Process Determining fastest mirrors * base: mirror.cs.pitt.edu * extras: mirrors.advancedhosters.com […]