Professional Documents
Culture Documents
In this post, I will explain How I create a script for manual database creations and this can also
works for you. Below are the main steps:
In this post, I will use Unix as Operating system and Oracle 11g as database version for creating
database manually, using All these options I am going to make a single instance database.
Here, We are making a database by name "newdb". So, we have set ORACLE_SID as newdb.
4.Create Initialization Parameter File: Each time when database starts, it read
initialization parameter file for database parameter values. This file could be text file called as
pfile or binary file called as spfile. Here, We will start with creating pfile and will create database
with this file and later on. There are few mendatory parameters to start database which we will
provided in this file. Before making pfile make sure you have required directories like
/etc/oracle/admin/newdb/adump, /etc/oracle/fast_recovery_area/newdb and
/etc/oracle/oradata/newdb.
db_name='newdb'
memory_target=1G
processes = 150
audit_file_dest='/etc/oracle/admin/newdb/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/etc/oracle/fast_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='/etc/oracle'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
control_files = ('/etc/oracle/oradata/newdb/newdb_control1.ctl',
'/etc/oracle/oradata/newdb/newdb_control2.ctl')
compatible ='11.2.0'
DBA has to change this file values according to their requirements like db_name,
memory_target, audit_file_dest control_files location and compatible parameter etc. Make a new
pfile by name 'initnewdb.ora' at $ORACLE_HOME/dbs and copy all these values in this file.
6. Start the Instance: Now DBA has to start database instance in nomount mode.
Nomount mode is used for database creation or maintenance operations.
Database created.
When I execute this command I face below error and database creation was aborted.
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-01501: CREATE DATABASE failed
ORA-01519: error while processing file '?/rdbms/admin/dtxnspc.bsq' near line 5
ORA-00604: error occurred at recursive SQL level 1
ORA-30012: undo tablespace 'UNDOTBS1' does not exist or of wrong type
Process ID: 8309
Session ID: 1 Serial number: 5
This is because of undo tablespaces name is different in create database statement and
initnewdb.ora file. Make sure undo tablesapces name is same in parameter file and create
database command.
About script has created mandatory tablespaces for database creation, but to work on database
DBA has to make some additional tablespaces.
Tablespace created.
SQL> @?/rdbms/admin/catalog.sql
-------------------------------
-------------------------------
Grant succeeded.
PL/SQL procedure successfully completed.
SQL> @?/rdbms/admin/catproc.sql
-------------------------------
------------------------------
TIMESTAMP
------------------------------------------------------------------------------
--
COMP_TIMESTAMP CATALOG 2013-07-25 23:19:56
SQL> @?/sqlplus/admin/pupbld.sql
Here, Manually Created database is ready to use, I would suggest to Restart the database and
check alert log for any error messages and act accordingly. Once DBA has created Database Next
step is to configure Tnsnames.ora and Listener.ora for database connection. Please see Quick
Steps to Configure Tnsnames.ora and Listener.ora file.
If you want to use GUI base tool DBCA to create database then Please see