-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Steps for Installing Oracle on LINUX
#groupadd dba
#groupadd oinstall
#useradd –g oinstall –G dba oracle
#passwd oracle
create directory
/u01/app/oracle/product/9.2
Connect to oracle user
Go to root/home/oracle directory.
In this directory one bash_profile file is unhide.
-> Edit this bash_profile file.and write this statement.
Unset USERNAME
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/9.2
LD_ASSUME_KERNEL=2.4.1
ORACLE_SID=ORCL
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export ORACLE_BASE
export ORACLE_HOME
export LD_ASSUME_KERNEL
export ORACLE_SID
export PATH
save this file.
Set the fillowing permission to directory.
DIRECTORY File OWNER File Group
/home Root Root
/home/oracle Oracle Oinstall
/u01 Root Root
/u01/app Root Root
/u01/app/oracle Oracle Dba
/u01/app/oracle/product Root Root
/u01/app/oracle/product/9.2 Oracle oinstall
Put the cd in cd-drive. After some some time one screen apper.
Enter unix group name: oinstall
hen after on script you have to run as a su user.
Run this script as
Go to particular location sh<scriptname.sh>
Now if “ set for unable to attch to shared memory segment “ this type is error is occur then write following code .
Then connect to root using su
#cat /proc/sys/kernel/shmmax 33554432
#echo `expr 1024 \*1024 \*1024 `>
/proc/sys/kernel/shmmax
#cat /proc/sys/kernel/shmmax 1073741824
Get table and index DDL the easy way
Prior to Oracle9i, getting table and index DDL was a time-consuming and tricky process. You could run the export utility with ROWS=NO, but the output was hard to re-use because of quoted strings. The only other option was to write complex dictionary scripts that might not work on complex objects such as IOT and nested tables.
Punching DDL from the dictionary is very useful when you are migrating a system to a new platform and you want to pre-create the objects in a new tablespace so that you can import with IGNORE=Y.
In Oracle9i we have the exciting new dbms_metadata utility to display DDL directly from the data dictionary. Using this powerful utility, we can punch individual objects or an entire schema.
Best of all, it is easy. You simply execute dbms_metadata. get_ddl.
To punch off all table and indexes for the EMP table, we execute dbms_metadata. get_ddl, select from DUAL, and providing all required parameters.
CREATE TABLE "SCOTT"."DEPT" ( "DEPTNO" NUMBER(2,0), "DNAME" VARCHAR2(14), "LOC" VARCHAR2(13), CONSTRAINT "PK_DEPT" PRIMARY KEY ("DEPTNO") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 12288 NEXT 12288 MINEXTENTS 1 MAXEXTENTS 249 PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SYSTEM" ENABLE ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 LOGGING STORAGE(INITIAL 12288 NEXT 12288 MINEXTENTS 1 MAXEXTENTS 249 PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SYSTEM" CREATE UNIQUE INDEX "SCOTT"."DEPT_IDX" ON "SCOTT"."DEPT" ("DNAME") FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SYSTEM" Now we can modify the syntax to punch a whole schema. It us easily done by selecting dbms_metadata. get_ddl and specifying USER_TABLES and USER_INDEXES. :
set pagesize 0
set long 90000
set feedback off
set echo off
spool scott_schema.sql
connect scott/tiger;
SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name)
FROM USER_TABLES u;
SELECT DBMS_METADATA.GET_DDL('INDEX',u.index_name)
FROM USER_INDEXES u;
spool off;
Syntax challenge: When you have foreign keys (“references” constraints), it would be nice to punch the table DDL in their proper order for re-loading into another database. If you do not order the table, a table may be added that references another table that has not yet been added. Making this change would involve adding a WHERE clause that queries dba_constraints and dba_cons_columns to determine the proper table order.