Saturday, April 23, 2011

Oracle Apps R12 installation step by step and planned.

Hi,
R12 installation is one of the crucial task for Apps DBA.Below are the steps described:

Preparation for Oracle Apps R12 Installation:
User & Mount point/File system :

We have created two users for installing Oracle R12 Application (one for database tier & another for middle tier also called as application tier). We need 73 GB space (45GB DB & 28GB application tier)

1)Create groups & Users for Oracle R12 Application software installation:
su - root
#groupadd dba => group of users to be granted SYSDBA system privilege
#groupadd oinstall => group owner of Oracle files
#useradd -m -c -g oinstall -G dba oracle =>For Database tier
#useradd -m -c -g oinstall -G dba applmgr =>For Application tier
passwd oracle
passwd applmgr

2) Minimum Requirement for Oracle R12 Application installation:
CPU & RAM
CPU 1.6 GHz
RAM 1GB
Staging Area

We need to use adautostg.pl available in Start Here CD.Advantage of using staging area is that after start CD you don’t have to manually insert CD’s and Installer will automatically pick next CD from staging Area. We can pass on configuration setting on first 3-4 screens & once installer starts we can see complete installation. In case of any failure or subsequent installations (If you have to install more than one Instance its always better to install using Staging Area)

[root@test]# more /etc/hosts
127.0.0.1 localhost.localdomain localhost
Open your hosts file wiht editor(I will use vi editor in this article),put your info in this file and save it. In this article my localhost will be test, my localdomain will be helios.com
PS: If you are using standalone server or pc you can give use any domain name you want. But if your server or pc on any domain you must use localdomain.
[root@test]# vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
10.100.x.x test.helios.com test

2. Set Kernel Parameters:
Add following line in end of the /etc/sysctl.conf file.
[root@test]# vi /etc/ sysctl.conf
#R12.1.1 kernel settings
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 256 32000 100 142
fs.file-max = 327679
net.ipv4.ip_local_port_range = 10000 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=4194304
#full qualified hostname(format is host.localdomain) << optional
kernel.hostname = test.helios .com << optional
#correct domain name !! << optional
kernel.domainname = helios.com << optional
After this steps you must set your new settings wiht below command:
/sbin/sysctl –p

3. Update /var/tmp/.oracle with 777 permissions
chmod 777 /var/tmp/.oracle
4. Edit /etc/security/limits.conf file:
Add the following lines to the /etc/security/limits.conf file:
[root@test]# vi /etc/ security/limits.conf
* hard nofile 65535
* soft nofile 4096
* hard nproc 16384
* soft nproc 2047

5. Edit /etc/resolv.conf file:
Add the following lines to the /etc/resolv.conf file:
options attempts:5
options timeout:15

6. Check /etc/sysconfig/network files format:
Verify that the /etc/sysconfig/network file is formatted as follows:
HOSTNAME=[node_name].[domain_name]

7. If the /etc/sysconfig/networking/profiles/default/network file exists, remove it.
If you changed any files in the previous steps, restart the system.
Be sure we have below rpms on our system:
The following i386 packages must be installed from the OEL 5 or RHEL 5 distribution media:
• compat-glibc-2.3.4-2.26
• gcc-4.1.2-14.el5
• gcc-c++-4.1.2-14.el5
• glibc-2.5-123
• glibc-common-2.5-123
• glibc-devel-2.5-12
• libgcc-4.1.2-14.el53
• libstdc++-devel-4.1.2-14.el5
• libstdc++-4.1.2-14.el53
• make-3.81-1.13
• gdbm-1.8.0-26.2.13
• libXp-1.0.0-8.1.el5
• libaio-0.3.106-3.23
• libgomp-4.1.2-14.el5
• sysstat-7.0.0-3.el5
• compat-libstdc++-296-2.96-138
• compat-libstdc++-33-3.2.3-61
Additionally, the following RPMs are required for an 11gR1 Database (which is bundled with the 12.1.1 release) on the database tier:
• elfutils-libelf-devel-0.125
• elfutils-libelf-devel-static-0.125
• libaio-devel-0.3.106
• unixODBC-2.2.11
• unixODBC-devel-2.2.11
• kernel-headers-2.6

Create folder for Oracle E-Business Suite R12.1.1 installation
Firstly check the mount point size of server.
As we can see i have free space, so i will create my stage folder and my installation folder on this mount point.
[root@test]# cd /data
[root@test data ]#mkdir TESTR12
Here we are doing Fresh Installation .Give 777 to installation folder.
[root@test]# chmod 777 /data/TESTR12
Create related folder for Application and Database tier(optional):
we want to put application tier installation folder together(also database tier installation folder) together we can create 2 subfolders under my main installation folder TESTR12.
[root@test]# cd /data/TESTR12
[root@test TESTR12]# mkdir apps
[root@test TESTR12]#mkdir db

We must give permisson to our user for can make installation of those folder
[root@testR12]# chown –R appltest:dba /data/TESTR12/apps
[root@testR12]# chown –R oratest:dba /data/TESTR12/db
C. Installation wizard steps:
D. After Installing of R12 Application:
Perform the following steps after installing or upgrading to Release 12.1.1 and before allowing users to access the system.
Relink Advanced Supply Chain Planning executables (for SLES 10 and OEL/RHEL 5.4 or higher only)
During the relink phase of the installation of EBS Release 12 (12.1.1) on OEL/RHEL 5.4 (failures will result while relinking the Advanced Supply Chain Planning (ASCP) executables. To fix this problem, users are required to replace the following line under the Linux section of the $AD_TOP/bin/adrelinknew.sh:
CPP_LDFLAGS=' -L$(ORACLE_HOME)/lib -L$(ORACLE_HOME)/lib/stubs -lclntsh'
with
CPP_LDFLAGS=' -L$(ORACLE_HOME)/lib -L$(ORACLE_HOME)/lib/stubs -lclntsh -Wl,--noinhibit-exec'
After making this change, users are then required to run the adadmin utility and relink application executables.


Hope it helps.

Best regards,

Rafi.

Step by step migration of schemas from Windows server Oracle10g Database to Linux Oracle 11g Database

Hi,
Migration of Data from One operating system to other is one of the common task going on in IT company and DBA's job in the current trend specially when Oracle 11g release2 planned to use by many organization because of huge advantages.Here I'm describing the steps to do it.The best way to do any migration task will be prepare
a plan in WORD document format and review and recheck with your Senior DBA members to know the best possible method and than going for the actual implementation.The actual
implemented steps are described below:


Migration from SOURCEDB1 to TARGETDB1:
--------------------------------------

I'm going to use Datapump for migrating from SOURCEDB1(Oracle 10g) to TARGETDB1(Oracle 11g) Database.


General information:
---------------------


Source:
---------

OS version: Windows Server 2003 R2
Database version:10.2.0.4.0
Database size:33 GB


Target:
---------

OS version:RHEL 5.4
Database version:11.2.0.1.0

SCHEMAS TO MIGRATE:TESTTOOL,TESTTOOLMIG,TESTTOOLQA,TESTD,TESTD_TEST,TEST3CNS,TESTHP,TEST_USR


STEP 1: CREATE USER FOR OUR MIGRATION PURPOSE WITH ENOUGH PRIVILEGES
------


SQL> create user MIGTEST
2 identified by MIGTEST;

User created.

SQL> grant dba to MIGTEST;


SQL> select name from v$database;

NAME
---------
SOURCEDB1

SQL> alter user MIGTEST identified by welcome123;

User altered.

SQL> alter user MIGTEST default tablespace users;

User altered.


Grant succeeded.

Step 2: CREATE DIRECTORY FOR DATAPUMP
-------

Create one directory for Datapump and point it to a directory where we have to
keep our dump files of datapump
Note: This location of keeping dump files should have enough space.

Directory Creation:
-------------------

SQL> CREATE DIRECTORY SOURCEDB1_MIG AS 'D:\ACEDBMIG';

Directory created.

GRANT Permission:
-----------------

SQL> GRANT READ,WRITE ON DIRECTORY SOURCEDB1_MIG TO MIGTEST;

Grant succeeded.


VERIFYING THE LOCATION:
---------------------------

SQL> select *from dba_directories;

OWNER DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
---------------------------------------------------------------------
SYS SOURCEDB1_MIG
D:\SOURCEDB1

STEP 3: EXPORT THE SCHEMAS WHICH WE WANT TO MIGRATE:
------------------

Here I'm create one parameter file for export where I'm specifying
schemas which I want to export.The details and usage of this parameter can
be obtained from command 'expdp help=y' and very much self explanatory.


a) create one parfile(.par):
----------------------------


mig_expdp_SOURCEDB1_12APR_2011.par:
________________________________

SCHEMAS=TESTTOOL,TESTTOOLMIG,TESTTOOLQA,TESTD,TESTD_TEST,TEST3CNS,TESTHP,TEST_USR
DIRECTORY= SOURCEDB1_MIG
DUMPFILE=mig1_expdp_SOURCEDB1_12APR_2011.dmp
LOGFILE=mig1_expdp_SOURCEDB1_12APR_2011.log
EXCLUDE=STATISTICS
CONTENT=ALL
JOB_NAME=mig_expdp_SOURCEDB1_12APR_2011
PARALLEL=2

b)Create one batch file(.bat):
----------------------------------


SOURCEDB1_MIG_12APR2011.bat:
__________________________

expdp MIGTEST/MIGTEST PARFILE=E:\TEST_work\SOURCEDB1 _MIG_UGALAXY\mig_expdp_SOURCEDB1_12APR_2011.par

We can execute the above batch file by double clicking it.Check the dump file location it
will be surely in the path 'D:\ACEDBMIG'(This is the path which you have used for creating
Datapump Directory).Check the log file for any errors or warnings.

STEP 4:COPY THE DUMPFILE FROM SOURCE DATABASE SERVER(WINDOWS) TO TARGET DATABASE SERVER(LINUX)
-------

