Rac database creation
export ORACLE_HOME=/u02/app/oracle/product/12.1.0.2/dbhome_1
export PATH=/u02/app/oracle/product/12.1.0.2/dbhome_1/bin
export ORACLE_SID=RCFDLP
Step1 : Create init file for new database
*.compatible='11.2.0.3.0'
*.CONTROL_FILES='+DATA_RCDB','+RECO_RCDB'
*.db_block_size=8192
*.db_domain=''
*.db_name='RCFDLP'
*.DB_UNIQUE_NAME='RCFDLP'
*.diagnostic_dest='/u02/app/oracle/'
*.audit_file_dest='/u02/app/oracle/admin/RCFDLP/adump'
*.db_recovery_file_dest='+RECO_RCDB'
*.db_recovery_file_dest_size=2G
*.db_create_file_dest='+DATA_RCDB'
*.sga_max_size= 2G
*.sga_target=1500M
*.open_cursors=300
*.pga_aggregate_target=100M
*.processes=300
*.REMOTE_LOGIN_PASSWORDFILE='EXCLUSIVE'
Step 2: Create pwd file for new database
orapwd file=$ORACLE_HOME/dbs/orapwRCFDLP password=sys123
---orapwd file=orapwRCFDLP2 password=sys123 entries=10
---orapwd file=orapwRCFDLP1 password=sys123 entries=10
Step 3 : Create database using belwo syntax
create database RCFDLP
maxdatafiles 2000
maxinstances 10
maxlogfiles 20
logfile group 1 ('+RECO_RCDB/RCFDLP/logfiles/redolog1.log') size 50M,
group 2 ('+RECO_RCDB/RCFDLP/logfiles/redolog2.log') size 50M
character set AL32UTF8
national character set utf8
datafile '+DATA_RCDB/RCFDLP/data/system01.dbf' size 5G
sysaux datafile '+DATA_RCDB/RCFDLP/data/syaux01.dbf' size 5G
undo tablespace undo1 datafile '+DATA_RCDB/RCFDLP/data/undo01.dbf' size 1G
default temporary tablespace temp1 tempfile '+DATA_RCDB/RCFDLP/data/temp01.dbf' size 1G
;
======================================================================
Step 3 : Create database using belwo syntax
create database RCFDLP
maxdatafiles 2000
maxinstances 10
maxlogfiles 20
logfile group 1 size 500M,
group 2 size 500M
character set AL32UTF8
national character set utf8
datafile size 3G
sysaux datafile size 3G
undo tablespace undo1 datafile size 1G
default temporary tablespace temp1 tempfile size 1G
DEFAULT TABLESPACE USERS DATAFILE SIZE 100M
;
===================================================================
Step 4: Once DB created then run below sql to create database dictionary view
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
O/P
ALTER SYSTEM SET db_securefile='PERMITTED' SCOPE=MEMORY;
Sat Mar 18 10:52:32 2017
Successfully created internal service SYS$BACKGROUND at open
Successfully created internal service SYS$USERS at open
XDB installed
AS a system user run the below :
select NAME,PASSWORD from user$ where NAME='SYSTEM';
test1> @$ORACLE_HOME/sqlplus/admin/pupbld.sql
ALTER SYSTEM SET sec_case_sensitive_logon=FALSE;
NAME PASSWORD
------------------------------ ------------------------------------------------------------
SYSTEM D4DF7931AB130E37
16:19:52 SQL> alter user SYSTEM identified by system;
User altered.
Elapsed: 00:00:00.08
16:20:07 SQL>
16:20:08 SQL>
16:20:08 SQL> select NAME,PASSWORD from user$ where NAME='SYSTEM';
NAME PASSWORD
------------------------------ ------------------------------------------------------------
SYSTEM 970BAA5B81930A40
alter user system identified by values 'D4DF7931AB130E37';
******Adding redo log file for remaining nodes and run catclust.sql script as SYS *************
create undo tablespace UNDO2 datafile '+DATA_RCDB' size 1G;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 3 ('+RECO_RCDB') SIZE 50M,GROUP 4 ('+RECO_RCDB') SIZE 50M;
ALTER DATABASE ENABLE PUBLIC THREAD 2;
@?/rdbms/admin/catclust.sql
---------------------RAC PARAMETER DOES NOT CONTAIN *. FOLLOW BY--------------
cluster_database=TRUE
cluster_database_instances=2
RCFDLP1.instance_number=1
RCFDLP2.instance_number=2
RCFDLP2.thread=2
RCFDLP1.thread=1
RCFDLP1.undo_tablespace=UNDO1
RCFDLP2.undo_tablespace=UNDO2
undo_management='AUTO'
--------------ORA-00205: error in identifying control file, check alert log for more info----------
*.CONTROL_FILES='+DATA_RCDB/RCFDLP/CONTROLFILE/Current.926.935855907','+RECO_RCDB/RCFDLP/CONTROLFILE/Current.31590.935855907'
Once we make above changes in pfile , while starting database export ORACLE_SID=SID1
create spfile='+DATA_RCDB/RCFDLP/spfile/spfileRCFDLP.ora' from pfile='/u02/app/oracle/product/12.1.0.2/dbhome_1/dbs/initRCFDLP1.ora';
https://rakadba1.appspot.com/dnccfg.blogspot.com/2012/10/creating-rac-database-manually-without.html
Use below command to add database in cluster --
srvctl add database -d RCFDLP -o /u02/app/oracle/product/12.1.0.2/dbhome_1
srvctl add instance -d RCFDLP -i RCFDLP1 -n rcdbdbadm01
srvctl add instance -d RCFDLP -i RCFDLP2 -n rcdbdbadm02
-d - unique db name -i = instance name -o = oracle home -n = node/hostname
SPFILE='+DATA_RCDB/RCFDLP/PARAMETERFILE/spfile.862.923593745'
srvctl enable database -d RCFDLP
srvctl enable instance -d RCFDLP -i RCFDLP1
srvctl enable instance -d RCFDLP -i RCFDLP2
-------------------------------------------------------
processing ?/rdbms/admin/dcore.bsq
create tablespace SYSTEM datafile size 3G
default storage (initial 10K next 10K) EXTENT MANAGEMENT DICTIONARY online
Completed: create tablespace SYSTEM datafile size 3G
default storage (initial 10K next 10K) EXTENT MANAGEMENT DICTIONARY online
create rollback segment SYSTEM tablespace SYSTEM
storage (initial 50K next 50K)
UNDO_SEG_CRT: Could not find usn tail
Completed: create rollback segment SYSTEM tablespace SYSTEM
storage (initial 50K next 50K)
Caching undo dictionary info: used hint for object index=0
Caching undo dictionary info: used hint for object index=1
Caching undo dictionary info: used hint for object index=2
Caching undo dictionary info: used hint for object index=3
Caching undo dictionary info: used hint for object index=4
Undo initialization finished serial:0 start:2034737834 end:2034737834 diff:0 ms (0.0 seconds)
alter tablespace system force logging
Completed: alter tablespace system force logging
processing ?/rdbms/admin/dsqlddl.bsq
processing ?/rdbms/admin/dmanage.bsq
CREATE TABLESPACE sysaux DATAFILE size 3G
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ONLINE FORCE LOGGING
Sat Mar 18 10:19:57 2017
Buffer Cache Full DB Caching mode changing from FULL CACHING ENABLED to FULL CACHING DISABLED
Full DB Caching disabled: DEFAULT_CACHE_SIZE should be at least 2103 MBs bigger than current size.
Completed: CREATE TABLESPACE sysaux DATAFILE size 3G
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ONLINE FORCE LOGGING
alter tablespace system default compress for all operations
Completed: alter tablespace system default compress for all operations
alter tablespace sysaux default compress for all operations
Completed: alter tablespace sysaux default compress for all operations
Sat Mar 18 10:19:58 2017
processing ?/rdbms/admin/dplsql.bsq
processing ?/rdbms/admin/dtxnspc.bsq
CREATE UNDO TABLESPACE UNDO1 DATAFILE size 2G
[204881] Successfully onlined Undo Tablespace 2.
Completed: CREATE UNDO TABLESPACE UNDO1 DATAFILE size 2G
CREATE TEMPORARY TABLESPACE TEMP1 TEMPFILE size 2G
Completed: CREATE TEMPORARY TABLESPACE TEMP1 TEMPFILE size 2G
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP1
Completed: ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP1
ALTER DATABASE DEFAULT TABLESPACE SYSTEM
Completed: ALTER DATABASE DEFAULT TABLESPACE SYSTEM
processing ?/rdbms/admin/dfmap.bsq
processing ?/rdbms/admin/denv.bsq
processing ?/rdbms/admin/drac.bsq
processing ?/rdbms/admin/dsec.bsq
processing ?/rdbms/admin/doptim.bsq
processing ?/rdbms/admin/dobj.bsq
processing ?/rdbms/admin/djava.bsq
processing ?/rdbms/admin/dpart.bsq
processing ?/rdbms/admin/drep.bsq
processing ?/rdbms/admin/daw.bsq
processing ?/rdbms/admin/dsummgt.bsq
processing ?/rdbms/admin/dtools.bsq
processing ?/rdbms/admin/dexttab.bsq
processing ?/rdbms/admin/ddm.bsq
processing ?/rdbms/admin/dlmnr.bsq
processing ?/rdbms/admin/ddst.bsq
processing ?/rdbms/admin/dfba.bsq
processing ?/rdbms/admin/dpstdy.bsq
processing ?/rdbms/admin/drupg.bsq
processing ?/rdbms/admin/dtlog.bsq
Sat Mar 18 10:20:05 2017
SMON: enabling tx recovery
Starting background process SMCO
Sat Mar 18 10:20:05 2017
SMCO started with pid=42, OS id=257874
Sat Mar 18 10:20:05 2017
Successfully created internal service SYS$BACKGROUND at open
Successfully created internal service SYS$USERS at open
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process AQPC
Sat Mar 18 10:20:05 2017
AQPC started with pid=45, OS id=258232
Completed: create database RHFMYWLD
maxdatafiles 2000
maxinstances 10
maxlogfiles 20
logfile group 1 size 500M,
group 2 size 500M
character set AL32UTF8
national character set utf8
datafile size 3G
sysaux datafile size 3G
undo tablespace undo1 datafile size 2G
default temporary tablespace temp1 tempfile size 2G
Sat Mar 18 10:20:06 2017
db_recovery_file_dest_size of 2048 MB is 50.10% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
export PATH=/u02/app/oracle/product/12.1.0.2/dbhome_1/bin
export ORACLE_SID=RCFDLP
Step1 : Create init file for new database
*.compatible='11.2.0.3.0'
*.CONTROL_FILES='+DATA_RCDB','+RECO_RCDB'
*.db_block_size=8192
*.db_domain=''
*.db_name='RCFDLP'
*.DB_UNIQUE_NAME='RCFDLP'
*.diagnostic_dest='/u02/app/oracle/'
*.audit_file_dest='/u02/app/oracle/admin/RCFDLP/adump'
*.db_recovery_file_dest='+RECO_RCDB'
*.db_recovery_file_dest_size=2G
*.db_create_file_dest='+DATA_RCDB'
*.sga_max_size= 2G
*.sga_target=1500M
*.open_cursors=300
*.pga_aggregate_target=100M
*.processes=300
*.REMOTE_LOGIN_PASSWORDFILE='EXCLUSIVE'
Step 2: Create pwd file for new database
orapwd file=$ORACLE_HOME/dbs/orapwRCFDLP password=sys123
---orapwd file=orapwRCFDLP2 password=sys123 entries=10
---orapwd file=orapwRCFDLP1 password=sys123 entries=10
Step 3 : Create database using belwo syntax
create database RCFDLP
maxdatafiles 2000
maxinstances 10
maxlogfiles 20
logfile group 1 ('+RECO_RCDB/RCFDLP/logfiles/redolog1.log') size 50M,
group 2 ('+RECO_RCDB/RCFDLP/logfiles/redolog2.log') size 50M
character set AL32UTF8
national character set utf8
datafile '+DATA_RCDB/RCFDLP/data/system01.dbf' size 5G
sysaux datafile '+DATA_RCDB/RCFDLP/data/syaux01.dbf' size 5G
undo tablespace undo1 datafile '+DATA_RCDB/RCFDLP/data/undo01.dbf' size 1G
default temporary tablespace temp1 tempfile '+DATA_RCDB/RCFDLP/data/temp01.dbf' size 1G
;
======================================================================
Step 3 : Create database using belwo syntax
create database RCFDLP
maxdatafiles 2000
maxinstances 10
maxlogfiles 20
logfile group 1 size 500M,
group 2 size 500M
character set AL32UTF8
national character set utf8
datafile size 3G
sysaux datafile size 3G
undo tablespace undo1 datafile size 1G
default temporary tablespace temp1 tempfile size 1G
DEFAULT TABLESPACE USERS DATAFILE SIZE 100M
;
===================================================================
Step 4: Once DB created then run below sql to create database dictionary view
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
O/P
ALTER SYSTEM SET db_securefile='PERMITTED' SCOPE=MEMORY;
Sat Mar 18 10:52:32 2017
Successfully created internal service SYS$BACKGROUND at open
Successfully created internal service SYS$USERS at open
XDB installed
AS a system user run the below :
select NAME,PASSWORD from user$ where NAME='SYSTEM';
test1> @$ORACLE_HOME/sqlplus/admin/pupbld.sql
ALTER SYSTEM SET sec_case_sensitive_logon=FALSE;
NAME PASSWORD
------------------------------ ------------------------------------------------------------
SYSTEM D4DF7931AB130E37
16:19:52 SQL> alter user SYSTEM identified by system;
User altered.
Elapsed: 00:00:00.08
16:20:07 SQL>
16:20:08 SQL>
16:20:08 SQL> select NAME,PASSWORD from user$ where NAME='SYSTEM';
NAME PASSWORD
------------------------------ ------------------------------------------------------------
SYSTEM 970BAA5B81930A40
alter user system identified by values 'D4DF7931AB130E37';
******Adding redo log file for remaining nodes and run catclust.sql script as SYS *************
create undo tablespace UNDO2 datafile '+DATA_RCDB' size 1G;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 3 ('+RECO_RCDB') SIZE 50M,GROUP 4 ('+RECO_RCDB') SIZE 50M;
ALTER DATABASE ENABLE PUBLIC THREAD 2;
@?/rdbms/admin/catclust.sql
---------------------RAC PARAMETER DOES NOT CONTAIN *. FOLLOW BY--------------
cluster_database=TRUE
cluster_database_instances=2
RCFDLP1.instance_number=1
RCFDLP2.instance_number=2
RCFDLP2.thread=2
RCFDLP1.thread=1
RCFDLP1.undo_tablespace=UNDO1
RCFDLP2.undo_tablespace=UNDO2
undo_management='AUTO'
--------------ORA-00205: error in identifying control file, check alert log for more info----------
*.CONTROL_FILES='+DATA_RCDB/RCFDLP/CONTROLFILE/Current.926.935855907','+RECO_RCDB/RCFDLP/CONTROLFILE/Current.31590.935855907'
Once we make above changes in pfile , while starting database export ORACLE_SID=SID1
create spfile='+DATA_RCDB/RCFDLP/spfile/spfileRCFDLP.ora' from pfile='/u02/app/oracle/product/12.1.0.2/dbhome_1/dbs/initRCFDLP1.ora';
https://rakadba1.appspot.com/dnccfg.blogspot.com/2012/10/creating-rac-database-manually-without.html
Use below command to add database in cluster --
srvctl add database -d RCFDLP -o /u02/app/oracle/product/12.1.0.2/dbhome_1
srvctl add instance -d RCFDLP -i RCFDLP1 -n rcdbdbadm01
srvctl add instance -d RCFDLP -i RCFDLP2 -n rcdbdbadm02
-d - unique db name -i = instance name -o = oracle home -n = node/hostname
SPFILE='+DATA_RCDB/RCFDLP/PARAMETERFILE/spfile.862.923593745'
srvctl enable database -d RCFDLP
srvctl enable instance -d RCFDLP -i RCFDLP1
srvctl enable instance -d RCFDLP -i RCFDLP2
-------------------------------------------------------
processing ?/rdbms/admin/dcore.bsq
create tablespace SYSTEM datafile size 3G
default storage (initial 10K next 10K) EXTENT MANAGEMENT DICTIONARY online
Completed: create tablespace SYSTEM datafile size 3G
default storage (initial 10K next 10K) EXTENT MANAGEMENT DICTIONARY online
create rollback segment SYSTEM tablespace SYSTEM
storage (initial 50K next 50K)
UNDO_SEG_CRT: Could not find usn tail
Completed: create rollback segment SYSTEM tablespace SYSTEM
storage (initial 50K next 50K)
Caching undo dictionary info: used hint for object index=0
Caching undo dictionary info: used hint for object index=1
Caching undo dictionary info: used hint for object index=2
Caching undo dictionary info: used hint for object index=3
Caching undo dictionary info: used hint for object index=4
Undo initialization finished serial:0 start:2034737834 end:2034737834 diff:0 ms (0.0 seconds)
alter tablespace system force logging
Completed: alter tablespace system force logging
processing ?/rdbms/admin/dsqlddl.bsq
processing ?/rdbms/admin/dmanage.bsq
CREATE TABLESPACE sysaux DATAFILE size 3G
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ONLINE FORCE LOGGING
Sat Mar 18 10:19:57 2017
Buffer Cache Full DB Caching mode changing from FULL CACHING ENABLED to FULL CACHING DISABLED
Full DB Caching disabled: DEFAULT_CACHE_SIZE should be at least 2103 MBs bigger than current size.
Completed: CREATE TABLESPACE sysaux DATAFILE size 3G
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ONLINE FORCE LOGGING
alter tablespace system default compress for all operations
Completed: alter tablespace system default compress for all operations
alter tablespace sysaux default compress for all operations
Completed: alter tablespace sysaux default compress for all operations
Sat Mar 18 10:19:58 2017
processing ?/rdbms/admin/dplsql.bsq
processing ?/rdbms/admin/dtxnspc.bsq
CREATE UNDO TABLESPACE UNDO1 DATAFILE size 2G
[204881] Successfully onlined Undo Tablespace 2.
Completed: CREATE UNDO TABLESPACE UNDO1 DATAFILE size 2G
CREATE TEMPORARY TABLESPACE TEMP1 TEMPFILE size 2G
Completed: CREATE TEMPORARY TABLESPACE TEMP1 TEMPFILE size 2G
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP1
Completed: ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP1
ALTER DATABASE DEFAULT TABLESPACE SYSTEM
Completed: ALTER DATABASE DEFAULT TABLESPACE SYSTEM
processing ?/rdbms/admin/dfmap.bsq
processing ?/rdbms/admin/denv.bsq
processing ?/rdbms/admin/drac.bsq
processing ?/rdbms/admin/dsec.bsq
processing ?/rdbms/admin/doptim.bsq
processing ?/rdbms/admin/dobj.bsq
processing ?/rdbms/admin/djava.bsq
processing ?/rdbms/admin/dpart.bsq
processing ?/rdbms/admin/drep.bsq
processing ?/rdbms/admin/daw.bsq
processing ?/rdbms/admin/dsummgt.bsq
processing ?/rdbms/admin/dtools.bsq
processing ?/rdbms/admin/dexttab.bsq
processing ?/rdbms/admin/ddm.bsq
processing ?/rdbms/admin/dlmnr.bsq
processing ?/rdbms/admin/ddst.bsq
processing ?/rdbms/admin/dfba.bsq
processing ?/rdbms/admin/dpstdy.bsq
processing ?/rdbms/admin/drupg.bsq
processing ?/rdbms/admin/dtlog.bsq
Sat Mar 18 10:20:05 2017
SMON: enabling tx recovery
Starting background process SMCO
Sat Mar 18 10:20:05 2017
SMCO started with pid=42, OS id=257874
Sat Mar 18 10:20:05 2017
Successfully created internal service SYS$BACKGROUND at open
Successfully created internal service SYS$USERS at open
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process AQPC
Sat Mar 18 10:20:05 2017
AQPC started with pid=45, OS id=258232
Completed: create database RHFMYWLD
maxdatafiles 2000
maxinstances 10
maxlogfiles 20
logfile group 1 size 500M,
group 2 size 500M
character set AL32UTF8
national character set utf8
datafile size 3G
sysaux datafile size 3G
undo tablespace undo1 datafile size 2G
default temporary tablespace temp1 tempfile size 2G
Sat Mar 18 10:20:06 2017
db_recovery_file_dest_size of 2048 MB is 50.10% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Comments
Post a Comment