Oracle Database - Creation of database query

Asked By shanti k
14-Oct-09 01:09 AM

Hi ,

How to create database in oracle 9i, with example.

i am need of query

i used create database DMS

it is throwing error as

insufficient privileges

Thanks,

shanti.

re  re

14-Oct-09 01:32 AM

The following is the initialization parameter file used to create the mynewdb database.

Sample Initialization Parameter File
# Cache and I/O
DB_BLOCK_SIZE=4096
DB_CACHE_SIZE=20971520

# Cursors and Library Cache
CURSOR_SHARING=SIMILAR
OPEN_CURSORS=300

# Diagnostics and Statistics
BACKGROUND_DUMP_DEST=/vobs/oracle/admin/mynewdb/bdump
CORE_DUMP_DEST=/vobs/oracle/admin/mynewdb/cdump
TIMED_STATISTICS=TRUE
USER_DUMP_DEST=/vobs/oracle/admin/mynewdb/udump

# Control File Configuration
CONTROL_FILES=("/vobs/oracle/oradata/mynewdb/control01.ctl",
               "/vobs/oracle/oradata/mynewdb/control02.ctl",
               "/vobs/oracle/oradata/mynewdb/control03.ctl")

# Archive
LOG_ARCHIVE_DEST_1='LOCATION=/vobs/oracle/oradata/mynewdb/archive'
LOG_ARCHIVE_FORMAT=%t_%s.dbf
LOG_ARCHIVE_START=TRUE

# Shared Server
# Uncomment and use first DISPATCHES parameter below when your listener is
# configured for SSL 
# (listener.ora and sqlnet.ora)
# DISPATCHERS = "(PROTOCOL=TCPS)(SER=MODOSE)",
#               "(PROTOCOL=TCPS)(PRE=oracle.aurora.server.SGiopServer)"
DISPATCHERS="(PROTOCOL=TCP)(SER=MODOSE)",
            "(PROTOCOL=TCP)(PRE=oracle.aurora.server.SGiopServer)",
             (PROTOCOL=TCP)

# Miscellaneous
COMPATIBLE=9.2.0
DB_NAME=mynewdb

# Distributed, Replication and Snapshot
DB_DOMAIN=us.oracle.com
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE

# Network Registration
INSTANCE_NAME=mynewdb

# Pools
JAVA_POOL_SIZE=31457280
LARGE_POOL_SIZE=1048576
SHARED_POOL_SIZE=52428800

# Processes and Sessions
PROCESSES=150

# Redo Log and Recovery
FAST_START_MTTR_TARGET=300

# Resource Manager
RESOURCE_MANAGER_PLAN=SYSTEM_PLAN

# Sort, Hash Joins, Bitmap Indexes
SORT_AREA_SIZE=524288

# Automatic Undo Management
UNDO_MANAGEMENT=AUTO
UNDO_TABLESPACE=undotbs
details here http://download.oracle.com/docs/cd/B10501_01/server.920/a96521/create.htm

reply  reply

14-Oct-09 01:40 AM
Hi,

Creating an Oracle 9i database from the command line only
       
This article is the successor to Creating an Oracle database on NT from the command line only. This article's successor is this one.
On the command line only refers to the fact, that no GUI tool is needed to create a database. For Unix users, the command line is their shell while for Windows users, the command line is the dos box. Windows users usually start the dos box with start->run and then enter cmd and press enter.
Creating a database consists basically of the following steps:

    * Creating the database's datafiles, its controlfiles and its online redo log files.
    * Creating the system tablespace
    * Creating the system rollback segment
    * Creating the data dictionary
    * Specifying the character set for textual data in the database
    * Setting the database time zone

All these steps are executed through the create database statement. The location of the control files is specified in the init.ora file.
First, a SID must be defined. This is in order to distinguish several Instances that run on the same machine. The SID's value is stored in the ORACLE_SID environment variable:
Setting ORACLE_HOME and PATH

ORACLE_HOME=/appl/oracle/product/9.2.0.2
export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin

ORACLE_SID=adpdb
export ORACLE_SID

Windows Users will set the variable like so:

set ORACLE_SID=adpdb

