>for i in {1..61}
> do
> for j in {01..12}
> do
> echo "create synonym us$i$j for usage_dummy;" >> 1.sql
> echo "create synonym au$i$j for accumulates_usage_dummy;" >> 1.sql
> done
> done
Oracle DBA and beyond; these are practical tips for day to day DBA operation and maintenance; a place where you would come to look for a quick fix for a burning situation. I hope that by sharing all these, we all will become better in what we do. And on the way, I hope to save you some sweat :-)
>for i in {1..61}
> do
> for j in {01..12}
> do
> echo "create synonym us$i$j for usage_dummy;" >> 1.sql
> echo "create synonym au$i$j for accumulates_usage_dummy;" >> 1.sql
> done
> done
Match nth character
SQL> select case when regexp_like('ter*minator' ,'^...[^[:alnum:]]') then 'Match Found' else 'No Match Found' end as output from dual;
Output: Match Found
In the above example we tried to search for a special character at the 4th position of the input string “ter*minator”
Let’s now try to understand the pattern '^...[^[:alnum:]]'
^ marks the start of the string
. a dot signifies any character (… 3 dots specify any three characters)
[^[:alnum:]] Non alpha-numeric characters (^ inside brackets specifies negation)
Note: The $ is missing in the pattern. It’s because we are not concerned beyond the 4th character and hence we need not mark the end of the string. (...[^[:alnum:]]$ would mean any three characters followed by a special character and no characters beyond the special character)