DB creation in 11.2.0.3 RAC

DB creation in11.2.0.3 :

1 . Set the environment variables

Export ORACLE_HOME=/local/oracle/product/rdbms/11g
Export ORACLE_BASE=/local/oracle/product
Export PATH=$ORACLE_HOME/bin:$PATH:.

2 . Set the display to open GUI session OR use XLAUNCH

3. Enable DBCA
4) select oracle real application cluster for RAC setup
5) select create database
6) Select for general purpose

7) type global database name (dbname) and select the nodes in which you are required to build the database.
8) Disable configureenterprice manager if not required.


9) insert default password for sys and system
10) Select the ASM required.
11) Disable flash recovery area and enable archive log if required.

12) Don’t enable sample schemas
13) Give the required value for memory size
14) Check file location variable and redo’s for verification
15) Enter finish to create a database
16) General summary—ok
17) DB creation under process
18) DB creation under progress
19) Final out put
20) check:

21)Put the entires in oratab.dat (under location /local/oracle/config)(not yet completed.)
22) Set all the values as below on both nodes:
alter system set background_dump_dest='/local/oracle/admin/diag/rdbms/nbobjp/nbobjp2/trace' scope=spfilesid='*' ;
alter system set user_dump_dest='/local/oracle/admin/diag/rdbms/nbobjp/nbobjp2/trace' scope=spfilesid='*' ;
alter system set diagnostic_dest='/local/oracle/admin' scope=both sid='*' ;
alter system set sec_case_sensitive_logon=false scope=both sid='*' ;
create or replace directory DATA_PUMP_DIR as ' /OLTPbackup/nbobjp/EXP’ ;
23) Create user nonpriv:
 Create user nonpriv identified by n0t0d0; grant connect,resource to nonpriv;
24) Tns entries should be add in both nodes.
cd/local/oracle/product/rdbms/11g/network/admin
nbobjp =
     (DESCRIPTION =
       (LOAD_BALANCE = yes)
       (FAILOVER = on)
       (ADDRESS = (PROTOCOL = TCP)(HOST = pm1dsolt05-vip.corp.nyx.com)(PORT = 1521))
       (ADDRESS = (PROTOCOL = TCP)(HOST = pm1dsolt06-vip.corp.nyx.com)(PORT = 1521))
       (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = nbobjp )
        (FAILOVER_MODE =
          (TYPE = SELECT)
          (METHOD = BASIC)
          (RETRIES = 180)
          (DELAY = 5)
        )
      )
  )

nbobjp1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = pm1dsolt05-vip.corp.nyx.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = nbobjp)
      (INSTANCE_NAME = nbobjp1)
    )
  )

nbobjp2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = pm1dsolt06-vip.corp.nyx.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = nbobjp)
      (INSTANCE_NAME = nbobjp2)
    )
  )
25. Enabling the archivelog:

alter system set log_archive_format='arch_nbobjp_%t_%s_%r.log' scope=spfilesid='*' ;

alter system set log_archive_dest_1='LOCATION=+NPRODO/nbobjp/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES)' scope=spfilesid='*' ;

alter system set cluster_database=false scope=spfilesid='*' ;

srvctl stop database -d nbobjp

srvctl start instance -d nbobjp -i nbobjp1 -o mount

SQL> select instance_name,status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
nbobjp1          MOUNTED

SQL> alter database archivelog;

Database altered.


alter system set cluster_database=true scope=spfilesid='*' ;

srvctl stop instance -d nbobjp -i nbobjp1

srvctl start database -d nbobjp

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +NPRODO/nbobjp/arch
Oldest online log sequence     9
Next log sequence to archive   10
Current log sequence           10
26. ORATAB ENTIRES on both nodes:

