17.03.2015 Views

Oracle pre-patch configuration document - download.gofrugal...

Oracle pre-patch configuration document - download.gofrugal...

Oracle pre-patch configuration document - download.gofrugal...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Before Start Import Data & Patch Operation<br />

Database Configuration:<br />

<strong>Oracle</strong> 10g, 11g ORCLConfiguration<br />

STEP 1. Connect into sql*plus as DBA and issue below command to create initorcl.ora file<br />

File created under below location<br />

create pfile from spfile;<br />

exit<br />

Windows:<br />

E:\oracle\product\10.2.0\db_1\database\initorcl.ora<br />

Linux:<br />

/home/oracle/product/10.2.0/db_1/dbs/initorcl.ora<br />

STEP 2. Edit initorcl.ora with wordpad in windows, vi editor in linux and add following<br />

If System RAM Size is 2G<br />

*.SGA_MAX_SIZE=1100M<br />

*.SGA_TARGET=1024M<br />

*.DB_CACHE_SIZE=512M<br />

*.PGA_AGGREGATE_TARGET=256M<br />

*.UNDO_MANAGEMENT=AUTO<br />

ctrl+s to save in windows, <strong>pre</strong>sss Esc type :wq to save in linux<br />

STEP 3. Connect as DBA and Issue below query to create spfile (dynamic update)<br />

connect /as sysdba<br />

create spfile from pfile;<br />

if you get ORA-32002: cannot create SPFILE already being used by the instance then please<br />

shutdown oracle using below query<br />

shut immediate;<br />

and then try,<br />

connect /as sysdba<br />

create spfile from pfile;<br />

on success you will receive file created message.<br />

if any other error shows please check initorcl.ora file that parameter which you added<br />

<strong>pre</strong>viously<br />

STEP 4. Please then startup the oracle using below query<br />

startup<br />

if everything goes well oracle started successfully with above settings<br />

Note: Please ensure you are logged as ORACLE user to connect as DBA.


Please Check Require Tablespaces Size and Disk Space Here: Size Estimator<br />

PRECHECK LIST<br />

Scenario<br />

CHECK 1 : MIN FREE DISKSPACE is<br />

DUMP FILESIZE i.e. If 100 GB dumpfile<br />

need to be imported, harddisk MUST have<br />

minimum 100GB<br />

Solution<br />

Contact System Administrator to add required<br />

disk space<br />

Procedure : Before dump data into database<br />

check available disk space<br />

Linux: df -lh<br />

Windows: du -skh<br />

CHECK2: 2GB FREE TEMP TABLESPACE<br />

is MINIMUM REQUIREMENT<br />

Procedure : check used & available space of<br />

temp tablespace using following query<br />

select bytes_used/1024/1024 Used,<br />

bytes_free/1024/1024 Free from<br />

v$temp_space_header;<br />

if available temp space is = zero<br />

1. To Clear temp space do following<br />

CREATE TEMPORARY TABLESPACE<br />

temp01 TEMPFILE 'path' SIZE 2048M<br />

AUTOEXTEND ON NEXT 100M MAXSIZE<br />

UNLIMITED EXTENT MANAGEMENT<br />

LOCAL UNIFORM SIZE 16M;<br />

PATH: please mention the path to place a file i.e<br />

'e:\oradata\temp02.dbf' in above query<br />

PATH: Please mention the path to place a file i.e<br />

'/home/oracle/app/product/oradata/tepm02.dbf'<br />

in above query<br />

ALTER DATABASE DEFAULT TEMPORARY<br />

TABLESPACE temp01;<br />

CHECK3: DUMP FILE SIZE EQUAL<br />

USERS TABLESPACE SIZE is MINIMUM<br />

REQUIREMENT ADD DATAFILES WITH<br />

AUTOEXTEND<br />

Procedure : To Check used & available space of<br />

USERS tablespace<br />

Free space in USERS:<br />

select tablespace_name, sum(bytes)/1024/1024<br />

FREE from dba_free_space group by<br />

tablespace_name having tablespace_name =<br />

'USERS';<br />

drop tablespace temp including contents and<br />

datafiles;<br />

To Add more free space or required space in<br />

USERS tablespace<br />

ALTER TABLESPACE USERS ADD<br />

DATAFILE 'path' SIZE 2048M AUTOEXTEND<br />

ON NEXT 200m MAXSIZE UNLIMITED;<br />

PATH: please mention the path to place a file i.e<br />

'e:\oradata\users02.dbf' in above query<br />

PATH: Please mention the path to place a file i.e<br />

'/home/oracle/app/product/oradata/users02.dbf'<br />

in above query<br />

USED space in USERS


select a.name, a.bytes/1024/1024 USED from<br />

v$datafile a, v$tablespace b where b.ts# = a.ts#<br />

and b.name = 'USERS';<br />

if free is zero or required space > free space<br />

CHECK4: 5GB FREE UNDO TABLESPACE<br />

is MINIMUM REQUIREMENT<br />

