About Me

Database and GIS Consultant.

Tuesday, December 18, 2007

Manually Creating an Oracle 11g Database

Creating an Oracle 11g Database in Windows using command line.

Creating a 11g database is just the same as 10g.

INIT.ORA.Below are the contents of my init.ora:-

db_name='ORA11'
memory_target=1G
processes = 150
audit_file_dest='C:\oracle\ora11\admin\adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest=C:\oracle\ora11\admin\ORA11\flash_recovery_area
db_recovery_file_dest_size=2G
diagnostic_dest=C:\oracle\ora11\admin\ORA11\diagnostic_dest
dispatchers='(PROTOCOL=TCP) (SERVICE=ORA11XDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
control_files = ("C:\oracle\oradata\ORA11\ORA11_CONTROL1.ora", "C:\oracle\oradata\ORA11\ORA11_CONTROL2.ora")
compatible ='11.1.0'

Set Environment Variables:-

set ORACLE_SID=ORA11
set ORACLE_HOME=C:\oracle\ora11

Create Oracle service

C:\oracle\ora11\bin\oradim.exe -new -sid ORA11 -startmode m -INTPWD oracle -PFILE "C:\oracle\ora11\database\initORA11.ora"

Instance created.
Error while deleting value, OS Error = 2

Create Database

C:\>sqlplus /nolog

SQL*Plus: Release 11.1.0.6.0 - Production on Mon Dec 10 15:25:47 2007

Copyright (c) 1982, 2007, Oracle. All rights reserved.

SQL> connect sys/oracle as sysdba
Connected to an idle instance.

SQL> startup nomount pfile="C:\oracle\ora11\database\initORA11.ora"

ORACLE instance started.

Total System Global Area 644468736 bytes
Fixed Size 1335108 bytes
Variable Size 171966652 bytes
Database Buffers 465567744 bytes
Redo Buffers 5599232 bytes

CREATE DATABASE ORA11
USER SYS IDENTIFIED BY ORACLE
USER SYSTEM IDENTIFIED BY ORACLE
DATAFILE 'C:\oracle\oradata\ORA11\SYSTEM01.DBF' SIZE 325M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
SYSAUX DATAFILE 'C:\oracle\oradata\ORA11\SYSAUX01.DAT' SIZE 120M REUSE AUTOEXTEND ON NEXT 5M MAXSIZE 2048M
DEFAULT TABLESPACE USERS DATAFILE 'C:\oracle\oradata\ORA11\USERS01.DBF' SIZE 50M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE 'C:\oracle\oradata\ORA11\TEMP01.DBF' SIZE 40M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
UNDO TABLESPACE "UNDOTBS1" DATAFILE 'C:\oracle\oradata\ORA11\UNDOTBS01.DBF'
SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
CHARACTER SET WE8MSWIN1252
NATIONAL CHARACTER SET AL16UTF16
LOGFILE 'C:\oracle\oradata\ORA11\REDO01.LOG' SIZE 100M REUSE,
'C:\oracle\oradata\ORA11\REDO02.LOG' SIZE 100M REUSE,
'C:\oracle\oradata\ORA11\REDO03.LOG' SIZE 100MREUSE
EXTENT MANAGEMENT LOCAL
MAXLOGFILES 32
MAXLOGMEMBERS 4
MAXLOGHISTORY 100
MAXDATAFILES 254
MAXINSTANCES 1;

@C:\oracle\ora11\rdbms\admin\catalog.sql
@C:\oracle\ora11\rdbms\admin\catproc.sql

SQL> connect system/ORACLE as sysdba
Connected.

@C:\oracle\ora11\sqlplus\admin\pupbld.sql

SQL> select program from v$session;

PROGRAM
-----------------------
sqlplus.exe
ORACLE.EXE (q001)
ORACLE.EXE (CJQ0)
ORACLE.EXE (q000)
ORACLE.EXE (W000)
ORACLE.EXE (QMNC)
ORACLE.EXE (FBDA)
ORACLE.EXE (SMCO)
ORACLE.EXE (MMNL)
ORACLE.EXE (MMON)
ORACLE.EXE (RECO)
ORACLE.EXE (SMON)
ORACLE.EXE (CKPT)
ORACLE.EXE (LGWR)
ORACLE.EXE (DBW0)
ORACLE.EXE (MMAN)
ORACLE.EXE (DIA0)
ORACLE.EXE (PSP0)
ORACLE.EXE (DBRM)
ORACLE.EXE (DIAG)
ORACLE.EXE (VKTM)
ORACLE.EXE (PMON)

