Logo F2FInterview

Oracle Database Interview Questions

Q   |   QA

Let's you made a mistake and changed to SGA to 16MB from the SYSTEM admin home page. When you run the batch file StartDB.bat, it will return a message saying server stated. However, if you try to connect to your server home page: http://localhost:8080/apex/, you will get no response. Why? Your server is running, but the default instance XE was not started.

If you go the Control Panel and Services, you will see service OracleServiceXE is listed not in the running status. 

If StartBD.bat failed to start the XE instance, you need to try to start the instance with other approaches to get detail error messages on why the instance can not be started.

One good approach to start the default instance is to use SQL*Plus. Here is how to use SQL*Plus to start the default instance in a command window:

>cd (OracleXE home directory)
>.instartdb
>.insqlplus
Enter user-name: SYSTEM
Enter password: globalguideline
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist

The first "cd" is to move the current directory the 10g XE home directory. The second command ".instartdb" is to make sure the TNS listener is running. The third command ".insqlplus" launches SQL*Plus. The error message "ORA-27101" tells you that there is a memory problem with the default instance.

So you can not use the normal login process to the server without a good instance. See other tips on how to log into a server without any instance. 

If your default instance is in trouble, and you can not use the normal login process to reach the server, you can use a special login to log into the server without any instance. Here is how to use SQL*Plus to log in as as a system BDA:

>cd (OracleXE home directory)
>.instartdb
>.insqlplus
Enter user-name: SYSTEM/globalguideline AS SYSDBA
Connected to an idle instance

SQL> show instance
instance "local"

The trick is to put user name, password and login options in a single string as the user name. "AS SYSDBA" tells the server to not start any instance, and connect the session the idle instance.

Log in as SYSDBA is very useful for performing DBA tasks. 

If you logged in to the server as a SYSDBA, you start the default instance with the "startup" command. Here is how to start the default instance in SQL*Plus in SYSDBA mode:

>.insqlplus
Enter user-name: SYSTEM/globalguideline AS SYSDBA
Connected to an idle instance

SQL> show instance
instance "local"

SQL> startup
ORA-00821: Specified value of sga_target 16M is too small,
needs to be at least 20M

Now the server is telling you more details about the memory problem on your default instance: your SGA setting of 16MB is too small. It must be increased to at least 20MB. 

Settings for each instance are stored in a file called Server Parameter File (SPFile). Oracle supports two types of parameter files, Text type, and Binary type. parameter files should be located in $ORACLE_HOMEdatabase directory. A parameter file should be named like "init$SID.ora", where $SID is the instance name. 

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: