Saturday, December 11, 2010

user equivalence or secure shell for remote installation

User equivalence:
vi /etc/hosts.equiv and add following two lines (node name).
pind33
pind34

test it using rsh (remote shell):
rsh pind33 uname –r
rsh pind34 uname –r


secure shell (ssh)
applptch@pind33(PTCH_806_BALANCE/Web:Forms:MWA):$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/applptch/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/applptch/.ssh/id_dsa.
Your public key has been saved in /home/applptch/.ssh/id_dsa.pub.
The key fingerprint is:
17:ce:1d:66:0d:25:01:fa:a9:70:fa:d9:d2:04:a0:c1 applptch@pind33.powellind.com
[~]:[time 14:15:03]

applptch@pind34(PTCH_806_BALANCE/Web:Forms:MWA):$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/applptch/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/applptch/.ssh/id_dsa.
Your public key has been saved in /home/applptch/.ssh/id_dsa.pub.
The key fingerprint is:
5c:ad:ca:aa:93:e7:b0:92:66:92:c4:6b:09:3c:8f:f0 applptch@pind34.powellind.com
[~]:[time 14:15:40]

applptch@pind33(PTCH_806_BALANCE/Web:Forms:MWA):$ ssh pind33 "cat /home/applptch/.ssh/id_dsa.pub" >> /home/applptch/.ssh/authorized_keys
applptch@pind33's password:
[~]:[time 14:16:58]
applptch@pind33(PTCH_806_BALANCE/Web:Forms:MWA):$ ssh pind34 "cat /home/applptch/.ssh/id_dsa.pub" >> /home/applptch/.ssh/authorized_keys
applptch@pind34's password:
[~]:[time 14:17:19]
applptch@pind33(PTCH_806_BALANCE/Web:Forms:MWA):$ scp /home/applptch/.ssh/authorized_keys pind34:/home/applptch/.ssh
applptch@pind34's password:
authorized_keys 100% 1336 1.3KB/s 00:00
[~]:[time 14:17:56]
applptch@pind33(PTCH_806_BALANCE/Web:Forms:MWA):$ ssh pind34
Last login: Wed Sep 15 14:13:53 2010 from 172.18.33.73
[~]:[time 14:18:26]
applptch@pind34(PTCH_806_BALANCE/Web:Forms:MWA):$

applptch@pind34(PTCH_806_BALANCE/Web:Forms:MWA):$ ssh pind33
Last login: Wed Sep 15 14:24:10 2010 from pind34.powellind.com
[~]:[time 14:26:51]
applptch@pind33(PTCH_806_BALANCE/Web:Forms:MWA):$

hangcheck_timer module for monitoring the Linux kernel hangs

Make sure hangcheck_timer is running on all cluster nodes.

crs.oracle.pind22>/sbin/lsmod |grep -i hang
Module Size Used by
hangcheck_timer 37465 0


add entry to start the hangcheck_timer module on all nodes if necessary
crs.oracle.pind22>vi /etc/rc.local

modprobe hangcheck-timer hangcheck_tick=1 hangcheck_margin=10 hangcheck_reboot=1

hangcheck_tick: defines how often, in seconds, the hangcheck_timer module checks nodes for hangs. The default value is 60 seconds.

Hangcheck_margin: defines how long, in seconds, the timer waits for a response from the kernel. The default value is 180 seconds.

Hangcheck_reboot: determines if the hangcheck_timer restarts the node if the kernel fails to respond within the sum of the hangcheck_tick and hangcheck_margin parameter values. If hangcheck_reboot >= 1, then the hangcheck_timer module restarts the system. If hangcheck_reboot = 0, then the hangcheck_timer will not reboot node even if a hang is detected.

For 10g, need to make sure that the cluster misscount is greater than the sum of the setting for hangcheck_tick+hangcheck_margin.

REF:
Hangcheck-timer module requirements for Oracle9i, 10g, and 11g RAC on Linux.

migrate a database to ASM

1. SQL>alter system set db_create_file_dest=’+DATA’ scope=spfile;
SQL>alter system set control_file=’’ scope=spfile;
2. SQL>shutdown immediate;
3. SQL>startup nomount;
4. RMAN>restore controlfile from ‘/u01/ORCL/control01.ctl’;
5. SQL>alter database mount;
6. RMAN>backup as copy database format ‘+DATA’;
7. RMAN>switch database to copy;
8. RMAN>recover database;
9. SQL>alter database open;
10. SQL>alter database tempfile ‘/u01/ORCL/temp1.dbf’ DROP;
SQL>alter tablespace temp add tempfile;