For copying the dumpfile I used winscp to copy it to my windows machine and than transferred to linux target
server,however you can use ftp or any other technique.


STEP 5:CREATE THE DIRECTORY FOR THE DATAPUMP IMPORT:
------


create directory IMP_MIGRATE_UGALAXY as '/u04/UGALAXY/ACEDB_MIGRAT_DUMPS';

grant read,write on directory IMP_MIGRATE_UGALAXY to system;

STEP 6:IMPORT THE DUMP IN THE TARGET DATABASE:
------


The import scripts are:
-----------------------

vi impdp_job_Apr13_2011.sh

impdp system/manager DIRECTORY=IMP_MIGRATE_UGALAXY REMAP_SCHEMA=TESTTOOL:TESTTOOL,TESTTOOLMIG:TESTTOOLMIG,
TESTTOOLQA:TESTTOOLQA,TESTD:TESTD,TESTD_TEST:TESTD_TEST,TEST3CNS:TEST3CNS,TESTHP:TESTHP,TEST_USR:TEST_USR
DUMPFILE=MIG1_EXPDP_ACEDB_12APR_2011.DMP LOGFILE=MIG1_EXPDP_ACEDB_12APR_2011.log

To run impdp job:
------------------


nohup sh impdp_job_Apr13_2011.sh >a.out


Once the import is completed check the logfiles for errors and warnings.

STEP 7: Validation of Data:
------


Validating the Data:
--------------------
Once the import is done successfully verify the object imported.Compare the Source and Target Databases:


Source Database(Oracle 10g rel2):
----------------
SQL>select count(*) from dba_objects where owner in('TESTTOOL','TESTTOOLMIG','TESTTOOLQA','TESTD','TESTD_TEST','TEST3CNS','TESTHP','TEST_USR');

Target Database(Oracle 11g rel2):
----------------
SQL>select count(*) from dba_objects where owner in('TESTTOOL','TESTTOOLMIG','TESTTOOLQA','TESTD','TESTD_TEST','TEST3CNS','TESTHP','TEST_USR');


Check for the invalid objects in Target Database side:
--------------------------------
SQL> select owner||' '||object_name||' '||status from dba_objects
where STATUS='INVALID';


Compile the invalid object using the below script:
-------------------------------------------------

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

Recheck again and compile:
---------------------------

SQL> select owner||' '||object_name||' '||status from dba_objects
where STATUS='INVALID';


Comparison of privs:
----------------------


Source:
----------
1)Object privs:
------------------
select grantee||' '||owner||' '||table_name||' '||privilege from dba_tab_privs
where owner in('TESTTOOL','TESTTOOLMIG','TESTTOOLQA','TESTD','TESTD_TEST','TEST3CNS','TESTHP','TEST_USR');

2)System privs:
----------------
select grantee||' '||privilege from dba_sys_privs
where grantee in ('TESTTOOL','TESTTOOLMIG','TESTTOOLQA','TESTD','TESTD_TEST','TEST3CNS','TESTHP','TEST_USR');


Target:
------------

1)Object privs:
------------------
select grantee||' '||owner||' '||table_name||' '||privilege from dba_tab_privs
where owner in('TESTTOOL','TESTTOOLMIG','TESTTOOLQA','TESTD','TESTD_TEST','TEST3CNS','TESTHP','TEST_USR');

2)System privs:
----------------
select grantee||' '||privilege from dba_sys_privs
where owner in('('TESTTOOL','TESTTOOLMIG','TESTTOOLQA','TESTD','TESTD_TEST','TEST3CNS','TESTHP','TEST_USR');

In my upcoming posts I will be posting the issues which I faced after doing migration and how I resolve them.Hope it helps


Best regards,

Rafi.

Unix operating system interview questions for DBA

Hi,
Below are some of the most important interview questions from Operating system
point of view to a DBA.

1)How can you check the files permission in Unix OS?
Ans: 'ls' command with the below option is used for checking files permission.
$ ls -altr
total 198
drwxr-xr-x 2 root root 4096 Aug 8 2008 srv
drwxr-xr-x 2 root root 4096 Aug 8 2008 mnt
drwxr-xr-x 3 root root 4096 Mar 7 05:10 home
drwxr-xr-x 7 root root 4096 Mar 7 05:47 lib64

2)How can you schedule job in Unix OS?
Ans: 'crontab' command is used for scheduling job in Unix OS.Crontab can be installed and removed as followed:

For commands that need to be executed repeatedly (e.g. hourly, daily or weekly), use crontab, which has the following options:

crontab filename Install filename as your crontab file.
crontab -e Edit your crontab file.
crontab -l Show your crontab file.
crontab -r Remove your crontab file.

Eg: Create a backup script as per your backup strategy and schedule as per strategy

$ vi backupdb.sh

. $HOME/.profile
export ORACLE_SID=
rman nocatalog << EOF
connect target
# backup controlfile
configure controlfile autobackup on;
# backup database,archivelogs and delete backed up archivelogs
backup database plus archivelog delete input;
# delete obsolete
delete obsolete;
yes
EOF

:wq
=>save and quit

Note: In the line ". $HOME/.profile" there has to be a space between . and $, to execute .profile in current shell.
Now schedule it with crontab(cronjob) command.
crontab -e

30 20 * * 1,3,5 /u01/backupdb.sh 1>/u01/backupdb.log 2>&1

:wq
=>save and quit displays the below message.

crontab: installing new crontab

Meaning: 00 =>seconds 00-59,Here it is 30 minutes;
20=>hours in a day 00-23,Here it is 8 pm;
*=>Day of the month,1-30,Here * signify the value does not apply
*=>Month of the year,1-12,Here * signify the value does not apply
1,3,5 =>Day of the week,0-6,Here 1,3,5 is monday,wednesday,friday.

/u01/backupdb.sh=>our backup script
> =>for overriding the content
/u01/backupdb.log =>for checking the output after the scheduled job is executed
& =>for running in backup

3)Which tool you use to copy files from windows to linux or linux to windows?
Ans: Winscp can be used for copying files from windows to linux.Winscp is easy to install GUI based utility for copying files in binary mode by default.Howerver 'ftp' command line utility can also be used.

4)How can you search file in Unix OS?
Ans: Using 'find' command we can search file in unix OS.

$ find /home/oracle -name "*.vim*" -print
/home/oracle/.viminfo

where: /home/oracle: path of the directory where you are searching file.

5)Which command is used to see the disk space details in Unix OS?
Ans: We use 'df -h' =>Linux OS, 'bdf' =>HP-UX OS,'df -g' =>AIX 0S

]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 5.7G 4.0G 1.5G 73% /
/dev/sda7 4.9G 4.1G 516M 90% /u01
/dev/sda3 6.3G 2.7G 3.3G 46% /u03
/dev/sda2 34G 32G 720M 98% /u02

Note: In IBM-AIX OS we have to use 'df -g' ; In HP-UX OS we have to use 'bdf' for checking the Disk Space details .

6) Which comand is used to see files usage details in Unix OS?
Ans:'du' command is used to see directories and file usage details in Unix OS.

$ cd /u01
[oracle@node1.u01]$ du -csh *
16K lost+found
756K oracle
4.1G oracle11g

7)Which command is used to schedule job without user intervention and backend?
Ans: 'nohup' command is used to run a command without user intervention.If we use '&' symbol than the command will run in backend.'nohup' command is my favourite command for running export and import jobs.I use this command very often.

Eg: nohup sh file_name.sh >file_output.out &

8)What are frequently used OS command for DBA's?
Ans: mkdir =>for creating directories in Unix OS; cd =>For changing the directory;
rm =>For removing files;rmdir =>For removing directories;grep =>For searching characters in a file; man =>User manual for all commands; useradd=>for creating OS user; chmod=For granting permission to files and Directories;chown=>For changing ownership of Directories.

Eg: mkdir test =>Create test directory
cd /u01/test =>Will change the path of Directory
man grep =>user manual for all command man has it own advantage.
chmod -R 775 /u01/test =>Grants permissions as read,write,execute to owner,groups
useradd -d oracle =>For Creating Operating system user as Oracle.

9)Which command is used to copy or synchronizing two Directories in a secure way on any Unix environment?
Ans : 'rsync' command can be used to copy or synchronize two directories.It is very important command and very handy tool for copying files fast for a DBA,Ofcourse
'scp' can also be use.But I really like using 'rsync' .Below is the example:

Eg:
----
[oracle@node1 HEALTH_CHECK_DB]$ rsync -av /u04/HEALTH_CHECK_DB/ /u05/SCRIPTS_DBA_TASKS/
building file list ... done
./
Database_status.sh
archive_gen.sql
c:&FileName._TESTDB1_20110509.html
c:&FileName._TESTDB2_20110509.html
db_monitor.sql
health_check.sql

sent 4225122 bytes received 158 bytes 8450560.00 bytes/sec
total size is 4224061 speedup is 1.00
[oracle@node1 HEALTH_CHECK_DB]$ cd ..
[oracle@node1 u04]$ cd /u05/SCRIPTS_DBA_TASKS/
[oracle@node1 SCRIPTS_DBA_TASKS]$ ls -altr
total 4176
-rwxrwxrwx 1 oracle dba 1815 Mar 27 23:53 archive_gen.sql
-rwxrwxrwx 1 oracle dba 2724 Mar 27 23:59 db_monitor.sql
-rw-r--r-- 1 oracle dba 1233385 May 9 11:40 health_check.sql
-rw-r--r-- 1 oracle dba 1421433 May 9 11:41 c:&FileName._TESTDB1_20110509.html
-rw-r--r-- 1 oracle dba 1564704 May 9 11:43 c:&FileName._TESTDB2_20110509.html
-rw-r--r-- 1 oracle dba 0 May 18 12:24 Database_status.sh
drwxrwxrwx 2 oracle dba 4096 May 18 12:24 .
drwxrwxr-x 9 oracle oinstall 4096 May 26 12:37 ..
-rwxrwxr-x 1 oracle dba 486 May 26 12:39 SCHEMA_CREATE_SCRIPT_TESTDB1_TESTDB2.sql
-rwxrwxr-x 1 oracle dba 846 May 26 14:06 profile_create.sql
-rwxrwxr-x 1 oracle dba 1252 May 27 20:44 crontab.oracle
-rwxrwxr-x 1 oracle dba 143 May 30 17:12 tablespace_create_script.sql

If you want to copy files from one linux(unix server) to other again it can be very handy,below is the syntax:

rsync -avc my_stuff2/ user@remotehost:~/mystuff3/

rsync copies only those files which are not copyied and this is definetly
useful in syncronizing source and destination directories.Hence it is very fast.

10)Which command is useful to see line by line display in Unix environment?
Ans: 'less' command is used to see line-by-line display('more' for page-by-page display).I find less more useful specially for seeing log files and to find the errors or Warnings in the log files.

Eg: less test1.log =>Will display test1.log file

11)Which command can be used to view file in readonly mode?
Ans:'view' command can be used to view file in readonly mode.A very good option to see cronjob file specially because at any this file should not get modified by mistake as all your daily jobs will be scheduled using cronjob.

Eg: view crontab.oracle

12)How we can delete the files which are few days(N days) old?
Ans:To save the disk space you might be deleting the old files or backup which are 1 week(2 weeks) old or depending on your Disk Space and other requirement.We should automate these tasks as a DBA.We can do this as follows:

For Unix environment:
-----------------------------------

Eg: If I want to delete files from a path which are 7 Days old:
Write one shell script as given below:

#remove_files_back.sh
#Removing 7 days old dump files
find /u03/DB_BACKUP_TESTDB/expdp_fulldb_backup -mtime +6 -exec rm {} \;

Where: find =>Finding the file; /u03/DB_BACKUP_TESTDB/expdp_fulldb_backup =>path;
-mtime=>Modified time,Here I'm giving 7 days(>6);-exec rm =>execute removing for files. Now as per your convenience schedule cronjob for doing this task,For example every sunday at 9 pm than:

00 21 * * 0 /u03/DB_BACKUP_TESTDB/expdp_fulldb_backup/remove_files_back.sh 2>&1 >/u05/DB_BACKUP_TESTDB/logs/CRONJOBS_LOGS/TESTDB_BACK_cron.log

Note: For Windows Environment you can create a .bat file as follows:

--remove_file_back.bat
forfiles /p "D:\dbbackup\testdb\daily" /s /d -7 /c "cmd /c del @file : date >=7 days >NUL"

Where:All files which are 7 days old are removed;D:\dbbackup\testdb\daily =>path.
However Please make a note Please don't use the above command for your /(root) directory or any software specified and confirm and test in test environment before using on the actual system.

14) How to FIND whether OS (kernel) is 32 or 64 bit in Unix Operating systems?
Ans: file /usr/bin/initdb

15)Which command can be use to convert Windows file to Unix file?
Ans: 'dos2unix' command can be use for this purpose.

After copying files with winscp use dos2unix utility to convert.
Unix uses a convention that a line is ended by a line feed character (Ascii 10). Windows/DOS uses a convention that a line is ended by a two character sequence, carriage-return line-feed (Ascii 13 then ascii 10). The dos2unix command converts for Windows/DOS format to Unix format. It writes the result to standard output. To write to a file, just redirect the standard output to the file. For example, use

$dos2unix myfile >mynewfile

Offcourse there are lot of useful commands which a DBA uses in Day-to-Day activities.If I come across few more useful commands I will attach this thread.

Hope it helps.

Happy UNIX OSs Learning


Best regards,

Rafi.

Monday, April 11, 2011

RAW Device and ASM for Oracle Database Creation on Linux & Solaris Platform

Hi,
We do have some doubts related to RAW Device and ASM when it comes to practical.
The below practical of mine can be useful to understand RAW Device and ASM and how both can be used to Create Database on Linux and Solaris Platform.

1.A)DATABASE CREATION ON RAW PARTITION ON LINUX:

Step 1:Create Logical volumes from Volume Group:
#pvcreate /dev/sdc
#pvdisplay – to display the information of volume
#vgcreate rawvg /dev/sdc
#vgdisplay -- to display the volume groups
#lvcreate –L 500 –n rawvg1 rawvg  for system (fixed)
#lvcreate –L 500 –n rawvg2 rawvg  for sysaux (fixed)
#lvcreate –L 500 –n rawvg3 rawvg  for undo
#lvcreate –L 250 –n rawvg4 rawvg  for temp
#lvcreate –L 160 –n rawvg5 rawvg  for example
#lvcreate –L 120 –n rawvg6 rawvg  for users
#lvcreate –L 120 –n rawvg7 rawvg  for redo logfiles
#lvcreate –L 120 –n rawvg8 rawvg  for redo logfiles
#lvcreate –L 120 –n rawvg9 rawvg  for redo logfiles
#lvcreate –L 110 –n rawvg10 rawvg  for control file
#lvcreate –L 110 –n rawvg11 rawvg  for control file
#lvcreate –L 110 –n rawvg12 rawvg  for control file
#lvcreate –L 5 –n rawvg13 rawvg  for spfile
#lvcreate –L 5 –n rawvg14 rawvg  for password file

Step 2:Grant ownership and permissions to your Logical volume:
chown oracle:oinstall /dev/rawvg/rawvg*
chmod 775 /dev/rawvg/rawvg*


Step 3:Create the configuration file for RAW DEVICE
create a text file orcl_raw.conf in /export/home/oracle

vi /export/home/oracle/orcl_raw.conf

system=/dev/rawvg/rawvg1
sysaux=/dev/rawvg/rawvg2
undotbs1=/dev/rawvg/rawvg3
temp=/dev/rawvg/rawvg4
example=/dev/rawvg/rawvg5
users=/dev/rawvg/rawvg6
redo1_1=/dev/rawvg/rawvg7
redo1_2=/dev/rawvg/rawvg8
red01_3=/dev/rawvg/rawvg9
control1=/dev/rawvg/rawvg10
control2=/dev/rawvg/rawvg11
control3=/dev/rawvg/rawvg12
spfile=/dev/rawvg/rawvg13
pwdfile=/dev/rawvg/rawvg14

Step 4:Create a Mapping file for Linux Understanding that it is RAW PARTITIONS

Linux does not support directly raw partitions, so we have to bind it explicitely to make linux understand that these are raw partitions.

DBCA_RAW_CONFIG=/export/home/oracle/raw_orcl.conf -- creation of mapping file
export DBCA_RAAW_CONFIG


vi /etc/sysconfig/rawdevices

/dev/raw/raw1 /dev/rawvg/rawvg1
/dev/raw/raw2 /dev/rawvg/rawvg2
/dev/raw/raw3 /dev/rawvg/rawvg3
/dev/raw/raw4 /dev/rawvg/rawvg4
/dev/raw/raw5 /dev/rawvg/rawvg5
/dev/raw/raw6 /dev/rawvg/rawvg6
/dev/raw/raw7 /dev/rawvg/rawvg7
/dev/raw/raw8 /dev/rawvg/rawvg8
/dev/raw/raw9 /dev/rawvg/rawvg9
/dev/raw/raw10 /dev/rawvg/rawvg10
/dev/raw/raw11 /dev/rawvg/rawvg11
/dev/raw/raw12 /dev/rawvg/rawvg12
/dev/raw/raw13 /dev/rawvg/rawvg13
/dev/raw/raw14 /dev/rawvg/rawvg14

#/sbin/service rawdevicess restart ----- to restart the rawdevices services
#/usr/bin/raw –qa ------ to view the binded raw devices

chown oracle:oinstall /dev/raw/raw*
chmod 775 /dev/raw/raw*

Step 5: RUN DBCA for creating Database
RUN THE DBCA AND CREATE THE DATABASE, MAKE SURE TO SELECT THE DATABASE TO BE CREATED ON RAW PARTITIONS.

**1.B)CREATING THE DATABASE WITH ASM ON LINUX:

Step 1: Create four partitions using fdisk utility like
/dev/sdb6
/dev/sdb7
/dev/sdb8
/dev/sdb9

Step 2:edit /etc/sysconfig/rawdevices and add following lines
/dev/raw/raw15 /dev/sdb6
/dev/raw/raw16 /dev/sbd7
/dev/raw/raw17 /dev/sdb8
/dev/raw/raw18 /dev/sdb9

Step 3:Now restart the raw devices services
/sbin/service rawdevices restart
To check it, /usr/bin/raw –qa

Step 4:Now we have to change the ownership to oracle user (software owner)
chown oracle:oinstall /dev/raw/raw*
chmod 775 /dev/raw/raw*

Step 5:Create the ASM Parameter file(i.e Parameter file for ASM Database)
#cd /export/home/oracle
#vi asminit.ora
Instance_name=+ASM
Instance_type=ASM
Asm_power_limit=1
Asm_diskstring=’/dev/raw/raw15’,’/dev/raw/raw16’.’/dev/raw/raw17’,’/dev/raw/raw18’
:wq

Step 6:Start Our ASM Instance
# cd $ORACLE_HOME/bin
./localconfig add => it will start the services for asm instance

Now login as Oracle USER and start the listener
$ lsnrctl start
$export ORACLE_SID=+ASM
$orapwd file=$ORACLE_HOME/dbs/orapw+ASM password=oracle
$sqlplus “/as sysdba”
>create spfile from pfile=’/export/home/oracle/asminit.ora’
>startup nomount
>create diskgroup dbgroup1 normal redundancy
Failgroup controller1 disk
‘/dev/raw/raw15’,
‘/dev/raw/raw16’
Failgroup controller2 disk
‘/dev/raw/raw17’,
‘/dev/raw/raw18’;

Step 7:Create the ASM Database using DBCA
* Open another terminal and run the dbca utility.

[ if after configuring the listner through netmgr,it is not working for connection string, then give following command on sql prompt,

>alter system register;

Cool your ASM Database is ready on Linux.Now lets try on Solaris platform.


** 2.A)DATABASE CREATION WITH RAW PARTITION ON SOLARIS :

 Make a replica
# metadb –a –f c1t1d0s6
#metadb –a –c 2 c1t1d0s7
#metadb –i  will display the information of replica
#metainit d4 1 4 c1t2d0s0 c1t2d0s1 c1t3d0s0 c1t4d0s1
#metainit d10 –p d4 500mb - system
#metainit d11 –p d4 500mb  sysaux
#metainit d12 –p d4 500mb  undotbs1
#metainit d13 –p d4 250mb  temp
#metainit d14 –p d4 160mb  example
#metainit d15 –p d4 120mb  users
#metainit d16 –p d4 120mb  redo1_1
#metainit d17 –p d4 120mb  redo1_2
#metainit d18 –p d4 120mb  control1
#metainit d19 –p d4 120mb  control2
#metainit d20 –p d4 5mb  spfile
#metainit d21 –p d4 5mb  pfile

 #chown oracle:oinstall /dev/md/rdsk/d*
 #chmod 775 /dev/md/rdsk/d*
 LOG IN AS ORACLE
 create a text file in ORACLE_HOME named dbname_raw.conf (where dbname is the name of the database u want to make)
$vi $ORACLE_HOME/dbname_raw.conf
System=/dev/md/rdsk/d10
Sysaux= /dev/md/rdsk/d11
Undotbs1=/dev/md/rdsk/d12
Temp=/dev/md/rdsk/d13
Example=/dev/md/rdsk/d14
Users=/dev/md/rdsk/d15
Redo1_1=/dev/md/rdsk/d16
Redo1_2=/dev/md/rdsk/d17
Control1=/dev/md/rdsk/d18
Control2=/dev/md/rdsk/d19
Spfile=/dev/md/rdsk/d20
Pfile=/dev/md/rdsk/d21
:wq

$export DBCA_RAW_CONFIG=$ORACLE_HOME/dbname_raw.conf
$dbca (enter)

**2.B)DATABASE CREATION WITH ASM ON SOLARIS :

 Create 4 slices named c1t2d0s3, c1t2d0s4,c1t2d0s5 and c1t2d0s6. we will use this slices for asm database creation.
 create init.ora file for asm
# cd /export/home
vi init.ora
instance_name=+ASM
instance_type=ASM
ASM_POWER_LIMIT=1
ASM_DISKSTRING=/dev/rdsk/c1t2d0s[3456]
:wq

#chown oracle:oinstall /dev/rdsk/c1t2d0s3
#chown oracle:oinstall /dev/rdsk/c1t2d0s4
#chown oracle:oinstall /dev/rdsk/c1t2d0s5
#chown oracle:oinstall /dev/rdsk/c1t2d0s6
#chmod 775 /dev/rdsk/c1t2d0s3
#chmod 775 /dev/rdsk/c1t2d0s4
#chmod 775 /dev/rdsk/c1t2d0s5
#chmod 775 /dev/rdsk/c1t2d0s6

 #cd $ORACLE_HOME/bin
#./localconfig add

 log out and log in as oracle user
$export ORACLE_SID=+ASM
$sqlplus “/as sysdba”
>create spfile from pfile=’/export/home/init.ora’
>startup nomount
> create diskgroup dbgroup1 normal redundancy
Failgroup controller1 disk
‘/dev/rdsk/c1t2d0s3’,
‘/dev/rdsk/c1t2d0s4’
Failgroup controller2 disk
‘/dev/rdsk/c1t2d0s5’,
‘/dev/rdsk/c1t2d0s6’;
>exit
$dbca (enter)


Hope it helps in understanding RAW and ASM better.

Best regards,

Rafi.

Friday, April 8, 2011

Apps DBA administration

Apps DBA administration:
--------------------------*******--------------------

Hi,
To maintain Oracle R12 Applictions the below article can be useful(Some changes are present in filesystem if you want to maintain for Oracle 11i which I will put in separate post to avoid confusions).

Whenever we are working with Oracle Application we have to make sure Oracle
Environment is set than you can proceed with the administration tasks based on the
requirements.So let us proceed with setting environment file which makes our Oracle Application server ready for doing administration tasks.
There are basically 2 environments file you need to set to start working with
ad scripts

Location of Environment files:

1)Application Environment file: The Application Environment file is located in the path where Application stack sits like '/oraAPP/apps/apps_st/appl' which is nothing but what we called as APPL_TOP

2)Application Database Environment file: The Database environment is present in Database technology stack like '/oraDB/db/tech_st/11.1.0'.


Step 1:Set the environment file for Applications:
Login as root user(Grant Applmgr or Oracle user the privilege to execute Environment files)

[root@test300949v20ebs appl]# cd /oraAPP/apps/apps_st/appl
[root@test300949v20ebs appl]# . VIS_test300949v20ebs.env
[root@test300949v20ebs appl]# pwd
/oraAPP/apps/apps_st/appl

(or)

[applmgr@test300949LX6 appl]$ . VIS_test300949lx6.env
[applmgr@test300949LX6 appl]$ pwd
/u01/oraEBS/apps/apps_st/appl
[applmgr@test300949LX6 appl]$ echo $APPL_TOP
/u01/oraEBS/apps/apps_st/appl
[applmgr@test300949LX6 appl]$ echo $INST_TOP
/u01/oraEBS/inst/apps/VIS_test300949lx6
[applmgr@test300949LX6 appl]$ echo $COMMON_TOP
/u01/oraEBS/apps/apps_st/comn


Step 2:Set the environment file for Application Database:

Login as root user and do the below steps for setting the environement files.
Setting of environment file plays major role in Applications as it create the
environment for working with AD utilities and working with various tops
like APPL_TOP,COMMON_TOP,INST_TOP,AD_TOP...

[root@test300949v20ebs tech_st]# cd /oraDB/db/tech_st/11.1.0
[root@test300949v20ebs 11.1.0]# . VIS_test300949v20ebs.env
[root@test300949v20ebs 11.1.0]# pwd
/oraDB/db/tech_st/11.1.0

(or)

[oracle@test300949LX6 11.1.0]$ . VIS_test300949lx6.env
[oracle@test300949LX6 11.1.0]$ pwd
/u01/oraEBS/db/tech_st/11.1.0


Step 3:Connect to sqlplus for obtaing URL for your Oracle E-businness suite home page.

Login as apps user(Apps user holds all the privileges in application)

Obtain the URL for the front end,which is also termed as Oracle E-business suite
home page as follows:

[oracle@test300949LX6 11.1.0]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.1.0.7.0 - Production on Tue Mar 22 22:07:15 2011

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select name from v$database;

NAME
---------
VIS

SQL> CONN APPS
Enter password:
Connected.
SQL> sho user
USER is "APPS"

SQL> select home_url from icx_parameters;

HOME_URL
--------------------------------------------------------------------------------
http://Test300949lx6.in.test.com:8000/OA_HTML/AppsLogin

The above URL is useful for login to your Front-end of Oracle E-businness suite and do lot of tasks.

Note: Like in Oracle Database there are few users in Oracle Applictions which are blessed with maximum privileges like sysadmin,apps...

sysadmin=>sysadmin user can login to Oraclee E-business suite home page and do lot of System administration tasks(Responsibility),he can create new users from front end and can do lot of tasks like viewing the status of patches which are application,status of Concurrent managers and so on...

apps=>apps user is like 'system' user of Database.In Apps it is having the access to all the objects of all the modules like (ar,gl,ap...),Whenever you are doing administration tasks in Application this user password is required.

Ofcourse there are many other users for each modules but for the initial stage of learning knowing the above user can be added to advantage.


Step 4:Working with AD Utilities:


All AD Utilities are found in $ADMIN_SCRIPTS_HOME path.We have to use this based on our requirements.Once you are ready with environment setting now you can direct go to the path where your scripts are located and other TOPs of your choice like APPL_TOP,COMMON_TOP,INST_TOP where your scripts are present.

[root@test300949v20ebs appl]# cd $ADMIN_SCRIPTS_HOME
[root@test300949v20ebs scripts]# ls -altr
total 268

-rwx------ 1 applmgr dba 5945 Mar 15 09:06 adstrtal.sh =>For starting all applications
-rwx------ 1 applmgr dba 5801 Mar 15 09:06 adstpall.sh =>For stopping all applications
-rwx------ 1 applmgr dba 7353 Mar 15 09:06 adalnctl.sh =>For starting/stopping RPC listeners
-rwx------ 1 applmgr dba 16547 Mar 15 09:06 adcmctl.sh =>For starting concurrent manager
-rwx------ 1 applmgr dba 1552 Mar 15 09:06 adautocfg.sh =>For running autoconfig
-rwx------ 1 applmgr dba 15332 Mar 15 09:06 adpreclone.pl =>For cloning apps
-rwx------ 1 applmgr dba 7181 Mar 15 09:06 adexecsql.pl =>For Executing sql scripts that update the profiles in an AutoConfig run.
-rwx------ 1 applmgr dba 2201 Mar 15 09:07 java.sh =>For Calling java executable with additional argumentss(It is used by opmn,Concurrent Managers)
-rwx------ 1 applmgr dba 2260 Mar 15 09:07 gsmstart.sh =>For starting/stopping FNDSM(i.e Standard concurrent manager)
-rwx------ 1 applmgr dba 8840 Mar 15 09:07 adformsctl.sh =>For starting/stopping forms services
-rwx------ 1 applmgr dba 8339 Mar 15 09:07 adapcctl.sh =>For starting/stopping Oracle HTTP/Apache/web services
-rwx------ 1 applmgr dba 8110 Mar 15 09:07 adoafmctl.sh =>For starting/stopping oafm(Oracle Application forms) OC4J
-rwx------ 1 applmgr dba 8102 Mar 15 09:07 adoacorectl.sh=>For starting/stopping oacore(Oracle Application core) OC4J
-rwx------ 1 applmgr dba 7376 Mar 15 09:07 adopmnctl.sh =>For starting/stopping OPMN(Oracle Process Manager & Notification)
-rwx------ 1 applmgr dba 10318 Mar 15 09:07 adformsrvctl.sh =>For starting forms services in socket mode

Note: Oracle Applications uses RPC server processes such as Report Review Agent (FNDFS) and OE Transaction
Manager (OEORPC) for listener ports.

Eg:
---
Starting All applications(services) :
--------------------------------------


[root@test300949v20ebs scripts]# ./adstrtal.sh =>Starts all the applications

You are running adstrtal.sh version 120.15


Enter the APPS username: apps

Enter the APPS password:
The logfile for this session is located at /oraAPP/inst/apps/VIS_test300949v20ebs/logs/appl/admin/log/adstrtal.log
Executing service control script:
/oraAPP/inst/apps/VIS_test300949v20ebs/admin/scripts/adopmnctl.sh start
script returned:
****************************************************

You are running adopmnctl.sh version 120.6

Starting Oracle Process Manager (OPMN) ...

adopmnctl.sh: exiting with status 0

adopmnctl.sh: check the logfile /oraAPP/inst/apps/VIS_test300949v20ebs/logs/appl/admin/log/adopmnctl.txt for more information ...


.end std out.

.end err out.

****************************************************


Executing service control script:
/oraAPP/inst/apps/VIS_test300949v20ebs/admin/scripts/adalnctl.sh start
script returned:
****************************************************

adalnctl.sh version 120.3

Checking for FNDFS executable.
Starting listener process APPS_VIS.

adalnctl.sh: exiting with status 1


adalnctl.sh: check the logfile /oraAPP/inst/apps/VIS_test300949v20ebs/logs/appl/admin/log/adalnctl.txt for more information ...


.end std out.

.end err out.

****************************************************


Executing service control script:
/oraAPP/inst/apps/VIS_test300949v20ebs/admin/scripts/adapcctl.sh start
script returned:
****************************************************

You are running adapcctl.sh version 120.7.12010000.2

Starting OPMN managed Oracle HTTP Server (OHS) instance ...

adapcctl.sh: exiting with status 0

adapcctl.sh: check the logfile /oraAPP/inst/apps/VIS_test300949v20ebs/logs/appl/admin/log/adapcctl.txt for more information ...


.end std out.

.end err out.

****************************************************


Executing service control script:
/oraAPP/inst/apps/VIS_test300949v20ebs/admin/scripts/adoacorectl.sh start
script returned:
****************************************************

You are running adoacorectl.sh version 120.13

Starting OPMN managed OACORE OC4J instance ...

adoacorectl.sh: exiting with status 0

adoacorectl.sh: check the logfile /oraAPP/inst/apps/VIS_test300949v20ebs/logs/appl/admin/log/adoacorectl.txt for more information ...


.end std out.

.end err out.

****************************************************


Executing service control script:
/oraAPP/inst/apps/VIS_test300949v20ebs/admin/scripts/adformsctl.sh start

Executing service control script:
/oraAPP/inst/apps/VIS_test300949v20ebs/admin/scripts/adoafmctl.sh start
script returned:
****************************************************

You are running adoafmctl.sh version 120.8

Starting OPMN managed OAFM OC4J instance ...

adoafmctl.sh: exiting with status 0

adoafmctl.sh: check the logfile /oraAPP/inst/apps/VIS_test300949v20ebs/logs/appl/admin/log/adoafmctl.txt for more information ...


.end std out.

.end err out.

****************************************************


Executing service control script:
/oraAPP/inst/apps/VIS_test300949v20ebs/admin/scripts/adcmctl.sh start
script returned:
****************************************************

You are running adcmctl.sh version 120.17.12010000.3

Starting concurrent manager for VIS ...
Starting VIS_0322@VIS Internal Concurrent Manager
Default printer is noprint

adcmctl.sh: exiting with status 0


adcmctl.sh: check the logfile /oraAPP/inst/apps/VIS_test300949v20ebs/logs/appl/admin/log/adcmctl.txt for more information ...


.end std out.

.end err out.

****************************************************


Executing service control script:
/oraAPP/inst/apps/VIS_test300949v20ebs/admin/scripts/jtffmctl.sh start
script returned:
****************************************************

You are running jtffmctl.sh version 120.3

Validating Fulfillment patch level via /oraAPP/apps/apps_st/comn/java/classes
Fulfillment patch level validated.
Starting Fulfillment Server for VIS on port 9300 ...

jtffmctl.sh: exiting with status 0


.end std out.

.end err out.

****************************************************

adstrtal.sh: Exiting with status 1

adstrtal.sh: check the logfile /oraAPP/inst/apps/VIS_test300949v20ebs/logs/appl/admin/log/adstrtal.log for more information .
[root@test300949v20ebs log]# cd /oraAPP/inst/apps/VIS_test300949v20ebs/logs/appl/admin/log
[root@test300949v20ebs log]# ls -altr
total 172
drwxr-xr-x 3 applmgr dba 4096 Mar 15 09:13 ..
drwxr-xr-x 2 applmgr dba 4096 Mar 16 00:47 .
-rw-r--r-- 1 applmgr dba 20172 Mar 21 21:45 adstpall.log
-rw-r--r-- 1 applmgr dba 2518 Mar 22 22:15 adopmnctl.txt
-rw-r--r-- 1 applmgr dba 14367 Mar 22 22:15 adalnctl.txt
-rw-r--r-- 1 applmgr dba 3234 Mar 22 22:15 adapcctl.txt
-rw-r--r-- 1 applmgr dba 3039 Mar 22 22:15 adoacorectl.txt
-rw-r--r-- 1 applmgr dba 3127 Mar 22 22:15 adformsctl.txt
-rw-r--r-- 1 applmgr dba 2961 Mar 22 22:15 adoafmctl.txt
-rw-r--r-- 1 applmgr dba 2509 Mar 22 22:15 adcmctl.txt
-rw-r--r-- 1 applmgr dba 33850 Mar 22 22:15 adstrtal.log
-rw-r--r-- 1 applmgr dba 1702 Mar 22 22:15 javacache.log
-rw-r--r-- 1 applmgr dba 9717 Mar 22 22:15 jtffmctl.txt
For viewing the logfiles the location is $APPL_TOP/admin/log

[root@test300949v20ebs log]#
[root@test300949v20ebs log]# pwd
/oraAPP/inst/apps/VIS_test300949v20ebs/logs/appl/admin/log =>logfiles location after running ad(Application database) scripts.

Note:
-----

As said above you can start any of the applications or services by going to
the $ADMIN_SCRIPTS_HOME

Eg:

To start concurrent manager:$./adcmctl.sh start
To stop concurrent manager:$./adcmctl.sh stop
To start Apache/HTTP server:$./adapcctl.sh start
To stop Apache/HTTP server:$./adapcctl.sh stop

Similarly we can start/stop other applications based on our need in the same way.

5)AD Administration(adadmin utility):

The main task of Apps DBA is to maintain the application with adadmin utility,Ofcourse there are other tasks like cloning and patching.First you have to set the environment.The environment file of Oracle Application which is located in APPL_TOP directory.
With 'adadmin' utilities you can do various tasks listed in the menu.Let me change
the maintainance mode which we do while applying patches.The other tasks are done whenever there is a need or request from developer to do so in your Oracle Applications.When you have upgraded your Oracle Application and whenever you applied a patch based on the module you have applied,than that time if the configuration gets changed we might have to use these 'adadmin' utility to make the configurations stable.

Working with ADUTILITIES(adamin)
[applmgr@test300949LX6 appl]$cd /u01/oraEBS/apps/apps_st/appl
[applmgr@test300949LX6 appl]$ . APPSVIS_test300949lx6.env
[applmgr@test300949LX6 appl]$ pwd
/u01/oraEBS/apps/apps_st/appl
[applmgr@test300949LX6 appl]$ adadmin

Copyright (c) 2002 Oracle Corporation
Redwood Shores, California, USA

Oracle Applications AD Administration

Version 12.0.0

NOTE: You may not use this utility for custom development
unless you have written permission from Oracle Corporation.

Your default directory is '/u01/oraEBS/apps/apps_st/appl'.
Is this the correct APPL_TOP [Yes] ?

AD Administration records your AD Administration session in a text file
you specify. Enter your AD Administration log file name or press [Return]
to accept the default file name shown in brackets.

Filename [adadmin.log] : adadmintest7.log

************* Start of AD Administration session *************
AD Administration version: 12.0.0
AD Administration started at: Wed Mar 23 2011 00:13:54

APPL_TOP is set to /u01/oraEBS/apps/apps_st/appl

You can be notified by email if a failure occurs.
Do you wish to activate this feature [No] ?

Please enter the batchsize [1000] :


Please enter the name of the Oracle Applications System that this
APPL_TOP belongs to.

The Applications System name must be unique across all Oracle
Applications Systems at your site, must be from 1 to 30 characters
long, may only contain alphanumeric and underscore characters,
and must start with a letter.

Sample Applications System names are: "prod", "test", "demo" and
"Development_2".

Applications System Name [VIS] : VIS *


NOTE: If you do not currently have certain types of files installed
in this APPL_TOP, you may not be able to perform certain tasks.

Example 1: If you don't have files used for installing or upgrading
the database installed in this area, you cannot install or upgrade
the database from this APPL_TOP.

Example 2: If you don't have forms files installed in this area, you cannot
generate them or run them from this APPL_TOP.

