Wednesday, September 16, 2009
Resume of a CIO
Here is the link to the doc
http://docs.google.com/fileview?id=0B3-ltEYqA7QUZGRjMjUyNGQtM2NhMy00M2U2LWEwNTgtYjdkYTQzYjg5NWRh&hl=en
http://docs.google.com/fileview?id=0B3-ltEYqA7QUZGRjMjUyNGQtM2NhMy00M2U2LWEwNTgtYjdkYTQzYjg5NWRh&hl=en
Sunday, September 13, 2009
gyaan about hostname that is taken wh...
gyaan about hostname that is taken while installing oracle;
the hostname for the machine while installing any oracle product is taken from the variable "hostname"
Now here is a catch.
When you and I type the command "hostname" manually, then we see some value - which actually may not necessarily be picked by the oracle software!
I burnt my fingers in this and I know that.
When I used to give the command hostname, it gave the output as octopus.
[oracle@octopus bin]$ hostname
octopus.sungardhe.com
But while checking it in the oracle files, it will show as something else!
eg:
[oracle@octopus bin]$ opmnctl status
Processes in Instance: SEED.localhost.localdomain
-------------------+--------------------+---------+---------
ias-component | process-type | pid | status
-------------------+--------------------+---------+---------
DSA | DSA | N/A | Down
LogLoader | logloaderd | N/A | Down
HTTP_Server | HTTP_Server | N/A | Down
dcm-daemon | dcm-daemon | 17855 | Alive
WebCache | WebCache | N/A | Down
WebCache | WebCacheAdmin | N/A | Down
OC4J | home | 20902 | Alive
OC4J | OC4J_BI_Forms | 20840 | Alive
or
[oracle@octopus bin]$ opmnctl status
Processes in Instance: SEED.m038038.sct.com
-------------------+--------------------+---------+---------
ias-component | process-type | pid | status
-------------------+--------------------+---------+---------
DSA | DSA | N/A | Down
LogLoader | logloaderd | N/A | Down
HTTP_Server | HTTP_Server | N/A | Down
dcm-daemon | dcm-daemon | 17855 | Alive
WebCache | WebCache | N/A | Down
WebCache | WebCacheAdmin | N/A | Down
OC4J | home | 20902 | Alive
OC4J | OC4J_BI_Forms | 20840 | Alive
Solution:
After installing it a couple of times and playing around I found that the oracle software picks it up just like the following command picks up the hostname
ping `hostname`
[root@octopus ~]# ping `hostname`
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.025 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.041 ms
or
[root@octopus ~]# ping `hostname`
PING octopus.sungardhe.com (149.24.38.38) 56(84) bytes of data.
64 bytes from octopus.sungardhe.com (149.24.38.38): icmp_seq=1 ttl=64 time=0.027 ms
64 bytes from octopus.sungardhe.com (149.24.38.38): icmp_seq=2 ttl=64 time=0.048 ms
This ping command takes it up from /etc/hosts.
Therefore, the entries in the /etc/hosts play a very important role in determining what the instance name will be!
I found that the right order in /etc/hosts so that the above ping command gives the right answer is by putting the desired hostname towards the beginning.
[oracle@octopus bin]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
149.24.38.38 octopus.sungardhe.com octopus
127.0.0.1 octopus.sungardhe.com octopus.sungardhe.com localhost.localdomain localhost
#AJ ::1 localhost6.localdomain6 localhost6
149.24.38.38 m038038.sungardhe.com m038038
Monday, September 7, 2009
FRM-92150 after applying 10.1.2.3 patchset
| After applying the Oracle AS 10.1.2.3 patchset and trying to launch Webforms, you are encountering the below error for all client connection: ------- FRM-92150: WEB Client Version too new ------ Solution Please manually rebuild the shared libraries by following the steps below: 1) ensure ORACLE_HOME is set in the environment 2) ensure all processes running in this oracle home are stopped. 3) enter the following commands at the unix prompt: cd $ORACLE_HOME/forms/lib make -f ins_forms.mk sharedlib 4) check the make.log for possible errors 5) if none, then test if the problem remains. |
Wednesday, September 2, 2009
nfs share across Linux machines
in order to nfs share a directory from one linux machine to another, following these steps:
1- nfs server type -> exportfs -rv
2- chkconfig portmap on
3- chkconfig nfs on
4- service portmap restart
5- service nfs restart
6- showmount -e localhost
This will show all the exported folders.
such as
[root@m039082 etc]# showmount -e localhost
Export list for localhost:
/var/ftp/pub *.sungardhe.com
/iso *.sungardhe.com
Client side
1- On the client side make sure that the portmap service is running as
service portmap restart
2 Then mount the mount the exported folder as
mount -t nfs <source_machine>:/path/to/export/<folder> /local_mount/point
Make a file system as swap
use fdisk to create a partition
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (197-621, default 197):<RETURN>
Using default value 197
Last cylinder or +size or +sizeM or +sizeK (197-621, default 621): +128M
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap)
Command (m for help): p
#
Now that you have the swap partition, use the command mkswap to setup the swap partition. At a shell prompt as root, type the following:
mkswap /dev/hdb2
#
To enable the swap partition immediately, type the following command:
swapon /dev/hdb2
#
To enable it at boot time, edit /etc/fstab to include:
/dev/hdb2 swap swap defaults 0 0
The next time the system boots, it will enable the new swap partition.
#
After adding the new swap partition and enabling it, make sure it is enabled by viewing the output of the command cat /proc/swaps or free
Monday, August 31, 2009
Root file system read write mount
I umounted the partition, howerver, I forgot to remove its mount line from /etc/fstab.
After I shutdown the machine, I removed the 4 GB physical(i.e virtual) disk from the Virtual Machine.
And then I added another partition of about 5.5 GB.
Then I rebooted the machine.
However, because of my not removing the entry from fstab, the boot failed, and the system went in read only mode.
I wanted to edit the fstab, but was not able to because of the read only mount of the root partition /
I then searched google, and found the way to mount the partition read-write in the following way
i.e. of the root filesystem is currently mounted read only, to remount it read-write, give the following command, at the root prompt.
#mount -n -o remount rw /
After this I was able to edit /etc/fstab - and the machine booted successfully.
Sunday, August 16, 2009
10.1.3 - going back to manual editing of files
One important thing that I found in this application server is that we cannot create DADs in 10.1.3 from the EM like we can do from 10.1.2.x.x application server - by clicking on the plsql properties on the HTTP link in the EM.
In 10.1.3.x.x we go back to editing $ORACLE_HOME/Apache/modplsql/conf/dads.conf file.
As is also stated in
http://download.oracle.com/docs/cd/B31017_01/web.1013/b28948/confmods.htm#i1055269
Friday, August 14, 2009
Oracle9i Recovery Manager (RMAN)
Oracle9i Recovery
Manager (RMAN)
Recovery manager is a platform
independent utility for coordinating your backup and restoration procedures
across multiple servers. In my opinion it's value is limited if you only have
on or two instances, but it comes into it's own where large numbers of
instances on multiple platforms are used. The reporting features alone mean
that you should never find yourself in a position where your data is in danger
due to failed backups.
The functionality of RMAN is too diverse to be covered in this article so I
shall focus on the basic backup and recovery functionality.
- Create
Recovery Catalog - Register
Database - Full
Backup - Restore
& Recover The Whole Database - Restore
& Recover A Subset Of The Database - Incomplete
Recovery - Disaster
Recovery - Lists
And Reports
Create Recovery Catalog
First create a user to hold the
recovery catalog:
CONNECT sys/password@w2k1 AS SYSDBA -- Create tablepsace to hold repositoryCREATE TABLESPACE "RMAN" DATAFILE 'C:\ORACLE\ORADATA\W2K1\RMAN01.DBF' SIZE 6208K REUSEAUTOEXTEND ON NEXT 64K MAXSIZE 32767MEXTENT MANAGEMENT LOCALSEGMENT SPACE MANAGEMENT AUTO; -- Create rman schema ownerCREATE USER rman IDENTIFIED BY rmanTEMPORARY TABLESPACE temp DEFAULT TABLESPACE rman QUOTA UNLIMITED ON rman; GRANT connect, resource, recovery_catalog_owner TO rman;
Then create the recovery catalog:
C:>rman catalog=rman/rman@w2k1 Recovery Manager: Release 9.2.0.1.0 - Production Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved. connected to recovery catalog databaserecovery catalog is not installed RMAN> create catalog tablespace "RMAN"; recovery catalog created RMAN> exit Recovery Manager complete. C:>
Register Database
Each database to be backed up by
RMAN must be registered:
C:>rman catalog=rman/rman@w2k1 target=sys/password@w2k2 Recovery Manager: Release 9.2.0.1.0 - Production Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved. connected to target database: W2K2 (DBID=1371963417)connected to recovery catalog database RMAN> register database; database registered in recovery catalogstarting full resync of recovery catalogfull resync complete RMAN>
Existing user-created backups can
be added to the catalog using:
RMAN> catalog datafilecopy 'C:\Oracle\Oradata\TSH1.dbf';RMAN> catalog archivelog 'log1', 'log2', 'log3', ... 'logN';
Full Backup
First we configure several
persistant parameters for this instance:
RMAN> configure retention policy to recovery window of 7 days;RMAN> configure default device type to disk;RMAN> configure controlfile autobackup on;RMAN> configure channel device type disk format 'C:\Oracle\Admin\W2K2\Backup%d_DB_%u_%s_%p';
Next we perform a complete
database backup using a single command:
RMAN> run {2> backup database plus archivelog;3> delete noprompt obsolete;4> }
The recovery catalog should be
resyncronized on a regular basis so that changes to the database structure and
presence of new archive logs is recorded. Some commands perform partial and
full resyncs implicitly, but if you are in doubt you can perform a full resync
using the follwoing command:
RMAN> resync catalog;
Restore & Recover
The Whole Database
If the controlfiles and online
redo logs are still present a whole database recovery can be achieved by
running the following script:
run { shutdown immediate; # use abort if this fails startup mount; restore database; recover database; alter database open;}
This will result in all datafiles
being restored then recovered. RMAN will apply archive logs as necessary until
the recovery is complete. At that point the database is opened. If the
tempfiles are still present you can issue a command like like the following for
each of them:
sql "ALTER TABLESPACE temp ADD TEMPFILE ''C:\Oracle\oradata\W2K2\temp01.dbf'' REUSE";
If the tempfiles are missing they
must be recreated as follows:
sql "ALTER TABLESPACE temp ADD TEMPFILE ''C:\Oracle\oradata\W2K2\temp01.dbf'' SIZE 100M AUTOEXTEND ON NEXT 64K";
Restore & Recover A
Subset Of The Database
A subset of the database can be
restored in a similar fashion:
run { sql 'ALTER TABLESPACE users OFFLINE IMMEDIATE'; restore tablespace users; recover tablespace users; sql 'ALTER TABLESPACE users ONLINE'; }
Incomplete Recovery
As you would expect, RMAN allows
incomplete recovery to a specified time, SCN or sequence number:
run { shutdown immediate; startup mount; set until time 'Nov 15 2000 09:00:00'; # set until scn 1000; # alternatively, you can specify SCN # set until sequence 9923; # alternatively, you can specify log sequence number restore database; recover database; alter database open resetlogs;}
The
incomplete recovery requires the database to be opened using the RESETLOGS option.
Disaster Recovery
In a disaster situation where all
files are lost you can only recover to the last SCN in the archived redo logs.
Beyond this point the recovery would have to make reference to the online redo
logs which are not present. Disaster recovery is therefore a type of incomplete
recovery. To perform disaster recovery connect to RMAN:
C:>rman catalog=rman/rman@w2k1 target=sys/password@w2k2
Once in RMAN do the following:
startup nomount;restore controlfile;alter database mount;
From SQL*Plus as SYS get the last
archived SCN using:
SQL> SELECT archivelog_change#-1 FROM v$database; ARCHIVELOG_CHANGE#-1-------------------- 1048438 1 row selected. SQL>
Back in RMAN do the following:
run { set until scn 1048438; restore database; recover database; alter database open resetlogs;}
If the "until scn" were
not set the following type of error would be produced once a redo log was
referenced:
RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of recover command at 03/18/2003 09:33:19RMAN-06045: media recovery requesting unknown log: thread 1 scn 1048439
With the database open all
missing tempfiles must be replaced:
sql "ALTER TABLESPACE temp ADD TEMPFILE ''C:\Oracle\oradata\W2K2\temp01.dbf'' SIZE 100M AUTOEXTEND ON NEXT 64K";
Once the database is fully
recovered a new backup should be perfomed.
The recovered database will be registered in the catalog as a new incarnation.
The current incarnation can be listed and altered using the following commands:
list incarnation;reset database to incarnation x;
Lists And Reports
RMAN has extensive listing and
reporting functionality allowing you to monitor you backups and maintain the
recovery catalog. Here are a few useful commands:
# Show all backup detailslist backup; # Show items that beed 7 days worth of# archivelogs to recover completelyreport need backup days = 7 database; # Show/Delete items not needed for recoveryreport obsolete;delete obsolete; # Show/Delete items not needed for point-in-time# recovery within the last weekreport obsolete recovery window of 7 days; delete obsolete recovery window of 7 days; # Show/Delete items with more than 2 newer copies availablereport obsolete redundancy = 2 device type disk;delete obsolete redundancy = 2 device type disk; # Show datafiles that connot currently be recoveredreport unrecoverable database;report unrecoverable tablespace 'USERS';
It's worth spending some time looking
at all the reporting capabilities whilst deciding whether you should switch
from shell scripting to RMAN. It might just influence your decision.
For more information see:
Tuesday, July 21, 2009
Oracle Fusion
will post my anything unusual here as well.
Vi: Search and Replace
Vi: Search and Replace
Change to normal mode with <ESC>.
Search (Wraped around at end of file):
Search STRING forward : / STRING.
Search STRING backward: ? STRING.
Repeat search: n
Repeat search in opposite direction: N (SHIFT-n)
Replace: Same as with sed,
Replace OLD with NEW:
First occurrence on current line: :s/OLD/NEW
Globally (all) on current line: :s/OLD/NEW/g
Between two lines #,#: :#,#s/OLD/NEW/g
Every occurrence in file: :%s/OLD/NEW/g
http://www.felixgers.de/teaching/emacs/vi_search_replace.html
How to add Swap space to Linux
Alternative 1 -> making it on a separate disk
Step 1- Add the disk. (eg /dev/sdf)
Step 2- format it using fdisk
fdisk /dev/sdf
select n
select p for primary, and create it (with cylinders begin and last)
then select t for ( t change a partition's system id)
select code 82
[root@fusion ~]# fdisk /dev/sdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): t
No partition is defined yet!
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-195, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-195, default 195):
Using default value 195
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): L
0 Empty 1e Hidden W95 FAT1 80 Old Minix bf Solaris
1 FAT12 24 NEC DOS 81 Minix / old Lin c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 82 Linux swap / So c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 83 Linux c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 84 OS/2 hidden C: c7 Syrinx
5 Extended 41 PPC PReP Boot 85 Linux extended da Non-FS data
6 FAT16 42 SFS 86 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set de Dell Utility
8 AIX 4e QNX4.x 2nd part 88 Linux plaintext df BootIt
9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM e1 DOS access
a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e3 DOS R/O
b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e4 SpeedStor
c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS eb BeOS fs
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi ee EFI GPT
f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ef EFI (FAT-12/16/
10 OPUS 55 EZ-Drive a6 OpenBSD f0 Linux/PA-RISC b
11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f1 SpeedStor
12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f4 SpeedStor
14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f2 DOS secondary
16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot fb VMware VMFS
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
Hex code (type L to list codes): 82
Changed system type of partition 1 to 82 (Linux swap / Solaris)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
step 3- mkswap /dev/sdf1
Step 4- swapon -a
Step 5- Add the entry to fstab
step 6- to check, swapon -s