22 rows selected.

Drop Database

SQL> connect sys/oracle as sysdba
Connected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount exclusive;
ORACLE instance started.

Total System Global Area 644468736 bytes
Fixed Size 1335108 bytes
Variable Size 171966652 bytes
Database Buffers 465567744 bytes
Redo Buffers 5599232 bytes
Database mounted.
SQL> alter system enable restricted session;

System altered.

SQL> drop DATABASE ;

Database dropped.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

or

SQL> STARTUP mount RESTRICT EXCLUSIVE;
ORACLE instance started.

Total System Global Area 644468736 bytes
Fixed Size 1335108 bytes
Variable Size 171966652 bytes
Database Buffers 465567744 bytes
Redo Buffers 5599232 bytes
Database mounted.

SQL> drop DATABASE ;

Operation 203 succeeded.

Version

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production

5 rows selected.

Following messages were noted in Alert.ora

Tue Dec 11 08:36:23 2007
Warning: chk_tab_prop - table doesn't exist :SYS.KUPC$DATAPUMP_QUETAB
Warning: chk_tab_prop - table doesn't exist :SYS.AQ$_KUPC$DATAPUMP_QUETAB_S
Warning: chk_tab_prop - table doesn't exist :SYS.AQ$_KUPC$DATAPUMP_QUETAB_I
Warning: chk_tab_prop - table doesn't exist :SYS.AQ$_KUPC$DATAPUMP_QUETAB_H
Warning: chk_tab_prop - table doesn't exist :SYS.AQ$_KUPC$DATAPUMP_QUETAB_T
Warning: chk_tab_prop - table doesn't exist :SYS.AQ$_KUPC$DATAPUMP_QUETAB_G
Warning: chk_tab_prop - table doesn't exist :SYS.AQ$_KUPC$DATAPUMP_QUETAB_P
Warning: chk_tab_prop - table doesn't exist :SYS.AQ$_KUPC$DATAPUMP_QUETAB_D
Tue Dec 11 08:39:11 2007
SERVER COMPONENT id=CATPROC: timestamp=2007-12-11 08:39:11

11 comments:

Anonymous said...

so "Error while deleting value, OS Error = 2" was not a problem?

babumani said...

The error was not a problem. Tried to delete and re-create the service many times, but the error was there all the time.

Anonymous said...

hey thanks! I finally succeed creating a database following ur steps

Shweta said...

I am facing the same error. Can you please share the steps you followed.

Anonymous said...

thanks, this was a great help.

babumani said...

Shweta --> That's not an error, just warnings (looks like its related to DataPump), so I ignored it and never had any issues after that.

Brandonqbro said...

What is a normal size that a data base should have on Oracle Database 11g..? Is 1,3 GB fine?? or is it too much??

oscardel said...

Hi Everyone, I am an OCA student. But this morning i got a call from a friend telling me that she have friend who owns a company an is intending to use oracle as his database system. So she recommended me. The truth is i am still a student and so is she the difference between she and i is that i am a kind of fast in comprehension and solve most of the problem we encounter in the class. I am a kind of confused as this juncture. please i need guidance from you guys.

oscardel said...

Hi Everyone, I am an OCA student. But this morning i got a call from a friend telling me that she have friend who owns a company an is intending to use oracle as his database system. So she recommended me. The truth is i am still a student and so is she the difference between she and i is that i am a kind of fast in comprehension and solve most of the problem we encounter in the class. I am a kind of confused as this juncture. please i need guidance from you guys.

umesh said...

Very nice Post. Please see mine as well.

http://www.dbas-oracle.com/2013/07/Manual-Database-Creation-Script.html

umesh said...

Very nice Post. Please see mine as well.

http://www.dbas-oracle.com/2013/07/Manual-Database-Creation-Script.html