Tuesday, 10 January 2012

User export failed with error EXP-00008/ORA-00904: "MAXSIZE"/"OLEVEL": invalid identifier

User export failed with error EXP-00008/ORA-00904: "MAXSIZE"/"OLEVEL": invalid identifier

EXP-00008: ORACLE error 1003 encountered
ORA-01003: no statement parsed
. . exporting table DMI_DIST_COMP_RECORD_R

EXP-00008: ORACLE error 904 encountered
ORA-00904: "MAXSIZE": invalid identifier
. . exporting table DMI_DIST_COMP_RECORD_S

EXP-00008: ORACLE error 1003 encountered
ORA-01003: no statement parsed
. . exporting table DMI_DUMP_OBJECT_RECORD_S

EXP-00008: ORACLE error 904 encountered
ORA-00904: "MAXSIZE": invalid identifier
. . exporting table DMI_EXPR_CODE_S

EXP-00008: ORACLE error 1003 encountered
ORA-01003: no statement parsed
. . exporting table DMI_INDEX_R

Cause:
Depends upon the version mismatch.
like if you trying to take a export from 11.x.x.x.x home to 10.x.x.x.x dump file, you will get this error.

Solution:
If you want to take exp from db version 10.x.x.x.x serious, try it from some other database with same version.


example:
cd /opt/oracle/product/11.1.0.7/db_1/bin
./exp system/password@10gdb(tnshostname) full=y file=/oradata/export/prod007.dmp log==/oradata/export/prod007.log

you will get below error...
User export failed with error EXP-00008/ORA-00904: "MAXSIZE": invalid identifier




see Metalink ID :-741984.1

Thursday, 5 January 2012

RMAN-03002, RMAN-06403, ORA-01034, ORA-27101: shared memory realm does not exist

using target database control file instead of recovery catalog

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of allocate command at 01/04/2012 13:25:07
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist

Check your database is running or down by

$ps -ef | grep pmon

sekiazubck05.rman06> ps -ef | grep pmon
oracle 352464           1 0     Jun 16 - 42:56 ora_pmon_dbname
oracle 688150 962658 0 18:17:10 pts/0 0:00 grep pmon

it shows like this, your db is running. otherwise check your instance

ORA-00059: maximum number of DB_FILES exceeded

SQL> create tablespace 0362_363 DATAFILE '/oradata/rman/data/0362_01.dbf' SIZE 100M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE 150M
*
ERROR at line 1:
ORA-00059: maximum number of DB_FILES exceeded

SQL> show parameter db_files
db_file_name_convert                string                             0
db_files                                      integer                          200

Cause: You are trying add more datafile then limit. the limit is 200 only.
Solution:
SQL>alter system set db_files = 256 scope = spfile;
 
SQL>shutdown immediate;
 
SQL> startup
 
SQL> sho parameter db_files
 db_files                               integer                             256

now ...
SQL>create spfile from pfile [path];


Wednesday, 4 January 2012

ORA-01092, ORA-01501, ORA-00450, ORA-00444, ORA-00020: maximum number of processes () exceeded

CREATE DATABASE D0308W

*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-01501: CREATE DATABASE failed
ORA-00450: background process 'QMNC' did not start
ORA-00444: background process "QMNC" failed while starting
ORA-00020: maximum number of processes () exceeded
Process ID: 2192
Session ID: 27 Serial number: 3

Cause : Minimum default process required.
Solutiion: Increase process values to 150(default)

ORA-12560: TNS Protocol adapter error on Windows

ORA-12560: TNS Protocol adapter error

if you tried you connect database, it seems to be create a service,
open command prompt and run "oradim"

if you are going to create new db, service should be in started.
orelse
create new service like
C:\> oradim   -NEW -SID [dbname]-SYSPWD [syspassword] -STARTMODE auto
Instance started.


Now you can connect.

Wednesday, 28 December 2011

NETWORK CONFIGURATION

                                           NETWORK CONFIGURATION
Networking scripts refer to logical interface names:
Ethernet
Dial-up
Loopback
:
:
:
eth0, eth1 …
ppp0, ppp1 …
lo
Driver selection:
 All drivers for network interface cards are built as modules
 /etc/modprobe.conf maps logical names to specific module name