Example 3: If you don't have concurrent program files installed in this area,
you cannot relink concurrent programs or generate reports from this APPL_TOP.


Do you currently have files used for installing or upgrading the database
installed in this APPL_TOP [YES] ? YES *


Do you currently have Java and HTML files for HTML-based functionality
installed in this APPL_TOP [YES] ? YES *


Do you currently have Oracle Applications forms files installed
in this APPL_TOP [YES] ? YES *


Do you currently have concurrent program files installed
in this APPL_TOP [YES] ? YES *


Please enter the name Oracle Applications will use to identify this APPL_TOP.

The APPL_TOP name you select must be unique within an Oracle Applications
System, must be from 1 to 30 characters long, may only contain
alphanumeric and underscore characters, and must start with a letter.

Sample APPL_TOP Names are: "prod_all", "demo3_forms2", and "forms1".

APPL_TOP Name [test300949lx6] : test300949lx6 *



You are about to use or modify Oracle Applications product tables
in your ORACLE database 'VIS'
using ORACLE executables in '/u01/oraEBS/apps/tech_st/10.1.2'.

Is this the correct database [Yes] ?

AD Administration needs the password for your 'SYSTEM' ORACLE schema
in order to determine your installation configuration.

Enter the password for your 'SYSTEM' ORACLE schema:


The ORACLE username specified below for Application Object Library
uniquely identifies your existing product group: APPLSYS

Enter the ORACLE password of Application Object Library [APPS] :

AD Administration is verifying your username/password.
The status of various features in this run of AD Administration is:

<-Feature version in->
Feature Active? APPLTOP Data model Flags
------------------------------ ------- -------- ----------- -----------
CHECKFILE Yes 1 1 Y N N Y N Y
PREREQ Yes 6 6 Y N N Y N Y
CONCURRENT_SESSIONS No 2 2 Y Y N Y Y N
PATCH_TIMING Yes 2 2 Y N N Y N Y
PATCH_HIST_IN_DB Yes 6 6 Y N N Y N Y
SCHEMA_SWAP Yes 1 1 Y N N Y Y Y
JAVA_WORKER Yes 1 1 Y N N Y N Y
CODELEVEL Yes 1 1 Y N N Y N Y



Identifier for the current session is 542217

Reading product information from file...

Reading language and territory information from file...

Reading language information from applUS.txt ...

AD Administration warning:
Product Data File
/u01/oraEBS/apps/apps_st/appl/admin/zfaprod.txt
does not exist for product "zfa".
This product is registered in the database but the
above file does not exist in APPL_TOP. The product
will be ignored without error.


AD Administration warning:
Product Data File
/u01/oraEBS/apps/apps_st/appl/admin/zsaprod.txt
does not exist for product "zsa".
This product is registered in the database but the
above file does not exist in APPL_TOP. The product
will be ignored without error.


AD Administration warning:
Product Data File
/u01/oraEBS/apps/apps_st/appl/admin/jtsprod.txt
does not exist for product "jts".
This product is registered in the database but the
above file does not exist in APPL_TOP. The product
will be ignored without error.


Reading database to see what industry is currently installed.

Reading FND_LANGUAGES to see what is currently installed.
Currently, the following language is installed:

Code Language Status
---- --------------------------------------- ---------
US American English Base

Your base language will be AMERICAN.

Setting up module information.
Reading database for information about the modules.
Saving module information.
Reading database for information about the products.
Reading database for information about how products depend on each other.
Reading topfile.txt ...

Saving product information.

AD code level : [B.1]

AD Administration Main Menu
--------------------------------------------------

1. Generate Applications Files menu

2. Maintain Applications Files menu

3. Compile/Reload Applications Database Entities menu

4. Maintain Applications Database Entities menu

5. Change Maintenance Mode

6. Exit AD Administration


Enter your choice [6] :



Enter your choice [6] : 5

Change Maintenance Mode
----------------------------------------

Maintenance Mode is currently: [Disabled].


Maintenance mode should normally be enabled when patching
Oracle Applications and disabled when users are logged on
to the system. See the Oracle Applications Maintenance
Utilities manual for more information about maintenance mode.


Please select an option:

1. Enable Maintenance Mode

2. Disable Maintenance Mode

3. Return to Main Menu



Enter your choice [3] : 1

