Friday 29 November 2019

Oracle database upgrade version 10.2.0.1.0 to 10.2.0.4.0



Step 1:download the appropriate patch from my oracle support and save it.

Step 1:  Stop all running services and shutdown database.

Startàrunàtype services.mscàstop all oracle services by using this widow.

Step 2: Take the cold backup of all files...like copy /paste from base directory(oracle)

Step 3: install the download patch in the same oracle home.

Step 4:start all services like the same above,

Step 5: startup database using “startup upgrade” command

Step 6: After database open

Give this command

SQL>spool patch.log(log will store in from which user u run the script that place)

SQL>@ORACLE_HOME/rdbms/admin/catupgrd.sql(this command for upgrade the database)

SQL>spool off

(shutdown the database from restricted mode and open in normal mode)

SQL>shutdown immediate

SQL>startup

(Below script recompile the invalid objects )

SQL>@ORACLE_HOME/rdbms/admin/utlrp.sql

SQL>select * from v$version

(it display upgraded version.)

OBIEE 10g installation on linux


The installation of an OBIEE 10g stack can be summarized in the following steps:

1) Configuration of JDK for Oracle Business Intelligence 
2) Set up of the Oracle Business Intelligence Server
3) Set up of the Oracle Business Intelligence Presentation Services
4) Set up of the Oracle Business Intelligence Client Tool set
PART 1 which is really a prerequisite to the installation of Oracle Business Intelligence Server
STEP :1 Confirm JDK 1.5.0 or higher installed
Redhat RHEL 5.4 comes installed with JRE 1.6 which is not the same as JDK 1.5 . JRE contains the run time binaries needed to run java applets , JDK contains the APIs needed to execute java functions in your application.

We need JDK because in an OBIEE 10g basic installation, J2EE is the Application Server.

To start, open your terminal:

in terminal, run :

java -version

it will generate
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)

in terminal, run:

echo $JAVA_HOME

it will generate no result. $JAVA_HOME is an environmental variable that you configure during your JDK installation. Since neither java -version or echo $JAVA_HOME mention JDK,  we can confirm that you do not have JDK installed
Step 2: Download Java Development Kit 5.xx or higher
Download the binary file :
http://www.oracle.com/technetwork/java/javase/downloads/jdk6u35-downloads-1836443.html

You need to make this file executable. This can be done by changing the permissions.

In terminal, run:
chmod a+x jdk-1_5_0_22-linux-i586-rpm.bin
 Step 3:  Create appropriate folders
We need to move the file to the folder that OBIEE utilizes during install - /usr/local/java. This folder doesn't exist by default so you will have to create it.

In terminal, run:
mkdir /usr/local/java/
cd /usr/local/java/
Note that your account may not have privileges to create a new folder in a system-wide directory, so you may need your sys admin to do this for you.

Now you need to move the  jdk-1_5_0_22-linux-i586-rpm.bin file you downloaded into the /usr/local/java folder.

In terminal, run:
mv /desktop/jdk-1_5_0_22-linux-i586-rpm.bin ./

The above statement assumes you downloaded the file to your /usr/home/username/Desktop folder.

Step 4: Install JDK 5.xx

Now that you've moved the file to the /usr/local/java/ folder, we can begin the install:

In terminal, run:
./jdk-1_5_0_22-linux-i586-rpm.bin


If successful, you will see the following:

Do you agree to the above license terms? [yes or no]
yes
Unpacking...
Checksumming...
0
0
Extracting...
  inflating: jdk-1_5_0_22-linux-i586.rpm
Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]

Done.


Step 5: Create an account with read/write privilege to /usr/local/java

If you've been paying attention, you'll notice that all of the above commands had to be executed by either 'root' or a super user. You cannot install OBI as root, nor should you attempt to run a server as root due to security concerns.

The appropriate solution is to create a new user with access to the folders needed for installation.

We are now going to create a new user which we will use for the rest of the installation.

Have your admin/root account run the following commands in terminal:

groupadd obi  #create a group called oinstall
 
/usr/sbin/useradd obi -g obi  #create a user called obi, with membership to group obi
 
passwd obi #create a new password for user obi


