#!/bin/bash . /home/oracle/.bash_profile userid=$1 password=$2 userexist="WHENEVER SQLERROR EXIT;" echo -e "alter session set container=PDB01;\n$userexist\nalter user $userid identified by $password account unlock;" | sqlplus -L -s / as sysdba
Minimalistic Oracle contains a collection of practical examples from my encounters with Oracle technologies. When relevant, I also write about other technologies, like Linux or PostgreSQL. Many of the posts starts with "how to" since they derive directly from my own personal experience. My goal is to provide simple examples, so that they can be easily adapted to other situations.
Tuesday, May 29, 2018
Shell script snipplet for resetting a password
This little code snipplet to use a Linux/Unix escape character to send a line shift into a string of mulitple commands:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment