Tuesday, December 30, 2008

Fixing ORA-01113: file x needs media recovery Error

The following steps are intended for a quick recovery of the database.

Symptom:
Oracle mounts the database, but refuses to open the database with an ORA-01113: file x needs media recovery Error.
% sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 24 09:29:10 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startupORACLE instance started.
Total System Global Area 2684354560 bytes
Fixed Size 1981064 bytes
Variable Size 436209016 bytes
Database Buffers 2231369728 bytes
Redo Buffers 14794752 bytes
Database mounted.
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/OraData/SIAMST/siamst_system.dbf'
% oerr ora 01113
01113, 00000, "file %s needs media recovery"
// *Cause: An attempt was made to online or open a database with a file that
// is in need of media recovery.
// *Action: First apply media recovery to the file.

Resolution:

1. Startup the database with the mount option

SQL> startup mount
ORACLE instance started.
Total System Global Area 2684354560 bytes
Fixed Size 1981064 bytes
Variable Size 436209016 bytes
Database Buffers 2231369728 bytes
Redo Buffers 14794752 bytes
Database mounted.

2. Find the name of the redo log file which belongs to the active group
SQL> SELECT MEMBER FROM V$LOG G, V$LOGFILE F WHERE G.GROUP# = F.GROUP# 2 AND G.STATUS = 'CURRENT';
MEMBER--------------------------------------------------------------------------------/OraRedo/RedoLogFiles/siamst_log01.dbf

3. Using a backup control file, start the cancel based recovery. The system may suggest a non-existing archive log
-- ignore it and specify the log file name {with full path} that you got in the above step
SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL
ORA-00279: change 21375038 generated at 09/21/2007 20:12:47 needed for thread 1
ORA-00289: suggestion : /export/pspp/oracle/dbs/arch1_4_633901491.dbf
ORA-00280: change 21375038 for thread 1 is in sequence #4
Specify log: {=suggested filename AUTO CANCEL}
/OraRedo/RedoLogFiles/siamst_log01.dbf
Log applied.
Media recovery complete.

4. Finally open the database in RESETLOGS mode.
It is recommended to reset the online logs after incomplete recovery or recovery with a backup control file
SQL> ALTER DATABASE OPEN RESETLOGS;
Database altered.

Take a backup of the database as soon as the recovery is done.

Overview of 10g Application Server Installation

– infrastructure & Middle Tier Should (MUST) be installed under separate Oracle Homes. Though they can be on Same Physical Machine or on different Machines
– First you have to install Infrastructure Tier then only you can install Middle Tier
– You can install Portal/Wireless or IM Repository in an existing database (Choose RepCA, Repository Creation Assistance tool for this option. If you are new to 10g AS skip this for time being as this is optional feature)
– Before Installation, Make sure all prereq. are complete (Check installation Document mentioned at bottom of this page)
– You can use eDelivery.oracle.com for software or use link http://www.oracle.com/technology/software/htdocs/devlic.html?=/technology/software/products/ias/htdocs/101202.html
– For Portal 10.1.4 , you need 10.1.2.0.2 & then Upgrade portal to 10.1.4 (P.S. Portal version is different than Application Server Version)

Options in Installation

While Installing Infrastructure Tier, you will get three options
- Identity Management & Metadata Repository
- Identity Management only
- Metadata Repository only
If you are new select option 1 i.e. IM+MR as option 2 & 3 are for advanced configuration like Infrastructure on Multiple Machines

While Installing Middle Tier, you will again get three options
- J2ee & Webcache
- Portal & Wireless
- Business Intelligence & Forms

BI & Form type Installation include first two options so this selection will include all J2ee, Webcache, Portal, Wireless, BI & Forms

Portal & Wireless include first option so this selection will include J2ee, Webcache, Portal, Wireless

J2ee & Webcache will install only j2ee & webcache. So if you are not aware of at this minute what you want better select option three i.e. Business Intelligence & Forms

Installation Document
Installation Document from oracle for Application Server version 10.1.2.0.2 is available at
http://download-uk.oracle.com/docs/cd/B14099_19/getstart.htm . Select as per your Operating System.

Hope this helps.....

Overview of 10g Application Server

Overview of 10g Application Server
10g Application Server Consist of Infrastructure Tier & Middle Tier.

What is Infrastructure Tier ?
Infrastructure Tier provides Infrastructure Services to 10g Application Server & consist of following technical components
- Database : To Store User/Applications Identity Data (Portal,Wireless,OID data)
- OID : Oracle Internet Directory, to store User Credentials, Schema passwords, Application details & lot more ...
- HTTP Server : This Web Server (OHS, Oracle HTTP Server) on Infra Tier is used to access SSO (Single Sign-On Server) & OIDDAS (OID Delegated Administrative Services)
- OC4J : Oracle Container for J2EE (OC4J_Security for SSO), You have additional OC4J_OCA if you have OCA (Oracle Certifying Autority). OCA is Optional component in Infrastructure Tier.

What is Middle Tier ?
Middle Tier is tier where application Server & applications logic resides. It consist of following Technical Components
- HTTP Server : This OHS (Oracle HTTP Server) is separate from above OHS & this is OHS from where users access application Server like portal, wireless, j2ee
- OC4J : These are container which provide place holder for j2ee or web applications . Applications are deployed on OC4J's. 10g AS comes with default OC4J name "home", you create more OC4J depending on your requirement
- Web Cache : Web Cache acts as cache for fast response to web server.

Logical Services for Infrastructure Tier
Above was technical components of Infrastructure Tier , Logically Infrastructure Tier consist of Two main categories which are
1. Identity Management
2.Metadata Repository

What is Metadata Repository?
MR is similar to Database Metadata & MR you can further classify as Metadata repository for Products (Like Portal, Wireless, BI) This MR usually is user data. Lets assume I created some pages, documents in Portal or User entered some data in any application , such data when stored in database is called as Product MR.
MR for OID : Oracle Internet Directory contain some data & data related to this , one can classify as MR for IM (as OID is part of Identity Management - discussed later).
MR for SSO : Oracle Single Sign-On data & schema definitions , one can classify as MR for IM (as SSO is part of IM).

So broadly there are three kind of MR (that's how I classify MR)

What is Identity Management?
Logical Grouping of Services which help in Managing Identity is called as Identity Management.Identity management Consist of following Services like :
- OID: Oracle Internet Directory
- DAS: Delegated Administrative Services
- DIP: Directory Integration & Provisioning Services
- SSO: Single Sign-On Service
- OCA: Oracle Certifying Authority

Installation of 10g Application Server in next post.....

Monday, December 29, 2008

orapwd

ORAPWD is a utility used to create a password file for an Oracle Database.

Run orapwd utility before:
-setting REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE or SHARED
-Grant OSDBA/OSOPER to users

Check V$PWFILE_USERS to see who was granted OSDBA/OSOPER access.

Examples :

Create a new password file:
orapwd file=orapwSID password=oracle entries=5

If the password file already exists:
orapwd file=orapwSID password=oracle entries=5 FORCE=Y

The FORCE parameter is available starting from Oracle 10g.

"Bean not found" error in webutil???

"Bean not found" bascially comes if you have not configured the formsweb.cfg and default.env file properly.

Solution:

Follow the below two steps:

1. In the default.env file add the path of "rt.jar" in the "CLASSPATH" variable like shown below:
CLASSPATH=E:\OracleDeveloper\j2ee\OC4J_BI_Forms\applications\formsapp\formsweb\WEB-INF\lib\frmsrv.jar;E:\OracleDeveloper\jlib\repository.jar;
E:\OracleDeveloper\jlib\ldapjclnt10.jar;E:\OracleDeveloper\jlib\debugger.jar;
E:\OracleDeveloper\jlib\ewt3.jar;E:\OracleDeveloper\jlib\share.jar;
E:\OracleDeveloper\jlib\utj.jar;E:\OracleDeveloper\jlib\zrclient.jar;
E:\OracleDeveloper\reports\jlib\rwrun.jar;E:\OracleDeveloper\forms\java\frmwebutil.jar;
E:\OracleDeveloper\jdk\jre\lib\rt.jar

2. In the formsweb.cfg file add ",frmwebutil.jar,jacob.jar" to "archive_jini=frmall_jinit.jar" like shown below:
Earlier :- archive_jini=frmall_jinit.jar
After Changing :- archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar

Hope this helps in solving your problem....

If you want to know how to configure webutil properly, refer to my previous post or click on the below link
http://planetofsolutions.blogspot.com/2008/12/steps-to-configure-webutil.html

How to use Client_Host to execute .exe???

In forms 10g to execute any thing on the client side we have to use client_host().

But now the question arises how to use client_host() to execute .exe on the client.

See below for the solution:

Client_Host('cmd /c START "" ' "your .exe");

Now one more thing is there,if you want to execute the .exe and want that it should wait for the .exe to complete execution before doing anything else.
Execute the .exe as shown below


client_host('cmd /c start "" /wait ' "your .exe");

Hope this helps.....

call_form not working in Oracle Forms???

When you are migrating the Oracle Forms Application to 10g, you may come accross a problem that call_form in the form code may not work.

Cause:
The problem is caused by the windows named ROOT_WINDOW.

Solution:
Rename the windows which have the ROOT_WINDOW name.

Sunday, December 28, 2008

Oracle Log files

Redo log files record all changes made on the database
Used for recovery

Require at least
2 Groups
1 member

Should try and divide up I/O
Try and keep data file and log files on seperat drives.

Min size 50k
Max size OS dependant

Make larger for many changes

You must enable arch in pfile before you can use the archiver.

LOG_ARCHIVE_DEST_1='location=pathToArchiveFolder'
LOG_ARCHIVE_START=true

Then you must shutdown the database and startup in mount mode and run:
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;

Switch log file online
ALTER SYSTEM SWITCH LOGFILE;

Forced check points
FAST_START_MTTR_TARGET = 600 -- 10min range

Alter system checkpoint
ALTER SYSTEM CHECKPOINT;

Adding online redo log file groups
ALTER DATABASE ADD LOGFILE GROUP 4
('PATH\log3a.rdo', 'PATH\log3b.rdo')SIZE 1M;

Adding online redo log file members
ALTER DATABASE ADD LOGFILE MEMBER
'PATH\log1c.rdo' TO GROUP 1,
'PATH\log2c.rdo' TO GROUP 2,
'PATH\log3c.rdo' TO GROUP 3;

Dropping redo log file groups
ALTER DATABASE DROP LOGFILE GROUP 4;

Dropping redo log file members
ALTER DATABASE DROP LOGFILE MEMBER
'PATH\log4c.rdo';

Relocate or rename redo log files
-Shutdown the database
-move the file to the new location
-Startup database in mount mode
-run script to rename file
ALTER DATABASE RENAME FILE
'PATH\log2a.rdo'
TO 'PATH\log3b.rdo';

Clearing online redo log files
ALTER DATABASE CLEAR LOGFILE GROUP 3;
-- might be used to reinitalize log file

ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP3;
-- used to avoid archiving corupt log file.

Data Dictionary views
V$LOG -- more for group info
Status types
-unused
-current
-active
-clearing
-clearing current
-inactive

V$LOGFILE -- more for member info
Status types
-invalid
-stale
-deleted"blank"

V$instance (archive) -- what mode is the archive in

archive log list -- gives info about log archive mode

Oracle ORADIM

ORADIM is a Windows only utility used for the creation, modification and deletion of the Windows Service

Definitions:-
ASMSID:- ASM instance name
ASMSRVC (service_name):- ASM service name
NEW:- Indicates that a new instance is being created
PFILE (file_name):- Parameter File Path and Name
RUNAS:- Options are OSUSR and OSPASS
SHUTMODE:- How the Windows Service should shutdown the database. Options are ABORT, NORMAL, and IMMEDIATE
SID:- Name of the Oracle instance
SPFILE:- Indicates that a server parameter file (SPFILE) be used during startup instead of a PFILE
SRVC (service_name):- Name of the Oracle service
SRVCSTART:- Options are SYSTEM and DEMAND
STARTMODE:- Should Windows start the instance when the Database service is started.Options are AUTO and MANUAL
SYSPWD (password):- System password
TIMEOUT (seconds):- Sets the maximum time to wait (in seconds) before the service for a particular SID stops

DROP:-
ORADIM -DELETE sid -ASMSID sid -SRVC srvc -ASMSRVC srvc
Example:-
$ORACLE_HOME\bin\oradim -DELETE -SID orabase

HELP:-
ORADIM -h $ORACLE_HOME\bin\oradim -?
Example:-
$ORACLE_HOME\bin\oradim -h
$ORACLE_HOME\bin\oradim -help

MODIFY Shutmode:-
ORADIM -EDIT -SID sid -ASMSID sid
[-SYSPWD pass]
[-STARTMODE auto manual]
[SRVCSTART systemdemand]
[-PFILE file -SPFILE]
[-SHUTMODE normal immediate abort]
[-SHUTTYPE srvc inst]
--RUNAS osusr/ospass]
Example:-
$ORACLE_HOME\bin\oradim -EDIT -SID orabase -SHUTMODE immediate

NEW:-
ORADIM -NEW -SID sid -SRVC srvc -ASMSID sid -ASMSRVC srvc
[-SYSPWD pass]
[-STARTMODE auto manual]
[SRVCSTART system demand]
[-PFILE file -SPFILE]
[-SHUTMODE normal immediate abort]
[-TIMEOUT secs]
--RUNAS osusr/ospass]
Example:-
$ORACLE_HOME\bin\oradim -NEW -SID orabase -SRVC orabase
-SYSPWD uwpwd -STARTMODE manual -SRVCSTART system
-PFILE c:\oracle\product\ora102\database\initorabase.ora
-SHUTMODE immediate

SPFILE Selection:-
ORADIM -STARTUP sid -ASMSID sid [-SYSPWD pass]
[STARTTYPE srvc inst srvc,inst]
[-PFILE filename -SPFILE]
Example:-
$ORACLE_HOME\bin\oradim -EDIT -SID orabase -SPFILE

STARTUP:-
ORADIM -STARTUP sid -ASMSID sid [-SYSPWD pass]
[STARTTYPE srvc inst srvc,inst]
[-PFILE filename -SPFILE]
Example:-
$ORACLE_HOME/bin/oradim -STARTUP -SID orabase
-STARTTYPE tstc -SPFILE

SHUTDOWN:-
ORADIM -SHUTDOWN sid -ASMSID sid [-SYSPWD pass]
[-SHUTTYPE srvc inst srvc,inst]
[-SHUTMODE normal immediate abort]
Example:-
$ORACLE_HOME\bin\oradim -SHUTDOWN -SID orabase -SHUTMODE abort

More Examples and General Information about ORADIM
oradim is a tool that can be used to create Oracle specific windows services and to start an instance.
oradim can be given the option -sid which identifies the system identifier.

Creating a service
c:\>oradim -new -sid SOME_SID -intpwd PASSWORD -startmode MODE -pfile PFILE
PASSWORD is the password that is used to connect / as sysdba.

MODE indicates how the service is started. It must either be auto or manual. auto tells Windows to automatically start the service when Windows is booted. manual, on the other hand, requires someone to manually start the service.

Starting things with oradim
Starting the service
c:\some\arbitrary\path> oradim -startup -sid -starttype srvc

Starting the instance
c:\some\arbitrary\path> oradim -startup -sid -starttype inst

Starting both the service and the instance
c:\some\arbitrary\path> oradim -startup -sid -starttype srvc,inst

Logging
ORADIM messages are not printed to the command prompt, instead, they're logged to %ORACLE_HOME%\database\oradim.log. It is possible to change the directory where the log file is stored by adding the ORA_CWD registry parameter.

How to uninstall a Windows Service???

Now the question comes....
How do I uninstall a Windows Service when there is no executable for it left on the system?

You should be able to uninstall it using sc.exe (I think it is included in the Windows Resource Kit) by calling

sc.exe delete service_ name

where service_name is the name of the service itself as you see it in the service management console, not of the exe.

Steps to re-name the database

The follwing are the steps to re-name the Database....

1. First of all take the database to the "Mount" stage.
-->Alter database close;

2. Trace the control file.
The Trace file will be created in the "udump" directory.
-->Alter database backup controlfile to trace;
Note:-Trace the control file in "Mount" stage only.

3. Now shutdown the database gracefully and exit from sql.
-->shutdown immediate.
-->exit

4. Go to "udump" directory and pick the lastest trace file created.
-->You can use the following command to get the latest trace file in linux.
Issue this command in the "udump" directory.
-->ls -lrt