11gR2 database swap space

The 11g install guide gives this formula for swap:

If RAM = 1024MB to 2048Mb then 1.5 times RAM
elseif RAM > 2048MB and < 8192MB then match RAM
else RAM > 8192MB then .75 times RAM

10gR2 EBS database init.ora

*.service_names = PROD,PROD1,PROD2,PROD.POWELLIND.COM
PROD1.local_listener = 'PROD1_LOCAL'
PROD1.remote_listener = 'PROD_REMOTE'
PROD2.local_listener = 'PROD2_LOCAL'
PROD2.remote_listener = 'PROD_REMOTE'
*.cluster_database = TRUE
*.cluster_database_instances = 2
*.undo_retention=28800
PROD1.undo_tablespace = APPS_UNDOTS1
PROD1.instance_name = PROD1
PROD1.instance_number = 1
PROD1.thread = 1
PROD2.undo_tablespace = APPS_UNDOTS2
PROD2.instance_name = PROD2
PROD2.instance_number = 2
PROD2.thread = 2
*.db_recovery_file_dest='/backup'
*.db_recovery_file_dest_size=1500G
*.recovery_parallelism=4
*.DB_CREATE_FILE_DEST = '+DSKGRP1'
*.DB_CREATE_ONLINE_LOG_DEST_1 = '+DSKGRP1'
*.DB_CREATE_ONLINE_LOG_DEST_2 = '+DSKGRP1'
*.db_name = PROD
*.control_files = '+DSKGRP1/PROD/CONTROLFILE/Current.275.682690593','+DSKGRP1/prod/controlfile/current.259.711532731'
*.control_file_record_keep_time = 30
*.db_block_size = 8192
*.compatible = 10.2.0
*._system_trig_enabled = TRUE # set FALSE for upgrades/migrations
*.O7_DICTIONARY_ACCESSIBILITY = FALSE
*.nls_language = AMERICAN
*.nls_territory = AMERICA
*.nls_date_format = DD-MON-RR
*.nls_numeric_characters = ".,"
*.nls_sort = binary # Required 11i setting
*.nls_comp = binary # Required 11i setting
*.nls_length_semantics = BYTE # Required 11i setting
*.audit_trail = false # if you want auditing
PROD2.user_dump_dest = /opt/oracle/product/10.2.0/PROD/admin/PROD2_pind42/udump
PROD2.background_dump_dest = /opt/oracle/product/10.2.0/PROD/admin/PROD2_pind42/bdump
PROD2.core_dump_dest = /opt/oracle/product/10.2.0/PROD/admin/PROD2_pind42/cdump
PROD1.user_dump_dest = /opt/oracle/product/10.2.0/PROD/admin/PROD1_pind41/udump
PROD1.background_dump_dest = /opt/oracle/product/10.2.0/PROD/admin/PROD1_pind41/bdump
PROD1.core_dump_dest = /opt/oracle/product/10.2.0/PROD/admin/PROD1_pind41/cdump
*.max_dump_file_size = 20480 # trace file size
*.timed_statistics = true
*._trace_files_public = TRUE
*.processes = 1000 # Max. no. of users x 2
*.sessions = 2000 # 2 X processes
*.db_files = 512 # Max. no. of database files
*.dml_locks = 10000
*.cursor_sharing = EXACT # Required 11i settting
*.open_cursors = 600 # Consumes process memory, unless using MTS.
*.session_cached_cursors = 500
*.archive_lag_target = 1800
*.db_block_checking = FALSE
*.db_block_checksum = TRUE
#*.log_checkpoint_timeout = 1200 # Checkpoint at least every 20 mins.
#*.log_checkpoint_interval = 100000
*.fast_start_mttr_target = 60 #in seconds
*.log_checkpoints_to_alert = TRUE
*.log_buffer = 10485760
*.undo_management=AUTO # Required 11i setting
*.workarea_size_policy=AUTO # Required 11i setting
*.olap_page_pool_size = 4194304
*.shared_pool_size = 900M
*.shared_pool_reserved_size = 90M
*.streams_pool_size = 50331648
*.session_max_open_files = 25
*.java_pool_size = 250M
*.remote_login_passwordfile = exclusive
*.large_pool_size =200M
*.pga_aggregate_target = 8G
*.plsql_optimize_level = 2 # Required 11i setting
*.plsql_code_type = INTERPRETED # Required 11i setting
# *.plsql_code_type = NATIVE # Required 11i setting
# *.plsql_native_library_dir = /opt/oracle/product/10.2.0/PROD/plsql/nativelib
# *.plsql_native_library_subdir_count = 1000
PROD1.utl_file_dir = /pcp/applprod/common/temp,/pcp/applprod/common/xx_custom/outbound/gl,/pcp/applprod/common/xx_custom/inbound/gl,/pcp/applprod/common/EDI/inholding,/pcp/applprod/common/EDI/outholding,/pcp/applprod/common/xx_custom/outbound/acsis,/opt/oracle/product/10.2.0/PROD/appsutil/outbound/PROD1_pind41,/pcp/applprod/common/xx_custom/outbound/ceridian,/usr/tmp
PROD2.utl_file_dir = /pcp/applprod/common/temp,/pcp/applprod/common/xx_custom/outbound/gl,/pcp/applprod/common/xx_custom/inbound/gl,/pcp/applprod/common/EDI/inholding,/pcp/applprod/common/EDI/outholding,/pcp/applprod/common/xx_custom/outbound/acsis,/opt/oracle/product/10.2.0/PROD/appsutil/outbound/PROD2_pind42,/pcp/applprod/common/xx_custom/outbound/ceridian,/usr/tmp
*.job_queue_processes = 10
*.parallel_max_servers = 16
*.parallel_min_servers = 0
*._like_with_bind_as_equality = TRUE
*._sort_elimination_cost_ratio=5
*._fast_full_scan_enabled = FALSE
*._sqlexec_progression_cost=2147483647
*._b_tree_bitmap_plans = FALSE
*._immediate_commit_propagation = TRUE
*._lm_global_posts = TRUE
*._optimizer_cost_based_transformation=off
*.optimizer_secure_view_merging = FALSE
*._kks_use_mutex_pin = TRUE
*.sga_target = 32G
*.pre_page_sga = TRUE
*.smtp_out_server = 'it-cy1-smtp.powellind.pri'
*_fix_control='8544722:ON'