Ex: alias eth0 r8179
 Network interface modules are loaded at boot time if networking has been enabled
    The appropriate module is loaded based on a alias line in /etc/modprobe.conf
 To view the module aliases
          grep ‘alias eth’ /etc/modprobe.conf
          ifconfig eth0 -View interface configuration
          netconfig - text based network configuration tool, only write config files,
          system-config-network - graphical tool to configure ipaddr

Use ifup and ifdown to activate the changes
    ifup eth0 -Enable eth0 interface
    ifdown eth0 -Disable eth0 interface
    mii-tool - This utility checks or sets the status of a network interface’s Media Independent
    Interface (MII) unit. Most fast ethernet adapters use an MII to auto negotiate link speed and
duplex setting
   ethtool - Display or change ethernet card settings
   kudzu - detects and configures new and/or changed hardware on a system
  Kudzu detects and configures new and/or changed hardware on a system.
  When started, kudzu detects the current hardware, and checks it against a database stored in
      /etc/sysconfig/hwconf, if one exists.
  It then determines if any hardware has been added or removed from the system.
     If so, it gives the users the opportunity to configure any added hardware, and unconfigure any
     removed hardware. It then updates the database in /etc/sysconfig/hwconf.
They do not activate device or changes
ethtool eth0

DEVICE CONFIGURATION IS STORED IN TEXT FILES
/etc/sysconfig/network-scripts/ifcfg-ethX

NETWORK CONFIGURATION IS STORED IN
/etc/sysconfig/network

CONFIGURING SECOND IPADDR OF THE SYSTEM:
netconfig --device eth1

BINDING MULTIPLE IP ADDRESSES:
For a small number of IP's, create ifcfg file for a virtual interface
ifcfg-ethX:XXX
For a large number of IP's create an ifcfg range file
ifcfg-ethX-rangeX
vim /etc/sysconfig/network-scripts/ifcfg-eth0-range0

IPADDR_START=192.168.1.1
IPADDR_END=192.168.1.255
CLONENUM_START=0
At the maximum of 256 IP address may be configured in a single NIC
Ex: Many websites running on a same server, this is used to identify different websites

DHCP/BOOTP:
dhclient - manages to configure ip address through dhcp/bootp

DEFAULT ROUTE:
Default gateway of the system

STATIC ROUTES:
It can be configured in two ways
ip route add 192.168.22.0/24 via 10.53.0.100
service network restart
ip route
Mount permanently using the following
vim /etc/sysconfig/network-scripts/route-ethX

IP/CIDR via GATEWAY
Ex: 192.168.22.0/24 via 10.53.0.100
Adds a static route to the 192.168.22.* network through 10.53.0.100 router
service network restart
If we have more than one interfaces use the following.
vim /etc/sysconfig/networking/devices/ethX.route
ADDRESS0=192.168.3.0
NETMASK0=255.255.255.0
GATEWAY0=192.168.0.100
For the second static route uses ADDRESS1/NETMASK1/GATEWAY1, and so on.

DISPLAY STATIC ROUTES WITH:
route
route -n
netstat
connections, and multicast memberships
netstat -r
ip route
- show / manipulate the IP routing table
-
Print
network connections, routing tables, interface statistics, masquerade,

CHANGING HOSTNAME:
Hostname is set initially by /etc/rc.sysinit at the boot time
If we want to change the Hostname:
Then change the hostname in the following file
hostname=stationX.example.com (temporary entry)
vim /etc/sysconfig/network
service network restart
Changes will be activated at the logout

LOCAL DATABASE OF HOSTNAME TO IP ADDRESS MAPPINGS (OR) LOCAL RESOLVER
vim /etc/hosts
192.168.0.X
stationX.example.com
stationX

DNS RESOLVER:
vim /etc/resolv.conf
search example.com cracker.org
nameserver 192.168.0.254
nameserver 192.168.1.254

DNS UTILITIES:
nslookup
nslookup
dig
dig -x
 By default looks at both the nameserver and search lines in /etc/resolv.conf
host
host -l
 By default looks only at the nameserver line in /etc/resolv.conf

NETWORK DIAGNOSTICS:
ping - Network packet loss and latency measurement tool
Ex:
The default behavior of ping is to send 64-byte ICMP packet to the specified host every
second until you cancel the operation with a Ctrl-c. When ping operation is cancelled or done, ping
will report summary statistics such as aversge packet loss, number of packets sent/received, etc.
These statistics can allow us to measure the quality of the network between hosts.
traceroute, mtr
Displays network path to a destination
ping 192.168.0.254
Ping –c 4 192.168.0.254