Location of the control files
The location of the control files is specified in the init.ora file.
Here's a minimal init.ora (under $ORACLE_HOME/dbs if it is Unix, or %ORACLE_HOME%\database, if it is windows) just to demonstrate how the control files are found. Of course, you will add more init params into the init.ora file.

control_files = (/db2/adpdb/control01.ctl,
                 /redolog1/adpdb/control02.ctl,
                 /redolog2/adpdb/control03.ctl)


undo_management = auto


compatible = 9.2.0

db_name     = adpdb

The undo_management parameter is necessary if we want to use automatic undo management.
Although the above seems to be the bare required minimum, you probably also want do define background_dump_dest, core_dump_dest and user_dump_dest.
Starting the instance
On Windows like systems, starting the instance requires oradim:

oradim -new -sid %ORACLE_SID% -pfile c:\path\to\some\init.ora

On Unix like systems, there is no oradim required. On both, Windows and Unix like systems, it must be proceeded like this:

adpdb:/appl/oracle/product/9.2.0.2/dbs >sqlplus "/ as sysdba"


SQL*Plus: Release 9.2.0.2.0 - Production on Fri Jul 25 14:08:37 2003


Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to an idle instance.


SQL>startup nomount pfile=/path/to/the/init.ora
ORACLE instance started.


Total System Global Area  160925320 bytes
Fixed Size                   730760 bytes
Variable Size             109051904 bytes
Database Buffers           50331648 bytes
Redo Buffers                 811008 bytes
SQL>CREATE DATABASE adpdb
  LOGFILE group 1 ('/redolog1/adpdb/redolog1a.dbf','/redolog2/adpdb/redolog1b.dbf' ) SIZE 10M,
          group 2 ('/redolog1/adpdb/redolog2a.dbf','/redolog2/adpdb/redolog2b.dbf' ) SIZE 10M,
          group 3 ('/redolog1/adpdb/redolog3a.dbf','/redolog2/adpdb/redolog3b.dbf' ) SIZE 10M
  DATAFILE '/db1/adpdb/system.dbf' SIZE 200M
  CHARACTER SET WE8ISO8859P1
  national character set utf8
  EXTENT MANAGEMENT LOCAL
  undo tablespace ts_undo
    datafile '/db1/adpdb/undo.dbf'
    size 50M
  default temporary tablespace ts_temp
    tempfile '/db1/adpdb/temp01.dbf'
    size 50M autoextend on next 50M maxsize 300M;

If an ORA-01031: insufficient privileges is returned, that means most likely, that the current user is not in the dba group (on unix), or the ORA_DBA (windows).
If the init.ora file is not at its default location or has not been found with the pfile attribute, an ORA-01078: failure in processing system parameters and an LRM-00109: could not open parameter file '/appl/oracle/product/9.2.0.2/dbs/initadpdb.ora' error is issued.
The create database command also executes a file whose name is determined by the (hidden) init parameter _init_sql_file.
After the creation of the database, it can be mounted and opened for use.
Completing the work
Run

    * ?/rdbms/admin/catalog.sql
    * ?/rdbms/admin/catproc.sql and
    * ?/rdbms/admin/caths.sql

as sys.
catalog.sql calls, for example, catexp.sql which is a requirement for exp, or dbmsstdx.sql which is a requirement to create triggers.
The user system might also want to run ?/sqlplus/admin/pupbld.sql. pupbld.sql creates a table that allows to block someone from using sql plus.
The ? shortcut will be replaced with the value of $ORACLE_HOME by SQL PLUS.
These scripts do quite a bit of work:

    * They create predefined roles
    * They create the data dictionary, consisting of dynamic (aka v$) and static (aka dba_) views.
    * to be completed...

Of course, tablespaces and users and tables and so on must be created according to the use of the database.
Also check this link:
http://www.devarticles.com/c/a/Oracle/Creating-a-Database-in-Oracle-9i/

reply  reply

14-Oct-09 01:42 AM
Hi,
Insufficient privileges means you donot have admin permissions:

Also try this :

Note: Instructions are for Windows XP

1. Create a SID for your new Database

set ORACLE_SID={SID};

Note: Where {SID} is any unique SID created by you.

2. Create suitable database directories within oracle directory.

make folders udump,cdump,bdump within admin/{SID} (optional for logs)
make folder {SID} within oradata