10gR2 ASM init.ora

##############################################################################
# Copyright (c) 1991, 2001, 2002 by Oracle Corporation
########################################################################

###########################################
# Cluster Database
###########################################
cluster_database=true

###########################################
# Diagnostics and Statistics
###########################################
background_dump_dest=/opt/oracle/product/10.2.0/asm/admin/+ASM/bdump
core_dump_dest=/opt/oracle/product/10.2.0/asm/admin/+ASM/cdump
user_dump_dest=/opt/oracle/product/10.2.0/asm/admin/+ASM/udump

###########################################
# Miscellaneous
###########################################
instance_type=asm

###########################################
# Pools
###########################################
large_pool_size=12M
db_cache_size = 64M
shared_pool_size = 128M # default is 48M

###########################################
# Security and Auditing
###########################################
remote_login_passwordfile=exclusive

asm_diskgroups='DSKGRP1'

+ASM1.instance_number=1
+ASM2.instance_number=2

*.processes=100

10gR2 ASM views

Viewing Information About Automatic Storage Management

V$ASM_DISKGROUP In an ASM instance, describes a disk group (number, name, size related info, state, and redundancy type).
In a DB instance, contains one row for every ASM disk group mounted by the local ASM instance.
This view performs disk discovery every time it is queried.

V$ASM_DISK In an ASM instance, contains one row for every disk discovered by the ASM instance, including disks that are not part of any disk group.
In a DB instance, contains rows only for disks in the disk groups in use by that DB instance.
This view performs disk discovery every time it is queried.

V$ASM_DISKGROUP_STAT Has the same columns as V$ASM_DISKGROUP, but to reduce overhead, does not perform a discovery when it is queried. It therefore does not return information on any disks that are new to the storage system. For the most accurate data, use
V$ASM_DISKGROUP instead.

V$ASM_DISK_STAT Has the same columns as V$ASM_DISK, but to reduce overhead, does not perform a discovery when it is queried. It therefore does not return information on any disks that are new to the storage system. For the most accurate data, use V$ASM_DISK instead.

V$ASM_FILE In an ASM instance, contains one row for every ASM file in every disk group mounted by the ASM instance.
In a DB instance, contains no rows.

V$ASM_TEMPLATE In an ASM or DB instance, contains one row for every template present in every disk group mounted by the ASM instance.

V$ASM_ALIAS In an ASM instance, contains one row for every alias present in every disk group mounted by the ASM instance.
In a DB instance, contains no rows.

V$ASM_OPERATION In an ASM instance, contains one row for every active ASM long running operation executing in the ASM instance.
In a DB instance, contains no rows.

V$ASM_CLIENT In an ASM instance, identifies databases using disk groups managed by the ASM instance.
In a DB instance, contains one row for the ASM instance if the database has any open ASM files.