|
Home >> FAQs/Tutorials >> Oracle DBA FAQ
Oracle DBA FAQ - Introduction to Oracle Database 10g Express Edition
By: FYIcenter.com
Part:
1
2
3
4
(Continued from previous part...)
What To Do If the StartBD.bat Failed to Start the XE Instance?
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)
>.\bin\startdb
>.\bin\sqlplus
Enter user-name: SYSTEM
Enter password: fyicenter
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 ".\bin\startdb" is to make sure the TNS listener is running.
The third command ".\bin\sqlplus" 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.
How To Login to the Server without an 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)
>.\bin\startdb
>.\bin\sqlplus
Enter user-name: SYSTEM/fyicenter 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.
How To Use "startup" Command to Start Default Instance?
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:
>.\bin\sqlplus
Enter user-name: SYSTEM/fyicenter 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.
Where Are the Settings Stored for Each Instance?
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_HOME\database directory.
A parameter file should be named like "init$SID.ora", where $SID is the instance name.
What To Do If the Binary SPFile Is Wrong for the Default Instance?
Let's say the SPFile for the default instance is a binary file, and some settings are
wrong in the SPFile, like SGA setting is bellow 20MB, how do you change a setting in the binary file?
This seems to be a hard task, because the binary SPFile is not allowed to be edited manually.
It needs to be updated by the server with instance started. But you can not start the instance
because the SPFile has a wrong setting.
One way to solve the problem is to stop using the binary SPFile, and use a text version
of the a parameter file to start the instance. Here is an example of how to use the backup copy
(text version) of the parameter file for the default instance to start the instance:
>.\bin\sqlplus
Enter user-name: SYSTEM/fyicenter AS SYSDBA
Connected to an idle instance
SQL> startup
PFILE=$ORACLE_HOME\config\scripts\initXETemp.ora;
ORACLE instance started.
Total System Global Area 146800640 bytes
Fixed Size 1286220 bytes
Variable Size 58724276 bytes
Database Buffers 83886080 bytes
Redo Buffers 2904064 bytes
Database mounted.
Database opened.
As you can see, 10g XE is distributed with a backup copy of the parameter file for the default instance XE.
The "startup" can take an option called PFILE to let you use a SPFILE from any location.
The default instance is running correctly now.
(Continued on next part...)
Part:
1
2
3
4
|