[nbobjp2]
        ORACLE_SID=nbobjp2
        DB_NAME=nbobjp
        INSTANCE_LISTENER=
        ORACLE_MGR=oracle
        ORACLE_HOME=/local/oracle/product/rdbms/11g
        SHLIB_PATH=/local/oracle/product/rdbms/11g/lib:/usr/lib
        LD_LIBRARY_PATH=/local/oracle/product/rdbms/11g/lib:/usr/lib:/usr/dt/lib:/usr/openwin/lib
        TNS_ADMIN=/local/oracle/product/rdbms/11g/network/admin
        UDUMP=$ORACLE_HOME/admin/nbobjp/udump
        APPL_MGR=
        APPL_TOP=
        INST_TYPE=RAC
        INST_OWNER= JAY YANG
        INST_USAGE=BOBJECTS DATABASE
        INST_EXPIRATION=NONE
        INST_CHARGE=
        ORA_NLS33=
        ALWAYS_UP=Y
        ARCHIVE_MODE=Y
        ARCH_KEEP=35
        ARCH_WARN=20
        START_ON_BOOT=Y
        BOOT_PRIORITY=1
        BACKUP_TYPE=EXPORT
        BACKUP_FREQUENCY=DAILY
        BACKUP_ARCHLOGS=Y
        BACKUP_COMMENT=Scheduled Backup
        DBBMON_GROUP=3
        MGRPWD=
        PROD_ARRAY=Y
        SG_PACKAGE=N
        PATCH_PROP_O=W
        PATCH_PROP_C=W
        SECURE=Y
        PRECISE=N
        INST_ANALYZE=N
        INST_CBO=N
        AUDIT_ALERT=N



[nbobjp1]
        ORACLE_SID=nbobjp1
        DB_NAME=nbobjp
        INSTANCE_LISTENER=
        ORACLE_MGR=oracle
        ORACLE_HOME=/local/oracle/product/rdbms/11g
        SHLIB_PATH=/local/oracle/product/rdbms/11g/lib:/usr/lib
        LD_LIBRARY_PATH=/local/oracle/product/rdbms/11g/lib:/usr/lib:/usr/dt/lib:/usr/openwin/lib
        TNS_ADMIN=/local/oracle/product/rdbms/11g/network/admin
        UDUMP=$ORACLE_HOME/admin/nbobjp/udump
        APPL_MGR=
        APPL_TOP=
        INST_TYPE=RAC
        INST_OWNER= JAY YANG
        INST_USAGE=BOBJECTS DATABASE
        INST_EXPIRATION=NONE
        INST_CHARGE=
        ORA_NLS33=
        ALWAYS_UP=Y
        ARCHIVE_MODE=Y
        ARCH_KEEP=35
        ARCH_WARN=20
        START_ON_BOOT=Y
        BOOT_PRIORITY=1
        BACKUP_TYPE=EXPORT
        BACKUP_FREQUENCY=DAILY
        BACKUP_ARCHLOGS=Y
        BACKUP_COMMENT=Scheduled Backup
        DBBMON_GROUP=3
        MGRPWD=
        PROD_ARRAY=Y
        SG_PACKAGE=N
        PATCH_PROP_O=W
        PATCH_PROP_C=W
        SECURE=Y
        PRECISE=N
        INST_ANALYZE=N
        INST_CBO=N
        AUDIT_ALERT=N
27. RMANConfigurations:

RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 8 BACKUP TYPE TO COMPRESSED BACKUPSET;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 8 BACKUP TYPE TO COMPRESSED BACKUPSET;
new RMAN configuration parameters are successfully stored
RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
new RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
new RMAN configuration parameters are successfully stored
RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/local/oracle/product/rdbms/11g/dbs/snapcf_nbobjp2.f';
new RMAN configuration parameters:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/local/oracle/product/rdbms/11g/dbs/snapcf_nbobjp2.f';
new RMAN configuration parameters are successfully stored
RMAN> host 'mkdir -p /OLTPbackup/oracle/BACKUP/nbobjp' ;
host command complete
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/OLTPbackup/oracle/BACKUP/nbobjp/CF_%d_%T_%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/OLTPbackup/oracle/BACKUP/nbobjp/CF_%d_%T_%F';
new RMAN configuration parameters are successfully stored
RMAN>exit
rman target sys/orap70d catalog rman/RMANcatalog@NDBA
RMAN> register database;
alter system set "_backup_ksfq_bufcnt"=32 scope=both sid='*';
alter system set "_backup_ksfq_bufsz"=1048576  scope=both sid='*';
pm1dsolt06:/local/oracle/DBA/bin >rmantarget  /  catalog=rman/rmancatalog@NDBA
Recovery Manager: Release 11.2.0.3.0 - Production on Tue Jul 3 06:00:59 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: NBOBJP (DBID=1093310100)
connected to recovery catalog database
CONFIGURE DEVICE TYPE DISK PARALLELISM 8 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXOPENFILES 16 CONNECT 'sys/orap70d@nbobjp1';
CONFIGURE CHANNEL 2 DEVICE TYPE DISK MAXOPENFILES 16 CONNECT 'sys/orap70d@nbobjp2';
CONFIGURE CHANNEL 3 DEVICE TYPE DISK MAXOPENFILES 16 CONNECT 'sys/orap70d@nbobjp1';
CONFIGURE CHANNEL 4 DEVICE TYPE DISK MAXOPENFILES 16 CONNECT 'sys/orap70d@nbobjp2';
CONFIGURE CHANNEL 5 DEVICE TYPE DISK MAXOPENFILES 16 CONNECT 'sys/orap70d@nbobjp1';
CONFIGURE CHANNEL 6 DEVICE TYPE DISK MAXOPENFILES 16 CONNECT 'sys/orap70d@nbobjp2';
CONFIGURE CHANNEL 7 DEVICE TYPE DISK MAXOPENFILES 16 CONNECT 'sys/orap70d@nbobjp1';
CONFIGURE CHANNEL 8 DEVICE TYPE DISK MAXOPENFILES 16 CONNECT 'sys/orap70d@nbobjp2';
RMAN> backup current controlfile;

Standby Build:
backup from production;
run
{
BACKUP FORMAT '/cifdba/hari/nbobjp/DB_%d_%T_S%s_P%p.bkp' DATABASE FILESPERSET 4 TAG nbobjp_db_backup ;
BACKUP FORMAT '/cifdba/hari/nbobjp/DB_%d_%T_S%s_P%p.bkp' ARCHIVELOG ALL FILESPERSET 4 TAG nbobjp_AL_backup ;
BACKUP CURRENT CONTROLFILE FOR STANDBY FORMAT '/cifdba/hari/nbobjp/CF_nbobjp_db_backup.bkp';
}
exit;


createtns entries on both primary and standby side


NBOBJP_MW =
     (DESCRIPTION =
       (LOAD_BALANCE = yes)
       (FAILOVER = on)
       (ADDRESS = (PROTOCOL = TCP)(HOST = pm1dsolt05-c)(PORT = 1521))
       (ADDRESS = (PROTOCOL = TCP)(HOST = pm1dsolt06-c)(PORT = 1521))
       (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = NBOBJP_MW )
        (FAILOVER_MODE =
          (TYPE = SELECT)
          (METHOD = BASIC)
          (RETRIES = 180)
          (DELAY = 5)
        )
      )
  )

NBOBJP_STBY =
     (DESCRIPTION =
       (LOAD_BALANCE = yes)
       (FAILOVER = on)
       (ADDRESS = (PROTOCOL = TCP)(HOST = pwtdsolt03-c)(PORT = 1521))
#       (ADDRESS = (PROTOCOL = TCP)(HOST = pwtdsolt02-c)(PORT = 1521))
       (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = NBOBJP_STBY )
        (FAILOVER_MODE =
          (TYPE = SELECT)
          (METHOD = BASIC)
          (RETRIES = 180)
          (DELAY = 5)
        )
      )
  )

SQL> ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/control01.ctl';

copypfile and password file from prod to DR

*.db_unique_name='nbobjp_stby'
*.service_names='NBOBJP_STBY'
*.standby_file_management=auto
*.fal_client='NBOBJP_STBY'
*.fal_server='NBOBJP_MW'
*.log_archive_dest_1='LOCATION=+NPRODO/nbobjp/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES)'
*.log_archive_dest_2='service=NBOBJP_PRI valid_for=(online_logfiles,primary_role)  db_unique_name=NBOBJP_PRI'
*.standby_archive_dest='LOCATION=+NPRODO/nbobjp/arch'
*.log_archive_dest_state_1=ENABLE
*.log_archive_dest_state_2=ENABLE