sqlplus -s &un_apps/***** @/u01/oraEBS/apps/apps_st/appl/ad/12.0.0/patch/115/sql/adsetmmd.sql ENABLE

Successfully enabled Maintenance Mode.

Review the messages above, then press [Return] to continue.


Backing up restart files, if any......Done.

Change Maintenance Mode
----------------------------------------

Maintenance Mode is currently: [Enabled].


Maintenance mode should normally be enabled when patching
Oracle Applications and disabled when users are logged on
to the system. See the Oracle Applications Maintenance
Utilities manual for more information about maintenance mode.


Please select an option:

1. Enable Maintenance Mode

2. Disable Maintenance Mode

3. Return to Main Menu


Enter your choice [3] : 2

sqlplus -s &un_apps/***** @/u01/oraEBS/apps/apps_st/appl/ad/12.0.0/patch/115/sql/adsetmmd.sql DISABLE

Successfully disabled Maintenance Mode.

Review the messages above, then press [Return] to continue.


Backing up restart files, if any......Done.

Change Maintenance Mode
----------------------------------------

Maintenance Mode is currently: [Disabled].


Maintenance mode should normally be enabled when patching
Oracle Applications and disabled when users are logged on
to the system. See the Oracle Applications Maintenance
Utilities manual for more information about maintenance mode.


Please select an option:

1. Enable Maintenance Mode

2. Disable Maintenance Mode

3. Return to Main Menu



Enter your choice [3] : 3

AD Administration Main Menu
--------------------------------------------------

1. Generate Applications Files menu

2. Maintain Applications Files menu

3. Compile/Reload Applications Database Entities menu

4. Maintain Applications Database Entities menu

5. Change Maintenance Mode

6. Exit AD Administration


Enter your choice [6] :
Please make sure you disable maintenance mode once your
patching activity is completed to avoid unnecessary issues.


Hope this helps our Beginner Apps DBAs for Administraton of Oracle R12 Applications.


Best regards,

Rafi.

Wednesday, April 6, 2011

Oracle 10g RAC on Linux Using NFS

Hi All,
There are various ways in which you can implement RAC,In this article I'm focussing on implementing it using NFS(Network File system),which I have done practically on OEL 4.6 in HP prolient servers,you can try this on vmware by choosing
ASM(Automatic Storage Management),since it is mostly used now a days because of various benefits,but the concept remain the same,there will change in shared storage setup and steps.

This article describes the installation of Oracle 10g release 2 (10.2.0.1) RAC on Linux (Oracle Enterprise Linux 4.6) using NFS to provide the shared storage.


• Introduction
• Download Software
• Operating System Installation
• Oracle Installation Prerequisites
• Create Shared Disks
• Install the Clusterware Software
• Install the Database Software
• Create a Database using the DBCA
• TNS Configuration
• Check the Status of the RAC
• Direct and Asynchronous I/O

1)Introduction:
NFS is an abbreviation of Network File System, a platform independent technology created by Sun Microsystems(Now its Oracle) that allows shared access to files stored on computers via an interface called the Virtual File System (VFS) that runs on top of TCP/IP. Computers that share files are considered NFS servers, while those that access shared files are considered NFS clients. An individual computer can be either a NFS server, a NFS client or both.

We can use NFS to provide shared storage for a RAC installation. In a production environment we would expect the NFS server to be a NAS, but for testing it can just as easily be another server or even one of the RAC nodes itself.

To cut costs, this articles uses one of the RAC nodes as the source of the shared storage. Obviously, this means if that node goes down the whole database is lost, so it's not a sensible idea to do this if you are testing high availability. If you have access to a NAS or a third server you can easily use that for the shared storage, making the whole solution much more resilient. Whichever route you take, the fundamentals of the installation are the same.

2)Download Software:
Download the following software.
• Oracle Enterprise Linux (4.6)
• Oracle 10g (10.2.0.1) CRS and DB software


3)Operating System Installation:
This article uses Oracle Enterprise Linux 4.6, but it will work equally well on CentOS 4 or Red Hat Enterprise Linux (RHEL) 4. A general pictorial guide to the operating system installation can be found here. More specifically, it should be a server installation with a minimum of 2.5G swap, firewall and secure Linux disabled and the following package groups installed:
• X Window System
• GNOME Desktop Environment
• Editors
• Graphical Internet
• Server Configuration Tools
• FTP Server
• Development Tools
• Legacy Software Development
• Administration Tools
• System Tools
To be consistent with the rest of the article, the following information should be set during the installation:

Step 1:Operating System installation (Oracle Enterprise Linux 4.6)
(On both Cluster Machines atpl131 and atpl136)


Remember:
1. Install Oracle Enterprise Linux 4.6 on two machines with (atlest 10 -15 gb root
space, 2,5 gb swap space and 1gb tmp space, 128 mb boot space then install
patches as explained above)
2. Make sure during installation give machine name as “atpl131.server” that is
domain should be “server” only not server.com
3. Ensure that both machines must have two ether net cards(eth0 and eth1)
4. Connect first Ethernet card (eth0) of both machines via cross cable connection
wire this makes private network between atpl131 and atpl136 machine
5. Then connect other ether net card (eth1) of both machines via router (this
makes both machines are connected in public network
6. Ensure that in both machines both network cards must be activated and
network wires are connected properly eth0 is private and eth1 is public
Ethernet card also
7. Both machines atpl131 and atpl136 must be having same time (difference up
to 1 second can work but more than that time difference may cause errors.
8. In files # means comments not hash prompt and rest places it is # prompt
9. Public and Virtual IP Address must be of same class (having same subnet
mask).
atpl131:
hostname: atpl131.server
IP Address eth1: 192.168.1.131 (public address)
Default Gateway eth0: 192.168.1.1 (public address)
IP Address eth0: 192.168.0.131 (private address)
Default Gateway eth0: none
Virtual IP Address: 192.168.1.132

atpl136:
hostname: atpl136.server
IP Address eth1: 192.168.1.136 (public address)
Default Gateway eth0: 192.168.1.1 (public address)
IP Address eth0: 192.168.0.136 (private address)
Virtual IP Address: 192.168.1.137
Default Gateway eth0: none

You can choose IP addresses as per your network requirement, but this must be same throughout the process.


Step 2:Install Packages
(On both Cluster Machines atpl131 and atpl136)


Once the basic installation is complete, install the following packages from root user. Install these four patches
compat-gcc-7.3-2.96.128.i386.rpm, compat-libstdc++-devel-7.3-2.96.128.i386.rpm
compat-libstdc++-7.3-2.96.128.i386.rpm, compat-gcc-c++-7.3-2.96.128.i386.rpm

# From Oracle Enterprise Linux Patch CD (or from Linux S/W CDs)
# cd /media/cdrecorder/patch
# rpm -Uvh compat-gcc-7.3-2.96.128.i386.rpm
# rpm -Uvh compat-gcc-c++-7.3-2.96.128.i386.rpm
# rpm -Uvh compat-libstdc++-7.3-2.96.128.i386.rpm
# rpm -Uvh compat-libstdc++-devel-7.3-2.96.128.i386.rpm
# cd /
# eject

Oracle Installation Prerequisites
Perform the following steps with root user into the atpl131 virtual machine.
The /etc/hosts file must contain the following information.

Step 3:CONFIGURING /etc/hosts file
(On both Cluster Machines atpl131 and atpl136)


#vi /etc/hosts

127.0.0.1 localhost.server localhost
# Public
192.168.1.131 atpl131.server atpl131
192.168.1.136 atpl136.server atpl136
#Private
192.168.0.131 atpl131-priv.server atpl131-priv
192.168.0.136 atpl136-priv.server atpl136-priv
#Virtual
192.168.1.132 atpl-vip.server server-vip
192.168.1.137 atpl-vip.server server-vip
#NAS
192.168.1.131 nas1.server nas1

Notice that the NAS1 entry is actually pointing to the atpl131 node. If you are using a real NAS or a third server to provide your shared storage put the correct IP address into the file.

Step 3:CONFIGURING kernel parameters in /etc/sysctl.conf file.
(On both Cluster Machines atpl131 and atpl136)

# vi /etc/sysctl.conf

kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
#fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
#net.core.rmem_default=262144
#net.core.rmem_max=262144
#net.core.wmem_default=262144
#net.core.wmem_max=262144

# Additional and amended parameters suggested by Kevin Closson
net.core.rmem_default = 524288
net.core.wmem_default = 524288
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.ipfrag_high_thresh=524288
net.ipv4.ipfrag_low_thresh=393216
net.ipv4.tcp_rmem=4096 524288 16777216
net.ipv4.tcp_wmem=4096 524288 16777216
net.ipv4.tcp_timestamps=0
net.ipv4.tcp_sack=0
net.ipv4.tcp_window_scaling=1
net.core.optmem_max=524287
net.core.netdev_max_backlog=2500
sunrpc.tcp_slot_table_entries=128
sunrpc.udp_slot_table_entries=128
net.ipv4.tcp_mem=16384 16384 16384
# These are optional I enter because during OS installation I wrongly gave hostname #and domain name
kernel.domainname=server
kernel.hostname=atpl131

Step 4. Rebuilding kernel without restarting the system for above changed kernel parameter.
(On both Cluster Machines atpl131 and atpl136)


# ./sbin/sysctl -p
if this do not work then restart both machines.

Step 5. Add the following lines to the /etc/security/limits.conf file. ( create same file in atpl136)
(On both Cluster Machines atpl131 and atpl136)


# vi /etc/security/limits.conf

* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536

Step 6:Add the following lines to the /etc/pam.d/login file if not already exists.
(On both Cluster Machines atpl131 and atpl136)

# vi /etc/pam.d/login

session required /lib/security/pam_limits.so

Step 7:Disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows.
(On both Cluster Machines atpl131 and atpl136)


# vi /etc/selinux/config

SELINUX=disabled

Step 8:Set the hangcheck kernel module parameters by adding the following line to the /etc/modprobe.conf file.
(On both Cluster Machines atpl131 and atpl136)


# vi /etc/modprobe.conf

options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180

You can do it also by GUI tool (Applications  System Settings Security Level). Click on the SELinux tab and disable the feature.

Step 9:To load the module immediately, execute this command"modprobe -v hangcheck-timer".
(On both Cluster Machines atpl131 and atpl136)


#modprob –v hangcheck-timer

Step 10:Create the new groups and users(with same user name, user id and os groups on bothe machines .
(On both Cluster Machines atpl131 and atpl136)


a) For atpl131:
Group create:
# groupadd oinstall
# groupadd dba
# groupadd oper
User Create:
# useradd -d /home/oracle -g oinstall -G dba -s /bin/bash oracle
# passwd oracle
# new password: oracle
# reenter password: oracle

To see the groups name and corresponding ids,user name and its id give:

# id oracle

b) For atpl136:
# id oracle


Step 11:During the installation, both RSH and RSH-Server were installed.
Enable remote shell and rlogin by doing the following.
(On both Cluster Machines atpl131 and atpl136)


# chkconfig rsh on
# chkconfig rlogin on
# service xinetd reload

Step 12:Create the /etc/hosts.equiv file as the root user.
(On both Cluster Machines atpl131 and atpl136)


# touch /etc/hosts.equiv
# chmod 600 /etc/hosts.equiv
# chown root:root /etc/hosts.equiv

Step 13:Edit the /etc/hosts.equiv file to include all the RAC nodes(atpl131 and atpl136):
(On both Cluster Machines atpl131 and atpl136)


# vi /etc/hosts.equiv

+atpl131 oracle
+atpl136 oracle
+atpl131-priv oracle
+atpl131-priv oracle

Step 14:Now restart both machines.

Step 15:Login as the oracle user and add the following lines at the end of the .bash_profile file.
(On both Cluster Machines atpl131 and atpl136)


Note:Edit this .bash_profile file in atpl136 also but give different ORACLE_SID there as: ORACLE_SID=RAC2; export ORACLE_SID

$ vi .bash_profile

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=RAC1; export ORACLE_SID (will be changed in 2nd machine)
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

Note: Remember to set the ORACLE_SID to RAC2 on the second node remaing valus are same for second machine.


Step 16:Create Shared Disks (On atpl131 Machine only)


First we need to set up some NFS shares. In this case we will do this on the atpl131 node, but you can do the on a NAS or a third server if you have one available. On the atpl131 node

Step 16.a:Create the following directories.

# mkdir /share1
# mkdir /share2


Step 16.b:CREATE TWO DISKS /dev/cciss/c0d1p11 and
/dev/cciss/c0d1p12 using fdisk


To see the attached disks

# fdisk -l

Partition the disk in two slices
# fdisk /dev/cciss/c0d1
fdisk> command (m for help) n
l logical (5 or over)
p primary partition (1-4)

fdisk> l
first cylinder (7303-35698, default 7303):7303
using default value 7303
fdisk> Last cylinder or +size or +sizeM or +sizeK (1-29801, default 29801): +10g
fdisk> p
show you created partition
fdisk> w
(This writes the created partition)
Now /dev/cciss/c0d1p12 is created.

Same way create the second partition (/dev/cciss/c0d1p12)

Step 16.c:Mount both disks on share1 and share2

# mount /dev/cciss/c0d1p11 /share1
# mount /dev/cciss/c0d1p12 /share2

Step 16.d:Also enter entries in /etc/fstab file for these two disk for permanent mounting at boot time.

# vi /etc/fstab

/dev/cciss/c0d1p11 /share1 ext3 defaults 0 0
/dev/cciss/c0d1p12 /share2 ext3 defaults 0 0

Step 16.e:Add the following lines to the /etc/exports file.

# vi /etc/exports

/share1 *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/share2 *(rw,sync,no_wdelay,insecure_locks,no_root_squash)

NOTE 1: Do not repeat Step 16 for atpl136 machine

NOTE 2: We have use NFS sharing by adding the entry in /etc/exports file


Step 17:Run the following command to export the NFS shares.
(On both Cluster Machines atpl131 and atpl136)


# chkconfig nfs on
# service nfs restart

Step 18:Create two mount points to mount the NFS shares share1 and share2 on both machines.
(On both Cluster Machines atpl131 and atpl136)

# mkdir /u01
# mkdir /u02

Step 19:Add the following lines to the "/etc/fstab" file for nfs mounting .
(On both Cluster Machines atpl131 and atpl136)


# vi /etc/fstab

atpl131:/share1 /u01 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=300rsize=32768,wsize= 32768,actimeo=0 0 0
atpl131:/share2 /u02 nfs rw,bg,hard,nointr,tcp,vers=3,timeo=300,rsize=32768,wsize =32768,actimeo=0 0 0

NOTE :
1. Here we can also use nas1 in place of atpl131 because nas1 is logical name of
atpl131 this we set it in /etc/hosts file.
2. /share1 and share2 are two folders which are created on the atpl131 and are used on atpl131 and 136 for nfs mount because here we use nfs sharing for cluster installation. this we did because we do not have nas device.

Step 20:Mount the NFS shares on both servers.
(On both Cluster Machines atpl131 and atpl136)


# mount /u01
# mount /u02

Step 21:Create the shared CRS Configuration and Voting Disk files.
(On both Cluster Machines atpl131 and atpl136)

# touch /u01/crs_configuration

NOTE: Don’t create voting_disk file now using # touch /u01/voting_disk
command other wise at the time of runinstaller step give this file is already exists .
when we run the runinstaller then it ask for voting_disk file click next->then it creates this file in “/u01/ ” directory if u again click next raise error so don’t worry go to /u01 directory and change permissions 700 to this file then click next goes without error.

Step 22:Create the directories in which the Oracle software will be installed.
(On both Cluster Machines atpl131 and atpl136)

# mkdir -p /u01/crs/oracle/product/10.2.0/crs
# mkdir -p /u01/app/oracle/product/10.2.0/db_1
# mkdir -p /u01/oradata
# chown -R oracle:oinstall /u01 /u02

Step 23:RESTART BOTH MACHINES atpl131 and atpl136

Step 24:Login to both atpl131 and atpl136 machines as the oracle user and run commands to check whether they are clustered properly or not.
(On both Cluster Machines atpl131 and atpl136)


$ cd /u02/clusterware/cluvfy
$ sh runcluvvfy.sh comp nodereach -n atpl131,atpl136 -verbose
$ sh runcluvfy.sh stage -pre crsinst -n atpl131,atpl136

Step 25:Install the Clusterware Software(On atpl131 machine only first)

Place the clusterware and database software in the /u02 directory and unzip it.

# cd /u02
# unzip 10201_clusterware_linux32.zip
# unzip 10201_database_linux32.zip

Start the Oracle installer.

$ cd /u02/clusterware
$ ./runInstaller


Step R-1. On the "Welcome" screen, click the "Next" button.



Step R-2. Accept the default inventory location by clicking the "Next" button.



Step R-3. Enter the appropriate file name and Oracle Home path (here shown
path and file name only because we already set these path & name in
“.bash_profile” )for the and click the "Next" button.



Step R-4. Wait while the prerequisite checks are done. If you have any failures
correct them and retry the tests before clicking the "Next" button.



Step R-4 The "Specify Cluster Configuration" screen shows only the atpl131
node in the cluster. Click the "Add" button to continue.




Step R-5 The "Specific Network Interface Usage" screen defines how each network interface will be used. Highlight the "eth0" interface and click the "Edit" button.

Note1:Now it ask for running the two scripts from root user

step 1. (i) first run “orainstRoot.sh” file on atpl131
# ./u01/app/oracle/oraInventory/orainstRoot.sh
step 1. (ii) then run root.sh script in atpl131
# ./u01/crs/oracle/product/10.2.0/crs/root.sh
during running these scripts if any error regarding dir ownership or services not on like comes then ignore this.

after step 1 just do step 2 on atpl136
step 2. (i) after that run orainstRoot.sh on atpl136 then
# ./u01/app/oracle/oraInventory/orainstRoot.sh
step 2. (ii) then run root.sh file on atpl136
# ./u01/crs/oracle/product/10.2.0/crs/root.sh
during running these scripts if any error regarding dir ownership or services not on like comes then ignore this.

step 3. after above step 1 and 2 before clicking on ok on atpl131
run vipca(virtual IP configuration assistanent)
# cd /u01/crs/oracle/product/10.2.0/crs/bin
# ./vipca
then it ask for choosing Ethernet card choose public network card(i.e. eth1)
then give these values
for atpl131:
IP alias name: atpl131-vip.server & IP address: 192.168.1.131 &subnet mask 255.255.255.0
for atpl136:
IP alias name: atpl136-vip.server & IP address: 192.168.1.136 &subnet mask 255.255.255.0

step 4. then come to atpl131. click ok next next …. installation complete.


step 5 launch dbca.


Hope this article helps.Suggestions and feedback always welcome and appreciated.


Best regards,

Rafi.

Tuesday, April 5, 2011

Logical Volume Manager & HARD DISK PARTITIONING AND NFS ON SOLARIS AND LINUX

Hi,
When it comes to volume manager for Solaris and Linux or any other unix platforms,If there is lack of resource in a small or mid-sized company the below task can be useful for DBA,where DBA have to perform the below task before installation of oracle softwares.

Note: The below steps is for Solaris platform,but when you are doing for linux and any other platforms there are only few changes command wise:
1)'Format' command for creating partitions in Solaris is replaced by 'fdisk ' in Linux.
2)Network file system(NFS) :For NFS sharing /etc/dfs/dfstab file of Solaris is replaced by /etc/exports in Linux

# format (ENTER)
TYPE THE DISK NUMBER I.E. 0, 1, 2, ETC.
IF YOU DON’T SEE THE DISKS, THEN RUN

** How to detect the external and internal devices:
#devfsadm ( normally used for all devices)
To check whether it has detected or not, use
#format, if this don’t work, run
#rmformat ( normally used for external or removable devices) wait for 3 to 4 seconds and run format to check, if this don’t work, run
#touch /reconfigure
# init 6 (for reboot)

After reboot, it must have detected the devices.
If this donot work out for cd / dvdrom, go to
# cd /etc/init.d
#./volmgt stop

Wait for 3 to 5 seconds

# ./volmgt start
Wait for 3 to 5 seconds to start. And then check with format command.

# format
Searching for disks...done

Steps for creating partitions and Filesystem for our usage:


AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@0,0/pci1000,30@10/sd@0,0
1. c1t1d0
/pci@0,0/pci1000,30@10/sd@1,0
2. c1t2d0
/pci@0,0/pci1000,30@10/sd@2,0
Specify disk (enter its number): 0

you will see some screen with format menu and at the end you will have format prompt, type in ‘p’ at the prompt to get the partition menu

format> p


PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
! - execute , then return
quit
partition>

now give the partition number you wan to configure and press enter


partition> 0
Part Tag Flag Cylinders Size Blocks
0 root wm 580 - 1301 5.53GB (722/0/0) 11598930

Enter partition id tag[root]:
Enter partition permission flags[wm]:
Enter new starting cyl[580]:
Enter partition size[11598930b, 722c, 1301e, 5663.54mb, 5.53gb]: 1gb
partition>

now to save the partition layout type in ‘label’ at the partition prompt and then type ‘q’ to quit from partition prompt. You will be in format prompt now, give again ‘label’ to save and again ‘q’ to quit from format prompt and you will be on # prompt

partition > label
then enter ‘y’ when asked to continue
partition > q
format > label
then enter ‘y’ when asked to continue
format > q
#

Now we have a raw partition and we need to construct file system on it.
The raw partition will be identified like /dev/rdsk/c0t0d0s0

#newfs /dev/rdsk/c0t0d0s0 (enter)
Wait till it formats

To mount this partition, following steps need to be done
#mkdir /dirname
Edit the vfstab file and add the entry like bold line
#vi /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 /dirname ufs 2 yes -

Press :wq to save and quit

#mountall
This will mount the c0t0d0s0 partition on the /dirname

** How to share a directory for network access:


To share a directory across the network, edit the /etc/dfs/dfstab file and add the line as follows on the same machine from where you want to share the folder.

share -F nfs -o rw,anon=0 /dirname
#shareall
#share (this should display the list of dirs. Being shared like

- /dirname rw,anon=0 ""
If you don’t see your dir. To be shared, then
#cd /etc/init.d
#./nfs.server stop
#./nfs.server strart
#share (to check whether the dir. Is being shared or not)
Make the dir on the client m/c
#mkdir /u01 this dir. We will use to mount the share dir.
Now on the m/c where you want to use this shared dir., edit the /etc/vfstab and add the following entry
#vi /etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options

sol1:/dirname - /u01 nfs - yes -

where sol1 is the server m/c from where we are sharing the folder


** LVM ON SOLARIS: (RAID-0)
CREATE 4 PARTITIONS AS ABOVE STEPS
WE WILL BE USING THESE PARTITIONS TO CREATE A LOGICAL VOLUME.
The partitions are c1t3d0s0, c1t3d0s1,c1t3d0s3 and c1t3d0s4.

#metadb –a -f c1t3d0s1 c1t3d0s3 c1t3d0s4
#metadb –i (to check the information about the slices)
#metadb –a –c 3 c1t3d0s0
#metadb –i
-c is to create replica
3 specifies the no. of replicas to be created.
#metainit d20 1 3 c1t3d0s1 c1t3d0s3 c1t3d0s4
This will create a concate/stripe from above three partitions named d20.
Now to create soft partitions,
#metastat (to display the information of concat/stripe
#metainit d21 –p d20 512mb
This will create soft partition of 512mb named d21 from volume d20.
#metainit d22 –p d20 512mb
#metainit d23 –p d20 512mb

Use the metastat command to get the information about the soft partitions like what slices being used, what is the size of the soft partitions.

Now to create a file system on the soft partition,
#newfs /dev/md/rdsk/d21 (enter)
#newfs /dev/md/rdsk/d22
#newfs /dev/md/rdsk/d23

To mount this slices, make three folders on root
#mkdir /p01 /p02 /p03
Edit the /etc/vfstab and add the following lines

/dev/md/dsk/d21 /dev/md/rdsk/d21 /p01 ufs 2 yes -
/dev/md/dsk/d22 /dev/md/rdsk/d22 /p02 ufs 2 yes -
/dev/md/dsk/d23 /dev/md/rdsk/d23 /p03 ufs 2 yes -

#mountall
#df –h will display the /p01 /p02 and /p03

To add a slice to volume:
- create a slice using format utility
- now attack this slice to volume d20 with the following command
#metadb –a c1t3d0s5
#metattach d20 c1t3d0s5

* To attach/grow the soft partition:
Suppose in our case soft partition d21 which is mounted on /p01 is falling short of space and we want to grow or attach some more space then,

#metattach d21 1g (this will attach 1gb of raw space from logical volume d20 to soft partition d21 and we have to grow the filesystem)
#growfs –M /p01 /dev/md/rdsk/d21

** How to remove the logical volume
First clear all soft partitions
#metaclear d21
#metaclear d22
To clear or delete the logical volume
#metadb –d c1t3d0s1
Similarly remove all slices attached to volume
To remove replica
#metadb –d –f c1t3d0s0 (name of the slice where replica resides)
Check wth metadb -i


Hope this helps.


Best regards,

Rafi.