//
you're reading...
Oracle Database Appliance

Oracle Database Appliance (X5-2) Study (Virtualized Platform deployment) section 4

**This article is only for the purpose of demonstrating of my study of the Oracle Database appliance, not for any other purposes.**

Oracle Database Appliance (X5-2) Deployment (Virtualized Platform) section 4

In Oracle Database Appliance, you can just create database by using the command oakcli create database, but Is there any other ways to create the database. After read the doc asm-acfs-migration-2379319.pdf, I think I can create the database manually in ODA. It might not be supported by Oracle, just try it in case.

Create database pfile

[oracle@testodbanode01  dbs]$ cd $ORACLE_HOME/dbs
[oracle@testodbanode01  dbs]$ vi inittestdb1.ora

Follow contents will add to the inittestdb1.ora

testdb1.__db_cache_size=3338665984
testdb2.__db_cache_size=3338665984
testdb1.__java_pool_size=16777216
testdb2.__java_pool_size=16777216
testdb1.__large_pool_size=33554432
testdb2.__large_pool_size=33554432
testdb1.__pga_aggregate_target=2147483648
testdb2.__pga_aggregate_target=2147483648
testdb1.__sga_target=4294967296
testdb2.__sga_target=4294967296
testdb1.__shared_io_pool_size=0
testdb2.__shared_io_pool_size=0
testdb1.__shared_pool_size=855638016
testdb2.__shared_pool_size=855638016
testdb1.__streams_pool_size=0
testdb2.__streams_pool_size=0
*._datafile_write_errors_crash_instance=false
*._db_writer_coalesce_area_size=16777216
*._disable_interface_checking=TRUE
*._ENABLE_NUMA_SUPPORT=FALSE
*._FILE_SIZE_INCREASE_INCREMENT=2143289344
*._fix_control='18960760:on'
*._gc_policy_time=0
*._gc_undo_affinity=FALSE
*.audit_file_dest='/u01/app/oracle/admin/testdb/adump'
*.audit_sys_operations=TRUE
*.audit_trail='db'
#*.cluster_database=true
*.compatible='11.2.0.4.0'
*.control_files='/u01/app/oracle/oradata/datastore/testdb/TESTDB/controlfile/o1_mf_cjr8try2_.ctl'
*.cpu_count=2
*.cursor_sharing='EXACT'
*.db_block_checking='FULL'
*.db_block_checksum='FULL'
*.db_block_size=8192
*.db_create_file_dest='/u02/app/oracle/oradata/datastore/.ACFS/snaps/testdb'
*.db_create_online_log_dest_1='/u01/app/oracle/oradata/datastore/testdb'
*.db_domain=''
*.db_files=1024
pmstest1.db_flash_cache_file='/u02/app/oracle/oradata/flashdata/.ACFS/snaps/flashcache/testdb/flash1'
pmstest2.db_flash_cache_file='/u02/app/oracle/oradata/flashdata/.ACFS/snaps/flashcache/testdb/flash2'
*.db_flash_cache_size=12884901888
*.db_lost_write_protect='TYPICAL'
*.db_name='testdb'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area/datastore/testdb'
*.db_recovery_file_dest_size=499289948160
*.db_writer_processes=2
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=testdbXDB)'
*.fast_start_mttr_target=300
*.filesystemio_options='setall'
*.global_names=TRUE
testdb1.instance_number=1
testdb2.instance_number=2
*.log_archive_format='%t_%s_%r.dbf'
*.log_buffer=16000000
*.nls_language='ENGLISH'
*.nls_territory='NEW ZEALAND'
*.open_cursors=1000
*.os_authent_prefix=''
*.parallel_adaptive_multi_user=FALSE
*.parallel_execution_message_size=16384
*.parallel_threads_per_cpu=2
*.pga_aggregate_target=2147483648
*.processes=200
*.remote_listener='testdb-cluster-scan:1521'
*.remote_login_passwordfile='exclusive'
*.session_cached_cursors=100
*.sga_target=4294967296
*.sql92_security=TRUE
testdb2.thread=2
testdb1.thread=1
*.undo_retention=900
testdb1.undo_tablespace='UNDOTBS1'
testdb2.undo_tablespace='UNDOTBS2'
*.use_large_pages='ONLY'

Please note, the parameter *.cluster_database=true has been commented out just for now

Create the database directories in ACFS file system

This step is very important

ASM Disk Group ACFS File System Contents
+DATA /u02/app/oracle/oradata/datastore Data Files, Tempfiles
+RECO /u01/app/oracle/fast_recovery_area/datastore Archive logs, Backups
+REDO /u01/app/oracle/oradata/datastore Control Files, Online Redo Logs

Create an empty snapshot

/sbin/acfsutil snap create -w testdb /u02/app/oracle/oradata/datastore

Create the database

Login to the database, the database status have to be in nomount.

[oracle@testodanode01  dbhome_1]$ sid
ORACLE_SID=testdb1
[oracle@testodanode01  dbhome_1]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri May 20 11:10:59 2016

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL>

SQL>
CREATE DATABASE testdb
   USER SYS IDENTIFIED BY oracle123     
   USER SYSTEM IDENTIFIED BY oracle123
   EXTENT MANAGEMENT LOCAL
   CONTROLFILE REUSE
   LOGFILE
      GROUP 1 ('/u01/app/oracle/oradata/datastore/testdb/testdb/onlinelog/onlinelog01.log') SIZE 500M,
      GROUP 2 ('/u01/app/oracle/oradata/datastore/testdb/testdb/onlinelog/onlinelog02.log') SIZE 500M,
      GROUP 3 ('/u01/app/oracle/oradata/datastore/testdb/testdb/onlinelog/onlinelog03.log') SIZE 500M,
	  GROUP 4 ('/u01/app/oracle/oradata/datastore/testdb/testdb/onlinelog/onlinelog04.log') SIZE 500M
   MAXLOGFILES 20
   MAXLOGHISTORY 100
   MAXDATAFILES 10
   MAXINSTANCES 10
   ARCHIVELOG
   CHARACTER SET US7ASCII 
   NATIONAL CHARACTER SET UTF8 
   DATAFILE '/u02/app/oracle/oradata/datastore/.ACFS/snaps/testdb/testdb/datafile/system01.dbf' SIZE 1G AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED
   SYSAUX DATAFILE '/u02/app/oracle/oradata/datastore/.ACFS/snaps/testdb/testdb/datafile/sysaux01.dbf' SIZE 1G AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED
   DEFAULT TABLESPACE USERS DATAFILE '/u02/app/oracle/oradata/datastore/.ACFS/snaps/testdb/testdb/datafile/user01.dbf' SIZE 50M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED
   DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/u02/app/oracle/oradata/datastore/.ACFS/snaps/testdb/testdb/datafile/temp01.dbf' SIZE 2G AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED
   UNDO TABLESPACE UNDOTBS1 DATAFILE '/u02/app/oracle/oradata/datastore/.ACFS/snaps/testdb/testdb/datafile/UNDOTBS101.dbf' SIZE 2G AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED
   SET TIME_ZONE = '+08:00';

Create Undo tablespace2

SQL> CREATE UNDO TABLESPACE UNDOTBS2 DATAFILE '/u02/app/oracle/oradata/datastore/.ACFS/snaps/testdb/testdb/datafile/UNDOTBS201.dbf' SIZE 4G AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED;

Run following scripts as SYS user


SQL> CONNECT / AS SYSDBA
Connected.
SQL> @$ORACLE_HOME/rdbms/admin/catalog.sql
SQL> @$ORACLE_HOME/rdbms/admin/catblock.sql
SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql
SQL> SHOW PARAMETER CASE

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
sec_case_sensitive_logon             boolean     TRUE

SQL> ALTER SYSTEM SET sec_case_sensitive_logon=FALSE;

System altered.

Run following scripts 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

Adding redo log file for remaining nodes and run catclust.sql script as SYS.

SQL> CONNECT / AS SYSDBA    
Connected.
SQL> ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 5 ('/u01/app/oracle/oradata/datastore/testdb/testdb/onlinelog/onlinelog05.log') SIZE 500M;
SQL> ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 6 ('/u01/app/oracle/oradata/datastore/testdb/testdb/onlinelog/onlinelog06.log') SIZE 500M;

Database altered.

SQL> ALTER DATABASE ENABLE PUBLIC THREAD 2;

Database altered.

SQL> @$ORACLE_HOME/rdbms/admin/catclust.sql

Create spfile for the database

Modify the pfile ready for RAC database instance

[oracle@testodanode01 ~]$ cd $ORACLE_HOME/dbs
[oracle@testodanode01 ~]$ vi inittestdb1.ora

Uncomment the *.cluster_database=true, save the inittestdb1.ora and exit.

.................
*.audit_file_dest='/u01/app/oracle/admin/testdb/adump'
*.audit_sys_operations=TRUE
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.4.0'
.................
[oracle@testodanode01  dbhome_1]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri May 20 11:10:59 2016

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> create spfile='/u02/app/oracle/oradata/datastore/.ACFS/snaps/testdb/testdb/spfilepmstest.ora' from pfile;

Once the spfile created, shutdown the database.

[oracle@testodanode01  dbhome_1]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri May 20 11:10:59 2016

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> shutdown immediate

Add spfile parameter to pfile inittestdb1.ora

[oracle@testodanode01  dbhome_1]$ cd $ORACLE_HOME/dbs
[oracle@testodanode01  dbs]$ vi inittestdb1.ora 
................
*.sql92_security=TRUE
testdb2.thread=2
testdb1.thread=1
*.undo_retention=900
testdb1.undo_tablespace='UNDOTBS1'
testdb2.undo_tablespace='UNDOTBS2'
*.use_large_pages='ONLY
spfile='/u02/app/oracle/oradata/datastore/.ACFS/snaps/testdb/testdb/spfilepmstest.ora'

Save and Exit, copy the inittestdb1.ora to node2 testodanode02 as name inittestdb2.ora

[oracle@testodanode01  dbs]$ scp inittestdb1.ora oracle@testodbanode02:$ORACLE_HOME/dbs/inittestdb2.ora

Register the database instance to cluster, making sure that all instances are down before continue below steps.

[oracle@testodbanode01 ~]$ srvctl add database -d testdb -o $ORACLE_HOME -m newzonetech.com -c RAC
[oracle@testodbanode01 ~]$ srvctl add instance -d testdb -i testdb1 -n testodbanode01
[oracle@testodbanode01 ~]$ srvctl add instance -d testdb -i testdb2 -n testodbanode02
[oracle@testodbanode01 ~]$ srvctl start database -d testdb
[oracle@testodbanode01 ~]$ srvctl status database -d testdb
Instance testdb1 is running on node testodbanode01
Instance testdb2 is running on node testodbanode02

Create database service for the new database

[oracle@testodanode01 bin]$ srvctl add service -d testdb -s testdboltp.newzonetech.com -r testdb1,testdb2 -m BASIC -q TRUE -e SELECT -z 180 -w 5 -j LONG
Advertisements

About daviewning

I am an Oracle DBA

Discussion

No comments yet.

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: