Archive

Archive for November, 2010

How to enable your 11g RAC to be active/passive

November 17, 2010 Leave a comment

Starting with 11g, the INSTANCE_COUNT parameter is no longer valid. You will have to manually add a service name to the cluster and connect to it.
Example:
srvctl add service -d PS -s PS_SVC -r PS1 -a PS2,PS3,PS4…
-d <db name>
-s <service name>
-r <primary instance>
-a  <alternate instances>

After running this command, the default is for this service to start up when the DB starts. The service name will automatically be configured to the listener.

Check by running, “lsnrctl status” and you should see the new service name included in the output.

Advertisements
Categories: Oracle

Oracle instance startup parameter order

November 16, 2010 Leave a comment

Oracle looks for these files in the following order, if none are present the instance will not start. SID refers to your Oracle SID.

$ORACLE_HOME/dbs/spfileSID.ora
$ORACLE_HOME/dbs/spfile.ora
$ORACLE_HOME/dbs/initSID.ora

Categories: Oracle

11g notes

November 15, 2010 Leave a comment

1. Connect to the database as user SYSTEM.
2. Determine if the instance is part of an RAC database: select parallel from v$instance; This will return NO if it is a single-instance database.
3. Determine if the database is protected against data loss by a standby database: select protection_level from v$database; This will return UNPROTECTED if the database is indeed unprotected.
4. Determine if Streams has been configured in the database: select * from dba_streams_administrator; This will return no rows, if Streams has never been configured.

1. Connect to the database as user SYSTEM.
2. Determine what processes are running, and how many of each:
select program from v$session order by program;
select program from v$process order by program;

From sqlplus command, type “host” to access command line from OS level.

Using dynamic listener registration:
SQL> alter system set local_listener=list2;
SQL> alter system register;

To see all the lsnrctl commands, use the HELP command:
C:\>lsnrctl help
LSNRCTL for 32-bit Windows: Version 11.1.0.4.0 – Beta on 26-NOV-2007 17:47:16 Copyright (c) 1991, 2006, Oracle. All rights reserved. The following operations are available An asterisk (*) denotes a modifier or extended command: start stop status services version reload save_config trace change_password quit exit set* show*
In summary, this commands are
■ START Start a listener.
■ STOP Stop a listener.
■ STATUS See the status of a listener.
■ SERVICES See the services a listener is offering (fuller information than status).
■ VERSION Show the version of a listener.
■ RELOAD Force a listener to reread its entry in listener.ora.
■ SAVE_CONFIG Write any changes made online to the listener.ora file.
■ TRACE Enable tracing of a listener’s activity.
■ CHANGE_PASSWORD Set a password for a listener’s administration.
■ QUIT Exit from the tool without saving changes to the listener.ora file.
■ EXIT Exit from the tool and save changes to the listener.ora file.
■ SET Set various options, such as tracing and timeouts.
■ SHOW Show options that have been set for a listener.

Creating a database link: create database link devscott connect to scott identified by tiger using ‘dev’;

Then update the development schema to match the production schema:
truncate table emp@devscott;
truncate table dept@devscott;
insert into dept@devscott select * from dept@prodscott;
insert into emp@devscott select * from emp@prodscott;
commit;

For setting location of tnsnames.ora if you have multiple Oracle Homes and only want to use one:

export TNS_ADMIN=/u01/oracle/net

Index Type Options
There are six commonly used options that can be applied when creating indexes:
■ Unique or non-unique
■ Reverse key
■ Compressed
■ Composite
■ Function based
■ Ascending or descending
All these six variations apply to B*Tree indexes, but only the last three can be
applied to bitmap indexes:

Categories: Oracle

Mount Options for Oracle files when used with NAS devices

November 12, 2010 Leave a comment

Operating
System

Mount options for Binaries

Mount options for
Oracle Datafiles

Mount options for CRS Voting Disk and OCR

Sun Solaris *

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,noac,vers=3,suid

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,noac,
forcedirectio, vers=3,suid

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,vers=3,noac,
forcedirectio

AIX (5L) **

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,
vers=3,timeo=600

cio,rw,bg,hard,nointr,
rsize=32768,
wsize=32768,tcp,noac,
vers=3,timeo=600

cio,rw,bg,hard,intr,rsize=32768,
wsize=32768,tcp,noac,
vers=3,timeo=600

HPUX 11.23 ****

rw,bg,vers=3,proto=tcp,noac,hard,
nointr,
timeo=600,rsize=32768,
wsize=32768,suid

rw,bg,vers=3,proto=tcp,noac,
forcedirectio,hard,nointr,
timeo=600,
rsize=32768,wsize=32768,suid

rw,bg,vers=3,proto=tcp,noac,
forcedirectio,hard,nointr,
timeo=600
,rsize=32768,wsize=32768,suid

Windows

Not Supported

Not Supported

Not Supported

Linux x86

rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,vers=3,
timeo=600, actime=0

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,actimeo=0,
vers=3,timeo=600

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,noac,vers=3,
timeo=600

Linux x86-64

rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,vers=3,
timeo=600, actime=0

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,actimeo=0,
vers=3,timeo=600

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,vers=3,
timeo=600,
noac

Linux – Itanium

rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,vers=3,
timeo=600, actime=0

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,actimeo=0,
vers=3,timeo=600

rw,bg,hard,nointr,rsize=32768,
wsize=32768,tcp,noac,vers=3,
timeo=600

* The NFS mount option “forcedirectio” is required on Solaris platforms when mounting the OCR/CRS files when using Oracle 10.1.0.4 or 10.2.0.2 or later (Oracle bug 4466428)
** AIX is only supported with NAS on AIX 5.3 TL04 and higher with Oracle 10.2.0.1 and later (NetApp)
*** NAS devices are only supported with HPUX 11.23 ONLY

Please refer to Doc ID: Note:359515.1 for future updates.

Here’s an example of the NFS command with the options suitable for RAC databases:
mount -t nfs -o rw,rsize=32768,wsize=32768,tcp,hard,nointr,nfsvers=3,bg,actimeo=0,timeo=600,suid,async mac:/data/NFS /NFS

Categories: HP-UX, Linux, Oracle, Redhat

Allowing root access via telnet on RHEL5

November 12, 2010 Leave a comment

While this is not a recommended option for accessing servers, sometimes developers and testers don’t want to change their legacy automated scripts.  Obviously this only applies to test/dev environments and not in Production.  Here are the steps to enable telnet access to the server and enable root logins.

# Get the telnet RPM from Redhat’s website for the version appropriate to your system.
telnet-server-0.17-39.el5.x86_64.rpm

# Install telnet server
#rpm -ivh telnet-server-0.17-39.el5.x86_64.rpm

#Enable it from xinetd
#vi /etc/xinetd.d/telnet
Change “disable = yes” to “disable = no”, so the file should look like this:
service telnet
{
        flags           = REUSE
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/sbin/in.telnetd
        log_on_failure  += USERID
        disable         = no
}

#kill -1 `cat /var/run/xinetd.pid`
# vi /etc/pam.d/remote
# Comment out line:
auth       required     pam_securetty.so
to:
#auth       required     pam_securetty.so

# That should do it.  Encourage the users to switch to SSH as soon as possible.

Categories: Linux, Redhat

Helpful Brocade commands list

November 9, 2010 Leave a comment
# Add a memeber to a zone
> zoneadd "Crm1_zoneA", "server1_pci0_emulex"

# Copy an existing zone
> zoneCopy

# Create a new zone
> zonecreate "ZoneName", "Alias"

# Delete a zone
> zoneDelete

# Remove a zone from the configuration
> zoneRemove

# Rename a zone
> zoneRename

# Print the current zone configuration
> zoneShow

# Add a member to the configuration
> cfgAdd

# Copy a zone configuration
> cfgCopy

# Create a zone configuration
> cfgCreate

# Delete a zone configuration
> cfgDelete

# Remove a member from a zone configuration
> cfgRemove

# Rename a zone configuration
> cfgRename

# Print zone configuration
> cfgShow

# Add a member to a zone alias
> aliAdd

# Copy a zone alias
> aliCopy

# Create a zone alias
> aliCreate "server1_pci0_emulex", "10:00:00:00:c9:32:75:92"

# Delete a zone alias
> aliDelete

# Remove a member from a zone alias
> aliRemove

# Rename a zone alias
> aliRename

# Print zone alias information
> aliShow

# Show the entries in the name server
> nsshow

# Dump the error log
> errdump
> errshow

# Dump port errors
> portErrShow

# Print port error log
> portLogDump

# Print port activity
> portLogShow

# Disable and enable the switch
> switchdisable
> switchenable

# Configure a trunk port
> portCfgTrunkPort

# Download new firmware
> firmwareDownload

# Configure the domain and CorePID
> configure

# Show port statistics
> portStatsShow

# Commands required to create a new zone

1. Create an alias
   $ alicreate "<alias name>", "PWWN"

2. Create a zone
   $ zonecreate "Zone_name", "Alias_name; storage_port_alias"

3. Optionally add additional aliases to the zone
   $ zoneadd "Current_zone_name", "Alias_to_add"

4. Optionally remove aliases from a zone
   $ zoneremove "Current_zone_name", "Alias_to_remove"

5. Add the zone to the definied configuration
   $ cfgadd "CFG_Name", "Zone_name"

6. Optionally remove a zone from the effective configuration
   $ cfgremove "cfg_name", "Zone_name_to_remove"

7. Save the definied configuration to persisten storage
   $ cfgsave

8. Enable the configuration
   $ cfgenable "CFG_Name"
Categories: Brocade

Backing up or restoring a Brocade switch configuration

November 9, 2010 Leave a comment

Use “configUpload” and “configDownload” commands to back up/restore  a switch configuration to a remote system. ConfigUplaod has two modes of oepration: interactive mode and automatic mode. To use the interactive mode to upload a config from a switch named switch1 to an ftp server with the IP address 1.2.3.4, configUpload can be run to walk you through backing up the configuration:

switch1:admin> configupload
Server Name or IP Address [host]: 1.2.3.4
User Name [user]: ftp
File Name [config.txt]: switch1_config.txt
Protocol (RSHD or FTP) [rshd]: ftp
Password:
upload complete

The file will be uploaded to the root ftp directory of the user.  Use configDownload to copy a config onto the SAN switch.

Categories: Brocade