3. Create a initialization parameter file and name it as
init{SID}.ora. Drop this file in

%ORACLE_HOME%/database folder. Contents could look like this.
(Settings and paths will

vary)

# Cache and I/O
DB_BLOCK_SIZE=4096
DB_CACHE_SIZE=20971520

# Cursors and Library Cache
CURSOR_SHARING=SIMILAR
OPEN_CURSORS=300

# Diagnostics and Statistics
BACKGROUND_DUMP_DEST=/oracle/admin/{SID}/bdump
CORE_DUMP_DEST=/oracle/admin/{SID}/cdump
TIMED_STATISTICS=TRUE
USER_DUMP_DEST=/oracle/admin/{SID}/udump

# Control File Configuration
CONTROL_FILES=(”/oracle/oradata/{SID}/control01.ctl”,
“/oracle/oradata/{SID}/control02.ctl”,
” /oracle/oradata/{SID}/control03.ctl”)

# Archive
LOG_ARCHIVE_DEST=’/oracle/oradata/{SID}/archive’
LOG_ARCHIVE_FORMAT=%t_%s.dbf
LOG_ARCHIVE_START=TRUE

# Shared Server
# Uncomment and use first DISPATCHES parameter below when your listener is
# configured for SSL
# (listener.ora and sqlnet.ora)
# DISPATCHERS = “(PROTOCOL=TCPS)(SER=MODOSE)”,
# “(PROTOCOL=TCPS)(PRE=oracle.aurora.server.SGiopServer)”
DISPATCHERS =”(PROTOCOL=TCP)(SER=MODOSE)”,
“(PROTOCOL=TCP)(PRE=oracle.aurora.server.SGiopServer)”,
“(PROTOCOL=TCP)”

# Miscellaneous
COMPATIBLE=9.2.0
DB_NAME={SID}

# Distributed, Replication and Snapshot
DB_DOMAIN=us.oracle.com
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE

# Network Registration
INSTANCE_NAME={SID}

# Pools
JAVA_POOL_SIZE=31457280
LARGE_POOL_SIZE=1048576
SHARED_POOL_SIZE=52428800

# Processes and Sessions
PROCESSES=150

# Redo Log and Recovery
FAST_START_MTTR_TARGET=300

# Resource Manager
RESOURCE_MANAGER_PLAN=SYSTEM_PLAN

# Sort, Hash Joins, Bitmap Indexes
SORT_AREA_SIZE=524288

# Automatic Undo Management
UNDO_MANAGEMENT=AUTO
UNDO_TABLESPACE=undotbs

4. Create a password file with name PWD{SID}.ora and place in
%ORACLE_HOME%/database folder.

Create the password file using the following command:

orapwd file={path\filename} password=oracle

5. Create an instance of this database

oradim -new – -sid {sid}

6. Start SQLPLUS using the following command

sqlplus /nolog

7. Connect to instance of database

connect / as sysdba

8. Startup the instance without mounting

startup nomount

9. Run create database SQL statement

CREATE DATABASE {sid}
USER SYS IDENTIFIED BY pz6r58
USER SYSTEM IDENTIFIED BY y1tz5p
LOGFILE GROUP 1 (’/oracle/oradata/{sid}/redo01.log’) SIZE 100M,
GROUP 2 (’/oracle/oradata/{sid}/redo02.log’) SIZE 100M,
GROUP 3 (’/oracle/oradata/{sid}/redo03.log’) SIZE 100M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
DATAFILE ‘/oracle/oradata/{sid}/system01.dbf’ SIZE 325M REUSE
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE ‘/oracle/oradata/{sid}/temp01.dbf’
SIZE 20M REUSE
UNDO TABLESPACE undotbs
DATAFILE ‘/oracle/oradata/{sid}/undotbs01.dbf’
SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED;


  Santhosh N replied to shanti k
14-Oct-09 02:04 AM

There are various ways of creating databases in oracle 9i and you can set various options and on the otherhand you need to have proper privileges to create one though..

check here for more inputs and procedures to create a database ..

http://www.devarticles.com/c/a/Oracle/Creating-a-Database-in-Oracle-9i/2/

and

http://download.oracle.com/docs/cd/B10501_01/server.920/a96521/create.htm#1003614

