Upgrade 11i to R12.1.1



                   Step by step process 11i to R12.1.1


Recently I have made complete iteration from fresh PROD 11i instance to R12.1.1 with database 11.2.0.2

I have used VMware for this iteration, the following step involved to achieve this upgrade from 11i to R12.1.1

OS Version:- OEL 4.6
Physical Memory:- 3GB
Application:- 11i CU2
Database:- 9.2.0.6

My VMware installation has been running on P5 processor with 4GB memory under Windows 7 (64 bits) machine.
Before starting this iteration, I have enabled multi-org. So please follow multi-org enabled procedure prior to this step. 

The following steps performed successfully to complete this hectic upgrade from 11i instance to R12.1.1

•      Upgrade 9.2.0.6 to 10.2.0.4
–     Patches applied before 10g upgrade are 5478710, 4676589, 4653225
–     Changed some of the OS kernel parameters
–     Created new oracle home directory
–     Installed 10gR1 (software only)
–     Installed 10gR1 companion CD
–     Installed 10g patch set 3 (10.2.0.4)
•      Configuration section for 10g
–     Created nls/data/9idata
–     Run the script cr9idata.pl
–     Copied environment file from 9i home to 10g home and made changes to reflect the directory structure of 10g home
–     Copied TNS_ADMIN directory from 9i to 10 home and made changes according to new home
–     Copies admin directory from 9i to 10g home and make necessary changes
–     Shutdown 9i database and listener
–     Startup 10g listener
–     Upgraded  9i to 10g using dbua from 10g home
•      Shutdown database and listener
•      Create temporary tablespace
•      Apply RDBMS Patches
•      Fix Korean Lexers
•      Run Adgrants.sql
•      Grant create procedure privilege on CTXSYS
•      Implement and run Autoconfig
•      Gather statistics for SYS schema
•      Recreate grants and synonym for apps
•      Restart application server process
•      Preparing for the Upgrade R12.1.1
–     Apply AD.I.6
–     Apply TUMS utility
–     Run AD preparation scripts
Backup database and applications
•      Startup 11i Instance
•      Check for Invalid Objects etc...
•      Create R12 application user
•      Create R12 Base folder
•      OS  Kernel setting etc
•      (Refer Metalink: 761564.1  - Oracle E-Business Suite Installation and Upgrade Notes R12.1.1 for Linux x86)
•      Installation of R12.1.1 applications
•      Enable maintenance mode in R12
•      Apply AD 12.1.1 upgrade driver (7461070)
•      Source the R12 Applications environment file
•      Run the Patch Application Assistant
•      Run the adgrants.sql
•      Apply patch
•      Re-Create grants and Synonyms
•      Compile APPS schema
•      Modify tablespace
•      Run the American English upgrade patch driver 6678700
•      Review patch history and timing
•      Install R12.1.1 again for configuration purpose
•       Startup / shutdown applications and database
•       Try with autoconfig in both tiers
•       Restart services
•       
    Upgrade 10.2.0.4 to 11.2.0.2
•      Patches applied before 11gR2 upgrades are 9062910, 8919489, 9868229, 10024524
•      Autoconfig latest version with 9852070 and 9738085
•      OS kernel parameters for 11gR2
•      
       Created new oracle home directory

     Installed 11gR2 (software only)
•      Installed 11g Examples CD
•       Configuration section for 11gR2
•      Created nls/data/9idata
•      Run the script cr9idata.pl
•      Copied environment file from 10g home to 11g home and made changes to reflect the directory structure of 11g home
•      Copied TNS_ADMIN directory from 10g to 11g home and made changes according to new home
•      Copies admin directory from 10g to 11g home and make necessary changes
•      Apply 11.2.0.2 RDBMS Patches – 4247037 and 10149223
•      Shutdown 10g database and listener
•      Startup 11g listener
•      Run  DBUA
•      Perform post-install instructions
•      Run adgrants.sql
•      Grant create procedure privilege on CTXSYS
•      Set CTXSYS parameter
•      Validate Workflow ruleset
•      Implement and run AutoConfig in the new Oracle home on the database server node.
•      Gather statistics for SYS schema
•      Re-create grants and synonyms
•      Restart Applications server processes
•      Synchronize Workflow views

***************************************END********************************************

Upgrade R12.0.4 to R12.1.3 steps


The R12.1.3 can only be applied on top of R12.1.1 or R12.1.2.

So the PATH have to be : 12.0.4 => 12.1.1 => 12.1.3

Relevant notes to perform  upgrade :-
 1)Upgrade from R12.0.4 to R12.1.1.

Note 752619.1 Oracle E-Business Suite Release 12.1.1 Maintenance Pack Installation Instructions
NOTE:798258.1 - Oracle Applications Release Notes, Release 12.1.1

2)Upgrading from R12.1.1 to R12.1.3

Note 1080973.1 - Title: Oracle E-Business Suite Release 12.1.3 Readme
Note 1077769.1 - To Install The "Patch 9239089 R12.AD.B.Delta.3"Oracle Applications

creating a synonym


How to Create Synonym

Database links are notoriously slow, not an optimal solution for applications needing real-time response.
Expect the database link to cause a delay in accessing the remote data.

Here is an example of creating a synonym for scott's database link. 

SQL> create synonym rem_emp for emp@remotedb;

Synonym created.

SQL> select count(*) from rem_emp;

COUNT(*)
----------
14


The other method is to create a view on your remote database's data. 


SQL> create view v_emp as select * from emp@remotedb;

View created.

SQL> select count(*) from v_emp;

COUNT(*)
----------
14


create /drop a database link



How to drop a database link



Dropping a database link from your Oracle database is as easy as doing the following:
drop database link remotedb; 
or
drop public database link remotedb;

You will need no other system privilege other than the 'create database link' privilege granted directly
to your username or granted via a role to drop your own database link.

It is not possible to drop a database link belonging to another user.

If you try to specify another schema's database link by qualifying it with a name, 
Oracle will just look for a private database link in your schema with a name 
which includes the other schema's name and will not find it.

To drop a public database link, you will need the system privilege 'drop public database link'.
For example: 

SQL> connect / as sysdba
Connected.

SQL> drop database link scott.remotedb;
drop database link scott.remotedb
*
ERROR at line 1:
ORA-02024: database link not found


SQL> connect scott/tiger
Connected.
SQL> drop database link scott.remotedb;
drop database link scott.remotedb
*
ERROR at line 1:
ORA-02024: database link not found


SQL> drop database link remotedb;

Database link dropped.


 how to create a db link 

Once a database link has been created 
you are now ready to select your data from the remote database referenced by the db link. 
The syntax is : 

select from @; 

For example: 
SQL> select * from dept@remotedb; 

DEPTNO DNAME LOC 
---------- -------------- ------------- 
10 ACCOUNTING NEW YORK 
20 RESEARCH DALLAS 
30 SALES CHICAGO 
40 OPERATIONS BOSTON 



The database link is opened during the select (or other DML transaction) and remains open for the duration of the session. 
After you close a session, the links that were active in the session are automatically closed. 

Close a db link 

To explicitly close the database link , use the command below: 

SQL> alter session close database link remotedb; 

Session altered. 


Using db links in other DML statements 

You can use insert/update/delete statements just as easily with database links 


SQL> select * from dept@remotedb; 

DEPTNO DNAME LOC 
---------- -------------- ------------- 
10 ACCOUNTING NEW YORK 
20 RESEARCH DALLAS 
30 SALES CHICAGO 
40 OPERATIONS BOSTON 

SQL> insert into dept@remotedb (deptno,dname,loc) 
2 values (50,'MARKETING','BOISE'); 

1 row created. 

SQL> commit; 

Commit complete. 

SQL> select * from dept@remotedb; 

DEPTNO DNAME LOC 
---------- -------------- ------------- 
10 ACCOUNTING NEW YORK 
20 RESEARCH DALLAS 
30 SALES CHICAGO 
40 OPERATIONS BOSTON 
50 MARKETING BOISE 



SQL> update dept@remotedb set loc = 'LONDON' 
where deptno = 50; 

1 row updated. 

SQL> commit; 

Commit complete. 

SQL> select * from dept@remotedb; 

