SQL tutorial | Interview questions | Oracle
Would you like to react to this message? Create an account in a few clicks or log in to continue.

steps to help you creating a new database manually from beginning to end

Go down

steps to help you creating a new database manually from beginning to end Empty steps to help you creating a new database manually from beginning to end

Post by Micheal Tue Jan 19, 2010 7:35 pm

How To Select an Oracle System ID (SID)?
This is Step 1. If you are planning to create a new database, you need to select an Oracle
System ID (SID). This ID will be used to identify the new Oracle database and its Oracle instance.
SID must be unique if you want to run multiple databases on a single server.
Let's set SID for the new database to be: FYI.
How To Establish Administrator Authentication to the Server?
This is Step 2. There are two ways to establish administrator authentication to a new database.
Use a password file.
Use operating system (OS) authentication.
Using OS authentication is easier on Windows system. If you used your own Windows user
account to install Oracle server, it will put your Windows user account into a special Window's
user group called SYSDBA. This Window's user group will be fully trusted by Oracle server with
SYSDBA privilege.
To continue with other steps, make sure you logged into the Windows system with a user account
in the SYSDBA group.
How To Create an Initialization Parameter File?
This is Step 3. To run an Oracle database as an Oracle instance, you need to create an
initialization parameter file, which contains a set of initialization parameters.
The easiest way to create an initialization parameter file to copy from the sample file provided by
Oracle. You can do this in a command window as shown below:
>cd $ORACLE_HOME
>copy .\config\scripts\init.ora .\database\initFYI_ini.ora
>edit .\database\initFYI_ini.ora
(replace XE by FYI)
In this example, only the SID is changed from XE to FYI. All other parameters are maintained as
is.
How To Connect the Oracle Server as SYSDBA?
This is Step 4. The best way to connect to the Oracle server as an administrator is to use
SQL*Plus. You need to run SQL*Plus with /nolog option and use the CONNECT with blank user
name, blank password and AS SYSDBA option. Here is a sample session:
>cd $ORACLE_HOME
>.\bin\sqlplus /nolog
SQL> CONNECT / AS SYSDBA
Connected.
How To Create a Server Parameter File?
This is Step 5. The initialization parameter file is good to get an Oracle database instance started.
But it is not ideal run an instance as production. You need to convert the initialization parameter
file into a Server Parameter File (SPFile) using the CREATE SPFILE statement. The script below
shows you how do this:
SQL> CREATE SPFILE=$ORACLE_HOME/dbs/SPFILEFYI.ora
2 FROM PFILE=$ORACLE_HOME/database/initFYI_ini.ora;
File created.
Note that $ORACLE_HOME should be replaced by the real path name where your Oracle server
is intalled.
The SPFile should be located in the expected directory and named as SPFILE($SID).ora.
How To Start an Oracle Instance?
This is Step 6. Now you are ready to start the new Oracle Instance without any database. This
instance will be used to create a database. Starting an instance without database can be done by
using STARTUP NOMOUNT statement as shown below:
>.\bin\sqlplus /nolog
SQL> CONNECT / AS SYSDBA
Connected.
SQL> SHUTDOWN
ORACLE instance shut down.
SQL> STARTUP NOMOUNT
ORA-00821: Specified value of sga_target 16M is too small,
needs to be at least 20M
The SHUTDOWN command is need to bring the default instance XE down.
The STARTUP NOMOUNT command failed because it tried to start the default instance XE, and
there is a bad parameter in the XE instance SPFile.

Micheal
Admin

Posts : 243
Join date : 2010-01-10

http://sql-tutorial.co.cc

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum