12c Multitenant Database…make a bunch of PDBs

Here’s a quick, simple little script to create a bunch of new PDBs in the 12c Multitenant architecture.

Enjoy!
Matt

[code language=”bash”]

#!/bin/bash -x

export ORACLE_BASE=/u01/app
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
export ORACLE_UNQNAME=cloud
export ORACLE_SID=cloud

for i in {1..256}
do
echo "—————————————"
echo " Run number" ${i}
echo "—————————————"
sqlplus "/ as sysdba" <<EOF
CREATE PLUGGABLE DATABASE PDB_${i} ADMIN USER MATT IDENTIFIED BY *ROLES=(CONNECT) FILE_NAME_CONVERT=NONE;
exit;
EOF

sqlplus "sys/oracle12c@brutus:1521/PDB_${i} as sysdba" <<EOF
ALTER database PDB_${i} open;
exit;
EOF
#sleep 3
done

[/code]

Leave a Reply

Discover more from OraMatt: YABAOracle

Subscribe now to keep reading and get access to the full archive.

Continue reading