DEPTNO DNAME LOC 
---------- -------------- ------------- 
10 ACCOUNTING NEW YORK 
20 RESEARCH DALLAS 
30 SALES CHICAGO 
40 OPERATIONS BOSTON 
50 MARKETING LONDON 


SQL> delete from dept@remotedb 
where dname = 'MARKETING'; 

1 row deleted. 

SQL> commit; 

Commit complete. 

SQL> select * from dept@remotedb; 

DEPTNO DNAME LOC 
---------- -------------- ------------- 
10 ACCOUNTING NEW YORK 
20 RESEARCH DALLAS 
30 SALES CHICAGO 
40 OPERATIONS BOSTON 


Note that DDL operations are not allowed through a database link: 

SQL> alter table dept@remotedb 
add column (manager varchar2(30)); 

alter table dept@remotedb add column 
(manager varchar2(30)) 
* 
ERROR at line 1: 
ORA-02021: DDL operations are not allowed 
on a remote database


*********************************END*********************************************

Automatically Startup and Shutdown an Oracle Database in Linux OS

Today I want to show you how we can Start-up and Shutdown an Oracle database on Linux OS automatically
In Windows, when we install an Oracle database, it creates a Windows Service which starts the database automatically as soon as OS starts. But in Linux, it’s different. You need to create your own service to start and shutdown your database when you start and shutdown your OS respectively. Now we’ll go through this example step by step to show how we can do it
  1. First of all we’ve to change our /etc/oratab file. Why do we use it? Oratab file is used by Oracle utilities. It’s created by root.sh script, when we install an Oracle Server, and is updated each time by DBCA (Database Configuration Assistant) when we create a new database. After having installed a new database (in this case, my database name is rajeev), entering by root user, let us see the source of this file. At the end of this file, you’ll find:
The first field is the name of my database (idea), the second one is my home directory (/home/oracle/oracle/product/10.2.0/db_1), and the third indicates to the dbstart utility whether the database should, or should not be brought up at the system boot time with “Y” or “N” parameters respectively
As a root user, we’ll change last field of this line from “N” to “Y” to let dbstart utility start this database when it runs
a. Open the file with the help of any editor (I prefer vi editor)
b. Modify the file
idea:/home/oracle/oracle/product/10.2.0/db_1:Y
save & exit. 
2. In this step, we’ll create a file with name startdb and write a small script to be run when our system starts or shuts down. If you want this file to be added as a service which starts when your OS boots, you should put it in /etc/init.d/ directory. In this script, we’ll define two variables, ORA_OWNER andORACLE_HOME and then, we’ll start (or shutdown) our database by connecting with oracle user and running lsnrctl (Listener utility), dbstart (utility which starts the database) and dbshut (utility which shutdowns the database) utilities depending on our OS state.
This is the source of our startdb file:
ORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1
ORA_OWNER=oracle
case “$1″ in
 ’start’)  #If the system is starting, then …
su – $ORA_OWNER -c “$ORACLE_HOME/bin/lsnrctl start” #Start the listener
su – $ORA_OWNER -c “$ORACLE_HOME/bin/dbstart #Start the database
  ;;
‘stop’)   #If the system is stops, that is we’re shutting down our OS, then …
  su -$ORA_OWNER -c $ORACLE_HOME/bin/dbshut
  su -$ORA_OWNER -c “$ORACLE_HOME/bin/lsnrctl stop”
  ;;
