Then set .bash_profile for oracle user .
Then keep init file[initPHNXTEST.ora] in location : /u02/app/oracle/product/11.2.0/db_1/dbs
And listener file[listener.ora/tnsnames.ora] in : /u02/app/oracle/product/11.2.0/db_1/network/admin
Then shoot the below commands
export ORACLE_SID=PHNXTEST
$ sqlplus 'sys as sysdba'
password - sysora11
SQL>create spfile from pfile='/u02/app/oracle/product/11.2.0/db_1/dbs/initPHNXTEST.ora';
then run dbcreate_phnxtest_7.18.sql
SQL>dbcreate_phnxtest_7.18.sql
then run
@$ORACLE_HOME/rdbms/admin/catalog.sql
@$ORACLE_HOME/rdbms/admin/catproc.sql
@$ORACLE_HOME/sqlplus/admin/pupbld.sql
$lsnrctl start
$sqlplus 'sys as sysdba' [ password sysora11]
SQL> startup
The above command will start the DB.
dbcreate_phnxtest_7.18.sql
==========================
CREATE DATABASE PHNXTEST
USER SYS IDENTIFIED BY sysora11
USER SYSTEM IDENTIFIED BY mgrora11
DATAFILE '/u02/oradata/ora11/phnxtest/SYSTEM01.DBF' SIZE 325M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
SYSAUX DATAFILE '/u02/oradata/ora11/phnxtest/SYSAUX01.DAT' SIZE 120M REUSE AUTOEXTEND ON NEXT 5M MAXSIZE 2048M
DEFAULT TABLESPACE USERS DATAFILE '/u02/oradata/ora11/phnxtest/USERS01.DBF' SIZE 50M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/u02/oradata/ora11/phnxtest/TEMP01.DBF' SIZE 40M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
UNDO TABLESPACE "UNDOTBS1" DATAFILE '/u02/oradata/ora11/phnxtest/UNDOTBS01.DBF'SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
CHARACTER SET AL32UTF8
LOGFILE '/u02/oradata/ora11/phnxtest/REDO01.LOG' SIZE 100M REUSE,
'/u02/oradata/ora11/phnxtest/REDO02.LOG' SIZE 100M REUSE,
'/u02/oradata/ora11/phnxtest/REDO03.LOG' SIZE 100M REUSE
EXTENT MANAGEMENT LOCAL
MAXLOGFILES 32
MAXLOGMEMBERS 4
MAXLOGHISTORY 100
MAXDATAFILES 254
MAXINSTANCES 1;
initPHNXTEST.ora
================
db_name='PHNXTEST'
memory_target=1G
processes = 150
audit_file_dest='/u02/app/oracle/admin/phnxtest/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/u02/app/oracle/flash_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='/u02/app/oracle/diagnostic_dest'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files = (/u02/oradata/ora11/phnxtest/CONTROL1.ora, /u02/oradata/ora11/phnxtest/CONTROL2.ora, /u02/oradata/ora11/phnxtest/CONTROL3.ora)
compatible ='11.2.0'
sessions=512
listener.ora
============
LISTENER=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc))))
SID_LIST_PHNXTEST=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=PHNXTEST)
(ORACLE_HOME=/u02/app/oracle/product/11.2.0/db_1)
(SID_NAME=PHNXTEST))
tnsnames.ora
============
#DEMO1 =
# (DESCRIPTION =
# (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.27.128)(PORT=1521))
# (CONNECT_DATA=(SERVICE_NAME=DEMO1)(SID=DEMO1)))
PHNXTEST =
(DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)(HOST=10.23.7.18)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=PHNXTEST)(SID=PHNXTEST)))
.bash_profile[Oracle user profile]
==================================
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
#PATH=$PATH:$HOME/bin
#export PATH
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=copfs-test-db; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=PHNXTEST; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
DISPLAY=localhost:0.0; export DISPLAY
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
export LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/db_1/lib32
N.B : The paths,Hostname/IP and the home,listener name will be changed as per your requirement.
No comments:
Post a Comment