Friday, February 18, 2011
resize redo log files
1. First see the size of the current logs:
SQL> connect / as sysdba
SQL> select group#, bytes, status from v$log;
GROUP# BYTES STATUS
---------- ---------- ----------------
1 52428800 INACTIVE
2 52428800 CURRENT
3 52428800 INACTIVE
Logs are 50MB from above which is default in oracle 10g, let's size them to 100MB.
2. Retrieve all the log member names for the groups:
SQL> select group#, member from v$logfile;
GROUP# MEMBER
--------------- ----------------------------------------
1 /usr/oracle/dbs/log1PROD.dbf
2 /usr/oracle/dbs/log2PROD.dbf
3 /usr/oracle/dbs/log3PROD.dbf
3. Now drop the log group 1 and recreate it with increased size
SQL> alter database drop logfile group 1;
SQL> alter database add logfile group 1
'/usr/oracle/dbs/log1PROD.dbf' size 100M reuse;
4. Check the size of the current logs:
SQL> connect / as sysdba
SQL> select group#, bytes, status from v$log;
GROUP# BYTES STATUS
---------- ---------- ----------------
1 10485760 UNUSED
2 52428800 CURRENT
3 52428800 INACTIVE
5. Do the same for log group 3
SQL> alter database drop logfile group 3;
SQL> alter database add logfile group 3
'/usr/oracle/dbs/log3PROD.dbf' size 100M reuse;
SQL> select group#, bytes, status from v$log;
GROUP# BYTES STATUS
---------- ---------- ----------------
1 10485760 UNUSED
2 52428800 CURRENT
3 10485760 INACTIVE
6. Now we go for group 2 but it is now used by oracle, so first switch the log
SQL> alter system switch logfile;
SQL> select group#, bytes, status from v$log;
GROUP# BYTES STATUS
---------- ---------- ----------------
1 10485760 UNUSED
2 52428800 INACTIVE
3 10485760 CURRENT
SQL> alter database drop logfile group 2;
SQL> alter database add logfile group 2
'/usr/oracle/dbs/log2PROD.dbf' size 100M reuse;
7. Check the size of the current logs:
SQL> connect / as sysdba
SQL> select group#, bytes, status from v$log;
GROUP# BYTES STATUS
---------- ---------- ----------------
1 10485760 UNUSED
2 10485760 UNUSED
3 10485760 CURRENT
** some times you may find that a log group status is ACTIVE, in that case you should
make a database checkpoint like this
SQL> ALTER SYSTEM CHECKPOINT;
** FOR safety reason please take full backup
Thursday, June 24, 2010
AWR REPORT
AWR Features
The AWR is used to collect performance statistics including:- Wait events used to identify performance problems.
- Time model statistics indicating the amount of DB time associated with a process from the
V$SESS_TIME_MODELandV$SYS_TIME_MODELviews. - Active Session History (ASH) statistics from the
V$ACTIVE_SESSION_HISTORYview. - Some system and session statistics from the
V$SYSSTATandV$SESSTATviews. - Object usage statistics.
- Resource intensive SQL statements.
- Automatic Database Diagnostic Monitor
- SQL Tuning Advisor
- Undo Advisor
- Segment Advisor
Snapshots
By default snapshots of the relevant data are taken every hour and retained for 7 days. The default values for these settings can be altered using:The changes to the settings are reflected in theBEGIN DBMS_WORKLOAD_REPOSITORY.modify_snapshot_settings( retention => 43200, -- Minutes (= 30 Days). Current value retained if NULL. interval => 30); -- Minutes. Current value retained if NULL. END; /
DBA_HIST_WR_CONTROL view. Typically the retention period should capture at least one complete workload cycle. If you system has monthly archive and loads a 1 month retention time would be more beneficial that the default 7 days. An interval of "0" switches off snapshot collection, which in turn stops much of the self-tuning functionality, hence this is not recommended. Automatic collection is only possible if the STATISTICS_LEVEL parameter is set to TYPICAL or ALL. If the value is set to BASIC manual snapshots can be taken, but they will be missing some statistics.Extra snapshots can be taken and existing snapshots can be removed using:
Snapshot information can be queried from theEXEC DBMS_WORKLOAD_REPOSITORY.create_snapshot; BEGIN DBMS_WORKLOAD_REPOSITORY.drop_snapshot_range ( low_snap_id => 22, high_snap_id => 32); END; /
DBA_HIST_SNAPSHOT view.Baselines
A baseline is a pair of snapshots that represents a specific period of usage. Once baselines are defined they can be used to compare current performance against similar periods in the past. You may wish to create baseline to represent a period of batch processing like:The pair of snapshots associated with a baseline are retained until the baseline is explicitly deleted:BEGIN DBMS_WORKLOAD_REPOSITORY.create_baseline ( start_snap_id => 210, end_snap_id => 220, baseline_name => 'batch baseline'); END; /
Baseline information can be queried from theBEGIN DBMS_WORKLOAD_REPOSITORY.drop_baseline ( baseline_name => 'batch baseline', cascade => FALSE); -- Deletes associated snapshots if TRUE. END; /
DBA_HIST_BASELINE view.Workload Repository Views
The following workload repository views are available:V$ACTIVE_SESSION_HISTORY- Displays the active session history (ASH) sampled every second.V$METRIC- Displays metric information.V$METRICNAME- Displays the metrics associated with each metric group.V$METRIC_HISTORY- Displays historical metrics.V$METRICGROUP- Displays all metrics groups.DBA_HIST_ACTIVE_SESS_HISTORY- Displays the history contents of the active session history.DBA_HIST_BASELINE- Displays baseline information.DBA_HIST_DATABASE_INSTANCE- Displays database environment information.DBA_HIST_SNAPSHOT- Displays snapshot information.DBA_HIST_SQL_PLAN- Displays SQL execution plans.DBA_HIST_WR_CONTROL- Displays AWR settings.
Workload Repository Reports
Oracle provide two scripts to produce workload repository reports (awrrpt.sql and awrrpti.sql). They are similar in format to the statspack reports and give the option of HTML or plain text formats. The two reports give essential the same output but the awrrpti.sql allows you to select a single instance. The reports can be generated as follows:The scripts prompt you to enter the report format (html or text), the start snapshot id, the end snapshot id and the report filename. The resulting report can be opend in a browser or text editor accordingly.@$ORACLE_HOME/rdbms/admin/awrrpt.sql @$ORACLE_HOME/rdbms/admin/awrrpti.sql
Smore More Example Scripts:
Display a list of snapshots
set lines 100 pages 999
select snap_id
, snap_level
, to_char(begin_interval_time, 'dd/mm/yy hh24:mi:ss') begin
from dba_hist_snapshot
order by 1
/
Produce a report:
@?/rdbms/admin/awrrpt.sql
To see the snapshot interval and retention period
col snap_interval format a30
col retention format a30
select snap_interval
, retention
from dba_hist_wr_control
/
Change the snapshot interval:
Note. This example changes it to 30 minutes
exec dbms_workload_repository.modify_snapshot_settings (interval => 30)
Change the retention period
Note. This example changes it to two weeks (14 days)
exec dbms_workload_repository.modify_snapshot_settings (retention => 14*24*60)
Manually take a snapshot
exec dbms_workload_repository.create_snapshot
List all baselines
set lines 100
col baseline_name format a40
select baseline_id
, baseline_name
, start_snap_id
, end_snap_id
from dba_hist_baseline
order by 1
/
Create a baseline
exec dbms_workload_repository.create_baseline (
Remove a baseline
exec dbms_workload_repository.drop_baseline('
Enable/Disable automatic snapshotsNote. This job is enabled by default
exec dbms_scheduler.enable('GATHER_STATS_JOB')
and to disable...
exec dbms_scheduler.disable('GATHER_STATS_JOB')
Time model queries
System time model
set lines 100 pages 999
select stat_name
, value
from v$sys_time_model
order by value desc
/
Session time model
set lines 100 pages 999
select stat_name
, value
from v$sess_time_model
where sid = '&sid'
order by value desc
/
Saturday, December 5, 2009
Table Fragmentation
Wednesday, September 9, 2009
Select Any Table
•If you have O7_DICTIONARY_ACCESSIBILITY=TRUE then SELECT ANY TABLE privilege provides access to all SYS and non-SYS objects.
•If you have O7_DICTIONARY_ACCESSIBILITY=FALSE then SELECT ANY TABLE privilege provides access only to non-SYS objects.
•If only SELECT_CATALOG_ROLE is enabled then it provides access to all SYS views only.
•If only SELECT ANY DICTIONARY privilege is enabled then it provides access to SYS schema objects only.
•If both SELECT ANY TABLE and SELECT any DICTIONARY privilege is enabled then it allow access to all SYS and non-SYS objects.
•SELECT ANY DICTIONARY privilege and SELECT_CATALOG_ROLE has no affect over O7_DICTIONARY_ACCESSIBILITY settings.
Saturday, January 3, 2009
ROLE MANAGEMENT
1) How to create a role
Create role role_name
Create role satish_role
2) Create Password Protected Role
Create role role name identified by password
3) How to Assign Privilege To A Role
GRANT privilege_name TO role_name;
GRANT create session TO role_name
You can give grant role to role
Grant
4) How to Assigning Roles To Users
GRANT roles_name TO user_name;
5) How to Revoking Privileges From Roles
REVOKE
6) How to Revoke a role from a user
REVOKE role_name FROM user_name;
7) How Activating A Role
SET ROLE role_name;
8) How Activating A Password Protected Role
SET ROLE role_name IDENTIFIED BY role_password;
9) How to Activating All Roles
SET ROLE all;
10) How to Activating All Roles Except One
SET ROLE all EXCEPT role_name;
11) How to Deactivating A Role
Can not be done on an individual basis
12) How Deactivating All Roles
SET ROLE none;
13) How to Dropping A Role
DROP ROLE role_name;
14) How to Creating And Assigning The PLUSTRACE Role Used By AUTOTRACE
This role must be created by SYS and grants SELECT on the following v_$ views:
· V$SESSTAT
· V$STATNAME
· V$MYSTAT
SQL> @c:\oracle\product\ora10\sqlplus\admin\plustrce.sql
GRANT plustrace TO uwclass;
15) User$
In this user$ table we can see all roles in our database
16) role_sys_privs
In this role_sys_privs table we can see which Privileges Granted To A Role
17) dba_role_privs
In this dba_role_privs we can see which Roles Granted To Schemas
18) session_roles
In this session_roles we can see the present session have which roles
19) session_prives
In this session_prives table we can see the present session have which privelags
20) dba_roles
In this dba_roles table we can see the dba user contain which roles
21) dba_sys_privs
In this dba_sys_privs table we can see all the system privileges
ORA-01045) this error will be come due to insufficient privs
all_tab_privs_made in this table you can see all tables privs
user_tab_privs_made
Sunday, September 7, 2008
Upgrade Oracle Database 10.2.0.1 to 10.2.0.2
The upgrade was fairly simple process. But it was loooongggg...The patchset to download is 4547817. Login http://metalink.oracle.com and search for this patch.
Download the 570 + MB patch, unzip it to temp folder and run the installer.
It helps to go through the patch note, but it was fairly straight forward if you are not using RAC.
Stop all services in the 10.2.0.1 home. Run the setup. Select the home of the 10.2.0.1 database.
Once you install the new 10.2.0.2, follow the patch note to perform the post installation steps. In short they are to
-Start the listener
-Start the database in the upgrade mode (startup upgrade, once you have logged in as sys)
-Run the catupgrd.sql script (in rdbms\admin folder) (plan for a couple of hours !!)
-Shutdown and Start the database-Run the utlrp to compile all invalid objects (optional step)-
- Some more steps if you are using the recovery manager catalog.
Tuesday, August 12, 2008
difference between the sysdba and sysoper
sysdba has following privilages
1) perform incompleate recovery
2) create database
3) see all user objects
Saturday, August 9, 2008
upgrading database rhel3 to rhel4
The steps to be followed if you are upgrading already existing OS without formatting OS partition.
1. Upgrade the OS from RHEL 3 to 4.
2. Install the required RPMs. Please refer to Metalink Note 169706.1 for the list of required RPMs to be installed. This is because the list of packages required for RHEL 3 and 4 are different.
3. Relink Oracle binaries. For more information about how to relink Oracle binaries, please refer to Metalink Note 131321.1
4. Here there is no need to configure the kernel parameters and Oracle user's environment because this will be preserved while upgrading the OS without formatting OS partition.
The steps to be followed if you are upgrading to RHEL 4 by formatting OS partition and re-installing RHEL 4.
1. Take backup of the files /etc/oraInst.loc and /etc/oratab files. Note down the Oracle database user(oracle) and groups (oinstall, dba) ids.
2. Install RHEL 4. While installing make sure that you have selected default RPM installation. This is mandatory requirement to install Oracle database.
3. Install all other required packages from Metalink Note 169706.1.
4. Create Oracle database user(oracle) and groups (oinstall, dba). Make sure that you have these Oracle users and groups with the same ids and names that you had in RHEL 3.
5. Configure the kernel parameters and Oracle user's environment as per installation guide.
6. Restore the files /etc/oraInst.loc and /etc/oratab files that you have taken backup in step 1.
7. Relink Oracle binaries. For more information about how to relink Oracle binaries, please refer to Metalink Note 131321.1.
8. Run $ORACLE_HOME/root.sh script that creates dbhome, oraenv and coraenv scripts in the directory /usr/local/bin.
Wednesday, April 23, 2008
Recovery in Archive log Mode
1.Closed Database Recovery
2.Open Database Recovery with database initially open
3.Open Database Recovery with database initially closed
4.Datafile Recovery with no datafile backup
1.Closed Database Recovery
Situations where this mode is applicable
1.When the system datafile is missing
2.When the undo datafile is missing
3.Large number of datafiles are missing
SQL> shut abort
Now physically copy the required datafiles from hot backup
SQL> startup mount
Check which datafile needs recovery by v$recover_file
SQL> recover database
SQL>alter database open
2.Open Database Recovery with database initially open
Situations where this mode is applicable
1.other than system undo data files are missing
Database is open stage
Offline the particular table space
Physically copy the missed files from hot backup
Recover data file name or number
Make table space online
SQL> alter tablespace tablespacename offline immediate
Copy the particular datafile which is missing from hotbackup
SQL> recover datafile ‘datafile path or number’
SQL>alter tablespace online
3.Open Database Recovery with database initially closed
Situations where this mode is applicable
1.other than system undo data files are missing
2.when the database is in the closed in abnormal state due to hardware issue
SQL>startup mount
SQL>alter database datafile ‘ path’ offline
SQL>alter database open
Copy the particular datafile which is missing from hotbackup
SQL>recover datafile ‘path or number’
SQL>alter datafile ‘path’ online
4.Datafile Recovery with no datafile backup
Situations where this mode is applicable
Normal Datafile is missing if no back up is there
SQL> startup mount
SQL> alter database create datafile ‘path’
SQL> recover datafile ‘path’
SQL>alter database open;
Or
If database is in open stage
SQL>alter datafile ‘file’ offline
or
SQL>alter tablespace t.name offline
SQL>alter database create datafile ‘filepath’
SQL>recover datafile ‘file path’
SQL>alter datafile ‘file path’ online
Sunday, March 16, 2008
password file creation
Oracle provides a password utility, orapwd, to create a password file. When you connect
using SYSDBA privilege, you are connecting as SYS schema and not the schema associated
with your username. For SYSOPER, you are connected to the PUBLIC schema.
What is the use of password file
By using password file you can create a user with sysdba privilages
and you can connect remotly with sysdba privilages
Creating a password file
Go to dba directory and create a password file by usein orapwd utility
[satish@host dbs]$ pwd
/oracle/satish/9i
[satish@host dbs]$ orapwd file=orapwsatish password=welcome
Then password file will be created
after set the parameter
remote_login_passwordfile=exclusive in pfile or spfile
then password file will be ready
after you can create a user with sysdba privilages and you can connect with sysdba prives
creating a user with sysdba privilages
SQL>show user
sys
SQL>create user satish identified by welcome
user created
SQL>grant sysdba to satish
Grant succeeded.
then normal user is ready with sysdba privilages
connect user with sysdba privilages
SQL> conn satish/welcome as sysdba
Note:-
Set the REMOTE_LOGIN_PASSWORDFILE parameter to EXCLUSIVE or SHARED
where:
EXCLUSIVE indicates that only one instance can use the password file and that
the password file contains names other than SYS. Using an
EXCLUSIVE password file you can grant SYSDBA or
SYSOPER privileges to individual users.
SHARED indicates that more than one instance can use the password file.
The only user recognized by the password file is SYS. You
cannot add users to the SHARED password file.
Tuesday, January 22, 2008
TABLE SPACE MANAGEMENT
you create additional tablespaces to store user data, user indexes, undo segments, and
temporary segments separate from data dictionary.
The DBA can create new tablespaces, resize data files, add data files to tablespaces, set and
alter default segment storage settings for segments created in a tablespace, make a tablespace
read-only or read-write, make a tablespace temporary or permanent, and drop
tablespaces.
- The data in an Oracle database are stored in tablespaces.
- An Oracle database can be logically grouped into smaller logical areas of space known
as tablespaces. - A tablespace can belong to only one database at a time.
- Each tablespace consists of one or more operating system files, which are called data files.
Table spaces are two types
1)system tablespace 2)nonsystem tablespace
SYSTEM tablespace
*Created with the database
*Contains the data dictionary
*Contains the SYSTEM undo segment
Non-SYSTEM tablespaces
*Separate segments
*Ease space administration
*Control amount of space allocated to a user
Space Management in Tablespaces
Table spaces are managed by two types
1)locally managed 2)Dictionary managed
locally managed:-The extents are managed with in the tablespace via bitmaps
*Free extents recorded in bitmap
*Each bit corresponds to a block or group of blocks
*Bit value indicates free or used
Dictionary managed:-the extents are managed by the data dictionary segments in dictionary managed tablespace can have customized storage.
*Free extents recorded in data dictionary tables
syntax for creation of tablespaces
SQL>create tablespace svs datafile '$ORACLE_HOME/oradata/svs.dbf ' size 10m extent management local;
SQL>create tablespace svs1 datafile '$ORACLE_HOME/oradata/svs1.dbf' size 20m extent management local autoallocated;
SQL>create tablespace svs2 datafile '$ORACLE_HOME/oradata/svs2.dbf ' size 30m extent management local uniform size 10k;
SQL>create tablespace svs3 datafile '$ORACLE_HOME/oradata/svs3.dbf ' size 10m extent management dictionary;
SQL>create tablespace svs4 datafile '$ORACLE_HOME/oradata/svs4.dbf ' size 10m extent management dictionary default storage (initial 1m next 1m pct increase0);
we can give storage parameters in three levels
1)server level
2)tablespace level
3)segment level
Configure database noarchive to archive log mode
create a directory for archives
[satish@host satish]$cd 9i/oradata
[satish@host oradata ]$pwd
/oracle/satish/9i/oradata
[satish@host oradata]$mkdir archs
then open the parameter file and add this parameters
[satish@host oradata]$cd $ORACLE_HOME/dbs
[satish@host dbs]$vi initsatish.ora
#add this lines
log_archive_start=true
log_archive_dest='/oracle/satish/9i/oradata/archs'
log_archive_format=%s%t
#save and exit
connect to sql promt with sysdba
[satish@host satish]$sqlplus /'as sysdba'
SQL>startup mount
SQL>alter database archivelog;
SQL>alter database open;
then database will be open with archive log mod
if you want to check your database is archive mod or noarchive mod then use this command
SQL>archive log list
--satish
Monday, January 21, 2008
MAINTAINING REDO LOG FILES
Redo log files provide the means to redo transaction in the event of a database failure
Online redo log file groups
- A set of identical copies of online redo log file is called an online redo log file group
- The LGWR background process concurrently writes the same information to all online redo log files in a group
- The oracle server needs a minimus of two online redo log file groups for the normal operation of a database
Online redo log file member
- each online redo log file in a group is called a member
- each member in a group has identical log sequence number and of the same size
- the corrent log sequence number is stored in the control file and in the header of all datafiles
Log switch
When the current online redo logfile group filled LGWR begins writing to the next group
this is called a log switch
this command is showing the redolog groups
SQL>select * from v$log;
this command is showing the redolog files
SQL>select * from v$logfile;
adding online redo log file group
SQL>alter database add logfile group3('/oracle/satish/9i/oradata/redo3a.log','/oracle/satish/9i/oradata/redo3b.log') size 5m;
adding online redo logfile member
SQL>alter database add logfile member '/oracle/satish/9i/oradata/redo3c.log' to group 3;
Relocation or renaming online redo log files
tow wayes is there
1)alter database
SQL>alter database rename file 'path1' to 'path2'
2)add new member and drop old member
Drop online redo log file groups
SQL>alter database drop logfile group 3;
- An instance require atleast two groups of online redo log files
- An active or current froup can not be dropped
Droping online redo log file members
SQL>alter database drop logfile member '/oracle/satish/9i/oradata/redo3a.log';
- we can not drop the last member
- we can not drop the current member
- if the databse is running in archive mode and the log file group to which the member belong is not archived then the member can not be dropped
Resize the redo log file
we can not resize the redo log file
just we can create another file and delete oldfile.
Forcing log switch
SQL>alter system switch logfile;
--satish
multiflexing of control files
The information in the control file includes:
• Database name is taken from either the name specified by the initialization parameter
DB_NAME or the name used in the CREATE DATABASE statement.
• Database identifier is recorded when the database is created.
• Time stamp of database creation is also recorded at database creation.
• Names and locations of associated data files and online redo log files are updated when
a data file or redo log is added to, renamed in, or dropped from the database.
• Tablespace information is updated as tablespaces are added or dropped.
• Redo log history is recorded during log switches.
• Location and status of archived logs are recorded when archiving occurs.
• Location and status of backups are recorded by the Recovery Manager utility.
• Current log sequence number is recorded when log switches occur.
• Checkpoint information is recorded as checkpoints are made.
Multiplexing the Control File using pfile
1)shutdown the database
2)By using OS command copy the oldfile to newfile
3)In initsid.ora file change this control_file=(oldfilepath,newfilepath')
4)startup the database
SQL>shut immediate
SQL>!
[satish@host oradata]$pwd
/oracle/satish/9i/oradata
[satish@host oradata]$ls
control.ctl redo1.log redo2.log system.dbf undo.dbf
[satish@host oradata]$cp control.ctl control1.ctl
[satish@host oradata]$cd /oracle/satish/9i/dbs
[satish@host dbs]$vi initsatish.ora
#change this parameter
control_files=(/oracle/satish/9i/oradata/control.ctl,oracle/satish/9i/oradata/control1.ctl)
#save and exit
[satish@host dbs]$ cd
[satish@host satish]$sqlplus /'as sysdba'
SQL>start up
then database will be start with two control files
if you want check youer control files use this command
SQL>show parameter control_files
Multiplexing the Control File using spfile
SQL>alter sysytem set control_files='$ORACLE_HOME/oradata/control.ctl','$ORACLE_HOME/oradata/control1.ctl','$ORACLE_HOME/oradata/control2.ctl' scop=spfile;
SQL>shut immediate
SQL>exit
[satish@host satish]$
[satish@host satish]$cd $ORACLE_HOME/oradata/
[satish@host oradata]$pwd
/oracle/satish/9i/oradata
[satish@host oradata]$ cp control.ctl control2.ctl
[satish@host oradata]$cd
[satish@host satish]$sqlplus /'as sysdba'
SQL>startup
then database will be started with 3 control files
if you want see the control file then
SQL>show parameter control_files
or
SQL>select * from v$control_file
--satish
SPFILE CREATION
If you know your database is using pfile or spfile like this
SQL>show parameter spfile
then if it will be displayed strig value is null then your database is running by using pfile
other wise it is running by using spfile
create spfile
SQL>create spfile from pfile;
then spfile will be created default location is $ORACLE_HOME/dbs
spfile file name is spfilesatish.ora means spfile
after shout down and startup the database
defult the database is startup by using spfile
if spfile is there but you want to start the database by using pfile then use this command
SQL>startup pfile=$ORACLE_HOME/dbs/initsatish.ora
what is the use of spfile
By using spfile you can change parameter values dynamically. That means if you want to change parameter value
no need to shutdown the database
offcourse you can chnge some parameters dynamically by using pfile but thsoe parameter values are not permanent
By using spfile you can change parameter value this type
SQL>alter system set parameter
database creation on 9i
Go to oracle s/w directory
I installed s/w in /oracle/satish/9i
So go to that directory and create 2directoryes like
[satish@host 9i]$ pwd
/oracle/satish/9i
[satish@host 9i]$ mkdir oradata dump
go to dump directory and create bdump udump cdump directoryes like
[satish@host dump]$ pwd
/oracle/satish/9i/dump
[satish@host dump]$ mkdir bdump cdump udump
wile instalation time in ORACLE_HOME/dbs init.ora file will be come
then copy that file to initsid.ora like
[satish@host dbs]$ pwd
/oracle/satish/9i/dbs
[satish@host dbs]$ cp init.ora initsatish.ora
after open initsatish.ora by using vi editor and make changes like
db_name=satish
control_file=(/oracle/satish/9i/oradata/control.ctl)
#and add this lines
background_dump_dest='$ORACLE_HOME/dump/bdump'
user_dump_dest='$ORACLE_HOME/dump/udump'
core_dump_dest='$ORACLE_HOME/dump/cdump'
compatible=9.2.0
undo_management=auto
save and exit
after connect to sql promp with sysdba like
[satish@host satish]$ sqlplus /'as sysdba'
after sql prompt will be come then nomount the database like
sql> startup nomount
then data base will be go to nomount stage after go to os and create a file by using vi editor and after run that file in sql promt like this
sql> !
[satish@host satish]$ vi createdb.sql
create database satish
logfile
group 1('/oracle/satish/9i/oradata/redo1.log') size 5m;
group 2('/oracle/satish/9i/oradata/redo2.log') size 5m
datafile
'$ORACLE_HOME/oradata/system.dbf' size 500m
undo tablespace undotabs
datafile '/oracle/satish/9i/oradata/undo.dbf' size 300m
charecte set us7ascii
;
#save and exit
after connect to sql prompt with sysdba
and take database with no mount stage
and run that script like
SQL>sqlplus 'as sysdba'
SQL>startup nomount
SQL> @/oracle/satish/createdb.sql
then database will be created and default database in open stage
then run this fallowing scripts
SQL>@/oracle/satish/9i/rdbms/admin/catalog.sql
SQL>@/oracle/satish/9i/rdbms/admin/catproc.sql
after connect system/manager run the pupbld.sql script like
SQL>conn system/manager
SQL>@oracle/satish/9i/sqlplus/admin/pupbld.sql
then database will be ready
best of luck
--satish
Saturday, January 19, 2008
instalation oracle 9i on RHEL3.0
those packges are available in redhat os cds
install that packages
[ root@host packlocation] # rpm -ivh compat-db* --aid --force
means rpm -ivh
install all packages by using above command
[ root@host packlocation] # rpm -qa comepat-db*
means rpm -qa (packname>
after run this commands
[root@host root]#mv -i /usr/bin/gcc /usr/bin/gcc323
[root@host root]#mv -i /usr/bin/g++ /usr/bin/gcc
[root@host root]#ln -s /usr/bin/g++296 /usr/bin/g++
required patch 3006854
down load that pach from metalink and unzip that and applay that patch
note-: after apply the patch restart the system
add group
[root@host root]#groupadd dba
add the user with home directory /oracle and group dba
[root@host root]#useradd -d /oracle/satish -g dba satish
hear /oracle is local mount point you can give any mount point name
how to check your mount points
[root@host root]#df -h
set password for user
[root@host root]#passwd satish
give new password and retype new password
then password will be set
set ora inst location
[root@host root]#vi /etc/oraInst.loc
inventory_loc=/oracle/satish/oraInventory
save and exit
check graphicaly mod is exist or not
[root@host root]#xclock
go to created user
[root@host root]#su - satish
set the bashrc in satish user
[satish@host satish]$vi .bashrc
#come to last line and writ it
export ORACLE_SID=satish
export ORACLE_BASE=/oracle/satish
export ORACLE_HOME=/oracle/satish/9i
export LD_ASSUME_KERNEL=2.4.19
export PATH=$PATH:/$ORACLE_HOME/bin:.
#save and exit
run the bashrc
[satish@host satish]$ . .bashrc
run the instalation
go to the 9i software path and run
[satish@host Disk1]./runInstaller
after select what ever packeges you need and install
you can download the software from this site
http://www.oracle.com/technology/software/products/oracle9i/index.html
best of luck
--satish