esac
3. Once you’ve saved your file into this directory, make sure that it’s executable by running:
chmod 750  startdb
4. Then you need to add the appropriate symbolic links to cause the script to be executed when the system goes down, or comes up. Create it with ln -s command.
# ln -s /etc/init.d/startdb /etc/rc.d/rc3.d/K01startdb
# ln -s /etc/init.d/startdb /etc/rc.d/rc3.d/S99startdb
# ln -s /etc/init.d/startdb /etc/rc.d/rc5.d/K01startdb
# ln -s /etc/init.d/startdb /etc/rc.d/rc5.d/S99startdb
Let’s analyze these commands:
The first line creates symbolic link of our script in rc3.d directory. At startup, Linux runs /etc/rc.d/rc script at the current level (normally 3 or 5). rc3.d indicates 3rd runlevel, “K” indicates OS’s shutdown (on servers shutdown, Linux calls the scripts in /etc/rc.d/rc3/K* in order)
The second line creates another symbolic link of our script, to be run at startup of our OS, indicating “S99″ and the name of our script
Another two lines creates symoblic links for 5th runlevel.
That’s all. Your script and your service is ready for use. Just restart your OS and upon startup you’ll see your newly created service running. Then open new terminal, enter you database and issue :
SQL>SELECT status FROM v$instance;
You’ll see your database’s status is OPEN
NOTE:-
In some releases, even when we create a new service, it doesn’t work. When we issue dbstart command manually from OS, we’re getting an error:
cat: /var/opt/oracle/oratab: No such file or directory
It has simple reason and solution
If the directory /var/opt/oracle exists during the Oracle installation the dbhome script will have the parameter ORATAB set to “/var/opt/oracle/oratab” instead of “/etc/oratab”. The normal DBCA process during a default installation will still add the instance entry to /etc/oratab.
It has two solutions:
1. You can either copy the original oratab file to this directory :
cp /etc/oratab /var/opt/oracle/
2. Or you can edit dbstart and dbshut scripts, find the variable ORATAB, and you’ll find that it’s addressing to  /var/opt/oracle/oratab file. Just change it to /etc/oratab
***********************************************END********************************************************

LINUX / UNIX Interview Questions




1. How can you determine the space left in a file system?

Expected answer: There are several commands to do this: du, df, or bdf

2. How can you determine the number of SQLNET users logged in to the UNIX system?
Level: Intermediate
Expected answer: SQLNET users will show up with a process unique name that begins with oracle, if you do a ps -ef|grep oracle|wc -l you can get a count of the number of users.
3. What command is used to type files to the screen?
Level: Low
Expected answer: cat, more, pg
4. What command is used to remove a file?
Level: Low
Expected answer: rm
5. Can you remove an open file under UNIX?
Level: Low
Expected answer: yes
6. How do you create a decision tree in a shell script?
Level: intermediate
Expected answer: depending on shell, usually a case-esac or an if-endif or fi structure
7. What is the purpose of the grep command?
Level: Low
Expected answer: grep is a string search command that parses the specified string from the specified file or files
8. The system has a program that always includes the word nocomp in its name, how can you determine the number of processes that are using this program?
Level: intermediate
Expected answer: ps -ef|grep *nocomp*|wc -l
9. What is an inode?
Level: Intermediate
Expected answer: an inode is a file status indicator. It is stored in both disk and memory and tracts file status. There is one inode for each file on the system.
10. The system administrator tells you that the system hasn?t been rebooted in 6 months, should he be proud of this?
Level: High
Expected answer: Maybe. Some UNIX systems don?t clean up well after themselves. Inode problems and dead user processes can accumulate causing possible performance and corruption problems. Most UNIX systems should have a scheduled periodic reboot so file systems can be checked and cleaned and dead or zombie processes cleared out.
11. What is redirection and how is it used?
Level: Intermediate
Expected answer: redirection is the process by which input or output to or from a process is redirected to another process. This can be done using the pipe symbol "|", the greater than symbol ">" or the "tee" command. This is one of the strengths of UNIX allowing the output from one command to be redirected directly into the input of another command.
12. How can you find dead processes?
Level: Intermediate
Expected answer: ps -ef|grep zombie -- or -- who -d depending on the system.
13. How can you find all the processes on your system?
Level: Low
Expected answer: Use the ps command
14. How can you find your id on a system?
Level: Low
Expected answer: Use the "who am i" command.
15. What is the finger command?
Level: Low
Expected answer: The finger command uses data in the passwd file to give information on system users.
16. What is the easiest method to create a file on UNIX?
Level: Low
Expected answer: Use the touch command
17. What does >> do?
Level: Intermediate
Expected answer: The ">>" redirection symbol appends the output from the command specified into the file specified. The file must already have been created.
18. If you aren?t sure what command does a particular UNIX function what is the best way to determine the command?
Expected answer: The UNIX man -k command will search the man pages for the value specified. Review the results from the command to find the command of interest.

Windows XP Installations Steps


How to Install Windows XP


This procedure demonstrates how to install Windows XP Professional. The procedure to install Windows XP home edition is very similar to the professional edition. Since Windows XP Pro is more advanced operating system, it will be used to demonstrate the installation procedure.
The best way install Windows XP is to do a clean install. It is not difficult to perform a clean installation. Before you perform the installation I recommend that you check Windows XP Compatibility List to ensure that your hardware is supported by XP. If your hardware is not on the compatibility list you can check your hardware manufactures website to download the drivers for Windows XP. Save all the necessary drivers onto floppy disks or CD before you start the installation.
All versions of Windows XP CD are bootable. In order to boot from CD/DVD-ROM you need to set the boot sequence. Look for the boot sequence under your BIOS setup and make sure that the first boot device is set to CD/DVD-ROM. You can then perform the following steps to install Windows XP:
Step 1 - Start your PC and place your Windows XP CD in your CD/DVD-ROM drive. Your PC should automatically detect the CD and you will get a message saying "Press any key to boot from CD". Soon as computer starts booting from the CD your will get the following screen:
Windows XP Screenshot - Click to enlarge
Step 2 - At this stage it will ask you to press F6 if you want to install a third party Raid or SCSI driver. If you are using a an IDE Hard Drive then you do not need to press F6. If you are using a SCSI or SATA Hard drive then you must press F6 otherwise Windows will not detect your Hard Drive during the installation. Please make sure you have the Raid drivers on a floppy disk. Normally the drivers are supplied on a CD which you can copy to a floppy disk ready to be installed. If you are not sure how to do this then please read your motherboard manuals for more information.
Windows XP Screenshot - Click to enlarge
Step 3 - Press S to Specify that you want to install additional device.
Windows XP Screenshot - Click to enlarge
Step 4 - You will be asked to insert the floppy disk with the Raid or SCSI drivers. Press enter after you have inserted the disk.
Windows XP Screenshot - Click to enlarge
Step 5 - You will see a list of Raid drivers for your HDD. Select the correct driver for your device and press enter.
Windows XP Screenshot - Click to enlarge
Step 6 - You will then get a Windows XP Professional Setup screen. You have the option to do a new Windows install, Repair previous install or quit. Since we are doing a new install we just press Enter to continue.
Windows XP Screenshot - Click to enlarge



Step 7 - You will be presented with the End User Licensing Agreement. Press F8 to accept and continue
Windows XP Screenshot - Click to enlarge
Step 8 - This step is very important. Here we will create the partition where Windows will be installed. If you have a brand new unformatted drive you will get a screen similar to below. In our case the drive size is 8190MB. We can choose to install Windows in this drive without creating a partition, hence use the entire size of the drive. If you wish to do this you can just press enter and Windows will automatically partition and format the drive as one large drive.
However for this demonstration I will create two partition. The first partition will be 6000MB (C: drive) and second partition would be 2180MB (E: drive). By creating two partition we can have one which stores Windows and Applications and the other which stores our data. So in the future if anything goes wrong with our Windows install such as virus or spyware we can re-install Windows on C: drive and our data on E: drive will not be touched. Please note you can choose whatever size partition your like. For example if you have 500GB hard drive you can have two partition of 250GB each.
Press C to create a partition.
Windows XP Screenshot - Click to enlarge
Step 8 - Windows will show the total size of the hard drive and ask you how much you want to allocate for the partition you are about to create. I will choose 6000MB. You will then get the screen below. Notice it shows C: Partition 1 followed by the size 6000 MB. This indicates the partition has been created. We still have an unpartitioned space of 2189MB. Next highlight the unpartitioned space by pressing down the arrow key. Then press C to create another partition. You will see the total space available for the new partition. Just choose all the space left over, in our case 2180MB.
Windows XP Screenshot - Click to enlarge
Step 9 - Now you will see both partition listed. Partition 1 (C: Drive) 6000MB and Partition 2 (E: Drive) 2180MB. You will also have 8MB of unpartitioned space. Don't worry about that. Just leave it how its is. Windows normally has some unpartitioned space. You might wonder what happened to D: drive. Windows has automatically allocated D: drive to CD/DVD-ROM.
Select Partition 1 (C: Drive) and press Enter.
Windows XP Screenshot - Click to enlarge
Step 10 - Choose format the partition using NTFS file system.This is the recommended file system. If the hard drive has been formatted before then you can choose quick NTFS format. We chose NTFS because it offers many security features, supports larger drive size, and bigger size files.
Windows XP Screenshot - Click to enlarge
Windows will now start formatting drive C: and start copying setup files as shown on the two images below :
Windows XP Screenshot - Click to enlarge
Windows XP Screenshot - Click to enlarge