ADVANCE FILESYSTEM MANAGEMENT

ADVANCE FILESYSTEM MANAGEMENT
RAID:
SOFTWARE RAID:
Multiple disks grouped together into "arrays" to provide better performance, redundancy or
both.
mdadm - provides the administration interface to software RAID.
Many "RAID Levels" supported, including RAID O, 1 and 5.
RAID devices are named, /dev/md0, /dev/md1, /dev/md2, /dev/md3 and so on.
RAID 0 or STRIPPING:
Two or more disks used to create a single large high performance volume. Performance is
better if drives of equal size are used. No redundancy, so chance of failure is very high,.
Array size equals the sum of all disks in array.
RAID0 is simply data striped over several disks. This gives a performance advantage,as it is
possible to read parts of a file in parallel. However not only is there no data protection, it is
actually less reliable than a single disk, as all the data is lost if a single disk in the array stripe
fails.
RAID 1 or MIRRORING:
Two disks containing the same data updated simultaneously. redundancy offers good
protection against disk failure. Can slow write performance but tends to improve read
performance. Only RAID type that you can place the /boot partition on. Hot spare disks can
be used to improve fault-tolerance. Array size equals the size of the smallest disk used.
RAID1 is data mirroring. Two copies of the data are held on two physical disks, and the data
is always identical. RAID1 has a performance advantage, as reads can come from either disk,
and is simple to implement. However, it is expensive, as twice as manydisks are needed to
store the data.
RAID 5:
Three or more disks with zero or more hot spares. A good balance between performance and
reliability. Redundancy is achieved by splitting parity between all disks, one disk can be lost
without causing array failure. Both read and write speeds are usually improved, but in certain
cases write performance is dramatically decreased. For this reason RAID 5 is often not a
good choice to host databases.
RAID5 data is written in blocks onto data disks, and parity is generated and rotated around
the data disks. Good general performance, and reasonably cheap to implement. Used
extensively for general data.
If data on a RAID5 disk is updated, then all the old data from the RAID stripe has to be read
back from the disks, then new parity calculated before the new data, and new parity can be
written out. This means that a RAID5 write operation requires 4 IOs. The performance impact
is usually masked by a large subsystem cache.
PARITY:
Parity is a means of adding extra data, so that if one of the bits of data is deleted,
it can be recreated from the parity
The advantage of parity is that it is possible to recover data from errors.
The disadvantage is that more storage space is required.
SOFTWARE RAID CONFIGURATION:
RAID1:
create 2 new partitions using the ID as `fd'
fdisk /dev/sda
p  n  +300M 
:wq
partprobe | sync
t
 partition no  l
 fd
TO START THE RAID
mdadm -C /dev/md0 --level=1 --raid-devices=2 /dev/sda{x,y} or/dev/sdax /dev/sday
or
mdadm -C /dev/md0 -l 1 -n 2 /dev/sda{x,y} or/dev/sdax /dev/sday
The raid should be started first and then only the partition should be formatted
mkfs.ext3 /dev/md0
mount /dev/md0 /mnt
vim /etc/fstab
/dev/md0
mount -a
mount
cd /mnt
touch a b c d
TO VIEW THE RAID STATUS
cat /proc/mdstat
/mnt ext3
defaults 0 0
TO STOP RAID
umount /dev/md0
mdadm --manage /dev/md0 --stop
TESTING AND RECOVERY
mount /dev/sdax /mnt ; mount /dev/sday /opt
ls /mnt ; ls /opt
TO FAIL A PARTICULAR HARDDISK
RAID must be started before failding a device
mdadm -C /dev/md0 --level=1 --raid-devices=2 /dev/sda{x,y} or/dev/sdax /dev/sday
mdadm --manage /dev/md0 -f /dev/sdax/y
or
mdadm --fail /dev/md0 /dev/sdax/y
TO REMOVE THE FAILED DEVICE
mdadm --manage /dev/md0 -r /dev/sdax/y
or
mdadm --remove /dev/md0 /dev/sdax/y
TO ADD A NEW DEVICE
mdadm --manage -a /dev/sdax/y
or
mdadm -a /dev/md0 /dev/sdax/y
cat /proc/mdstat
LOGICAL VOLUME MANAGEMENT

LVM is a tool for logical volume management which includes allocating disks, striping,
mirroring and resizing logical volumes.

The physical volumes are combined into logical volumes, with the exception of the /boot/
partition.

The /boot partition cannot be on a logical volume group because the boot loader cannot read
it.

If the root (/) partition is on a logical volume, create a separate /boot/ partition which is not a
part of a volume group.
LOGICAL VOLUME CONFIGURATION:
Create 2 new partitions using the ID as '8e'
fdisk /dev/sda
p
n
:wq
partprobe | sync
fdisk -l
pvcreate /dev/sdaX
pvdisplay
vgcreate /dev/sdaX
vgdisplay
lvcreate -L 300M -n
lvdisplay
mkfs.ext3 /dev//
vim /etc/fstab
/dev//lvname> /home
mount -a
mount
 +1000M  t

partition no  l
 8e
ext3
defaults
0 0
Store some data on the mount point
TO INCREASE THE LOGICAL VOLUME SIZE WITH OUT DATA LOSS
lvextend -L +700M /dev//lvname>
lvdisplay
lvdisplay show that the has the space of 1000 Mb, but df -h shows that,
df -h
To format the extended LV and added to the existing LV.
resize2fs
df -h
/dev//lvname>
TO ADD ANOTHER PARTITION TO THE EXISTING LOGICAL VOLUME:
create a new partition with the ID as '8e'
pvcreate /dev/sdaY
pvdisplay
vgextend /dev/sdaY
vgdisplay
Now the new partition is also added to the existing volume group.
TO REDUCE LVM
Now reduce the filesystem by 100MB. This example assumes that the original size was 440MB
umount /home
fsck –f /dev//lvname>
resize2fs /dev//lvname> 440M
lvreduce -L 100M /dev//lvname>
mount -a
df -h
USER QUOTA WITH LVM PARTITION:
Remount the above partition with usrquota option
Temporary:
mount /dev//lvname> -o rw,remount,usrquota
/home
Permanent:
umount /home
vim /etc/fstab
/dev//lvname> /home ext3 defaults,usrquota
:wq
mount -a
mount
Now the Above partition is ready to allocate userquota
useradd test
passwd test
00
quotacheck -cu /home
repquota /home
quotaon /home
BLOCK LIMIT: To set soft limit = 5120 kb (5Mb)
setquota 5120 10240 0 0 -u test /home
edquota -u test
==> to create the quota file
==> to display the quota file
hard limit
= 10240 kb (10Mb)
or
5120 10240
0
0
Note: Add the size of used blocks with the soft and hard limit given.
To check the above condition
su - test
quota
dd if=/dev/zero
dd if=/dev/zero
dd if=/dev/zero
of=newfile
of=newfile
of=newfile
To set soft limit = 50
bs=100k count=45  should succeed
bs=100k count=70  should succeed with warning
bs=100k count=150 should fail to write the whole file
hard limit = 70
FILE LIMIT:
setquota 0 0 50 70 -u test /home
or
edquota -u test
0
0
50
70
Note: Add the size of used blocks with the soft and hard limit given
To check the above condition
su - test
quota
Create 49 files successfully, 50th file should be created with warning. 80th file should not be created,
it should be failed.
Note: if any condition did not work properly you have to off the quota and the edit as need.
quotaoff /home
quotaon /home
LVM SNAPSHOTS:
Note: Don't try this with /home, try to use another mount point.
create an LVM partition and mount that in /snapshot
store some data in the mount point
ls /snapshot
lvcreate -L 16M -p r -s -n backups
lvdisplay
mkdir /mybackup
mount /dev//backups /mybackup/backups
mkdir /dump
dump -0u -f /dump/datadump
umount /mybackup/backups
lvremove /dev//backups
umount /snapshot
mkfs.ext3 /dev//lvname>
mount -a
ls /snapshot
Now the Directory contains no data
cd /snapshot
restore -rf /dump/datadump
ls
Now the data is restored in the mount point.
/dev//
/mybackup/backups
TO REMOVE LOGICAL VOLUMES:
umount /home
vim /etc/fstab
Remove the entries regarding to the LVM
lvremove /dev//lvname>
lvdisplay
vgremove
vgdisplay
pvremove /dev/sdaX
pvdisplay
Finally remove the partition using fdisk.