RMAN> restore controlfile from '/cifdba/hari/nbobjp/CF_nbobjp_db_backup.bkp';

RMAN> mount database;

RMAN> catalog start with '/cifdba/hari/nbobjp/';

RMAN> restore database;

RMAN> shutdown immediate;

RMAN> exit

sqlplus "/as sysdba"

SQL> startup nomount;
SQL> alter database mount standby database;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1
GROUP 15 ('+NPRODO/nbobjp/redo_1_15a.log','+NPRODO/nbobjp/redo_1_15b.log') SIZE 500M,
GROUP 16 ('+NPRODO/nbobjp/redo_1_16a.log','+NPRODO/nbobjp/redo_1_16b.log') SIZE 500M,
GROUP 17 ('+NPRODO/nbobjp/redo_1_17a.log','+NPRODO/nbobjp/redo_1_17b.log') SIZE 500M,
GROUP 18 ('+NPRODO/nbobjp/redo_1_18a.log','+NPRODO/nbobjp/redo_1_18b.log') SIZE 500M,
GROUP 19 ('+NPRODO/nbobjp/redo_1_19a.log','+NPRODO/nbobjp/redo_1_19b.log') SIZE 500M,
GROUP 20 ('+NPRODO/nbobjp/redo_1_20a.log','+NPRODO/nbobjp/redo_1_20b.log') SIZE 500M;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 2
GROUP 21 ('+NPRODO/nbobjp/redo_2_21a.log','+NPRODO/nbobjp/redo_2_21b.log') SIZE 500M,
GROUP 22 ('+NPRODO/nbobjp/redo_2_22a.log','+NPRODO/nbobjp/redo_2_22b.log') SIZE 500M,
GROUP 23 ('+NPRODO/nbobjp/redo_2_23a.log','+NPRODO/nbobjp/redo_2_23b.log') SIZE 500M,
GROUP 24 ('+NPRODO/nbobjp/redo_2_24a.log','+NPRODO/nbobjp/redo_2_24b.log') SIZE 500M,
GROUP 25 ('+NPRODO/nbobjp/redo_2_25a.log','+NPRODO/nbobjp/redo_2_25b.log') SIZE 500M,
GROUP 26 ('+NPRODO/nbobjp/redo_2_26a.log','+NPRODO/nbobjp/redo_2_26b.log') SIZE 500M;
primary:
alter system set fal_client='nbobjp_mw' sid='*';
alter system set fal_server='nbobjp_stby' sid='*';
standby:
alter system set fal_client='nbobjp_stby' sid='*';
alter system set fal_server='nbobjp_mw' sid='*';
Primary:
alter system set log_archive_dest_state_2='ENABLE' scope=memory sid='*';
alter system set log_archive_dest_2='service=NBOBJP_STBY valid_for=(online_logfiles,primary_role) db_unique_name=NBOBJP_STBY LGWR ASYNC REOPEN=600 MAX_FAILURE=10' scope=both sid='*' ;
Standby:
alter database recover managed standby database disconnect from session;
SQL> SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM v$ARCHIVED_LOG GROUP BY THREAD#)) ARCH, (SELECT THREAD# ,SEQUENCE# FROM v$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;
    Thread Last Sequence Received Last Sequence Applied Difference
---------- ---------------------- --------------------- ----------
         1                     27                    27          0
         2                     24                    24          0

Tidal Job Creation:
Floe of tidal job scheduling is DEV to QA and QA to PROD. Directly we don’t have access to create in prod.
1.       Job Group creation
Depending up on the job group type we need to set all tabs information in the job group definition window like, schedule, Run, Dependencies and others which we can see in below screen shot.





Creation of job under the job group:
Depending up on the job type we need to set all tabs information in the job group definition window like, program, schedule, Run, Dependencies and others which we can see in below screen shot.
Note: for creating job and job group in detail please find the tidal related document which I am attaching with this document.
Run Book Creation for Tidal job:
Below select NYDEV and give the user credentials for run book creation. If we miss to create Tidal Admins will reject the change.


Select the job location where we created in tidal.
If we click CREATE across job name we get RESET EDIT across the job.

Click edit job and give mention the below details and publish it.

No comments: