I have seen this error so many times that I thought I would note down the resolution (for me anyway)
When logging into the database you get:
ORA-01034: ORACLE not available. ORA-27101: shared memory realm does not exist
To solve you connect to sqlplus as follows:
sqlplus /nolog
Login in as a sys dba:
connect sys/sys as sysdba
When connected, startup the database using:
startup
The database will startup and can be connected to as normal.