//
you're reading...
Database, Oracle Installation & Configuration

Install Oracle Database 11g R2 on Linux RHEL/CentOS 6.5 – Section 6

Create Oracle Database Manually without using DBCA

Before start create the database I need to change the ‘oracle‘ bin permission for oracle software.

[root@newzonetechdb02 bin]# cd /ora01/app/oracle/product/11.2.0.4/dbhome_1/bin/
[root@newzonetechdb02 bin]# ll -ls oracle 
234248 -rwsr-s--x. 1 oracle oinstall 239626683 Oct 17 00:03 oracle
[root@newzonetechdb02 bin]# chown oracle:asmadmin oracle
[root@newzonetechdb02 bin]# chmod 6555 oracle
[root@newzonetechdb02 bin]# ll -ls oracle
234248 -r-sr-sr-x. 1 oracle asmadmin 239626683 Oct 17 00:03 oracle

Create the init parameter file for oracle database

[oracle@newzonetechdb02]$ cd $ORACLE_HOME/dbs
[oracle@newzonetechdb02]$ vi initTESTDB.ora

Insert the following contents

db_name='TESTDB'
processes = 150
audit_file_dest='/ora01/app/oracle/admin/TESTDB/adump'
audit_trail ='db'
db_block_size=4096
db_domain=''
db_recovery_file_dest='+TESTDBFRA'
db_recovery_file_dest_size=4G
diagnostic_dest='/ora01/app/oracle'
dispatchers='(PROTOCOL=TCP) (SERVICE=TESTDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
control_files = ('+TESTDBDATA','+TESTDBFRA')
compatible ='11.2.0'
os_authent_prefix=''
#remote_os_authent=TRUE
NLS_DATE_FORMAT='DD-MON-RR HH24:MI'
utl_file_dir='/tmp'
SGA_TARGET=800M
shared_servers=5
max_shared_servers=50
dispatchers='(PRO=TCP)(DIS=5)'
max_dispatchers=15
[oracle@newzonetechdb02] mkdir -p /ora01/app/oracle/admin/TESTDB/adump

Login to an idle instance as sysdba

