Generate Random Passwords for Automated Oracle Installs
Oracle enforces complexity rules for passwords when creating a database:
This can be a bit of a pain when automating database builds for migration, perhaps to Oracle Database Appliance or Oracle Cloud. Eventually the password file from source gets restored. The password isn’t really important in this case, leaving two options.
Use a static password for everything
Generate passwords for each database
Producing random strings is easy, but guaranteeing minimums for upper and lowercase, numbers and special characters from a list is a little more complex.
I addressed this by producing a minimum of each type, adding random characters for length, then shuffling the output into a variable my automation uses to set the database password in the CLI:
Pass the value to the CLI:
Viola!