5. Open the lastest trace file.
-->vi latest_trace_file.trc
Note: In this trace file there will be two scripts.
1st one is used create the control file(which i have told i the previous post)
2nd one is used to rename the database(while i'm telling in this post)

6. Remove everything in the trace file except the 2nd script.
In the 2nd script change "REUSE" to "SET" and database name which will be in the starting of the script.
For Example:-
Create controlfile "SET" database "ORCLXYZ"

7. Save the trace file.

8. Copy the trace file to the home directory.
-->cp ~/rename.sql

9. Change the name of the database in the paramater file.

10. Remove the old control file.

11. Connect to datbase as sysdba.
-->sqlplus / as sysdba

12. Start the database to "nomont" stage.
-->startup nomont

13. Run the script file that we have created from the trace file.
-->@rename.sql

14. Now open the database with resetlogs option.
-->Alter database open resetlogs;

15. Now check the name of the database to confirm.
-->select name from v$database;

Hope it helps....

Steps to Re-Create the Control File

The follwing are the steps to re-create the control file....

1. First of all take the database to the "Mount" stage.
-->Alter database close;

2. Trace the control file.
The Trace file will be created in the "udump" directory.
-->Alter database backup controlfile to trace;
Note:-Trace the control file in "Mount" stage only.

3. Now shutdown the database gracefully and exit from sql.
-->shutdown immediate.
-->exit

4. Go to "udump" directory and pick the lastest trace file created.
-->You can use the following command to get the latest trace file in linux.
Issue this command in the "udump" directory.
-->ls -lrt

5. Open the lastest trace file.
-->vi latest_trace_file.trc
Note: In this trace file there will be two scripts.
1st one is used create the control file(which i'm telling in this post)
2nd one is used to rename the database(while i will be telling in the next post)

6. Remove everything in the trace file except the 1st script.

7. Save the trace file.

8. Copy the trace file to the home directory.
-->cp ~/cont.sql

9. Remove any old control file if it is there.

10. Connect to datbase as sysdba.
-->sqlplus / as sysdba

11. Start the database to "nomont" stage.
-->startup nomont.

12. Run the script file that we have created from the trace file.
-->@cont.sql

13. Now open the database.
-->Alter database open.

Now the crotrol file has been created, you can go to the control file diretory and check.

Saturday, December 27, 2008

How to Check Spatial Index???

SELECT INDEX_NAME, TABLE_OWNER, TABLE_NAME, STATUS, ITYP_OWNER, ITYP_NAME, DOMIDX_STATUS, DOMIDX_OPSTATUS
FROM user_indexes
WHERE ITYP_NAME IS NOT NULL;

How to Rebuild Spatial Index???

When I excute "truncate table ..." or "delete from ...", sometimes I encounter ORA-29859 or ORA-29861 error. In most cases, I just rebuild the spatial index on the geometry column and the problem will be fixed.

For Example:
DROP INDEX GEO_PS_POSITION_SX;
CREATE INDEX GEO_PS_POSITION_SX ON GEO_PS_POSITION (ROUTE) INDEXTYPE IS MDSYS.SPATIAL_INDEX;

How to compile invalid objects???

Operations such as upgrades, patches and DDL changes can invalidate schema objects. Provided these changes don't cause compilation failures the objects will be revalidated by on-demand automatic recompilation, but this can take an unacceptable time to complete, especially where complex dependencies are present. For this reason it makes sense to recompile invalid objects in advance of user calls. It also allows you to identify if any changes have broken your code base. This article presents several methods for recompiling invalid schema objects.

1. Identifying Invalid Objects
2. The Manual Approach
3. Custom Script
4. DBMS_UTILITY.compile_schema
5. UTL_RECOMP
6. utlrp.sql and utlprp.sql
7. Magic Script

1. Identifying Invalid Objects:
The DBA_OBJECTS view can be used to identify invalid objects using the following query:

COLUMN object_name FORMAT A30
SELECT owner,object_type,object_name,status
FROM dba_objects
WHERE status = 'INVALID'
ORDER BY owner, object_type, object_name;

With this information you can decide which of the following recompilation methods is suitable for you.

2. The Manual Approach:
For small numbers of objects you may decide that a manual recompilation is sufficient.
The following example shows the compile syntax for several object types:

ALTER PACKAGE my_package COMPILE;
ALTER PACKAGE my_package COMPILE BODY;
ALTER PROCEDURE my_procedure COMPILE;
ALTER FUNCTION my_function COMPILE;
ALTER TRIGGER my_trigger COMPILE;
ALTER VIEW my_view COMPILE;

Notice that the package body is compiled in the same way as the package specification, with the addition of the word "BODY" at the end of the command.

An alternative approach is to use the DBMS_DDL package to perform the recompilations:
This procedure is equivalent to the following SQL statement:
ALTER PROCEDUREFUNCTIONPACKAGE [.] COMPILE [BODY]
Syntax
Exec dbms_ddl.alter_compile ( type , schema, name);
Type : Must be either PROCEDURE, FUNCTION, PACKAGE, PACKAGE BODY or TRIGGER.
Schema : Database Username
Name : Objects name
Example
SQL> exec dbms_ddl.alter_compile ('PROCEDURE','SCOTT','TEST');
PL/SQL procedure successfully completed

For more detail see below.

EXEC DBMS_DDL.alter_compile('PACKAGE', 'MY_SCHEMA', 'MY_PACKAGE');
EXEC DBMS_DDL.alter_compile('PACKAGE BODY', 'MY_SCHEMA', 'MY_PACKAGE');
EXEC DBMS_DDL.alter_compile('PROCEDURE', 'MY_SCHEMA', 'MY_PROCEDURE');
EXEC DBMS_DDL.alter_compile('FUNCTION', 'MY_SCHEMA', 'MY_FUNCTION');
EXEC DBMS_DDL.alter_compile('TRIGGER', 'MY_SCHEMA', 'MY_TRIGGER');

This method is limited to PL/SQL objects, so it is not applicable for views.

3. Custom Script:
In some situations you may have to compile many invalid objects in one go. One approach is to write a custom script to identify and compile the invalid objects.
The following example identifies and recompiles invalid packages and package bodies.

SET SERVEROUTPUT ON SIZE 1000000
BEGIN
FOR cur_rec IN (SELECT owner, object_name,object_type,
DECODE(object_type, 'PACKAGE', 1,'PACKAGE BODY', 2, 2)
AS recompile_order
FROM dba_objects
WHERE object_type IN ('PACKAGE', 'PACKAGE BODY')
AND status != 'VALID'
ORDER BY 4)
LOOP
BEGIN
IF cur_rec.object_type = 'PACKAGE' THEN
EXECUTE IMMEDIATE 'ALTER ' cur_rec.object_type ' "' cur_rec.owner '"."' cur_rec.object_name '" COMPILE';
ElSE EXECUTE IMMEDIATE 'ALTER PACKAGE "' cur_rec.owner '"."' cur_rec.object_name '" COMPILE BODY';
END IF;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line(cur_rec.object_type ' : ' cur_rec.owner ' : ' cur_rec.object_name);
END;
END LOOP;
END;
/
This approach is fine if you have a specific task in mind, but be aware that you may end up compiling some objects multiple times depending on the order they are compiled in. It is probably a better idea to use one of the methods provided by Oracle since they take the code dependencies into account.

4. DBMS_UTILITY.compile_schema:
The COMPILE_SCHEMA procedure in the DBMS_UTILITY package compiles all procedures, functions, packages, and triggers in the specified schema.

Syntax
Exec dbms_utility.compile_schema ( schema,compile all)
Schema : Database Username
Compile All : Object type ( procedure, function, packages,trigger)

The example below shows how it is called from SQL*Plus:
EXEC DBMS_UTILITY.compile_schema(schema => 'SCOTT');

5. UTL_RECOMP:
This script is particularly useful after a major-version upgrade that typically invalidates all PL/SQL and Java objects.

The UTL_RECOMP package contains two procedures used to recompile invalid objects. As the names suggest, the RECOMP_SERIAL procedure recompiles all the invalid objects one at a time, while the RECOMP_PARALLEL procedure performs the same task in parallel using the specified number of threads.

Their definitions are listed below:
PROCEDURE RECOMP_SERIAL( schema IN VARCHAR2 DEFAULT NULL, flags IN PLS_INTEGER DEFAULT 0);
PROCEDURE RECOMP_PARALLEL( threads IN PLS_INTEGER DEFAULT NULL, schema IN VARCHAR2 DEFAULT NULL, flags IN PLS_INTEGER DEFAULT 0);

The usage notes for the parameters are listed below:
•schema - The schema whose invalid objects are to be recompiled. If NULL all invalid objects in the database are recompiled.
•threads - The number of threads used in a parallel operation. If NULL the value of the "job_queue_processes" parameter is used. Matching the number of available CPUs is generally a good starting point for this value.
•flags - Used for internal diagnostics and testing only.

The following examples show how these procedures care used:

-- Schema level.
EXEC UTL_RECOMP.recomp_serial('SCOTT');
EXEC UTL_RECOMP.recomp_parallel(4, 'SCOTT');

-- Database level.
EXEC UTL_RECOMP.recomp_serial();
EXEC UTL_RECOMP.recomp_parallel(4);

-- Using job_queue_processes value.
EXEC UTL_RECOMP.recomp_parallel();
EXEC UTL_RECOMP.recomp_parallel(NULL, 'SCOTT');

There are a number of restrictions associated with the use of this package including:
•Parallel execution is perfomed using the job queue. All existing jobs are marked as disabled until the operation is complete.
•The package must be run from SQL*Plus as the SYS user, or another user with SYSDBA.
•The package expects the STANDARD, DBMS_STANDARD, DBMS_JOB and DBMS_RANDOM to be present and valid.
•Runnig DDL operations at the same time as this package may result in deadlocks.

6.utlrp.sql and utlprp.sql:
The utlrp.sql and utlprp.sql scripts are provided by Oracle to recompile all invalid objects in the database. They are typically run after major database changes such as upgrades or patches. They are located in the $ORACLE_HOME/rdbms/admin directory and provide a wrapper on the UTL_RECOMP package. The utlrp.sql script simply calls the utlprp.sql script with a command line parameter of "0". The utlprp.sql accepts a single integer parameter that indicates the level of parallelism as follows:
•0 - The level of parallelism is derived based on the CPU_COUNT parameter.
•1 - The recompilation is run serially, one object at a time.
•N - The recompilation is run in parallel with "N" number of threads.

Both scripts must be run as the SYS user, or another user with SYSDBA, to work correctly.

7. Magic Script
Now last but not the least,below is the query which i use to compile the invalid objects at one go:

SELECT CASE object_type
WHEN 'PACKAGE' THEN
'ALTER 'object_type' 'owner'.'object_name' COMPILE;'
ELSE
'ALTER PACKAGE 'owner'.'object_name' COMPILE BODY;'
END
FROM dba_objects
WHERE STATUS = 'INVALID'
AND object_type IN ('PACKAGE','PACKAGE BODY','FUNCTION','PROCEDURE');

Hope this helps....

Monday, December 22, 2008

Steps to configure Webutil

What is WebUtil???

"WebUtil is a pre-packaged set of components that can be used to add a great deal of extra functionality to Web-deployed Forms applications. WebUtil addresses common challenges faced by Oracle Forms developers who wish to build applications which integrate tightly with the client browser - the computer at which the end user is actually located."

Configuration :
1- Downlaod the file from oracle site or from the attachments as I've attached the version 1.0.6 also Jacob files.
2- Extract the webutil_106.zip file in the ( ORACLE_HOME\forms90 or [forms in 10g] )You've to get direcotries like this inside forms folder:
■ doc
■ java
■ server
■ webutil
■ Webutil.pll, Webutil.olb and the create_webutil_db.sql exist in the Forms directory

--> Also extract jacov.dll into webutil directory and jacob.jar into java directory from Jacob_18.zip

3- Create user named webutil in your database and give appropiate privilge.

4- conenct with the user and run the file create_webutil_db.sql5- Create public synonym for webutil_db
Please see this example :

C:\>sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Sat May 17 14:51:55 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> conn / as sysdbaConnected.

SQL> create user webutil identified by webutil default tablespace users;
User created.

SQL> grant connect,resource to webutil;
Grant succeeded.

SQL> conn webutil/webutil
Connected.

SQL> @C:\Dev10g\forms\create_webutil_db.sql
Package created.
Package body created.

SQL> conn / as sysdba
Connected.

SQL> create public synonym webutil_db for webutil.webutil_db;
Synonym created.

SQL> grant execute on webutil_db to public;
Grant succeeded.

SQL> revoke connect,resource from webutil;
Revoke succeeded.

6- Configuring the files :
a- Create virtual directory :
Add the following code in : forms/server/forms.conf
# Virtual path for webutil
AliasMatch ^/forms/webutil/(..*) "C:\Dev10g/forms/webutil/$1"

Check if the above line is not there, then add it else leave.

b- in forms/server/default.env file add this line :

# webutil config file path
WEBUTIL_CONFIG=C:\Dev10g\forms\server\webutil.cfg

Also append the following to CLASSPATH variable which reside in the same file
;C:\Dev10g\forms\java\frmwebutil.jar

it will look like this :
CLASSPATH=C:\Dev10g\j2ee\OC4J_BI_Forms\applications\formsapp\formsweb\WEB-INF\lib\frmsrv.jar;C:\Dev10g\jlib\repository.jar;C:\Dev10g\jlib\ldapjclnt10.jar;C:\Dev10g\jlib\debugger.jar; C:\Dev10g\jlib\ewt3.jar;C:\Dev10g\jlib\share.jar;C:\Dev10g\jlib\utj.jar;C:\Dev10g\jlib\zrclient.jar; C:\Dev10g\reports\jlib\rwrun.jar;C:\Dev10g\forms\java\frmwebutil.jar

c- Configuring formsweb.cfg :
Please insure that these files are in server directory : webutilbase.htm,webutiljini.htm,webutiljpi.htm,webutil.cfg

Open formsweb.cfg
:-- Add these lines to your application configuration which will use Webutil :
WebUtilArchive=frmwebutil.jar,jacob.jar
WebUtilLogging=off
WebUtilLoggingDetail=normal
WebUtilErrorMode=Alert
WebUtilDispatchMonitorInterval=5
WebUtilTrustInternal=true
WebUtilMaxTransferSize=16384
baseHTMLjinitiator=webutiljini.htm
baseHTMLjpi=webutiljpi.htm

or add this config to your file if you want to run seperate FMX against it :
[webutil]
WebUtilArchive=frmwebutil.jar,jacob.jar
WebUtilLogging=off
WebUtilLoggingDetail=normal
WebUtilErrorMode=Alert
WebUtilDispatchMonitorInterval=5
WebUtilTrustInternal=true
WebUtilMaxTransferSize=16384
baseHTMLjinitiator=webutiljini.htm
baseHTMLjpi=webutiljpi.htm
archive_jini=frmall_jinit.jar
archive=frmall.jar
lookAndFeel=oracle

7-Please add the below to archive_jini=frmall_jinit.jar in formsweb.cfg file like
archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar

8- Siging the JAR files :
a- Open a Command window and change to the ORACLE_HOME\forms\webutil directory.
b- Check that ORACLE_HOME/jdk/bin is in the path. If it is not, add it by runing this :
C:\Dev10g\forms\webutil>set path=c:\Dev10g\jdk\bin;%path%

c- call the sign batch file :
C:\Dev10g\forms\webutil>sign_webutil.bat c:\dev10g\forms\java\frmwebutil.jar
=> Also sign the jacob file
C:\Dev10g\forms\webutil>sign_webutil.bat c:\dev10g\forms\java\jacob.jar

you can test your configuration by calling like this :
http://yourserver/forms/frmservlet?config=webutil&form=testwebutil.fmx

To download jacob_18.zip click on the below link.
http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip

To download webutil_106.zip click on the below link.
http://www.oracle.com/technology/software/products/forms/files/webutil/webutil_106.zip

To download webutil_demo.zip click on the below link.
http://www.oracle.com/technology/products/forms/htdocs/webutil/Webutil_demo.zip

To see webutil demo click on below link.
http://www.oracle.com/technology/sample_code/products/forms/demo/9i/javabeans_pjc_samples/webutil/viewlet/WebUtil_Simple_viewlet_swf.html

Please post comment if you need any help.

Monday, December 8, 2008

SALAAM

You can donate Rs.3/- to the martyr's families of Mumbai terroist attack victims by sending the message
SALAAM to 56388.

It is an NDTV initiative.

You will also receive a textback for this. I tried it and it works.


Jai Hind!!!

Monday, December 1, 2008

Anti terror Squad Helpline

DEAR ALL,

In case you come across any suspicious activity, any suspicious movement
or have any information to tell to the Anti-Terror Squad (ATS),
please take a note of the new
ALL INDIA TOLL-FREE Terror Help-line "1090".
Your city's Police or Anti-Terror squad will take action as quickly as possible.

Remember that this single number 1090 is valid all over India
This is a toll free number and can be dialed from mobile phones also.

Moreover, the identity of the caller will be kept a secret.
Let us make each and every citizen of India aware about this facility.

"Jai Hind"

Friday, November 21, 2008

Please give a serious look..!!

Please read it carefully and prove yourself a true indain.

U CAN MAKE A HUGE DIFFERENCE TO THE INDIAN ECONOMY BY FOLLOWING FEW SIMPLE STEPS.

Please spare a couple of minutes here........for the sake of India ... our country..I got this article from one of my friend, but it's true, I can see this from day to day life,Small example,

Before 5 months 1 CAN $ = IND Rs 32
After 5 months. Now it is 1 CAN $ = IND Rs 37

Do you think Canadian Economy is booming?
No, but Indian Economy is Going Down.

Our Economy is in u'r handsINDIAN economy is in a crisis.

Our country like many other ASIAN countries is undergoing a severe economic crunch. Many INDIAN industries are closing down. The INDIAN economy is in a crisis and if we do not take proper steps to control those, we will be in a critical situation.

More than 30000 crore rupees of foreign exchange are being siphoned out of our country on products such as cosmetics, snacks, tea, beverages...etc which are grown, produced and consumed here . A cold drink that costs only 70 / 80 paisa to produce is sold for NINE rupees, and a major chunk of profits from these are sent abroad. This is a serious drain on INDIAN economy.

"COCA COLA "and" SPRITE" belong to the same multinational company, "COCA COLA"?

Coke advertisements says ' JO CHAHO HOJAYE, COCACOLA ENJOY'(Whatever the hell, let it happen, you drink coke) What can you do?

You can consider some of the better alternatives to aerated drinks. You can drink LEMON JUICE, FRESH FRUIT JUICES, CHILLED LASSI (SWEET OR SOUR), BUTTER MILK, COCONUT WATER, JALJEERA, ENERJEE, MASALA MILK..........

Everyone deserves a healthy drink, including you!Over and above all this, economic sanctions have been imposed on us.

We have nothing against Multinational companies, but to protect our own interests we request everybody to use INDIAN products only for next two years. With the rise in petrol prices, if we do not do this, the rupee will devalue further and we will end up paying much more for the same products in the near future.

What you can do about it?
1. Buy only products manufactured by WHOLLY INDIAN COMPANIES.
2. ENROLL as many people as possible for this cause.

Each individual should become a leader for this awareness. This is the only way to save our country from severe economic crisis. You don't need to give-up your lifestyle. You just need to choose an alternate product.
All categories of products are available from WHOLLY INDIAN COMPANIES.

LIST OF PRODUCTS

BATHING SOAP:
USE - CINTHOL & OTHER GODREJ BRANDS, SANTOOR, WIPRO SHIKAKAI, MYSORE SANDAL, MARGO, NEEM, EVITA, MEDIMIX, GANGA , NIRMA BATH & CHANDRIKA

INSTEAD OF - LUX, LIFEBOY, REXONA, LIRIL, DOVE, PEARS, HAMAM, LESANCY, CAMAY, PALMOLIVE

TOOTH PASTE:
USE - NEEM, BABOOL, PROMISE, VICO VAJRADANTI, PRUDENT, DABUR PRODUCTS, MISWAK

INSTEAD OF - COLGATE, CLOSE UP, PEPSODENT, CIBACA, FORHANS, MENTADENT. TOOTH BRUSH: USE - PRUDENT, AJANTA , PROMISEINSTEAD OF - COLGATE, CLOSE UP, PEPSODENT, FORHANS, ORAL-B

SHAVING CREAM:
USE - GODREJ, EMANI

INSTEAD OF - PALMOLIVE, OLD SPICE, GILLETE

BLADE:
USE - SUPERMAX, TOPAZ, LAZER, ASHOKA

INSTEAD OF - SEVEN-O -CLOCK, 365, GILLETTE

TALCUM POWDER:
USE - SANTOOR, GOKUL, CINTHOL, WIPRO BABY POWDER, BOROPLUS

INSTEAD OF - PONDS, OLD SPICE, JOHNSON BABY POWDER, SHOWER TO SHOWER

MILK POWDER:
USE - INDIANA, AMUL, AMULYA

INSTEAD OF - ANIKSPRAY, MILKANA, EVERYDAY MILK, MILKMAID.

SHAMPOO:
USE - LAKME, NIRMA, VELVET

INSTEAD OF - HALO, ALL CLEAR, NYLE, SUNSILK, HEAD AND SHOULDERS, PANTENE

MOBILE CONNECTIONS
USE - BSNL, AIRTEL

INSTEAD OF - HUTCH

Every INDIAN product you buy makes a big difference. It saves INDIA . Let us take a firm decision today.

BUY INDIAN TO BE INDIAN we are not against of foreign products.

WE ARE NOT ANTI-MULTINATIONAL.

WE ARE TRYING TO SAVE OUR NATION.

EVERY DAY IS A STRUGGLE FOR A REAL FREEDOM.

WE ACHIEVED OUR INDEPENDENCE AFTER LOSING MANY LIVES.

THEY DIED PAINFULLY TO ENSURE THAT WE LIVE PEACEFULLY.

THE CURRENT TREND IS VERY THREATENING.

MULTINATIONALS CALL IT GLOBALISATION OF INDIAN ECONOMY.

FOR INDIANS LIKE YOU AND ME IT IS RECOLONISATION OF INDIA ....

THE COLONIST'S LEFT INDIA THEN.

BUT THIS TIME THEY WILL MAKE SURE THEY DON'T MAKE ANY MISTAKES.

WHO WOULD LIKE TO LET A" GOOSE THAT LAYS GOLDEN EGGS" SLIP AWAY.

PLEASE REMEMBER: POLITICAL FREEDOM IS USELESS WITHOUT ECONOMIC INDEPENDENCE .. RUSSIA , S.KOREA , MEXICO ..........

THE LIST IS VERY LONG!!LET US LEARN FROM THEIR EXPERIENCE AND FROM OUR HISTORY.

LET US DO THE DUTY OF EVERY TRUE INDIAN.FINALLY: IT'S OBVIOUS THAT U CAN'T GIVE UP ALL OF THE ITEMS MENTIONED ABOVE, SO GIVE UP ATLEAST ONE ITEM TO FOR THE SAKE OF OUR COUNTRY.


"LITTLE DROPS MAKE A GREAT OCEAN .."

Monday, September 8, 2008

Need Blood???

Need Blood?Got a mail for Blood?
SMS?
Clueless about whom to contact!!!
Here is the Answer
Dial 1062
Blood Availabilty from the most reputed
blood banks is now available for you on this
toll free help line.
The 24 x 7 x 365 call center will guide you
to the blood bank that has the blood you require.

Monday, August 18, 2008

A Small Touching Story!!!

A small touching story mainly for professionals. ..

A man came home from work late, tired and irritated, to find his 5-year old son waiting for him at the door.

SON: "Daddy, may I ask you a question?"
DAD: "Yeah sure, what is it?" replied the man.

SON: "Daddy, how much do you make an hour?"
DAD: "That's none of your business. Why do you ask such a thing?"
the man said angrily.
SON: "I just want to know. Please tell me, how much do you make an
hour?"
DAD: "If you must know, I make Rs.100 an hour."
SON: "Oh," the little boy replied, with his head down.

SON: "Daddy, may I please borrow Rs.50?"
The father was furious, "If the only reason you asked that is so you
can borrow some money to buy a silly toy or some other nonsense, then you march yourself straight to your room and go to bed. Think about
why you are being so selfish. I work hard everyday for such this childish behavior."

The little boy quietly went to his room and shut the door.
The man sat down and started to get even angrier about the little
boy's questions. How dare he ask such questions only to get some money?
After about an hour or so, the man had calmed down, and started to
think: Maybe there was something he really needed to buy with that Rs.50 and he really didn't ask for money very often. The man went to
the door of the little boy's room and opened the door. "Are you asleep, son?" He asked.

"No daddy, I'm awake," replied the boy.
"I've been thinking, maybe I was too hard on you earlier" said the
man.
"It's been a long day and I took out my aggravation on you.. Here's the
Rs.50 you asked for."
The little boy sat straight up, smiling. "Oh, thank you daddy!" He
yelled.
Then, reaching under his pillow he pulled out some crumpled up bills. The man saw that the boy already had money, started to get angry
again. The little boy slowly counted out his money, and then looked up at his father.

"Why do you want more money if you already have some?" the father grumbled.

"Because I didn't have enough, but now I do," the little boy replied.
"Daddy, I have Rs.100 now. Can I buy an hour of your time?

Please come home early tomorrow. I would like to have dinner with you."

The father was crushed. He put his arms around his little son, and he begged for his forgiveness.

It's just a short reminder to all of you working so hard in life. We should not let time slip through our fingers without having spent some
time with those who really matter to us, those close to our hearts.
Do remember to share that Rs.100 worth of your time with someone you love.
If we die tomorrow, the company that we are working for could easily replace us in a matter of days.
But the family & friends we leave behind will feel the loss for the rest of their lives. And come to think of it, we pour ourselves more into work than to our family.

How to find lost Mobile???

Simple to find Lost Mobile!!!
After reading this post please preserve the IMEI number in a notepad and send to your mail box so that it will be permanetly with u.
An IMEI number-The International Mobile Equipment Identity (IMEI) number is an international identity number used to uniquely identify a mobile phone. The 15-digit IMEI number is an electronic fingerprint transmitted every time a phone is used, which reveals the identity of the mobile handset.
How can I find out my IMEI number?
IMEI numbers are independent of the phone number and are usually written underneath the battery or on the back of the handset. Mobile phone users can also check their 15 digit IMEI number by dialling *#06# on their mobile handset. Mobile phone owners should make a note of their IMEI number and keep the details in a safe place.
If u lost your mobile, send an e-mail to cop@vsnl.net with the following info.
Your name:
Address:
Phone model:
Make:
Last used No.:
E-mail for communication:
Missed date:
IMEI No.:
"No need to go to police station"

Source: THE HINDU, 13.5.06

Sent this message to other friends..........

Thursday, August 14, 2008

Good Use Of Mobiles!!!

Would you like to know if your mobile is original or not ?????
Press the following on your mobile *#06# and the-international mobile equipment identity number appears. Then check the 7th and 8th numbers:

1 2 3 4 5 6 7th 8th 9 10 11 12 13 14 15
Phone Serial No. x x x x x x ? ? x x x x x x x

IF the Seventh & Eighth digits are 02 or 20 this means your cell phone was assembled in Emirates which is very Bad quality
IF the Seventh & Eighth digits are 08 or 80 this means your cell phone was manufactured in Germany which is fair quality
IF the Seventh & Eighth digits are 01 or 10 this means your cell phone was manufactured in Finland which is very Good
IF the Seventh & Eighth digits are 00 this means your cell phone was manufactured in original factory which is the best Mobile Quality
IF the Seventh & Eighth digits are 13 this means your cell phone was assembled in Azerbaijan which is very Bad quality and also dangerous for your health

THINGS YOU NEVER KNEW YOUR CELL PHONE COULD DO

There are a few things that can be done in times of grave emergencies.
Your mobile phone can actually be a life saver or an emergency tool for survival. Check out the things that you can do with it: -
(1 )
EMERGENCY
*The Emergency Number worldwide for **Mobile** is 112 ..* If you find yourself out of coverage area of your mobile network and there is an emergency, dial 112 and the mobile will search any existing network to establish the emergency number for you, and interestingly this number 112 can be dialed even if the keypad is locked. **Try it out.**
(2)
Have you locked your keys in the car? Does you car have remote keys?
This may come in handy someday. Good reason to own a cell phone: If you lock your keys in the car and the spare keys are at home, call someone at home on their cell phone from your cell phone. Hold your cell phone about a foot from your car door and have the person at your home press the unlock button, holding it near the mobile phone on their end. Your car will unlock.
Saves someone from having to drive your keys to you. Distance is no object. You could be hundreds of miles away, and if you can reach someone who has the other 'remote' for your car, you can unlock the doors (or the trunk). Editor's Note: *It works fine! We tried it out and it unlocked our car over a cell phone!'*
(3)
Hidden Battery power
Imagine your cell battery is very low , you are expecting an important call and you don't have a charger. Nokia instrument comes with a reserve battery. To activate, press the keys *3370# Your cell will restart with this reserve and the instrument will show a 50% increase in battery. This reserve will get charged when you charge your cell next time. AND
(4 )
How to disable a STOLEN mobile phone?
To check your Mobile phone's serial number, key in the following digits on your phone: * # 0 6 # A 15 digit code will appear on the screen. This number is unique to your handset. Write it down and keep it somewhere safe. when your phone get stolen, you can phone your service provider and give them this code. They will then be able to block your handset so even if the thief changes the SIM card, your phone will be totally useless. You probably won't get your phone back, but at least you know that whoever stole it can't use/sell it either. If everybody does this, there would be no point in people stealing mobile phones..

Please spread this useful information around

Wednesday, August 13, 2008

India has an online Grievance forum.

Dear Friends,

Government of India has an online Grievance forum at http://darpg-grievance.nic.in/

Can you imagine this is happening in INDIA? The govt. wants people to use this tool to highlight the problems they faced while dealing with Government officials or departments like Passport Office, Electricity board, BSNL/MTNL, Railways etc. I know many people will say that these things don't work in India, but this actually works as one of our colleague in CSC found. The guy I'm talking about lives in Faridabad. Couple of months back, the Faridabad Municipal Corporation laid new roads in his area and the residents were very happy about it. But 2 weeks later, BSNL dug up the newly laid roads to install new cables which annoyed all the residents including this guy. But it was only this guy! Who used the above listed grievance forum to highlight his concern. And to his surprise, BSNL and Municipal Corporation of Faridabad were served a show because notice and the guy received a copy of the notice in one week. Government has asked the MC and BSNL about the goof up as it’s clear that both the government departments were not in sync at all. So use this grievance forum and educate others who don't know about this facility. This way we can at least raise our concerns instead of just talking about the ' System ' in India.

Invite your friends to contribute for many such happenings.

PLEASE SPREAD THIS MESSAGE IF U WANT OUR INDIA TO CHANGE.

Now RTI is online!!!

Good news for the indian people,now you can file your RTI (Right To Information) online through this site http://www.cic.gov.in and check your request status also.
Atleast this Government have done something good for the indian people.
Now what are you waiting for go and get what you want.
Jai Hind!!!

Friday, August 8, 2008

The following are the basic commands used in Linux

1.1 Access to the system and logout
Let's start with something wrong.

login: redio[Enter]

Even if the account doesn't exist you'll be asked for a password

Password: radio2001[Enter]

Login incorrect

Let's start again

login: radio[Enter]
Password: 2001[Enter]

Last login: Sun Nov 11 10:45:11 on tty1

You get information about your last access

The prompt shell means the system is ready to receive your commands.
$

1.1.1 Switching account

logging out and then logging in with a different account
using su.

$ su root[Enter]

Password: smr1301[Enter]

If it is the right password you get identity and the rights of the typed user.

1.1.2 Who am I?

When you have more then one account may be necessary to check which account you are using.

$ whoami[Enter]

root

whoami let you know under which identity you are working on.

$ logname[Enter]

radio

logname allows you to know what account you used when you first entered in the system (login).

1.1.3 Ending a session

Just need to end the shell, that is the program that shows the prompt.

$ whoami[Enter]

root

$ exit[Enter]

In case we had used su

$ whoami[Enter]

radio

This exit closes last shell, and logs the user out of the system.

$ exit[Enter]
1.1.4 Shutting down

login: root[Enter]

Password: smr1301[Enter]

# shutdown -h now[Enter]

System is going down NOW!!

...
System halted

When this happens it is possible to reboot the system.

---------

You can use su to become root and shutdown the system.
1.2 Password management

1.2.1 User root changes password to regular user

# passwd radio[Enter]

New UNIX password: 123[Enter]

The password is too short, the system advises you but it doesn't stop you from using it.

BAD PASSWORD: it's a WAY too short

Retype new UNIX password: 123[Enter]

passwd: all authentication tokens updated successfully

1.2.2 Regular user changes its password

$ passwd[Enter]

You'll be asked for the old password.

Changing password for radio

(current) UNIX password: 123[Enter]

New UNIX password: elpoep[Enter]

BAD PASSWORD: it is based on a (reversed) dictionary word

passwd: Authentication token manipulation error

$ passwd[Enter]

Changing password for radio

(current) UNIX password: 123[Enter]

New UNIX password: I cannot understand PCs[Enter]

Retype new UNIX password: I cannot understand PCs[Enter]

passwd: all authentication tokens updated successfully

1.3 Moving around directories

The filesystem is organizated in directory and subdirectory.

1.3.1 Current Directory

$ cd /usr/bin[Enter]

$ pwd[Enter]

/usr/bin

1.3.2 Absolute and relative path

The absolute path starts from the root directory while the relative one starts from the current directory.

$ cd /usr/local[Enter]

This is an absolute path since it starts with /.

$ pwd[Enter]

/usr/local

$ cd bin[Enter]

This is a relative one: it starts from the local directory moving downward to bin.

$ pwd[Enter]

/usr/local/bin

1.3.3 Moving backward

Every directory holds two references to special subdirectory:

single (.) that is a reference to the current directory.
double (..) that is a reference to the previous directory.

These symbols are effective directory names.

$ cd ..[Enter]

$ pwd[Enter]

/usr/local

$ cd ../bin[Enter]

$ pwd[Enter]

/usr/bin

You may go backward for more then one level.

$ cd ../../var/tmp[Enter]

$ pwd[Enter]

/var/tmp

$ cd /usr/bin/../local/bin/..[Enter]

$ pwd[Enter]

/usr/local

1.3.4 The precise reference to the current directory

The current directory can be seen as a single dot. In practice all relative paths can start with the prefix ./.

$ cd ./bin[Enter]

$ pwd[Enter]

/usr/local/bin

1.3.5 Home Directory

Every user has his own personal directory, known as home, it keeps all the data owned by the user. Typing just cd the user can reach his home directory.

$ cd[Enter]

$ pwd[Enter]

/home/radio

Some shells replace tilde (~) at the begging of a path with the path of the home directory of the working user.

$ cd ~[Enter]

$ pwd[Enter]

/home/radio

In the same way if tilde is set before a user account it will be replaced with the path of user's home directory.

$ cd ~ftp[Enter]

$ pwd[Enter]

/home/ftp

Going back to home directory.

$ cd[Enter]

1.4 File content

1.4.1 Directory content


To list the directory content command ls is used

$ ls /bin[Enter]

…..
……

The command ls /bin lists the content of /bin/.

A more expressive listing can be obtened using option -l.

$ ls -l /bin[Enter]
-rwxr-xr-x 1 root root 2612 Mar 7 11:29 arch
-rwxr-xr-x 1 root root 60592 Feb 3 20:12 ash
-rwxr-xr-x 1 root root 263064 Feb 3 20:12 ash.static
-rwxr-xr-x 1 root root 9968 Feb 3 19:04 aumix-minimal
lrwxrwxrwx 1 root root 4 Apr 13 23:28 awk -> gawk
-rwxr-xr-x 1 root root 5756 Mar 7 12:15 basename
-rwxr-xr-x 1 root root 316848 Feb 27 18:44 bash
... many lines ...
-rwxr-xr-x 1 root root 4320 Mar 7 12:15 true
-rwsr-xr-x 1 root root 26608 Feb 3 15:14 umount
-rwxr-xr-x 1 root root 6196 Mar 7 12:15 uname
lrwxrwxrwx 1 root root 14 Apr 13 23:49 userconf -> /bin/linuxco
nf
-rwxr-xr-x 1 root root 16252 Mar 8 17:26 usleep
-rwxr-xr-x 1 root root 346352 Mar 7 18:18 vi
lrwxrwxrwx 1 root root 2 Apr 14 00:00 view -> vi
-rwxr-xr-x 1 root root 362 Mar 7 18:18 vimtutor
lrwxrwxrwx 1 root root 8 Apr 13 23:51 ypdomainname -> hostname
-rwxr-xr-x 3 root root 46384 Feb 15 17:04 zcat

$ cd[Enter]

$ ls[Enter]

To list hidden files

$ ls -a[Enter]
. .bash_history .enlightenment .mc
.. .bash_logout .gnome .tcshrc
.ICEauthority .bash_profile .gnome-desktop .xsession-errors
.Xauthority .bashrc .gnome-help-browser
.Xdefaults .cshrc .gnome_private

1.4.2 File Content

In order to analyse the file content cat,less and more ca be used (it doesn't make sense if it is a binary file).

$ cat /etc/issue[Enter]

Red Hat Linux release 6.2 (Zoot)
Kernel 2.2.14-5.0 on an i586

1.4.3 Find out the file type

file is command the uses the so called magic number (Unix tradition) to figure out the file type..

$ file /etc/*[Enter]

/etc/CORBA: directory
/etc/DIR_COLORS: English text
/etc/HOSTNAME: ASCII text
/etc/X11: directory
/etc/adjtime: ASCII text
/etc/aliases: English text
...many lines...
/etc/shells: ASCII text
/etc/skel: directory
/etc/smb.conf: English text
/etc/smrsh: directory
/etc/snmp: directory
/etc/sound: directory
/etc/sysconfig: directory
/etc/sysctl.conf: English text
/etc/syslog.conf: English text
/etc/termcap: English text
/etc/up2date.conf: can't read `/etc/up2date.conf' (Permission denied).
/etc/vga: directory
/etc/yp.conf: English text
/etc/ypserv.conf: English text

This method is not realible but can be useful.

1.4.4 Used and free space

In order to check the free space on disk you can use df.

$ df[Enter]

The result maybe something similar to this one.
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda5 1511968 805300 629860 56% /
/dev/hda1 99521 2482 91900 3% /boot
To check the directory used space: du.

$ du /bin[Enter]

5240 /bin

In this case the /bin/ directory holds files for a total amount of 5240KB.

1.5 File creation, copy and deletion

1.5.1 File creation


There are different ways to create a file. The easiest way to create an empty file si to use touch. First move to the home directory, the best place where to play.

$ cd[Enter]

$ touch myfile[Enter]

$ ls -l myfile[Enter]

-rw-rw-r-- 1 radio radio 0 Dec 23 10:49 myfile

The file was created..

You can use cat too:

$ cat > myfile2[Enter]

there are better ways to write[Enter]

text.[Enter]

This is a oneway writing.[Enter]

[Ctrl+d]

$ cat myfile2[Enter]

1.5.2 File copy

$ cp myfile2 myfile3[Enter]

Group copy is possible only if the last file is an existing directory.

$ cp myfile myfile2 myfile3 /tmp[Enter]

$ cp myfile* /tmp[Enter]

1.5.3 File deletion

Becareful when you delete something as root!!

$ rm myfile myfile2[Enter]

There is noway to recover deleted files.

You can use the wild chars:* and ?.

$ ls myfile*[Enter]

myfile3

$ rm myfile*[Enter]

1.6 Working with directory

1.6.1 Directory creation


$ cd[Enter]

$ mkdir mydir[Enter]

Let's check with ls.

$ ls -l[Enter]

...
drwxr-xr-x 8 radio radio 1024 Dec 23 12:11 mydir
...

The d character at the beginning of the string tells has that the file is a directory.

1.6.2 Directory copy

cp with option -r or-R.

$ cp -r mydir mydir2[Enter]

1.6.3 Directory deletion

You may delete an empty directory using rmdir.

$ rmdir mydir2[Enter]

Let's try with something more complex.

$ mkdir carbon[Enter]

$ mkdir carbon/hydrogen[Enter]

$ mkdir carbon/oxygen[Enter]

$ mkdir carbon/hydrogen/helium[Enter]

$ rmdir carbon[Enter]

rmdir: carbon: Directory not empty

$ rm -r carbon[Enter]

1.7 Moving around directories

In Unix environment rename and moving a file are the same thing.

1.7.1 Moving and renaming

The command used is mv.

$ touch white[Enter]

$ touch green[Enter]

$ mkdir purple[Enter]

Let's check.

$ ls -l[Enter]

...

-rw-rw-r-- 1 radio radio 0 Dec 25 12:46 white

-rw-rw-r-- 1 radio radio 0 Dec 25 12:46 green

drwxrwxr-x 2 radio radio 1024 Dec 25 12:46 purple

...

Let's rename white file to make it brown.

$ mv white brown[Enter]

$ ls -l[Enter]

...

-rw-rw-r-- 1 radio radio 0 Dec 25 12:46 brown

...

To move more file all in once the destination must be a directory.

$ mv brown green purple[Enter]

$ ls -l purple[Enter]

-rw-rw-r-- 1 radio radio 0 Dec 25 12:46 green

-rw-rw-r-- 1 radio radio 0 Dec 25 12:46 brown

$ mv purple /tmp[Enter]
1.8 The shell

The shell is the way to interact with the operative systme. The shell bash is the one used in our exercises.

1.8.1 Automatic fulfilling

The shell can fulfill a command using [Tab], this feature is particularly useful when you have file with long names.

$ touch microprocessor[Enter]

$ touch microscopic[Enter]

$ touch supersonic[Enter]

$ ls sup[Tab]

$ ls sup[Tab]ersonic[Enter]

$ ls mic[Tab]ro

$ ls mic[Tab]rop[Tab]rocessor[Enter]

1.9.2 Substitution: wild char

This is an alternative way to fulfill a command, it is the the shell that changes symbols with the right information.

1.8.2.1 Asterisk *

That symbol can be replaced with a sequence, from 0 to infinity, of symbols.

$ ls[Enter]

$ ls *[Enter]

This command is different, the shell changes the * with the list of files and directory held in the current directory. This means that if there is any subdirectory its content
would be displayed.

$ ls micro*[Enter]

microprocessor microscopic

* can be changed with null string:

$ touch millimicro[Enter]

$ ls *micro*[Enter]

microprocessor microscopic millimicro

8.2.2 Question mark ?

The question mark ? can be change with just one symbol

Let's create some files.

$ touch xy123j4[Enter]

$ touch xy456j5[Enter]

$ touch xy789j111[Enter]

$ touch xy78j67[Enter]

$ ls [Enter]

xy123j4
xy456j5
xy789j111
xy78j67

$ ls ?????j?[Enter]

xy123j4
xy456j5

We would have a different result using *

$ ls *j*[Enter]

xy123j4 xy456j5 xy789j111 xy78j67

1.8.2.3 Square brackets [ ]

The square brackets are used to have a range of symbols from which to choose the substitution symbols. Just one symbol from the one listed is used.

$ ls xy????[4567]*[Enter]

xy123j4 xy456j5

$ ls xy????[4-7]*[Enter]

1.8.2.4 Escape

For some special symbols you need to use escape

$ touch six\*height[Enter]

$ ls[Enter]

...

six*height

If you create a filename with a space inside

$ touch my\ letter[Enter]

$ ls[Enter]

...

my letter

six*height

1.8.3 Input/Output redirection and pipeline

The shell allows you to redirect command output from the standard output (usually the screen). The same for the input.

1.8.4 Redirection

$ ls -l > mylist[Enter]

$ cat mylist[Enter]

For the input .. instead of using the standard input (keyboard).

$ cat < mylist[Enter]

Appending to a file.

$ ls -l /tmp >> mylist[Enter]

$ cat mylist[Enter]

1.8.5 Pipeline

The pipeline is a way of redirecting input and output commands.

$ cat mylist sort[Enter]

$ cat < mylist sort[Enter]

Make it easier but without using pipeline.

$ sort < mylist[Enter]

1.8.6 Alias

Aliases allows you to create an alternative name to an existing command.

$ alias ll='ls -l'[Enter]

$ ll[Enter]

This alias take options as an ordinary command.

$ ll micro*[Enter]

It's the same as ls -l micro*.

-rw-rw-r-- 1 radio radio 0 Dec 26 10:19 microprocessor

-rw-rw-r-- 1 radio radio 0 Dec 26 10:19 microscopic


This are the aliases that are usually created to avoid mistake

$ alias rm='rm -i'[Enter]

$ alias cp='cp -i'[Enter]

$ alias mv='mv -i'[Enter]

Now try to remove a file.

$ rm microprocessor[Enter]

rm: remove `microprocessor'?:

n[Enter]

In this way the file was not removed.

1.9 Searching

Searching files or directories it's an important task in a filesystem as complex as the Linux (or Unix) one.

1.9.1 Find

Searching a file or directory using its name or other external feature find command is used.

$ find / -name bash -print[Enter]

This command search for files and directory named bash inside all the directory starting from the root directory (/).

/bin/bash

...

find: /var/run/sudo: Permission denied

find: /var/spool/at: Permission denied

find: /var/spool/cron: Permission denied

...

You can use wild chars, in this case it will be the find command that will have to manage them, without using shell.

$ find / -name \*sh -print[Enter]

The escape char \ tells the shell not to translate the * as wild char.

/bin/bash

/bin/ash

/bin/sh

...
1.9.2 Grep

To search inside the content of a file grep is used.

$ grep radio /etc/*[Enter]

/etc/group:radio::500:radio

/etc/passwd:radio:Ide2ncPYY1234:500:500:radiolab:/home/radio:/bin/bash

grep: /etc/skel: Is a directory

grep: /etc/sudoers: Permission denied

Thanks!!!

Saturday, May 10, 2008

Is corporate world same as it seems to be???

Now-a-days we are hearing and reading lot of articles on 'How one can be successful in his/her professional life?'. Some of the key points are:-
1. Stay Focussed.
2. No compromise on performance. Know your job well.
3. Always be ethical in your dealings.
4. Develop good people skills and traits that make for complete professional.
5. Corporate world is all about making the right decisions. It is easy to choose between right and wrong. What you need to develop is to choose between right and more right, and the wrong and the less wrong.
Few years back, when i stepped into this corporate world, i came with the same above thoughts, zeal and passion. But its a myth, reality is totally opposite.
1. Stay more focussed on PR(personal relationship), less on technical or your professional stuff.
2. Know your PR skills and try to enhance in order to meet the expectations.
3. And at last,but not the least you should know with whom to make PR i.e. right decision at right time with right person.
Most Important is that in corporate language PR is the synonym of Boot Polish,buttering(चापलूसी) and it is called as " Assocaite/Employee Attitude".

Now its time to come up and raise our voice against this injustice. Lets join our hands to make this world fair to everyone, afterall its our right which is at stake!!!

Sunday, April 20, 2008

One of the most beautiful place to visit in India

Visakhapatnam, or Vizag as it was often called, is the true spot where one can find the beauty of Andhra. Lapped by the Bay of Bengal, on the eastern part of Andhra Pradesh lies the beach city, Vishakapatnam. It is the best tourism destination in Andhra Pradesh. Visakhapatnam has beautiful hill ranges caves,valleys,temples and also from lakes to cool beaches and many more. The district has many tourism spots that will definitely be exciting, enriching and refreshing experience.It is one of the fastest growing cities in Asia. Visakhapatnam is a city of cultural & religious diversity.It has many tourism spots that represent the Culture and Heritage of the true India.No one should miss to see the Cultural constructions built during the age of kings who ruled this region.

When indians will become socially responsible?

In all the major cities of India , we crib and are used to doing that because we can always save ourselves by blaming others. This is what we have learnt from the society? I have heard from a lot of the people : Indian metropolitan cities are becoming so polluted and dirty day by day. I just want to ask everyone one simple question :- What you and me as a Citizen of India have done for this? You walk down the street in front of your house. You see a large ditch. What you do.? You curse the govt and municipality for taxing you like hell yet not taking care of the roads. But did you try to close that ditch yourself. NO.... Never. Why should I do it.... This is what most of us think. Why ? In many countries , its the people in the neighbourhood who help the Govt and Municipality in maintaining the locality. But we never tried that. People say that the roads are not adequate in our city. Every year no of people flocking into these metropolitan cities is huge. If all the major establishments offices are in the mid of your city then you cannot expect to have a better road without much jams. You cannot expect govt to pull down the entire city and reconstruct afresh just to make sure that there are better road facilities. We just sit back and curse the govt. With India as a major hub for all Engg fields ,how many civil engg in India have actually thought about doing something. Why cant people work for developing the place of living . What we need today is to be more creative in solving our day to day problems. By doing so you can not only be happy but also make this place much better to live. I may not be entirely correct , but I know that somewhere in my heart that If Indians set their mind on, they can turn India into the most developed country in this whole world. Thanks

Saturday, April 19, 2008

On quota, IIT cut-offs may go negative???

What a Indian Politian, ARJUN SINGH and Congress??? Hats off to them... Its my humble request that dont play politics atleast in Education Grounds. It may ruin our future, Today we Indians have proved ourself as the World Best. Bill Gates also recognized Indain Talent, thats why in US Congress he asked for more H1-B visas. He said if one Indian will come to US, two Americans will get the job around him. But Arjun Singh and Congress are on the way to dump our future. If you want to see India as a developed not developing country. Please dont vote for Congress. Dont let them play with us. JAGO INDIA JAGO!!! Its our future which is at stake.