[oracle@newzonetechdb02 dbs]$ sid
ORACLE_SID=TESTDB
[oracle@newzonetechdb02 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Oct 17 23:09:57 2014

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

Connected to an idle instance.

SQL>

Start the database at nomount status

SQL> startup nomount
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size                  2257840 bytes
Variable Size             281021520 bytes
Database Buffers          549453824 bytes
Redo Buffers                2371584 bytes

Run the create database statement

CREATE DATABASE TESTDB
   USER SYS IDENTIFIED BY oracle123		
   USER SYSTEM IDENTIFIED BY oracle123
   EXTENT MANAGEMENT LOCAL
   CONTROLFILE REUSE
   LOGFILE
      GROUP 1 ('+TESTDBDATA', '+TESTDBFRA') SIZE 200M,
      GROUP 2 ('+TESTDBDATA', '+TESTDBFRA') SIZE 200M,
      GROUP 3 ('+TESTDBDATA', '+TESTDBFRA') SIZE 200M
   MAXLOGFILES 20
   MAXLOGHISTORY 100
   MAXDATAFILES 10
   MAXINSTANCES 10
   ARCHIVELOG
   CHARACTER SET WE8MSWIN1252
   NATIONAL CHARACTER SET AL16UTF16
   DATAFILE '+TESTDBDATA' SIZE 1G AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED
   SYSAUX DATAFILE '+TESTDBDATA' SIZE 2G AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED
   DEFAULT TABLESPACE USERS DATAFILE '+TESTDBDATA' SIZE 50M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED
   DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '+TESTDBDATA' SIZE 2G AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED
   UNDO TABLESPACE UNDOTBS1 DATAFILE '+TESTDBDATA' SIZE 4G AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED
   SET TIME_ZONE = '+08:00';

Database created.

SQL>
SQL> @$ORACLE_HOME/rdbms/admin/catalog.sql
SQL> @$ORACLE_HOME/rdbms/admin/catblock.sql
SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql
SQL> ALTER SYSTEM SET sec_case_sensitive_logon=FALSE;

System altered.

Run following script as SYSTEM user.

SQL> connect system/oracle123
Connected.
SQL> @$ORACLE_HOME/sqlplus/admin/pupbld.sql
SQL> @$ORACLE_HOME/sqlplus/admin/help/hlpbld.sql helpus.sql

Create password file

[root@newzonetechdb02 ~]# orapwd file=$ORACLE_HOME/dbs/orapwTESTDB password=oracle123 entries=5[/sourcecode]
List the Database Control File in the ASM Disks

[grid@newzonetechdb02 ~]$ asmcmd ls +TESTDBDATA/TESTDB/CONTROLFILE
Current.256.861232543
[grid@newzonetechdb02 ~]$ asmcmd ls +TESTDBFRA/TESTDB/CONTROLFILE
Current.256.861232543

Modify the pfile for the control file location

db_name='TESTDB'
processes = 150
audit_file_dest='/ora01/app/oracle/admin/TESTDB/adump'
audit_trail ='db'
db_block_size=4096
db_domain=''
db_recovery_file_dest='+TESTDBFRA'
db_recovery_file_dest_size=4G
diagnostic_dest='/ora01/app/oracle'
dispatchers='(PROTOCOL=TCP) (SERVICE=TESTDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
control_files = ('+TESTDBDATA/TESTDB/CONTROLFILE/Current.256.861232543','+TESTDBFRA/TESTDB/CONTROLFILE/Current.256.861232543')
compatible ='11.2.0'
os_authent_prefix=''
#remote_os_authent=TRUE
NLS_DATE_FORMAT='DD-MON-RR HH24:MI'
utl_file_dir='/tmp'
SGA_TARGET=800M
shared_servers=5
max_shared_servers=50
dispatchers='(PRO=TCP)(DIS=5)'
max_dispatchers=15

Create the spfile for the database

 
SQL> startup nomount
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size                  2257840 bytes
Variable Size             281021520 bytes
Database Buffers          549453824 bytes
Redo Buffers                2371584 bytes
SQL> create spfile from pfile;

File created.

SQL> shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size                  2257840 bytes
Variable Size             281021520 bytes
Database Buffers          549453824 bytes
Redo Buffers                2371584 bytes
Database mounted.
Database opened.
SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /ora01/app/oracle/product/11.2
                                                 .0.4/dbhome_1/dbs/spfileTESTDB
                                                 .ora
SQL>

Create database listener

[oracle@newzonetechdb02 dbs]$ vi $ORACLE_HOME/network/admin/listener.ora

LISTENERTESTDB =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.101)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

Start the database listener

[oracle@newzonetechdb02 dbs]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-OCT-2014 22:12:39

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
[oracle@newzonetechdb02 dbs]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-OCT-2014 22:13:46

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Starting /ora01/app/oracle/product/11.2.0.4/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /ora01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/listener.ora
Log messages written to /ora01/app/oracle/diag/tnslsnr/newzonetechdb02/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=newzonetechdb02)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                21-OCT-2014 22:13:46
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /ora01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/listener.ora
Listener Log File         /ora01/app/oracle/diag/tnslsnr/newzonetechdb02/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=newzonetechdb02)(PORT=1521)))
The listener supports no services
The command completed successfully

Check the database listener status

[oracle@newzonetechdb02 dbs]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-OCT-2014 22:14:36

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                21-OCT-2014 22:13:46
Uptime                    0 days 0 hr. 0 min. 50 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /ora01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/listener.ora
Listener Log File         /ora01/app/oracle/diag/tnslsnr/newzonetechdb02/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=newzonetechdb02)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "TESTDB" has 1 instance(s).
  Instance "TESTDB", status READY, has 6 handler(s) for this service...
The command completed successfully

References
Oracle® Database Installation Guide 11g Release 2 (11.2) for Linux http://docs.oracle.com, Retrieved on 2014-10-20

Advertisements

About daviewning

I am an Oracle DBA

Discussion

Trackbacks/Pingbacks

  1. Pingback: Install Oracle Database 11g R2 on Linux CentOS 6.5 – Before Start | DBTechZone - February 13, 2016

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: