Monday, July 17, 2017

Password reset procedure oracle

Deleting a password from history table in oracle and resetting the password

CREATE OR REPLACE PROCEDURE password_reset( p_user_name IN VARCHAR2,
                                       p_password  IN VARCHAR2) is
  ln_user_id   NUMBER;
  lc_alter     VARCHAR2(100);
BEGIN
   ln_user_id := NULL;
   lc_alter   := NULL;
   SELECT user_id
     INTO ln_user_id
  FROM dba_users
 WHERE username = p_user_name;
   dbms_output.put_line('User id is :'||ln_user_id);
 
   DELETE FROM  user_history$
    WHERE user#=ln_user_id;
   dbms_output.put_line(SQL%ROWCOUNT||' rows deleted for the User id :'||ln_user_id);
   COMMIT;
 
   lc_alter := 'alter user '||p_user_name||' identified by '||p_password||' account unlock';
   EXECUTE IMMEDIATE lc_alter;
 
EXCEPTION
WHEN OTHERS
THEN
   dbms_output.put_line('Exception Message is :'||SQLERRM);
END;


grant execute on sys.password_reset to user;



Execute it using the following

DECLARE
  P_USER_NAME VARCHAR2(32767);
  P_PASSWORD VARCHAR2(32767);

BEGIN
  P_USER_NAME := 'xxx';
  P_PASSWORD := 'Passwrd#1';

  SYS.PASSWORD_RESET ( P_USER_NAME, P_PASSWORD );
  COMMIT;
END;


Friday, July 14, 2017

pre req's for 11g oracle database install

For linux

yum install xorg-x11-apps

yum install xorg-x11-apps.x86_64
xhost +


yum install wget
For linux 7

Oracle Linux 7
cd /etc/yum.repos.d
wget http://yum.oracle.com/public-yum-ol7.repo

yum install oracle-rdbms-server-11gR2-preinstall


after install try to install below rpm's

If fails saying gpgcheck failed

add below line and rerun the commands

yum install --nogpgcheck gcc -y





yum install binutils -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libXext -y
yum install libXext.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
yum install zlib-devel -y
yum install elfutils-libelf-devel -y

yum install ksh -y


Once everything is installed.. proceed with installation


while installing oracle database

During the link phase you will encounter an error invoking the "ins_emagent.mk" file. To fix this, edit the "$ORACLE_HOME/sysman/lib/ins_emagent.mk", doing a search and replace for the line shown below.

FROM:
$(MK_EMAGENT_NMECTL)
TO  :
$(MK_EMAGENT_NMECTL) -lnnz11


****************************************************************

For Solaris

pkg install pkg:/x11/diagnostic/x11-info-clients
pkg install oracle-rdbms-server-12-1-preinstall


ndd -set /dev/udp udp_smallest_anon_port 9000
ndd -set /dev/udp udp_largest_anon_port 65500
ndd -set /dev/tcp tcp_smallest_anon_port 9000
ndd -set /dev/tcp tcp_largest_anon_port 65500

Featured Post

Apply Patch 22191577 latest GI PSU to RAC and DB homes using Opatch auto or manual steps

Patch 22191577: GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.4.160119 (JAN2016) Unzip the patch 22191577 Unzip latest Opatch Version in or...