Showing posts from September, 2015

Creating a DB user without using a CREATE statement

I was teaching an Oracle Database 12c New Features class recently when I stumbled upon something I found quite interesting. While preparing for the class, I had to correct some of the exercises that had been provided since there were some typos due to OCR conversion. For one of the exercise, I had to create a new user and while I was entering the commands, I realized that I typed a GRANT statement before issuing the CREATE user statement. This must've been a typo I thought, but proceeded anyway. To my surprise Oracle didn't throw any errors at me!

Well I must have done something wrong so let's try this again.

First let's connect to the database - in this example I'm using Oracle but I've tested and confirmed it works in Oracle 11.2 as well and should also work in Oracle 10.2 but I haven't tested it.

Session altered. Check if the user exists
PDB1@ORCL> SELECT username,account_status,created
2 FROM …