Step 11 - After the setup has completed copying the files the computer will restart. Leave the XP CD in the drive but this time DO NOT press any key when the message "Press any key to boot from CD" is displayed. In few seconds setup will continue. Windows XP Setup wizard will guide you through the setup process of gathering information about your computer.
Windows XP Screenshot - Click to enlarge
Step 12 - Choose your region and language.
Windows XP Screenshot - Click to enlarge
Step 13 - Type in your name and organization.
Windows XP Screenshot - Click to enlarge
Step 14. Enter your product key.
Windows XP Screenshot - Click to enlarge
Step 15 - Name the computer, and enter an Administrator password. Don't forget to write down your Administrator password.
Windows XP Screenshot - Click to enlarge
Step 16 - Enter the correct date, time and choose your time zone.
Windows XP Screenshot - Click to enlarge
Step 17 - For the network setting choose typical and press next.
Windows XP Screenshot - Click to enlarge
Step 18 - Choose workgroup or domain name. If you are not a member of a domain then leave the default settings and press next. Windows will restart again and adjust the display.
Windows XP Screenshot - Click to enlarge

Step 19 - Finally Windows will start and present you with a Welcome screen. Click next to continue.
Windows XP Screenshot - Click to enlarge
Step 20 - Choose 'help protect my PC by turning on automatic updates now' and press next.
Windows XP Screenshot - Click to enlarge
Step 21 - Will this computer connect to the internet directly, or through a network? If you are connected to a router or LAN then choose: 'Yes, this computer will connect through a local area network or home network'. If you have dial up modem choose: 'No, this computer will connect directly to the internet'. Then click Next.
Windows XP Screenshot - Click to enlarge
Step 22 - Ready to activate Windows? Choose yes if you wish to active Windows over the internet now. Choose no if you want to activate Windows at a later stage.
Windows XP Screenshot - Click to enlarge
Step 23 - Add users that will sign on to this computer and click next.
Windows XP Screenshot - Click to enlarge
Step 24 - You will get a Thank you screen to confirm setup is complete. Click finish.
Windows XP Screenshot - Click to enlarge
Step 25. Log in, to your PC for the first time.
Windows XP Screenshot - Click to enlarge
Step 26 - You now need to check the device manager to confirm that all the drivers has been loaded or if there are any conflicts. From the start menu select Start -> Settings -> Control Panel. Click on the System icon and then from the System Properties window select the Hardware tab, then click on Device Manager.
Windows XP Screenshot - Click to enlarge
If there are any yellow exclamation mark "!" next to any of the listed device, it means that no drivers or incorrect drivers has been loaded for that device. In our case we have a Video Controller (VGA card) which has no drivers installed.
Your hardware should come with manufacturer supplied drivers. You need to install these drivers using the automatic setup program provided by the manufacturer or you need to manually install these drivers. If you do not have the drivers, check the manufacturers website to download them.
To install a driver manually use the following procedure:
(a) From the device manager double click on the device containing the exclamation mark.
(b) This would open a device properties window.
(c) Click on the Driver tab.
(d) Click Update Driver button. The Wizard for updating device driver pops up as shown below:
Windows XP Screenshot - Click to enlarge
You now get two options. The first option provides an automatic search for the required driver. The second option allows you to specify the location of the driver. If you don't know the location of the driver choose the automatic search which would find the required driver from the manufacturer supplied CD or Floppy disk. Windows would install the required driver and may ask you to restart the system for the changes to take affect. Use this procedure to install drivers for all the devices that contain an exclamation mark. Windows is completely setup when there are no more exclamation marks in the device manager.












ERROR 1396 (HY000): Operation ALTER USER failed for 'Mysql'@'%'

 This MySQL error — ERROR 1396 (HY000): Operation ALTER USER failed for 'Mysql'@'%' — means that MySQL cannot find the user ...