Monday, September 29, 2014

ORA-00000: normal, successful completion

This error may occur in many circumstances you need to check environment variables:
$ORACLE_HOME
$ORACLE_BASE
$ORACLE_SID
also check /etc/hosts file it must contains correct hostname and ip.
example:

[oracle@oel6 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Jan 27 11:55:17 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.
SQL> startup;
ORA-00000: normal, successful completion
after that i checked environment variables:
[oracle@oel6 ~]$ echo $ORACLE_BASE
/u0/app/oracle
[oracle@oel6 ~]$ echo $ORACLE_HOME
/u0/app/oracle/product/11.2.0/dbhome_1
[oracle@oel6 ~]$ echo $ORACLE_SID
orcl
it’s correct, then checked /etc/host file
cat /etc/hosts
#10.10.1.176 oel6
bingo! someone maybe system administrator or other dba commented this machine hostname and ip, hence we can’t start database, uncomment it and everything goes correct.
vi /etc/hosts
10.10.1.176 oel6

sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Jan 27 12:03:10 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup;
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size                  2232960 bytes
Variable Size             645926272 bytes
Database Buffers          180355072 bytes
Redo Buffers                6590464 bytes
Database mounted.
Database opened.
 

Friday, September 5, 2014

GParted - Increase disk size of a Linux native partition


Prerequisites:
You will need to download the GParted live CD ISO file so that you can use it later, you can get this here.
Below is an image displaying disk information on the server before we begin.
disk free and fdisk
It is important to identify that you are actually using a Linux native partition – as this is what we are extending. As you can see in the above image /dev/sda1 is listed as “Linux” and it has the ID of 83. The 83 hex code shows that it is a Linux native partition, while 8e shows a Linux LVM.
Note that /dev/sda1 is the partition we will be expanding.
Increasing the virtual hard disk
First off we increase the allocated disk space on the virtual machine itself.
VMware virtual disk increase
Booting into the GParted Live CD
Mount GParted live CD



Now we are ready to power on the virtual machine.
Once the virtual machine has powered on and you have booted to the CD, you will be presented with the following menu, just press enter to boot into GParted Live (Default Settings).
GParted
After some time you will then arrive at the following screen, for this I did not change anything and just accepted the defaults by pressing enter.
GParted
You will then be prompted to select a language, pressing enter defaults to English.
GParted
Next we select the default option 0 by pressing enter as we will be working with the GUI.
GParted
Once complete you will be presented with the GUI with GParted already open, if it is not already open you can select it from the Desktop icon.
GParted
As you can see the original /dev/sda1 partition that is making use of the 20gb disk is there, as well as the new unallocated 10gb from when we increased the size of the virtual hard disk earlier. The space between the two is the swap space. The total /dev/sda disk size of 30gb is also shown.
What needs to be done now is get /dev/sda1 to take up that unallocated space, this is not currently possible because swap is in the way so we need to move things around. If you do not have swap in between the partition to be extended and the unallocated space then you will be able to skip down a few steps until you arrive at the image where /dev/sda1 and the unallocated space are next to each other.
First we select /dev/sda2 which is the extended partition containing the swap, we want to expand this to include the 10gb of unallocated space.
Select /dev/sda2 and click “Resize/Move” and you will be presented with the following.
GParted
Basically you just need to drag the black arrow of /dev/sda2 all the way to the end of the unallocated space and click the Resize/Move button.
GParted
After doing this, you should see /dev/sda2 (represented by the blue box) spread out over the unallocated space.
GParted
This change and all further changes will not yet be applied, you can see the tasks down the bottom of the GParted interface and these will be applied only once you click the Apply button. Alternatively you can click the Undo button to remove a pending change.
This time we want to select /dev/sda5 which is the swap partition and select Resize/Move, this will result in the following.
GParted
This time rather than expanding the partition, we want to just move swap all the way to the end of the /dev/sda2 space that it is in, this is done by just dragging the box to the end which will then look like this.
GParted
Click the Resize/Move button and then a warning may appear informing you that moving a partition might cause your operating system to fail to boot. It also warns that performing this move may take a long time to apply, read the warning then click OK to continue.
The GUI should now look something like the below image, where /dev/sda1 is located right next to /dev/sda2 which contains the unallocated space.
GParted
Select the /dev/sda2 extended partition and click Resize/Move.
GParted
Drag this to the right so that only the swap space is contained and the grey unallocated space is freed, click Resize/Move once complete.
GParted
Once this is complete the disk will look like this.
GParted
Now we have /dev/sda1 next to the unallocated space so we are finally ready to expand /dev/sda1. Select /dev/sda1 and click the Resize/Move button.
GParted
You will be able to perform this action straight away if you did not have swap in between /dev/sda1 and the unallocated space, the previous steps were to get swap out of the way in GParted.
Drag the arrow over so that the unallocated space is then consumed by /dev/sda1 as shown below, then click Resize/Move.
GParted
Once this is done the /dev/sda1 partition will now be using the unallocated space that was previously there. All that is left to do is click the apply button which will apply the changes – you will be prompted to confirm with a warning that data loss may occur.
Note that this may take a while depending on how much of the disk is currently in use and the amount of disk space you are increasing, because a file system check (fsck) is run before the expansion and after it to ensure that there are no issues. I have performed this method on a 400gb server in the past and to increase it 100gb took approximately 5 hours. In this example I am only increasing by 10gb and there is only about 1gb of data on the disk so this took approximately 2 minutes to finish applying.
Once complete you will see something similar to the below image, you will be able to click close once finished.
GParted
Everything is now finished, you just need to reboot the virtual machine and then boot from disk rather than CD, alternatively shut down the virtual machine and unmount the live CD and then power it back on.
Once the operating system has booted you can confirm that the disk space has expanded correctly. Below you can see that /dev/sda1 is now 30gb in size.
GParted


Thursday, September 4, 2014

All about relinking in Oracle

1)  What is relinking ?
The predefined functions for any language are defined inside the library files for that language  and it is required to Compile the code to create a binary format file (object file).The Object files are then linked together with OS libraries to create one executable file. Successful linking requires all the function definition should be found , Linking generates an executable from it's component. The terms linking and relinking mean the same in this context and used interchangeably. In both cases an executable is being built from pre-built components.

The types of files involved in relinking are:

* .c   (source code file)
* .o   (object file)
* .a   (archived file)
* .so or .sl on HP/UX (PA-RISC)  (library files)







--------------------------------------------------------------------------------

2)  What is relinking of Oracle Home Binaries ?
The Oracle software is shipped in form of object files (.o files),  archive files (.a files) and then grouped in a compressed jar format. These object files are then get "relinked" at the operating system level during installation to create usable executables.  This guarantees a reliable integration with functions provided by the OS system libraries. Generally, during relinking the current executables are renamed and saved, while the new executables are being generated. Once the new executables are in place and you have successfully tested that the new executables are working, you can delete the old executables in the directory ORACLE_HOME/bin. Each old executable has an 'O' appended to it's file name, for example, 'exp' is renamed to 'expO'.

The advantage of providing the object file is that it reduces the patch/package size , instead of providing the whole libraries  or program , only objects files are shipped which then linked with OS libraries to create usable executables.



 The following are the directories where various object files and archive files will reside in Oracle Home.

- /lib

- /usr/lib

- $ORACLE_HOME/lib

- $ORACLE_HOME/rdbms/lib

- $ORACLE_HOME/<product>/lib

There is file named “ sysliblist “ which lives in $ORACLE_HOME/rdbms/lib or $ORACLE_HOME/lib directory. It contains a list of other libraries, which need to be included.






--------------------------------------------------------------------------------

3)  Why Oracle Home Relinking is required ?
Oracle Home relinking  is required to link Oracle provided object files to the OS system library. Relinking  guarantees a reliable integration with functions provided by the OS system libraries.



Relinking occurs automatically under these circumstances:

An Oracle Database has  been  installed with Oracle Universal Installer ( OUI )
An Oracle Database Patchset  has been applied via Oracle Universal Installer ( OUI )
An Oracle Database Patch has been applied  using  “ opatch tool “
Relinking can also be performed manually.






--------------------------------------------------------------------------------

4)  When Manual relinking is required?
Manual relinking is required in below situations.

A)  After OS upgrade, Generally OS Vendors guarantee operating system binary compatibility, therefore, no  reinstall or relink of the Oracle software is required when upgrading these operating systems unless  specifically stated otherwise.

"However Oracle recommends performing manual relinking of Oracle Home binaries after OS upgrade".

B)   After Operating system has been patched.( Recommended ).

C)   Relinking phase during installation of Oracle Home has errors/warnings.

D)  Application of a RDBMS patch failed in relinking phase.

E)   Applications gives error for missing lib files in RDBMS home.

F)   Troubleshooting RDBMS home binaries issue.

G)  After manually modifying RDBMS home binary permissions.

H)  Verifying Integrity of Oracle Home Binaries.

I)  Resetting Oracle Home binaries permission.




--------------------------------------------------------------------------------



5)  Is relinking required after an OS upgrade , Downgrade , Patching or removal of the patch ?
Yes, Oracle recommends to perform manual relinking of Oracle Home Binaries after OS Upgrade , Patching , Downgrade or removal of the Patch or any change which impact OS library behavior . Successful relinking shows Oracle Executable are properly linked with OS binaries.


For more info check Metalink:

root.sh - Purpose of oraenv, coraenv & dbhome

The oraenv and coraenv utilities both aid in setting the Oracle environment on UNIX systems (other utilities exist on Windows platform that enable the Oracle Home to be set.) The coraenv utility is appropriate for the UNIX C Shell; oraenv should be used with either the Bourne or Korn shells.

Database operations require the ORACLE_HOME to be set before the user may access the database. If ORACLE_HOME is not set, commands such as sqlplus, exp, or any other utility for that matter, will not be found.

Both utilities are shell scripts that do the same thing in the different UNIX shells. They will prompt for a SID of the database unless ORAENV_ASK is set to N. The utility will also append the ORACLE_HOME value to the path, marking the location of the utility.

The oraenv command will prompt for the SID of the database that you wish $ORACLE_HOME to access.

$ . oraenv

ORACLE_SID = [] ? ASG920

The dbhome utility can now be used to verify that $ORACLE_HOME is correct.

$ dbhome

/usr/oracle/9.2.0

The “dot space” part of the command is required to make the environment change with the parent shell, as opposed to entering a command without it which would only affect the subshell running that process.

These commands can be used to avoid specifying the network service name when issuing commands. For instance, without using oraenv, a sqlplus command would look like:

$ sqlplus system/manager@nameofservice as sysdba

whereas after oraenv has been executed, the following command would work:

$ sqlplus system/manager as sysdba



Source: http://blog.abigold.fr/joomla/index.php?option=com_content&view=article&id=200:oraenvcoraenvdbhome&catid=41:command-batch-utility-utilitaire&Itemid=66

Tuesday, September 2, 2014

adpreclone.pl dbTier - Can't locate strict.pm in @INC

On running adcfgclone.pl on 11.2.0.3 RDBMS ORACLE_HOME, it got errored out with the message below.

Issue:
$cd $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME

$ perl adcfgclone.pl dbTechStack
Can't locate strict.pm in @INC (@INC contains: /erpR1213/oracle/11.2.0/perl/lib/5.8.3 /erpR1213/oracle/11.2.0/perl/lib/site_perl/5.8.3 /erpR1213/oracle/11.2.0/appsutil/perl ../lib/5.10.0/sun4-solaris-thread-multi-64 ../lib/5.10.0 ../lib/site_perl/5.10.0/sun4-solaris-thread-multi-64 ../lib/site_perl/5.10.0 ../lib/5.10.0 ../lib/5.10.0/sun4-solaris-thread-multi-64 ../lib/site_perl .) at adcfgclone.pl line 27.
BEGIN failed--compilation aborted at adcfgclone.pl line 27.


Reason:
After upgrading you database from 10g to 11g , perl utility has been upgraded from 5.8.3 to 5.10.0.


Solution:
This is a known issue and now documented in My Oracle Support Article ADPreclone Fails When Can't Find Strict.PM Following Database Upgrade to 11gR2 [ID 1139403.1].

11.2.0.3 ships with perl 5.10.0. So you need to change the values of context variables pointing to PERL5LIB and ADPERLPRG inside the context file.

vi $CONTEXT_FILE
Global replace 5.8.3 with 5.10.0
Save
cd $ORACLE_HOME/appsutil/template
vi adxdbctx.tmp
Global replace 5.8.3 with 5.10.0

Run adcfgclone.pl, or adconfig or adpreclone.pl and it will work.