Last active
February 2, 2021 22:05
-
-
Save krisrice/d8ce252c201690f4a9d50a9485b7b473 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Print current instances for autonomous db | |
# Uses $OCI_TENANCY for compartment id since that is the "root" | |
# | |
cat > db.jq <<EOF | |
.data[] | | |
."db-name" + "\tocid:" + .id , | |
"\t" + ."db-name" + "_low" , | |
"\tORDS Version: " + ."apex-details"."ords-version", | |
"\tAPEX Version: " + ."apex-details"."apex-version", | |
"\tSDW: " + ."connection-urls"."sql-dev-web-url", | |
"\tAPEX: " + ."connection-urls"."apex-url", | |
"\n\toci db autonomous-database generate-wallet \\\n\t\t--autonomous-database-id " + .id + " \\\n\t\t--file mywallet.zip --password <YOURPASSWORD>", | |
"\n\toci db autonomous-database generate-wallet--region --file mywallet.zip --password <YOURPASSWORD>", | |
"\n\t sql -cloudconfig mywallet.zip admin@" +."db-name" + "_low\n" | |
EOF | |
oci db autonomous-database list --compartment-id $OCI_TENANCY | jq -r -f db.jq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment