Wednesday, June 2, 2010

ASM commands

===============================================
CREATE
===============================================
---CREATE DISKGROUP

CREATE DISKGROUP disk_group_1 NORMAL REDUNDANCY
FAILGROUP failure_group_1 DISK
'/devices/diska1' NAME diska1,
'/devices/diska2' NAME diska2,
FAILGROUP failure_group_2 DISK
'/devices/diskb1' NAME diskb1,
'/devices/diskb2' NAME diskb2;

---create tablespace
CREATE TABLESPACE DATA1 DATAFILE '+' SIZE 100M AUTOEXTEND ON;

•NORMAL REDUNDANCY - Two-way mirroring, requiring two failure groups.
•HIGH REDUNDANCY - Three-way mirroring, requiring three failure groups.
•EXTERNAL REDUNDANCY - No mirroring for disks that are already protected using hardware mirroring or RAID.

-- Add disks.
ALTER DISKGROUP disk_group_1 ADD DISK
'/devices/disk*3',
'/devices/disk*4';

SQL> alter diskgroup DATA1 add directory '+DATA1/oradata/orcl;
#Now create the alias
SQL> alter diskgroup DATA1 add alias '+DATA1/oradata/orcl/nitin01.dbf' for
+DATA1/orcl/datafile/nitin.263.3;

-- Create a directory.
ALTER DISKGROUP disk_group_1 ADD DIRECTORY '+disk_group_1/my_dir';

-- Rename a directory.
ALTER DISKGROUP disk_group_1 RENAME DIRECTORY '+disk_group_1/my_dir' TO '+disk_group_1/my_dir_2';

-- Delete a directory and all its contents.
ALTER DISKGROUP disk_group_1 DROP DIRECTORY '+disk_group_1/my_dir_2' FORCE;

==============================================
DROP
==============================================
DROP DISKGROUP disk_group_1 INCLUDING CONTENTS;
-- Drop a disk.
ALTER DISKGROUP disk_group_1 DROP DISK diska2;

-- Drop file using an alias.
ALTER DISKGROUP disk_group_1 DROP FILE '+disk_group_1/my_dir/my_file.dbf';

-- Drop file using a numeric form filename.
ALTER DISKGROUP disk_group_1 DROP FILE '+disk_group_1.342.3';

-- Drop file using a fully qualified filename.
ALTER DISKGROUP disk_group_1 DROP FILE '+disk_group_1/mydb/datafile/my_ts.342.3';

==============================================
RESIZE
==============================================
-- Resize a specific disk.
ALTER DISKGROUP disk_group_1
RESIZE DISK diska1 SIZE 100G;

-- Resize all disks in a failure group.
ALTER DISKGROUP disk_group_1
RESIZE DISKS IN FAILGROUP failure_group_1 SIZE 100G;

-- Resize all disks in a disk group.
ALTER DISKGROUP disk_group_1
RESIZE ALL SIZE 100G;
ALTER DISKGROUP disk_group_1 REBALANCE POWER 5;
ALTER DISKGROUP ALL DISMOUNT;
ALTER DISKGROUP ALL MOUNT;
ALTER DISKGROUP disk_group_1 DISMOUNT;
ALTER DISKGROUP disk_group_1 MOUNT;

-- Check metadata for a specific file.
ALTER DISKGROUP disk_group_1 CHECK FILE '+disk_group_1/my_dir/my_file.dbf'

-- Check metadata for a specific failure group in the disk group.
ALTER DISKGROUP disk_group_1 CHECK FAILGROUP failure_group_1;

==============================================================================
MIGRATION TO ASM USING RMAN
===============================================================================

1> Disable change tracking (only available in Enterprise Edition) if it is currently being used.

SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;•Shutdown the database.

SQL> SHUTDOWN IMMEDIATE

2>•Modify the parameter file of the target database as follows:

set the DB_CREATE_FILE_DEST and DB_CREATE_ONLINE_LOG_DEST_n parameters to the relevant ASM disk groups.
Remove the CONTROL_FILES parameter from the spfile so the control files will be moved to the DB_CREATE_* destination and the spfile gets updated automatically.
If you are using a pfile the CONTROL_FILES parameter must be set to the appropriate ASM files or aliases.

3>•Start the database in nomount mode.

RMAN> STARTUP NOMOUNT

4>Restore the controlfile into the new location from the old location.

RMAN> RESTORE CONTROLFILE FROM 'old_control_file_name';

5>Mount the database.