Now give user obi read/write access to the /usr/local/java folder. This is necessary because during the start of BI presentation services, log files will be created and .jar files will be executed.

In terminal, run the following command:

chown -R obi:obi /usr/local/java

chmod -R 777 /usr/local/java

cd /usr/local

ls –l

Command ls -l should generate:

drwxrwxr-x  3 obi  oinstall 4096 May 23 13:42 java

User obi now has read/write access to /usr/local/java

Step 6: Update the bash profile for user obi

 Remember in step run, when we ran echo $JAVA_HOME , no results were returned? This is not ok because $JAVA_HOME is an environmental variable that OBIEE server uses during its install. We need to create this variable prior to installing OBIEE Server.
As I stated earlier, OBIEE Server cannot be installed on root. We created a user obi which we will utilize during installation. So we need to modify the bash profile for user obi.

Log out of your current user, and into user obi.

In your bash shell terminal, run the following command:

vi ~/.bash_profile

and modify it to include:

# Java Home
JAVA_HOME=/usr/java/jdk1.5.0_22
export JAVA_HOME
After you save your changes, restart your machine , log back into obi and in terminal , run:

Or sourch the bash file like   terminal(. .bash_profile)
echo $JAVA_HOME
you should get the following output:

/usr/local/java/jdk1.5.0_22

You now have:
1) JDK installed
2) a user called obi
3) user obi has access to /usr/local/java folder
4) user obi has an environmental variable called JAVA_HOME

Notice how we haven't even downloaded or installed OBIEE yet. This is fundamental pre-work that must be done. Take the time to understand this and do not proceed until echo $JAVA_HOME is populated and obi user has read/write access to /usr/local/java.

PART 2:
Step 1 : Modification of bash shell script to include Oracle Environmental Variables


The OBIEE 10g installation is going to look for the following variables in your bash profile:

1) $JAVA_HOME
2) $PATH  - modified to include your OBI Set up folder

We created the $JAVA_HOME variable in step 1, so let's go ahead and modify our bash shell script to include the OBI Set up folder for the $PATH variable

For user account OBI, run the following command in terminal:
vi ~/.bash_profile

modify the bash shell start up script to include 

# OBI Setup Script

PATH=$PATH:/usr/local/OracleBI/setup

export PATH

Also, set the file descriptor limit to 10240 

# File Descriptor Limit

ulimit -n 10240 


step 2: Create installation folders & grant required access

Oracle Analytics Server uses /u05/local/OracleBI/setup and /u05/local/OracleBIData/setup for installation and execution. We need to create those folders and grant our user obi read write access:

Log into your root/super user account or have the sys admin execute the following commands:
 
mkdir -p /u05/local/OracleBI

chown -R obi:obi /u05/local/OracleBI

chmod -R 775 /usr/local/OracleBI

mkdir -p /u05/local/OracleBIData

chown -R obi:obi /u05/local/OracleBIData

chmod -R 775 /usr/local/OracleBIData

mkdir -p /u05/local/OracleBI/setup
mkdir -p /u05/local/OracleBIdata/setup
Step 3: Confirm /dev/random and /dev/urandom are available

Oracle BI  Presentation Services requires pseudo random number generation devices. Confirm your system has urandom and random installed:
In terminal, run the following command:

[root@oel11g ~]# cd /dev
[root@oel11g dev]# ls *random
random  urandom

You should see the following output:

random  urandom

Step 4: Download Oracle BI Suite EE 10.1.3
and download x86 (Red Hat Linux / Oracle Enterprise Linux)

Then extract the file to your /tmp folder. You should have 2 folders:

drwxrwxr-x  3    59934 obi       4096 May 24 10:40 Server
drwxrwxr-x  5    59934 obi       4096 May 24 10:41 Server_Ancillary

Using your root/super user account, execute (or have the sys admin) the following commands:

chown -R obi:obi /tmp/Server
chmod -R 775 /tmp/Server
chown -R obi:obi /tmp/Server_Ancillary
chmod -R 775 /tmp/Server_Ancillary

Step 5: Run final compatibility check with UnixChk.sh


Oracle created a script which will determine if you've successfully completed all of the pre-work needed for installation.
In terminal, run the following command:
./UnixChk.sh -b /u05/local/OracleBI 

You should get the following output: 

SUCCESS!! - This machine is configured for Oracle BI EE 10.1.3.3.2

Step 6: Proceed with installation


Congratulations, you've completed all of the required pre-work needed to install OBIEE! Let's get started! Navigate to your /u05/local/OracleBI/setup folder and run the following command as a obi user

if any error through like permission problem follow below steps.
As the Java Development Kit 1.5.0 or greater installation location and all its files and subdirectories must have the writable user or user group permissions for the user installing Oracle Business Intelligence, run the following as root:
chmod -R 777 /usr/java/jdk1.5.0_22

./setup.sh

You will be asked to identify your java directory, installation type and installation folder.
Here are the details:
  • Installation Location: /u05/local/OracleBI
  • Data Location: /u05/local/OracleBIData
  • Installation Type: Basic
  • JDK Location: /usr/java/jdk1.5.0_22 or higher
select next options in the installer.

Just Click on Next to continue the installation process.
Next Screen will appear like following. Here you have to give the folder name where you want to install the OBIEE 10g. It will ask to folder Names. 
     
/u05/local/oracleBI/ for Admin Tool Process related with OracleBIServer Service
/u05/local/OracleBIData for Webcatalog related with oracleBIPresentationService

FYI: Basic vs Advanced Installation Primer:

Basic installation uses the J2EE Application Server rather than the Oracle Application Server. If you want to utilize single sign on, select Advanced.

select basic installation options select next.

with the above option, Select Basic Option and Click Next

4. Next Screen will give the choice that what are the component we want with the installation. Select "Complete" and Click Next

choose the complete setup options then select next.


5. This screen will give what are the components of OBIEE 10g going to install. By default all the components are selected. If you don't want any of the components, you have the choice to unselect it.

select to next.

6. In the following screen, we have to specify the installed JDK Location and Enter OC4JAdmin Password. Keep that in Mind. This password is getting used to Login with Enterprise Manager and to UnInstall the OBIEE.


choose the jdk location and select the administrator password then continue 


8. After the changes, Click Next button and select which language you want to see the Error Message Language Selection

select language.

9.  So, The installation will start with the following Screen and It will take some moment to install all the components of OBIEE 10g

preview select continue.

10. We will get Installing OBIEE Components 100% Screen and following that the other screen also will come.

 installation continue

select next 

then select restart finish.                                   

Restore the JDK directory permission as root:
chmod -R 755 /usr/java/jdk1.5.0_22

Step 7: Start Services

Now that you've installed OBIEE Server & Presentation services, you need to activate it by running the following scripts from your /usr/local/OracleBI/setup folder:
./oc4j -start # starts Oracle Application Server
./run-sa.sh start # starts BI server
./run-saw.sh start # starts presentation server
./run-ccs.sh start  # Oracle BI Cluster Controller


To shutdown the server, you need to run the commands in the opposite order:

./run-ccs.sh stop
./run-saw.sh stop
./run-sa.sh stop
./oc4j -shutdown -port ---- -password oc4jadmin 

Installation complete and check the BI server username/password is Administrator/ Administrator is located on http://hostname.domainname.net:portnumber/analytics.

Thursday 28 November 2019

Working on oracle tablespace..


SQL> CREATE TABLESPACE svss DATAFILE '/u02/oracle/svss/svss01.dbf' SIZE 50m EXTENT MANAGEMENT LOCAL AUTOALLOCATE;

AUTOALLOCATE causes the tablespace to be system managed with a minimum extent size of 64K.
The alternative to AUTOALLOCATE is UNIFORM. which specifies that the tablespace is managed with extents of uniform size. You can specify that size in the SIZE clause of UNIFORM. If you omit SIZE, then the default size is 1M. The following example creates a Locally managed tablespace with uniform extent size of 256K

SQL> CREATE TABLESPACE svss DATAFILE '/u02/oracle/svss/svss01.dbf' SIZE 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K;

To Extend the Size of a tablespace

 Option 1         
 You can extend the size of a tablespace by increasing the size of an existing datafile by typing the following command
SQL> alter  database svss datafile ‘/u01/oracle/data/svss01.dbf’ resize 100M;
This will increase the size from 50M to 100M
  
