Posts

Creating a DB user without using a CREATE statement

Image
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 12.1.0.1 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. PDB1@ORCL> ALTER SESSION SET CONTAINER=PDB1; Session altered. Check if the user exists PDB1@ORCL> SELECT username,account_status,create...

Downloading EMCLI via Curl

The Enterprise Manager Command Line Interface or EMCLI enables ease of use and automation for administrators. However, in order to install EMCLI you need to access the EM Console to download the jar file. A question on twitter about downloading EMCLI via command-line. There may be a couple of ways to accomplish it but the one that came to mind used the same technique as method 2 posted on this blog post by Pythian. curl --header 'Host: oemcc.example.com' --header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:30.0) Gecko/20100101 Firefox/30.0' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header 'Accept-Language: en-US,en;q=0.5' --header 'DNT: 1' --header 'Referer: https://oemcc.example.com/em/faces/core-uifwk-console-overview?_afrLoop=1867249808458041&_afrWindowMode=0&_afrWindowId=bb8yoxpcb_1' --header 'Cookie: ORA_SMP_EM_AUTH_68934127863622066490=JtCfT0nY2Dq3LMzT2S1V0...

Getting Started with VMware vSphere 5.5: Part I

Much of my research to date has involved the use of virtualization technology especially Oracle VM VirtualBox. Lately however, I've found that my aging 5 year old iMac has been struggling to keep up with my testing and research even despite attempts at increasing performance by adding physical memory (16GB) and SSD disks. I could also try using other desktop virtualization software such as VMware Fusion or Parallels for OS X (I have both) since other users have had better experience with them. However, I find the alternatives lacking in some feature that I currently use in VirtualBox (such as shared disks for clustering). Also Oracle publishes several Virtual appliances for VirtualBox which makes it easy to learn a plethora of Oracle products and features. For more on Oracle with VirtualBox you can read my paper and presentations on Slideshare. With that said I've been wanting to build a dedicated lab machine for doing database research for a while now. I've been using VM...

PRVF:002 Could Not Retrieve Local Node Name During Oracle Database 12c Install

Image
Simple troubleshooting note during Oracle Database 12.1.0.2.0 installation on Oracle Linux 6.6 If you get the message above after running OUI (runInstaller) the message simply indicates that OUI is unable to retrieve the name of the local node. To determine why this happens you can validate using hostname command.  For example: [oracle@matthew database]$ hostname --long hostname: Unknown host To get additional information use the --verbose flag. [oracle@matthew database]$ hostname --long --verbose gethostname()=`matthew' Resolving `matthew' ... hostname: Unknown host It now becomes obvious that the resolution using gethostname() is failing. Hostnames in Linux can be resolved using the /etc/hosts or a name server .e.g DNS. If a name server is not in use a quick check of /etc/hosts will reveal that an entry for the hostname (matthew) is not present. [oracle@matthew database]$ cat /etc/hosts 127.0.0.1 localhost.localdomain localhost ::1 loca...

OpenWorld and SLOUG Presentations Update

Just a short post linking to my presentations at Oracle OpenWorld 2014 and St. Louis Oracle User Group (SLOUG) Big Bash. Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitoring (Top 10 Features for DBAs v1.1) from Leighton Nelson A Second Look at Oracle RAC 12c from Leighton Nelson

Provisioning Databases with Oracle Multitenant Self Service Application

Image
Uploaded slide from my KScope 14 presentation: "Databases for the Masses: Self-Service Oracle Multitenant with APEX" Here are a couple of short demos on using the PDBSS application.

Automatic RAC Recovery (Database Cloning)

For the past couple of months I've been working on a project to automatically clone a three node RAC database on AIX to a single instance database from storage snapshots. The clone was to be done daily after our ETL process had completed and was used to offload reporting as well as other purposes. Initially I thought this would be quite straightforward having done clones using RMAN before. How hard could it be? The procedure to clone the database is summarized as follows: 1. Generate controlfile  creation script 2. Identify cloned LUNS 3. Rename cloned disk groups e.g. DG_DATA -> DG_DATA_CLONE 4. Mount cloned disk groups 5. Modify/Create pfile or use existing pfile for clone 6. Setup environment variables for clone 7. Create audit directories for clone 8. Startup clone instance in nomount mode and re-create controlfile from script 9. Recover clone database (Apply archivelogs from source DB) 10. Open database with resetlogs 11. Rename database using NID ...