Step 7: Starting The Database
If you chose to create a database using DBCA during the installation
process, your database will be started and running when the process
has completed. If not, you will need to either use DBCA to create
a new database, or use a set of your own database creation scripts.
To see if ORACLE will cooperate with you, try running SQL*Plus.
oracle-bsd> sqlplus '/ as sysdba'
SQL*Plus: Release 9.2.0.1.0 - Production on Wed
Aug 20 12:02:07 2003
Copyright (c) 1982, 2002, Oracle Corporation.
All rights reserved.
Connected to an idle instance.
SQL>
|
Listing 14. Running SQL*Plus.
If this command fails, here are the most common reasons:
- ORA-01031: insufficient privileges
Your user account is not a member of the OSDBA group. If you are
logged in as "oracle," but still get this error, check to make sure
that you are a member of the appropriate groups using the "id"
command.
- Message file sp1.msb not found
Be sure that $ORACLE_HOME is set.
- Library "libclntsh.so.9.0" not found
In rare cases like this, you may need to define LD_LIBRARY_PATH=$ORACLE_HOME/lib
in your .profile to link the shared libraries properly.
(Obviously, please refer to Oracle Technology Network,
Tom, and the "Other"
manual if you encounter problems not listed here.)
Notice the message Connected to an idle instance. As anyone
who has seen Oracle before will know, this indicates that my Oracle
instance (which I configured to be called "ORACLE") is not running.
In my case, it indicates further that my instance does not exist. I
will fix this by running a database creation script, created by DBCA,
on my system. Rather than list out the whole (rather long) thing,
I have provided a tarball (download here)
of these scripts which you can run on your own system, and will only
list the bare essentials of the output here.
oracle-bsd> cd /u01/app/oracle/admin
oracle-bsd> tar xzf dbca-ORACLE.tgz
oracle-bsd> cd ORACLE/scripts
oracle-bsd> ORACLE_SID=ORACLE; export ORACLE_SID
oracle-bsd> sh ORACLE.sh
|
Listing 15. Using my database scripts to create your database.
If the above process fails (you'll see it scroll by quickly without any
pauses - look more closely, and you'll probably see the message "ORACLE
not available"), you can try a more manual process like the one below:
oracle-bsd> sqlplus '/ as sysdba'
SQL*Plus: Release 9.2.0.1.0 - Production on Wed
Aug 20 13:19:02 2003
Copyright (c) 1982, 2002, Oracle Corporation.
All rights reserved.
Connected to an idle instance.
SQL> STARTUP NOMOUNT PFILE =
'/u01/app/oracle/admin/ORACLE/scripts/init.ora';
ORACLE instance started.
Total System Global Area 114364796 bytes
Fixed Size 450940 bytes
Variable Size 88080384 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
SQL> CREATE DATABASE ORACLE
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE '/u02/oradata/ORACLE/system01.dbf'
SIZE 250M
REUSE
AUTOEXTEND ON
NEXT 10240K
MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE TEMP
TEMPFILE '/u02/oradata/ORACLE/temp01.dbf'
SIZE 40M
REUSE
AUTOEXTEND ON
NEXT 640K
MAXSIZE UNLIMITED
UNDO TABLESPACE "UNDOTBS1"
DATAFILE '/u02/oradata/ORACLE/undotbs01.dbf'
SIZE 200M
REUSE
AUTOEXTEND ON
NEXT 5120K
MAXSIZE UNLIMITED
CHARACTER SET WE8ISO8859P1
NATIONAL CHARACTER SET AL16UTF16
LOGFILE
GROUP 1
('/u02/oradata/ORACLE/redo01.log')
SIZE 102400K,
GROUP 2
('/u02/oradata/ORACLE/redo02.log')
SIZE 102400K,
GROUP 3
('/u02/oradata/ORACLE/redo03.log')
SIZE 102400K;
|
Listing 16. Doing things the hard way.
Common Errors
Here are some errors I have encountered:
- ORA-27102: out of memory
If your SYSVSHM kernel settings are configured correctly, this error will
be due to excessive sizes in your init.ora file. Try reducing the
number of processes, and some of the buffer sizes that make up the SGA.
- LRM-00109: could not open parameter file '...'
Your init.ora file could not be found. Make sure it exists in the location
you specified.
- ORA-07446: sdnfy: bad value '...' for parameter user_dump_dest.
Make sure the directory specified in this error message exists.
Testing Things Out
You may want to test starting up and shutting down your database to ensure
that things are working correctly. Do something like this:
oracle-bsd> sqlplus '/ as sysdba'
SQL*Plus: Release 9.2.0.1.0 - Production on Wed
Aug 20 13:19:02 2003
Copyright (c) 1982, 2002, Oracle Corporation.
All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0
- Production
JServer Release 9.2.0.1.0 - Production
SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP;
ORACLE instance started.
Total System Global Area 114364796 bytes
Fixed Size 450940 bytes
Variable Size 88080384 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
|
Listing 17. Doing things the hard way.
Is that the smell of success? Naw, it smells more like my processor
burning itself up running this Oracle instance! If these commands
ran correctly, your database should be up and running normally. At
this point, you can load your database applications of choice into
the system!
Assuming my next experiment goes well, I hope to have an installation
guide similar to this for Oracle 9i Application Server soon.
If you don't hear from me for a while, just drop me an e-mail, and I
will let you know how it is going. In any event, I hope this document
was useful for you! I would love to hear your feedback on the items
contained here - if something didn't work for you, let me know, and I
will see if I can help you work through it. Of course, if you did find
the document helpful, and everything worked, I would still love to hear
what you think! Feel free to e-mail
me, either way.
Until later,
Brian C. Ledbetter