Option 2
You can also extend the size of a tablespace by adding a new datafile to a tablespace. This is useful if the size of existing datafile is reached o/s file size limit or the drive where the file is existing does not have free space. To add a new datafile to an existing tablespace give the following command.
SQL> alter tablespace svss add datafile  /u02/oracle/svss/svss02.dbf’ size 50M;

Option 3
You can also use auto extend feature of datafile. In this, Oracle will automatically increase the size of a datafile whenever space is required. You can specify by how much size the file should increase and Maximum size to which it should extend.
To make a existing datafile auto extendable give the following command
SQL> alter database datafile ‘/u01/oracle/svss/svss01.dbf’ auto extend ON next 5M maxsize 500M;
You can also make a datafile auto extendable while creating a new tablespace itself by giving the following command.
SQL> create tablespace svss datafile ‘/u01/oracle/svss/svss01.dbf’ size 50M auto extend ON next 5M maxsize 500M;



You can decrease the size of tablespace by decreasing the datafile associated with it. You decrease a datafile only up to size of empty space in it. To decrease the size of a datafile give the following command
SQL> alter database datafile ‘/u01/oracle/svss/svss01.dbf’ resize 30M;

Taking tablespaces Offline or Online


You can take an online tablespace offline so that it is temporarily unavailable for general use. The rest of the database remains open and available for users to access data. Conversely, you can bring an offline tablespace online to make the schema objects within the tablespace available to database users. The database must be open to alter the availability of a tablespace.
To alter the availability of a tablespace, use the ALTER TABLESPACE statement. You must have the ALTER TABLESPACE or MANAGE TABLESPACE system privilege.
To Take a Tablespace Offline give the following command
SQL>alter tablespace svss offline;
To again bring it back online give the following command.
SQL>alter tablespace svss online;



Making a tablespace read-only prevents write operations on the datafiles in the tablespace. The primary purpose of read-only tablespaces is to eliminate the need to perform backup and recovery of large, static portions of a database. Read-only tablespaces also provide a way to protecting historical data so that users cannot modify it. Making a tablespace read-only prevents updates on all tables in the tablespace, regardless of a user's update privilege level.
To make a tablespace read only
SQL>alter tablespace svss read only
Again to make it read write
SQL>alter tablespace svss read write;


You can drop a tablespace and its contents (the segments contained in the tablespace) from the database if the tablespace and its contents are no longer required. You must have the DROPTABLESPACE system privilege to drop a tablespace.
Caution: Once a tablespace has been dropped, the data in the tablespace is not recoverable. Therefore, make sure that all data contained in a tablespace to be dropped will not be required in the future. Also, immediately before and after dropping a tablespace from a database, back up the database completely
To drop a tablespace give the following command.

SQL> drop tablespace svss;
This will drop the tablespace only if it is empty. If it is not empty and if you want to drop it anyhow then add the following keyword

SQL>drop tablespace svss including contents;

This will drop the tablespace even if it is not empty. But the datafiles will not be deleted you have to use operating system command to delete the files.
But If  you include datafiles keyword then, the associated datafiles will also be deleted from the disk.

SQL>drop tablespace svss including contents and datafiles;


Temporary tablespace is used for sorting large tables. Every database should have one temporary tablespace. To create temporary tablespace give the following command.
SQL>create temporary tablespace temp tempfile ‘/u01/oracle/data/svss_temp.dbf’ size 100M 
   extent management local  uniform size 5M;

The extent management clause is optional for temporary tablespaces because all temporary tablespaces are created with locally managed extents of a uniform size.  The AUTOALLOCATE clause is not allowed for temporary tablespaces.

Increasing or Decreasing the size of a Temporary Tablespace

You can use the resize clause to increase or decrease the size of a temporary tablespace. The following statement resizes a temporary file:

SQL>ALTER DATABASE TEMPFILE '/u02/oracle/data/temp02.dbf' RESIZE 18M;

The following statement drops a temporary file and deletes the operating system file:
SQL> ALTER DATABASE TEMPFILE '/u02/oracle/data/temp02.dbf' DROP  INCLUDING DATAFILES;