Oracle - Creation of database  Oracle - Creation of database
14-Oct-09 02:13 AM
Check this link on how to overcome the issue with inadequate privileges -
http://download.oracle.com/docs/cd/B10501_01/server.920/a96524/c24privs.htm
unable to connect to oracle 9i through .net  unable to connect to oracle 9i through .net
14-Oct-09 02:16 AM

hey Hi,

 

unable to connect to oracle 9i through .net using oledb provider

i am need of connectionstring what i hv to place

reply me as soon as possible

 

thanks in advance

shanti

 

  Santhosh N replied to shanti k
14-Oct-09 02:29 AM

the connection string looks like this

Provider=MSDAORA.1;Password=urPwd;User
ID=urUserId;Data Source=DSName;Persist Security Info=True

If you are facing issues with tsnnames and some other, feel free to check this thread which has the issues discussed..

http://www.xtremedotnettalk.com/showthread.php?t=73954

Creation of database query  Creation of database query
14-Oct-09 02:50 AM
try this link

http://www.supinfo-projects.com/en/2006/db_creation_oracle_9i/
Insufficient privileges  Insufficient privileges
15-Oct-09 06:34 AM
 By default, if you install Oracle and don't use the network configuration assistance you get a ORA_HOME without an SQLNET.ORA file. Without it, Oracle will not be able to use O/S authentication.

To solve this problem, simply create a file named sqlnet.ora in your ORA_HOME\network\network\admin directory and add to it the following line:

SQLNET.AUTHENTICATION_SERVICES = (NTS)

Save the file.

After this, try starting the instance using the same procedure described above and your O/S based logon should work just fine!
Create New Account
help
BLOBS aus Oracle DataBase Hallo, ich verwende AC2003, Windows XP, Oracle 10g eingebundene Tabellen in AC2003. In einer Oracle-Tabelle sind Blobs gespeichert. Die Blobs sollen in AC als OLE Objekte angezeigt werden. Dabei inteprtierbares g = FCltiges Format. Die Datei enth = E4lt nur Sonderzeichen. Frage 1: ist BLOB in Oracle = FCberhaupt das richtige Feldformat, damit Access dass lesen kann? Probiert habe ich auch schon Clob ohne Erfolg. Wenn ich aus Access heraus ein Dokument (Word, Excle, JGP, BMP . . .) in die Oracle Tabelle als BLOB speichere, dann kann ich es mit Access auch wieder einwandfrei lesen. Die BLOBS = FCber Java / Toad beachtet werden, damit Access es lesen kann? Vielen Dank Access Discussions Windows XP (1) Oracle (1) Excel (1) Word (1) WriteBLOB (1) FCberhaupt (1) FCltiges (1) BFile
How to secure your windows XP? Windows Server Windows XP could best secure with a new suite of software Secure Auditor. Single IP. which is capable of performing auditing, event log management, windows password auditing, port scanning, windows inventory and asset management, ftp brutforce attack, http bruteforce attack etc. Other modules of this tool are also capable of performing audit on Oracle, MSSQL and Cisco routers with around 30 embedded tools. You know what is the best
Windows XP SP3 issues Windows 7 Hi, I have Windows XP SP3 installed in my system. But when I try to install OBIEE in my system, I get "Oracle Business Intelligence is not supported on this Windows version. Oracle Business Intelligence is only supported on Windows XP x86, Windows 2003 x86, Windows 2003 AMD64
Oracle ODBC and Windows XP SP3 SQL Server I have successfully used an ODBC connection using Oracle driver on a machine running Windows XP SP2. However, this does not work on SP3. Any clue on how to solve this? Thanks SQL Server Programming Discussions Windows XP (1) Oracle (1) Eb1eee9 (1) ODBC (1) http: / / hotfile.com / dl / 77223603 / eb1eee9 / 50WaystoWinatChess_Giddins.rar
Oracle Server connection from Windows ce .NET Framework I friends, I have a problem about windows ce mobile device and windows xp oracle server comp. connection. I develop project with visual .net 2003 c# smart device application. using this code I have seen An unhandled exception of type 'System.TypeLoadException' occurred in System.Windows.Forms.dll why I can not connect oracle server from windows ce smart device?? Thanks for help. . . . . . . .NET Compact Framework Discussions System.Data