RMAN> ALTER DATABASE MOUNT;

6>Copy the database into the ASM disk group.

RMAN> BACKUP AS COPY DATABASE FORMAT '+disk_group';

7>Switch all datafile to the new ASM location.

RMAN> SWITCH DATABASE TO COPY;

8>Open the database.

RMAN> ALTER DATABASE OPEN;

9>Create new redo logs in ASM and delete the old ones.

10>Enable change tracking if it was being used.

SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;



=================================================================
11g NEW FEATURE
=================================================================
Oracle 11g ASM includes two new compatibility attributes that determine the version of the ASM
and database software that can use specific disk groups:

--------------------------------------------------------------------
The compatibility versions of a disk group can only be */increased/*

•COMPATIBLE.ASM - The minimum version of the ASM software that can access the disk group.
In 11g, the default setting is 10.1.
•COMPATIBLE.RDBMS - The minimum COMPATIBLE database initialization parameter setting for any database
instance that uses the disk group. In 11g, the default setting is 10.1.

CREATE DISKGROUP DATA1 DISK '/dev/raw/*'
ATTRIBUTE 'compatible.asm' = '11.1';
CREATE DISKGROUP DATA1 DISK '/dev/raw/*'
ATTRIBUTE 'compatible.rdbms' = '11.1', 'compatible.asm' = '11.1';

ALTER DISKGROUP DATA1 SET ATTRIBUTE 'compatible.asm' = '11.1';
ALTER DISKGROUP DATA1 SET ATTRIBUTE 'compatible.rdbms' = '11.1';
---------------------------------------------------------------------
Fast Mirror Resync
ASM keeps track of the changed extents that need to be applied to the offline disk.
*/Once the disk is available, only the changed extents are written to resynchronize the disk, /*
rather than overwriting the contents of the entire disk.
This can speed up the resynchronization process considerably

-- Set using the hours unit of time.
ALTER DISKGROUP disk_group_1 SET ATTRIBUTE 'disk_repair_time' = '4.5h';

-- Set using the minutes unit of time.
ALTER DISKGROUP disk_group_1 SET ATTRIBUTE 'disk_repair_time' = '300m';
---------------------------------------------------------------------
ROLLING MIGRATION

ALTER SYSTEM START ROLLING MIGRATION TO 11.2.0.0.0;

-----CAN BE DONE ONLY
•Mount and dismount of the disk groups.
•Open, close, resize, and delete of database files.
•Access to local fixed views and fixed packages

-----CURRENT STATUS
SELECT SYS_CONTEXT('sys_cluster_properties', 'cluster_state') FROM dual;
If a disk goes offline during a rolling upgrade, the timer is not started until after the rolling upgrade is complete.
--------------------------------------------------------------------------------
UPGRADE
Clustered ASM instances for 11g onwards can be upgraded using a rolling upgrade.
The ASM cluster is placed in rolling upgrade mode by
issuing the following command from one of the nodes.

ALTER SYSTEM START ROLLING MIGRATION TO 11.2.0.0.0;

Once the cluster is in rolling upgrade mode each node in turn can be shutdown, upgraded and started.
The cluster runs in a mixed version environment until the upgrade is complete.
In this state, the cluster is limited to the following operations:

•Mount and dismount of the disk groups.
•Open, close, resize, and delete of database files.
•Access to local fixed views and fixed packages.
The current status of the ASM cluster can be determined using the following query.

SELECT SYS_CONTEXT('sys_cluster_properties', 'cluster_state') FROM dual;

Once the last node is upgraded, the rolling upgrade is stopped by issuing the following command,
which checks all ASM instances are at the appropriate version,
turns off rolling upgrade mode and restarts any pending rebalance operations.

ALTER SYSTEM STOP ROLLING MIGRATION;

Restrictions and miscellaneous points about the rolling upgrade process include:

•The Oracle clusterware must be fully patched before an ASM rolling upgrade is started.
•Rolling upgrades are only available from 11g onwards,
so this method is not suitable for 10g to 11g upgrades.
•This method can be used to rollback to the previous version if the rolling upgrade fails before completion.
•If the upgrade fails, any rebalancing operations must complete before a new upgrade can be attempted.
•New instances joining the cluster during a rolling upgrade are automatically placed in rolling upgrade mode.
•If all instances in a cluster are stopped during a rolling upgrade,
once the instances restart they will no longer be in rolling upgrade mode. The upgrade must be initiated as if it were a new process.

The "ALTER DISKGROUP ... MOUNT" statement allows disk groups to be mounted in restricted mode.

======================================================================
ALLOCATION_UNIT AU_SIZE
======================================================================
When the disk group compatibility attributes are set to 11.1 or higher,
the extent size will automatically grow as the file grows.
The first 20,000 extents match the allocation unit size (1*AU).
The next 20,000 extents are made up of 8 allocation units (8*AU).
Beyond that point, the extent size becomes 64 allocation units (64*AU).

CREATE DISKGROUP disk_group_2
EXTERNAL REDUNDANCY
DISK '/dev/sde1'
ATRRIBUTE 'au_size' = '32M';

----------------------------------------------------------------------------
SYSASM Privilege and OSASM OS Group
$ sqlplus / as sysasm

---------------------------END OF 11G FEATURE--------------------------------
=============================================================================
V$VIEWS
=============================================================================

View ASM Instance DB Instance
V$ASM_ALIAS Displays a row for each alias present in every disk group mounted by the ASM instance.
Returns no rows
V$ASM_CLIENT Displays a row for each database instance using a disk group managed by the ASM instance.
Displays a row for the ASM instance if the database has open ASM files.
V$ASM_DISK Displays a row for each disk discovered by the ASM instance, including disks which are not part of any disk group.
Displays a row for each disk in disk groups in use by the database instance.
V$ASM_DISKGROUP Displays a row for each disk group discovered by the ASM instance. Displays a row for each disk group mounted by the local ASM instance.
V$ASM_FILE Displays a row for each file for each disk group mounted by the ASM instance.
Displays no rows.
V$ASM_OPERATION Displays a row for each file for each long running operation executing in the ASM instance. Displays no rows.
V$ASM_TEMPLATE Displays a row for each template present in each disk group mounted by the ASM instance. Displays a row for each template present in each disk group mounted by the ASM instance with which the database instance communicates.

select name, state, type, total_mb, free_mb from v$asm_diskgroup;

NAME STATE TYPE TOTAL_MB FREE_MB
------------------------------ ----------- ------ ---------- ----------
DATA1 MOUNTED EXTERN 34512 34101

select name, path, mode_status, state, disk_number from v$asm_disk

NAME PATH MODE_ST STATE DISK_NUMBER
------------ ---------------------- ------- -------- -----------
DATA_0000 /dev/rdsk/c3t19d5s4 ONLINE NORMAL 0
DATA_0001 /dev/rdsk/c3t19d16s4 ONLINE NORMAL 1
DATA_0002 /dev/rdsk/c3t19d17s4 ONLINE NORMAL 2
DATA_0003 /dev/rdsk/c3t19d18s4 ONLINE NORMAL 3

SQL> select INSTANCE,NAME,STATUS,SOFTWARE_VERSION,COMPATIBLE_VERSION from v$asm_client;

------- ------------ ------------ ------------
cubs1 CONNECTED 10.2.0.1.0 10.2.0.1.0

FROM +ASM (ASM instance)
select file_number , sum(bytes)/(1024*1024) from v$asm_file group by
file_number


FROM ORCL (database instance)
SQL> select name from v$datafile
NAME
----------------------------------------
+DATA1/orcl/datafile/sysaux.256.3

SQL> select member from v$logfile;
MEMBER
-------------------------------------------------------------------------------
-
+DATA1/orcl/onlinelog/group_3.264.3

To show the hierarchical tree of files stored in the diskgroup

SELECT concat('+'||gname, sys_connect_by_path(aname, '/')) full_alias_path FROM
(SELECT g.name gname, a.parent_index pindex, a.name aname,
a.reference_index rindex FROM v$asm_alias a, v$asm_diskgroup g
WHERE a.group_number = g.group_number)
START WITH (mod(pindex, power(2, 24))) = 0
CONNECT BY PRIOR rindex = pindex;



==============================================================
ASMCMD
==============================================================

he lsdsk command lists information about ASM disks from the V$ASM_DISK_STAT and V$ASM_DISK views
lsdsk [-ksptcgHI] [-d ] [pattern]

cp [-ifr] <[\@connect_identifier:]src> <[\@connect_identifier:]tgt>

md_restore -b [-li]
[-t (full)|nodg|newdg] [-f ]
[-g ',,...']
[-o ':,...']


lsdg dgroup2 Lists all disk groups and their attributes.
lsct dgroup1 LIST ABOUT CLIENTS ACCESS
lsdsk -kspt '/dev/sdb6'


===============================================================
INIT+ASM.ORA
===============================================================
SQL> select instance_name from v$instance
INSTANCE_NAME
----------------
+ASM
ASM init.ora parameters
*.background_dump_dest='/opt/app/admin/+ASM/bdump'
*.core_dump_dest='/opt/app/admin/+ASM/cdump'
*.instance_type=asm
*.asm_diskgroups=+DATA1
*.large_pool_size=12M
*.asm_diskstring='/dev/rdsk/c3t19d*s4'
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/opt/app/admin/+ASM/udump'

==================================================================
KNOWLEDGEBASE
==================================================================
ASMLIB
Oracle has developed a storage management interface called the ASMLIB API. ASMLIB is not required to
run ASM; it is simply an add-on module that simplifies the management and discovery of ASM disks. The
ASMLIB provides an alternative, to the standard operating system interface, for ASM to identify and
access block devices. The ASMLIB API provides storage and operating system vendors the opportunity to
supply extended storage-related features and exploit the capabilities and strengths of vendors‘ storage
array.
The ASMLIB API provides two major feature enhancements over standard interfaces:
• Disk discovery | Providing more information about the storage attributes to the Database and the DBA
• I/O processing | To enable more efficient I/O
Oracle is providing an ASMLIB, called the Oracle ASMLIB, for the Linux platform (current version as of
this writing is 2.0).

Friday, May 28, 2010

prepare ASM disk, create ASM instance & diskgroups from scratch

login as root user

[root@TEST6 ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 637 5116671 83 Linux
/dev/sda2 638 2167 12289725 83 Linux
/dev/sda3 2168 2418 2016157+ 83 Linux
/dev/sda4 2419 2610 1542240 5 Extended
/dev/sda5 2419 2609 1534176 82 Linux swap

Disk /dev/sdb: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

FIRST PARTITION

[root@TEST6 ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-391, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-391, default 391): 125

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@TEST6 ~]#

SECOND PARTITION

[root@TEST6 ~]# fdisk /dev/sdb

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (126-391, default 126): 126
Last cylinder or +size or +sizeM or +sizeK (126-391, default 391): 275

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

THIRD PARTITION

[root@TEST6 ~]# fdisk /dev/sdb

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (276-391, default 276):
Using default value 276
Last cylinder or +size or +sizeM or +sizeK (276-391, default 391):
Using default value 391

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


WHICH PARTITION ARE UNBOUND
[root@TEST6 ~]# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 5036284 3456608 1323844 73% /
none 375068 0 375068 0% /dev/shm
/dev/sda2 12096756 1662808 9819464 15% /u00
/dev/sda3 1984428 35784 1847840 2% /u01
/dev/hdc 116020 116020 0 100% /media/cdrom

[root@TEST6 ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 637 5116671 83 Linux
/dev/sda2 638 2167 12289725 83 Linux
/dev/sda3 2168 2418 2016157+ 83 Linux
/dev/sda4 2419 2610 1542240 5 Extended
/dev/sda5 2419 2609 1534176 82 Linux swap

Disk /dev/sdb: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 125 1004031 83 Linux ------> CANT FIND IN df -k
/dev/sdb2 126 275 1204875 83 Linux ------> CANT FIND IN df -k
/dev/sdb3 276 391 931770 83 Linux-------> CANT FIND IN df -k

[root@TEST6 ~]# vi /etc/sysconfig/rawdevices
edit
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdb2
/dev/raw/raw3 /dev/sdb3
~
[root@TEST6 ~]# service rawdevices restart
Assigning devices:
/dev/raw/raw1 --> /dev/sdb1
/dev/raw/raw1: bound to major 8, minor 17
/dev/raw/raw2 --> /dev/sdb2
/dev/raw/raw2: bound to major 8, minor 18
/dev/raw/raw3 --> /dev/sdb3
/dev/raw/raw3: bound to major 8, minor 19
done
[root@TEST6 ~]#

[root@TEST6 ~]# chown oracle:dba /dev/raw/raw1
[root@TEST6 ~]# chown oracle:dba /dev/raw/raw2
[root@TEST6 ~]# chown oracle:dba /dev/raw/raw3
[root@TEST6 ~]# chown 660 /dev/raw/raw[1-3]
[root@TEST6 ~]# ls -lart /dev/raw/raw*
crw-rw---- 1 oracle dba 162, 1 May 28 15:43 /dev/raw/raw1
crw-rw---- 1 oracle dba 162, 2 May 28 15:43 /dev/raw/raw2
crw-rw---- 1 oracle dba 162, 3 May 28 15:43 /dev/raw/raw3

loging as oracle
[root@TEST6 ~]#su - oracle
AS ORACLE USER

test6-> mkdir -p /u00/oradata/test/asmdisk1
test6-> mkdir -p /u00/oradata/test/asmdisk2
test6-> mkdir -p /u00/oradata/test/asmdisk4
test6-> ln -sf /dev/raw/raw1 /u00/oradata/test/asmdisk1
test6-> ln -sf /dev/raw/raw2 /u00/oradata/test/asmdisk2
test6-> ln -sf /dev/raw/raw3 /u00/oradata/test/asmdisk3

[root@TEST6 ~]# vi /etc/udev/permissions.d/50-udev.permissions
# raw devices
ram*:root:disk:0660
raw/*:oracle:dba:0660

[root@TEST6 ~]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: [ OK ]
Loading module "oracleasm": [ OK ]
Mounting ASMlib driver filesystem: [ OK ]
Scanning system for ASM disks: [ OK ]
[root@TEST6 ~]#

[root@TEST6 ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
Marking disk "/dev/sdb1" as an ASM disk: [ OK ]
[root@TEST6 ~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdb2
Marking disk "/dev/sdb2" as an ASM disk: [ OK ]
[root@TEST6 ~]# /etc/init.d/oracleasm createdisk VOL3 /dev/sdb3
Marking disk "/dev/sdb3" as an ASM disk: [ OK ]
[root@TEST6 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
[root@TEST6 ~]#

AS ORACLE USER

test6-> mkdir -p $ORACLE_BASE/admin/+ASM/bdump
test6-> mkdir -p $ORACLE_BASE/admin/+ASM/cdump
test6-> mkdir -p $ORACLE_BASE/admin/+ASM/hdump
test6-> mkdir -p $ORACLE_BASE/admin/+ASM/pfile
test6-> mkdir -p $ORACLE_BASE/admin/+ASM/udump

INITFILE OF ASM

--------------------------------------------------------------

###########################################
# Automatic Storage Management
###########################################
###########################################
# Diagnostics and Statistics
###########################################
background_dump_dest=/u00/app/oracle/admin/+ASM/bdump
core_dump_dest=/u00/app/oracle/admin/+ASM/cdump
user_dump_dest=/u00/app/oracle/admin/+ASM/udump

###########################################
# Miscellaneous
###########################################
instance_type=ASM
compatible=10.1.0.4.0

###########################################
# Pools
###########################################
large_pool_size=12M

###########################################
# Security and Auditing
###########################################
remote_login_passwordfile=exclusive

--------------------------------------------------------------


vi /u00/app/oracle/admin/+ASM/pfile/init.ora
ln -s $ORACLE_BASE/admin/+ASM/pfile/init.ora $ORACLE_HOME/dbs/init+ASM.ora

AS ROOT USER GO TO $ORACLE_HOME/bin

[root@TEST6 bin]# ./localconfig add
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized

Adding to inittab
Startup will be queued to init within 90 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
test6
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)



test6-> ORACLE_SID=+ASM; export ORACLE_SID
test6-> sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Fri May 28 16:43:22 2010

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

Connected to an idle instance.

SQL> startup
ASM instance started

Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted

SQL> create spfile from pfile;

File created.

SQL> alter system set asm_diskstring = '/dev/raw/raw*';

System altered.

SQL> create diskgroup DATA1 external redundancy disk '/dev/raw/raw1';

Diskgroup created.


Sunday, May 23, 2010

database characteristics

VERSION
select banner from v$version;

COMPONENT INSTALLED

select COMP_NAME,COMP_ID from dba_registry;

CHARACTERSET
select * from nls_database_parameters where parameter='NLS_CHARACTERSET';

TRACE LOCATIONS
select * from v$parameter where value like '%/%;

TIMEZONE
select dbtimezone from dual;

DIRECTORIES
select directory_path from dba_directories;

This is the view could tell you most of about database operating characteristics...

NLS_DATABASE_PARAMETERS

Saturday, May 22, 2010

Upgradge 10g RAC upto 10204 | applying patch on 10g RAC

we will upgrade 10201 to 10204 in two phase for RAC.

first we will upgrade CRS clusterware.
second we will upgrade db sofware.


if you get
xlib
cant display 0.0 error
the easiest method is
do
xhost + from root user

then check xclock from oracle user.

Now
run the ./runinstaller from DISK1 of patch
















first we will just upgrade clusterware...
so specify clusterware home and path.















specify all nodes , choose cluster installation..















check below pre-requisite for any major errors















follow the instruction at end of installation















you must watch successfully applied word at the end of running root102.sh































After running root102.sh on clusterware















lets query version of CRS has been upgrade to 10204 or not ??

crsctl query css activeversion
crs active version on the cluster is [10.2.0.4]

NOW ITS TIME TO UPGRADE DB SOFTWARE.
before we start upgrade our db software please make sure listener is shutdown
cs_stat -t has to be look like this one
















select HOME name and path.




























































run root.sh by root user
















Note: change database parameter cluster_database = false

open instance in upgrade mode and run catupg.sql















after that
NOTE: change database parameter cluster_database = true

startup database

select * from v$version;

database views

DATABASE PROPERTIES=
DATABASE_PROPERTIES,V$NLS_PARAMETERS
DATABASE=
V$DATABASE, V$VERSION, V$INSTANCE
SHARED SERVER =
V$QUEUE, V$DISPATCHER, V$SHARED_SERVER
CONNECTION POOLING=
DBA_CPOOL_INFO, V$CPOOL_STAT, V$CPOOL_CC_STATS
SPACE=
DBA_DATA_FILES,DBA_FREE_SPACE,DBA_TS_QUOTAS
CONTROLFILES=
V$CONTROLFILE, V$PARAMETER, V$CONTROLFILE_RECORD_SECTION
DATAFILES=
V$DATAFILE,V$DATAFILE_HEADER, DBA_DATA_FILES
SEGMENTS=
DBA_SEGMENTS, USER_SEGMENTS
EXTENTS=
DBA_EXTENTS, USER_EXTENTS
REDOLOG=
V$THREAD, V$LOG, V$LOGFILE, V$LOG_HISTORY
UNDO=
V$UNDOSTAT, V$ROLLSTAT, V$TRANSACTION
ARCHIVE=
V$DATABASE, V$LOG, V$ARCHIVED_LOG, V$ARCHIVE_DEST
INSTANCE=
V$INSTANCE, V$PARAMETER, V$SYSTEM_PARAMETER
MEMORY=
V$SGA, V$SGASTAT, V$SGAINFOV$SGA_DYNAMIC_COMPONENTS,V$SGA_RESIZE_OPS
ADVICE=
V$SGA_TARGET_ADVICE, V$PGA_TARGET_ADVICE
PROCESSES=
V$PROCESS, V$BGPROCESS
PERFORMANCE=
V$SYSSTAT,V$SESSMETRIC,V$SYSTEM_EVENT
ALERTS=
DBA_THRESHOLDS, DBA_OUTSTANDING_ALERTS,DBA_ALERT_HISTORY, V$ALERT_TYPES,V$METRIC
LOCK & LATCH=
V$LOCK,v$LOCKED_OBJECTS,DBA_LOCK, V$SESSION_WAIT,V$LATCH
TABLES=
DBA_TABLES, ALL_TABLES, USER_TABLES
INDEXES=
DBA_INDEXES, ALL_INDEXES, USER_INDEXES
DATAPUMP=
DBA_DATAPUMP_JOBS,DBA_DATAPUMP_SESSIONS,(V$SESSION_LONGOPS|SOFAR|TOTALWORK|UNITS)
OBJECTS=
DBA_OBJECTS, ALL_OBJECTS, USER_OBJECTS
ASM=
V$ASM_DISKGROUP,V$ASM_FILE,V$ASM_OPERATION,V$ASM_ALIAS,V$ASM_CLIENT,V$ASM_DISK)
FLASH RECOVERY=
V$RECOVERY_FILE_DEST
TRASPORT PLATFORM=
V$TRANSPORTABLE_PLATFORM
RECYCLE BIN=
DBA_RECYCLEBIN
MODIFIED TABLE=
DBA_TAB_MODIFICATIONS (since last stats gather)
SQL TRACES=
DBA_ENABLED_TRACES
DATA DICTIONARY HIT RATIO=
V$ROWCACHE
LIBRARY CACHE | RELOAD RATIO
V$LIBRARYCACHE
HIST TABLES=
v$ACTIVE_SESSION_HISTORY,DBA_HIST_SQLSTAT,DBA_HIST_SQLTEXT,DBA_HIST_SQLPLAN