Procedure: To Check Used and Available space<br />

of UNDO tablespace<br />

Free space in UNDO:<br />

select tablespace_name, sum(bytes)/1024/1024<br />

FREE from dba_free_space group by<br />

tablespace_name having tablespace_name =<br />

'UNDOTBS1';<br />

USED space in UNDO:<br />

To Add more free space or required space in<br />

UNDO tablespace<br />

ALTER TABLESPACE UNDOTBS1 ADD<br />

DATAFILE 'path' SIZE 2048M AUTOEXTEND<br />

ON NEXT 200m MAXSIZE UNLIMITED;<br />

PATH: please mention the path to place a file i.e<br />

'e:\oradata\undotbs02.dbf' in above query<br />

PATH: Please mention the path to place a file i.e<br />

'/home/oracle/app/product/oradata/undotbs02.db<br />

f' in above query<br />

select a.name, a.bytes/1024/1024 USED from<br />

v$datafile a, v$tablespace b where b.ts# = a.ts#<br />

and b.name = 'UNDOTBS1';<br />

if free is zero or required space > free space<br />

CHECK5: 3 REDO Log file each 500MB is<br />

MINIMUM REQUIREMENT<br />

Procedure: Check REDO log file size<br />

select bytes/1024/1024 MB from v$log;<br />

if SIZE of MB = 50MB then add more redo log<br />

file<br />

Create 3 REDO log file with 500MB<br />

alter database add logfile ('path','path','path') size<br />

500m;<br />

alter system switch logfile;<br />

PATH: please mention the path to place a file i.e<br />

'e:\oradata\redo5.log' in above query<br />

CHECK6: ALL DATAFILES<br />

AUTOEXTEND ENABLED<br />

Procedure:<br />

select<br />

file_name,tablespace_name,bytes/1024/1024,AU<br />

TOEXTENSIBLE,status from dba_data_files<br />

order by tablespace_name;<br />

PATH: Please mention the path to place a file i.e<br />

'/home/oracle/app/product/oradata/redo5.log' in<br />

above query<br />

As i mentioned procedure will create datafile<br />

with autoextend option when you add new<br />

datafile to tablespaces.<br />

Creating USERS Tablespace with autoextend<br />

enable:<br />

CREATE TABLESPACE USERS01 ADD<br />

DATAFILE 'path' SIZE 2048M AUTOEXTEND<br />

ON NEXT 200m MAXSIZE UNLIMITED<br />

EXTENT MANAGEMENT LOCAL;<br />

ALTER DATABASE DEFAULT TEMPORARY<br />

TABLESPACE USERS01;<br />

PATH: please mention the path to place a file i.e


'e:\oradata\users01.dbf' in above query<br />

CHECK7: Do monitor size of temp, undo<br />

and users tablespace while <strong>patch</strong> executions<br />

running on. If require increase or resize<br />

tablespace size to avoid space errors.<br />

Procedure: Query to find free and used space in<br />

tablespace in SQL * plus using mentioned<br />

procedure above.<br />

Based on DUMP file size and for <strong>patch</strong><br />

operations<br />

PATH: Please mention the path to place a file i.e<br />

'/home/oracle/app/product/oradata/users01.dbf'<br />

in above query<br />

Add datafiles in USERS tablespace, Increase<br />

UNDO Tablespace, TEMP tablespace<br />

Follow above procedure to add space in<br />

appropriate tablespace<br />

if dump size is 100GB then create 5 datafiles<br />

with minimum of 2G each datafile will grow<br />

upto 32GB with unlimited option which is<br />

enough to complete the process<br />

Note: ORACLE XE user data limited 4GB you can't extend space like you do in orcl database. 1<br />

datafile with size of 4GB is suggested in ORACLE XE<br />

Knowledge:<br />

1. Use tablespace other than system and sysaux tablespace to store users data. Verify the<br />

default tablespace & temp tablespace using below query<br />

select property_name,property_value from database_properties where property_name<br />

like '%TABLESPACE';<br />

2. Place user datafiles in seperate hardisk or partiation.<br />

3. Use recommanded parameters settings and on load basis reset or increase value of<br />

parameters<br />

4. Large DML (insert,update and delete) operations require more UNDO tablespace. Increase<br />

the size of UNDO tablespace to avoid space errors.<br />

5. Sorting (group by, order by, having) operations require more Temp tablespace. Increase the<br />

size of TEMP tablespace to avoid space errors.<br />

6. As per dump file size add require datafiles to USERS tablespace. Each datafile can have<br />

max value of 32768 MB (32GB) to avoid space errors. Before add datafiles in USERS<br />

tablespace do check available disk space in the appropriate directory.<br />

Example: if dump file size is 140GB add 5 datafiles in USERS tablespace and each datafile<br />

value 32768<br />

7. At lease have 3 members and 2 group totally 6 redo log files for better log switch operations<br />

and make sure each 500MB<br />

8. Verify with alert log and trace file for error cause and do report immediately to fix issue.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!