About dbms_random.string

dbms_random.string can be used to generate random password, here are some simple examples of using different parameters.

SYS@orcl>column random_string format a10
SYS@orcl>select dbms_random.string(‘u’,10) random_string from dual; — Upper char
RANDOM_STR
———-
LLBVXCXRQM

SYS@orcl>select dbms_random.string(‘l’,10) random_string from dual; — Lower char
RANDOM_STR
———-
zipfrfoiwg

SYS@orcl>select dbms_random.string(‘a’,10) random_string from dual; –Mixed char
RANDOM_STR
———-
ZDFtxrWrQc

SYS@orcl>select dbms_random.string(‘x’,10) random_string from dual; –Upper char and number
RANDOM_STR
———-
5YWNEMGN8Y

SYS@orcl>select dbms_random.string(‘p’,10) random_string from dual; –printable char
RANDOM_STR
———-
<_||+L!owX

One Response

Subscribe to comments with RSS.