Friday, September 25, 2009

Read Oracle SQL Developer Release 2.1

Oracle SQL Developer 2.1 Early Adopter is now available. (24th September '09 ).

Read about New Features.
By the way I'm so happy, when I used it with Timesten 11g. I saw packages/procedures/functions.

Nice ;)

Wednesday, September 23, 2009

Learn ORA-00600: internal error code, arguments: [17059]

My Database traced many files with ORA-00600
Errors in file $ORACLE_BASE/admin/db/udump/db1_ora_13255.trc:
ORA-00600: internal error code, arguments: [17059], [0x0D36AD8A8], [], [], [], [], [], []
Checked trace file, I found many sql statements and etc...
.
.
.
KGL recovered in-flux handle for lock 0xd4ee3178
----------------------------------------
SO: 0xd4ee3178, type: 53, owner: 0xdf985d88, flag: INIT/-/-/0x00
LIBRARY OBJECT LOCK: lock=d4ee3178 handle=0
call pin=(nil) session pin=(nil) hpc=0000 hlc=0000
htl=0xd4ee31f8[0xd4ee31f8,0xd4ee31f8] htb=(nil) ssga=0xaf9cf7e0
user=0 session=0 count=0 flags=[0000] savepoint=0x0
That's a bad thing with oracle bugs, when checked on metalink (138554.1). but still no idea to solve(10.2.0.4 linux x86_64 RAC).

One thing i can do it now... flush buffer_cache and shared_pool.
SQL> ALTER SYSTEM FLUSH BUFFER_CACHE;

SQL> ALTER SYSTEM FLUSH SHARED_POOL;
I know this's not good idea to do... but it helped(... but may error again, again, ...).
However I still check Memory misconfiguration and SQL statements. Anyway this case made me need Oracle Support as well ;)

Thursday, September 17, 2009

Test to use FreeRadius with TimesTen (OCI)

On TimesTen 11.2.1, TimesTen OCI depends on the Oracle client library and the TimesTen ODBC libraries. TimesTen OCI support enables you to run many existing OCI applications with TimesTen in direct mode or client/server mode.

TimesTen Release 11.2.1 OCI is based on Oracle Release 11.1.0.7 OCI and supports the contemporary OCI 8 style APIs.

tns_entry = (DESCRIPTION =(CONNECT_DATA =(SERVICE_NAME = dsn)(SERVER = timesten_direct | timesten_client)))

So, I want to compile freeradius to use OCI connect to TimesTen(testing):

- Setup TimesTen on radius Server by using "Client/Server and Data Manager" components.
# tar xvf timesten112120.linux8664.tar.gz
# cd linux8664
# ./setup.sh

[...]
Please choose an instance name for this installation? [ tt1121 ]
Instance name will be 'tt1121'.
Is this correct? [ yes ] y

Of the three components:

[1] Client/Server and Data Manager
[2] Data Manager Only
[3] Client Only

Which would you like to install? [ 1 ] 1
Where would you like to install the tt1121 instance of TimesTen? [ /opt ] /oracle
Installing into /oracle/TimesTen/tt1121 ...
Creating /oracle/TimesTen/tt1121 ...
Uncompressing ...
[...]
I need library only, so stop TimesTen daemon:
# /oracle/TimesTen/tt1121/startup/tt_tt1121 stop
Stopping TimesTen Daemon : [ OK ]
- Install freeradius
# cd SRC
# tar zxf freeradius-server-2.1.7.tar.gz
# cd freeradius-server-2.1.7
# ./configure && make && make install
I installed freeradius, but no driver. So build driver by using "rlm_sql_oracle"
# cd src/modules/rlm_sql/drivers/rlm_sql_oracle/
# vi Makefile
--- Begin Makefile ---

include ../../../../../Make.inc

TARGET = rlm_sql_oracle
SRCS = sql_oracle.c
INSTDIR = /oracle/TimesTen/tt1121
COMMDIR = $(INSTDIR)/quickstart/sample_code/common
TTORACLE_HOME = $(INSTDIR)/ttoracle_home/instantclient_11_1
OCIINCS = $(TTORACLE_HOME)/sdk/include
CC = gcc
PLATCFLAGS = -Os -finline-functions
LDFLAGS =
EXTRALIBS = -lpthread -lm -lrt
INCS = -I$(OCIINCS) -I$(INSTDIR)/include -I$(COMMDIR)
RLM_SQL_CFLAGS = $(INCLTDL) $(PLATCFLAGS) $(INCS)
TTLINK = -L$(INSTDIR)/lib -L$(TTORACLE_HOME) -Wl,-rpath,$(INSTDIR)/lib,-rpath,$(TTORACLE_HOME)
RLM_SQL_LIBS = $(TTLINK) -lclntsh $(EXTRALIBS)

include ../rules.mak

--- End Makefile ---
# make

SRC/freeradius-server-2.1.7/libtool --mode=compile gcc -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -D_GNU_SOURCE -DNDEBUG -I../.. -ISRC/freeradius-server-2.1.7/src/ -ISRC/freeradius-server-2.1.7/libltdl -Os -finline-functions -I/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1/sdk/include -I/oracle/TimesTen/tt1121/include -I/oracle/TimesTen/tt1121/quickstart/sample_code/common -c sql_oracle.c
mkdir .libs
gcc -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -D_GNU_SOURCE -DNDEBUG -I../.. -ISRC/freeradius-server-2.1.7/src/ -ISRC/freeradius-server-2.1.7/libltdl -Os -finline-functions -I/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1/sdk/include -I/oracle/TimesTen/tt1121/include -I/oracle/TimesTen/tt1121/quickstart/sample_code/common -c sql_oracle.c -fPIC -DPIC -o .libs/sql_oracle.o
[...]
gcc -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -D_GNU_SOURCE -DNDEBUG -I../.. -ISRC/freeradius-server-2.1.7/src/ -ISRC/freeradius-server-2.1.7/libltdl -Os -finline-functions -I/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1/sdk/include -I/oracle/TimesTen/tt1121/include -I/oracle/TimesTen/tt1121/quickstart/sample_code/common -c sql_oracle.c -o sql_oracle.o >/dev/null 2>&1
SRC/freeradius-server-2.1.7/libtool --mode=link gcc -release 2.1.7 \
-module -export-dynamic -o rlm_sql_oracle.la \
-rpath /usr/local/lib sql_oracle.lo -L/oracle/TimesTen/tt1121/lib -L/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1 -Wl,-rpath,/oracle/TimesTen/tt1121/lib,-rpath,/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1 -lclntsh -lpthread -lm -lrt
gcc -shared .libs/sql_oracle.o -L/oracle/TimesTen/tt1121/lib -L/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1 -lclntsh -lpthread -lm -lrt -Wl,-rpath -Wl,/oracle/TimesTen/tt1121/lib -Wl,-rpath -Wl,/oracle/TimesTen/tt1121/ttoracle_home/instantclient_11_1 -Wl,-soname -Wl,rlm_sql_oracle-2.1.7.so -o .libs/rlm_sql_oracle-2.1.7.so
(cd .libs && rm -f rlm_sql_oracle.so && ln -s rlm_sql_oracle-2.1.7.so rlm_sql_oracle.so)
ar cru .libs/rlm_sql_oracle.a sql_oracle.o
ranlib .libs/rlm_sql_oracle.a
creating rlm_sql_oracle.la
(cd .libs && rm -f rlm_sql_oracle.la && ln -s ../rlm_sql_oracle.la rlm_sql_orac

# make install
# ls -l /usr/local/lib | grep oracle
lrwxrwxrwx 1 root root 17 Sep 17 15:57 rlm_sql_oracle-2.1.7.la -> rlm_sql_oracle.la
-rwxr-xr-x 1 root root 27880 Sep 17 15:57 rlm_sql_oracle-2.1.7.so
-rw-r--r-- 1 root root 32296 Sep 17 15:57 rlm_sql_oracle.a
-rwxr-xr-x 1 root root 967 Sep 17 15:57 rlm_sql_oracle.la
lrwxrwxrwx 1 root root 23 Sep 17 15:57 rlm_sql_oracle.so -> rlm_sql_oracle-2.1.7.so
- Configure freeradius to use "rlm_sql_oracle"
# cd /usr/local/etc/raddb
# vi radiusd.conf
Uncomment in radiusd.conf file:
[...]
$INCLUDE sql.conf
[...]
Add "sql" in radiusd.conf file:
[...]
instantiate {

sql
}
[...]
- Modify "sql.conf" to connect TimesTen database
# vi sql.conf
In sqlconf file:

database = "oracle"
login = "radius"
password = "password"
radius_db = "(DESCRIPTION=(CONNECT_DATA = (SERVICE_NAME = db01CS)(SERVER = timesten_client)))"

- Modify odbc in /etc/odbc.ini file.
# vi /etc/odbc.ini
In odbc.ini file:

[db01CS]
TTC_SERVER=timesten_server
TTC_SERVER_DSN=db01

- Test to start freeradius
# radiusd -X

[...]
rlm_sql (sql): Driver rlm_sql_oracle (module rlm_sql_oracle) loaded and linked
rlm_sql (sql): Attempting to connect to radius@localhost:/(DESCRIPTION=(CONNECT_DATA = (SERVICE_NAME = db01CS)(SERVER = timesten_client)))
rlm_sql (sql): starting 0
rlm_sql (sql): Attempting to connect rlm_sql_oracle #0
rlm_sql (sql): Connected new DB handle, #0
rlm_sql (sql): starting 1
rlm_sql (sql): Attempting to connect rlm_sql_oracle #1
rlm_sql (sql): Connected new DB handle, #1
rlm_sql (sql): starting 2
rlm_sql (sql): Attempting to connect rlm_sql_oracle #2
rlm_sql (sql): Connected new DB handle, #2
rlm_sql (sql): starting 3
rlm_sql (sql): Attempting to connect rlm_sql_oracle #3
rlm_sql (sql): Connected new DB handle, #3
rlm_sql (sql): starting 4
rlm_sql (sql): Attempting to connect rlm_sql_oracle #4
rlm_sql (sql): Connected new DB handle, #4
}
[...]
A freeradius connected to TimesTen server.

Wednesday, September 16, 2009

Exadata Version 2


Oracle Unveils Exadata Version 2: The First Database Machine for OLTP

The Exadata Database Machine Version 2, made by Sun and Oracle, is the world’s fastest machine for both data warehousing and online transaction processing (OLTP).

Exadata Version 2 is available 4 models:
- full rack (8 database servers and 14 storage servers)
- half-rack (4 database servers and 7 storage servers)
- quarter-rack (2 database servers and 3 storage servers)
- a basic system (1 database server and 1 storage server)

http://www.oracle.com/corporate/pricing/exadata-pricelist.pdf

Sunday, September 13, 2009

_disable_interface_checking

sqlplus / as sysasm

SQL> startup
ORA-27504: IPC error creating OSD context
ORA-27300: OS system dependent operation:check if cable failed with status: 0
ORA-27301: OS failure message: Error 0
ORA-27302: failure occurred at: skgxpcini1
ORA-27303: additional information: requested interface eth1 interface not running set _disable_interface_checking = TRUE to disable this check for single instance cluster. Check output from if
"_disable_interface_checking" supports on Oracle Database since 10.2.0 (FALSE)

SQL> show parameter "_disable_interface_checking"
...Nothing...

When Private Interconnect is down in RAC, that make ASM doesn't start.
If need to start ASM(some node) anyway... To bypass by set: _disable_interface_checking = true

SQL> show parameter "_disable_interface_checking"
NAME TYPE VALUE
------------------------------------ ----------- ---------
_disable_interface_checking boolean TRUE

Saturday, September 05, 2009

Deinstallation Tool

The Deinstallation Tool (deinstall) is available in the installation media before installation, and is available in Oracle home directories after installation. It is located in the path $ORACLE_HOME/deinstall.

On 11gR2 ,we don't find deinstall/uninstall on Oracle Installer page. we need to use the Deinstallation Tool.

However we can download the Deinstallation Tool.

$ ls linux.x64_11gR2_deinstall.zip
linux.x64_11gR2_deinstall.zip
$ unzip linux.x64_11gR2_deinstall.zip
$ cd deinstall

$ ./deinstall
Location of logs /oracle/oraInventory/logs/

############ ORACLE DEINSTALL & DECONFIG TOOL START ############
Usage:
deinstall -home <Complete path of Oracle home>
[ -silent ]
[ -checkonly ]
[ -local ]
[ -paramfile <complete path of input parameter property file> ]
[ -params <name1=value[ name2=value ...]> ]
[ -o <complete path of directory for saving files> ]
[ -help | -h: Type -h or -help to get more information on each of the above options. ]
Specify any of the above options.
############# ORACLE DEINSTALL & DECONFIG TOOL END #############

$ ./deinstall -home /oracle/product/11.2.0/db_2
ORACLE_HOME = /oracle/product/11.2.0/db_2
Location of logs /oracle/oraInventory/logs/

############ ORACLE DEINSTALL & DECONFIG TOOL START ############

######################## CHECK OPERATION START ########################
Install check configuration START

Checking for existence of the Oracle home location /oracle/product/11.2.0/db_2
Oracle Home type selected for de-install is: SIDB
Oracle Base selected for de-install is: /oracle/product
Checking for existence of central inventory location /oracle/oraInventory

Install check configuration END

Network Configuration check config START

Network de-configuration trace file location: /oracle/oraInventory/logs/netdc_check16937.log

Network Configuration check config END

Database Check Configuration START

Database de-configuration trace file location: /oracle/oraInventory/logs/databasedc_check16938.log

Use comma as separator when specifying list of values as input

Specify the list of database names that are configured in this Oracle home []:
Database Check Configuration END

Enterprise Manager Configuration Assistant START

EMCA de-configuration trace file location: /oracle/oraInventory/logs/emcadc_check.log

Enterprise Manager Configuration Assistant END
Oracle Configuration Manager check START
OCM check log file location : /oracle/oraInventory/logs//ocm_check8092.log
Oracle Configuration Manager check END

######################### CHECK OPERATION END #########################

####################### CHECK OPERATION SUMMARY #######################
Oracle Home selected for de-install is: /oracle/product/11.2.0/db_2
Inventory Location where the Oracle home registered is: /oracle/oraInventory
No Enterprise Manager configuration to be updated for any database(s)
No Enterprise Manager ASM targets to update
No Enterprise Manager listener targets to migrate
Checking the config status for CCR
Oracle Home exists with CCR directory, but CCR is not configured
CCR check is finished
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/oracle/oraInventory/logs/deinstall_deconfig2009-09-05_10-01-12-PM.out'
Any error messages from this session will be written to: '/oracle/oraInventory/logs/deinstall_deconfig2009-09-05_10-01-12-PM.err'

######################## CLEAN OPERATION START ########################

Enterprise Manager Configuration Assistant START

EMCA de-configuration trace file location: /oracle/oraInventory/logs/emcadc_clean.log

Updating Enterprise Manager ASM targets (if any)
Updating Enterprise Manager listener targets (if any)
Enterprise Manager Configuration Assistant END
Database de-configuration trace file location: /oracle/oraInventory/logs/databasedc_clean16939.log

Network Configuration clean config START

Network de-configuration trace file location: /oracle/oraInventory/logs/netdc_clean16940.log

De-configuring Naming Methods configuration file...
Naming Methods configuration file de-configured successfully.

De-configuring backup files...
Backup files de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END

Oracle Configuration Manager clean START
OCM clean log file location : /oracle/oraInventory/logs//ocm_clean8092.log
Oracle Configuration Manager clean END
Oracle Universal Installer clean START

Detach Oracle home '/oracle/product/11.2.0/db_2' from the central inventory on the local node : Done

Delete directory '/oracle/product/11.2.0/db_2' on the local node : Done

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END

Oracle install clean START

Clean install operation removing temporary directory '/tmp/install' on node 'RHEL5-TEST'

Oracle install clean END

Moved default properties file /home/oracle/deinstall/response/deinstall_OraDb11g_home2.rsp as /home/oracle/deinstall/response/deinstall_OraDb11g_home2.rsp1

######################### CLEAN OPERATION END #########################

####################### CLEAN OPERATION SUMMARY #######################
Cleaning the config for CCR
As CCR is not configured, so skipping the cleaning of CCR configuration
CCR clean is finished
Successfully detached Oracle home '/oracle/product/11.2.0/db_2' from the central inventory on the local node.
Successfully deleted directory '/oracle/product/11.2.0/db_2' on the local node.
Oracle Universal Installer cleanup was successful.

Oracle install successfully cleaned up the temporary directories.
#######################################################################
############# ORACLE DEINSTALL & DECONFIG TOOL END #############

Example: deinstall Oracle Home and Database's register on Oracle Restart
$ crsstat
HA Resource Type Target State (Host)
----------- ------ ------ -----
ora.LISTENER.lsnr ora.listener.type ONLINE ONLINE on rhel5-test
ora.cssd ora.cssd.type ONLINE ONLINE on rhel5-test
ora.diskmon ora.diskmon.type ONLINE ONLINE on rhel5-test
ora.testdb.db ora.database.type ONLINE ONLINE on rhel5-test

$ ./deinstall -home /oracle/product/11.2.0/dbhome_1
ORACLE_HOME = /oracle/product/11.2.0/dbhome_1
Location of logs /oracle/oraInventory/logs/

############ ORACLE DEINSTALL & DECONFIG TOOL START ############

######################## CHECK OPERATION START ########################
Install check configuration START

Checking for existence of the Oracle home location /oracle/product/11.2.0/dbhome_1
Oracle Home type selected for de-install is: SIDB
Oracle Base selected for de-install is: /oracle/product
Checking for existence of central inventory location /oracle/oraInventory

Install check configuration END

Network Configuration check config START

Network de-configuration trace file location: /oracle/oraInventory/logs/netdc_check6881.log

Network Configuration check config END

Database Check Configuration START

Database de-configuration trace file location: /oracle/oraInventory/logs/databasedc_check6882.log

Use comma as separator when specifying list of values as input

Specify the list of database names that are configured in this Oracle home [testdb]:

###### For Database 'testdb' ######
Specify the type of this database (1.Single Instance Database|2.Oracle Restart Enabled Database) [2]:
Specify the list of nodes on which this database has instances [rhel5-test]:
Specify the diagnostic destination location of the database [/oracle/product/diag/rdbms/testdb]:
Specify the storage type used by the Database ASM|FS []: FS

Specify the list of directories if any database files exist on a shared file system. If 'testdb' subdirectory is found, then it will be deleted. Otherwise, the specified directory will be deleted. Alternatively, you can specify list of database files with full path [ ]: /oracle/product/oradata

Specify the flash recovery area location, if it is configured on the file system. If 'testdb' subdirectory is found, then it will be deleted. []:

Specify the database spfile location [ ]:

Database Check Configuration END

Enterprise Manager Configuration Assistant START

EMCA de-configuration trace file location: /oracle/oraInventory/logs/emcadc_check.log

Checking configuration for database testdb
Enterprise Manager Configuration Assistant END
Oracle Configuration Manager check START
OCM check log file location : /oracle/oraInventory/logs//ocm_check6867.log
Oracle Configuration Manager check END

######################### CHECK OPERATION END #########################

####################### CHECK OPERATION SUMMARY #######################
Oracle Home selected for de-install is: /oracle/product/11.2.0/dbhome_1
Inventory Location where the Oracle home registered is: /oracle/oraInventory
The following databases were selected for de-configuration : testdb
Database unique name : testdb
Storage used : FS
Will update the Enterprise Manager configuration for the following database(s): testdb
No Enterprise Manager ASM targets to update
No Enterprise Manager listener targets to migrate
Checking the config status for CCR
Oracle Home exists with CCR directory, but CCR is not configured
CCR check is finished
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/oracle/oraInventory/logs/deinstall_deconfig2009-09-06_03-24-28-PM.out'
Any error messages from this session will be written to: '/oracle/oraInventory/logs/deinstall_deconfig2009-09-06_03-24-28-PM.err'

######################## CLEAN OPERATION START ########################

Enterprise Manager Configuration Assistant START
EMCA de-configuration trace file location: /oracle/oraInventory/logs/emcadc_clean.log

Updating Enterprise Manager Database Control configuration for database testdb
Updating Enterprise Manager ASM targets (if any)
Updating Enterprise Manager listener targets (if any)
Enterprise Manager Configuration Assistant END
Database de-configuration trace file location: /oracle/oraInventory/logs/databasedc_clean6883.log
Database Clean Configuration START testdb
This operation may take few minutes.
Database Clean Configuration END testdb

Network Configuration clean config START

Network de-configuration trace file location: /oracle/oraInventory/logs/netdc_clean6884.log

De-configuring Naming Methods configuration file...
Naming Methods configuration file de-configured successfully.

De-configuring backup files...
Backup files de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END

Oracle Configuration Manager clean START
OCM clean log file location : /oracle/oraInventory/logs//ocm_clean6867.log
Oracle Configuration Manager clean END
Oracle Universal Installer clean START

Detach Oracle home '/oracle/product/11.2.0/dbhome_1' from the central inventory on the local node : Done

Delete directory '/oracle/product/11.2.0/dbhome_1' on the local node : Done

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END

Oracle install clean START

Clean install operation removing temporary directory '/tmp/install' on node 'RHEL5-TEST'

Oracle install clean END

Moved default properties file /home/oracle/De-install/deinstall/response/deinstall_OraDb11g_home2.rsp as /home/oracle/De-install/deinstall/response/deinstall_OraDb11g_home2.rsp3

######################### CLEAN OPERATION END #########################

####################### CLEAN OPERATION SUMMARY #######################
Updated Enterprise Manager configuration for database testdb
Successfully de-configured the following database instances : testdb
Cleaning the config for CCR
As CCR is not configured, so skipping the cleaning of CCR configuration
CCR clean is finished
Successfully detached Oracle home '/oracle/product/11.2.0/dbhome_1' from the central inventory on the local node.
Successfully deleted directory '/oracle/product/11.2.0/dbhome_1' on the local node.
Oracle Universal Installer cleanup was successful.

Oracle install successfully cleaned up the temporary directories.
#######################################################################

############# ORACLE DEINSTALL & DECONFIG TOOL END #############
$ crsstat
HA Resource Type Target State (Host)
----------- ------ ------ -----
ora.LISTENER.lsnr ora.listener.type ONLINE ONLINE on rhel5-test
ora.cssd ora.cssd.type ONLINE ONLINE on rhel5-test
ora.diskmon ora.diskmon.type ONLINE ONLINE on rhel5-test

Friday, September 04, 2009

ASM (DVM) & ACFS by command-lines

11gR2 feature... ASM Dynamic Volume Manager (ADVM) and ASM Clustered File System (ACFS), that make me excite, So I spent much time to get idea...

We can create ACFS by using asmca (link). and we can use command-lines(sql*plus, asmcmd) as well.

- Create a volume from an ASM diskgroup

Connect sql*plus with sysasm:
$ sqlplus / as sysasm

Add volume by "alter diskgroup":
SQL> alter diskgroup DISK03 add volume 'asm_vol1' size 5G;

Diskgroup altered.
Check :
SQL> SELECT dg.name AS diskgroup, v.volume_name, v.bytes_read, v.bytes_written FROM V$ASM_DISKGROUP dg, V$ASM_VOLUME_STAT v WHERE dg.group_number = v.group_number;

DISKGROUP VOLUME_NAME BYTES_READ BYTES_WRITTEN
------------------------------ ------------------------------ ---------- -------------
DISK03 ASM_VOL1 0 0

SQL> SELECT dg.name AS diskgroup, v.volume_name, v.volume_device, v.mountpath,v.state FROM V$ASM_DISKGROUP dg, V$ASM_VOLUME v WHERE dg.group_number = v.group_number;

DISKGROUP VOLUME_NAM VOLUME_DEVICE MOUNTPATH STATE
---------- ---------- ------------------------------ ------------------------------ --------
DISK03 ASM_VOL1 /dev/asm/asm_vol1-15 DISABLED
Or... use "asmcmd"
ASMCMD> volcreate -G DISK03 -s 5G asm_vol1

ASMCMD> volstat

DISKGROUP NUMBER / NAME: 3 / DISK03
---------------------------------------
VOLUME_NAME
READS BYTES_READ READ_TIME READ_ERRS
WRITES BYTES_WRITTEN WRITE_TIME WRITE_ERRS
-------------------------------------------------------------
ASM_VOL1
0 0 0 0
0 0 0 0

ASMCMD> volinfo -G DISK03 asm_vol1
Diskgroup Name: DISK03

Volume Name: ASM_VOL1
Volume Device: /dev/asm/asm_vol1-15
State: DISABLED
Size (MB): 5120
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage:
Mountpath:
- Enable "asm_vol1' volume
SQL> !ls -l /dev/asm/asm_vol1-15
ls: /dev/asm/asm_vol1-15: No such file or directory

SQL> alter diskgroup DISK03 enable volume 'asm_vol1';

Diskgroup altered.

SQL> !ls -l /dev/asm/asm_vol1-15
brwxrwx--- 1 root osasm 252, 7681 Sep 4 11:26 /dev/asm/asm_vol1-15

SQL> SELECT dg.name AS diskgroup, v.volume_name, v.volume_device, v.mountpath,v.state FROM V$ASM_DISKGROUP dg, V$ASM_VOLUME v WHERE dg.group_number = v.group_number;

DISKGROUP VOLUME_NAM VOLUME_DEVICE MOUNTPATH STATE
---------- ---------- ------------------------------ ------------------------------ --------
DISK03 ASM_VOL1 /dev/asm/asm_vol1-15 ENABLED
Or... use "asmcmd"
$ ls -l /dev/asm/asm_vol1-15
ls: /dev/asm/asm_vol1-15: No such file or directory

ASMCMD> volenable -G DISK03 asm_vol1

ASMCMD> volinfo -G DISK03 asm_vol1
Diskgroup Name: DISK03

Volume Name: ASM_VOL1
Volume Device: /dev/asm/asm_vol1-15
State: ENABLED
Size (MB): 5120
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage:
Mountpath:

$ ls -l /dev/asm/asm_vol1-15
brwxrwx--- 1 root osasm 252, 7681 Sep 4 11:43 /dev/asm/asm_vol1-15
- Register mount point
$ mkdir -p /oracle/product/acfsmounts/disk03_asm_vol1

$ su - root

# acfsutil registry -a -f /dev/asm/asm_vol1-15 /oracle/product/acfsmounts/disk03_asm_vol1
acfsutil registry: mount point /oracle/product/acfsmounts/disk03_asm_vol1 successfully added to Oracle Registry

# mount.acfs -o all
mount.acfs: ACFS-00591: error found in volume disk header
mount.acfs: ACFS-02037: File system not created on a Linux system. Cannot mount.
found error... so(make acfs)
# mkfs.acfs -f /dev/asm/asm_vol1-15
mkfs.acfs: version = 11.2.0.1.0.0
mkfs.acfs: on-disk version = 39.0
mkfs.acfs: volume = /dev/asm/asm_vol1-15
mkfs.acfs: volume size = 5368709120
mkfs.acfs: Format complete.
And mount:
# mount.acfs -o all
Or mount.acfs /dev/asm/asm_vol1-15 /oracle/product/acfsmounts/disk03_asm_vol1/

Check...
# df
Filesystem 1K-blocks Used Available Use% Mounted on

/dev/asm/asm_vol1-15 5242880 47512 5195368 1% /oracle/product/acfsmounts/disk03_asm_vol1
- Test create file
# cd /oracle/product/acfsmounts/disk03_asm_vol1
# ls -la
drwxr-xr-x 5 root root 4096 Sep 4 11:54 .ACFS

# touch file.txt
# ls file.txt
file.txt
- Check Again
SQL> SELECT dg.name AS diskgroup, v.volume_name, v.volume_device, v.mountpath,v.state FROM V$ASM_DISKGROUP dg, V$ASM_VOLUME v WHERE dg.group_number = v.group_number;

DISKGROUP VOLUME_NAM VOLUME_DEVICE MOUNTPATH STATE
---------- ---------- ------------------------------ ------------------------------------------ --------
DISK03 ASM_VOL1 /dev/asm/asm_vol1-15 /oracle/product/acfsmounts/disk03_asm_vol1 ENABLED

SQL> SELECT dg.name AS diskgroup, v.volume_name, v.bytes_read, v.bytes_written FROM V$ASM_DISKGROUP dg, V$ASM_VOLUME_STAT v WHERE dg.group_number = v.group_number;

DISKGROUP VOLUME_NAM BYTES_READ BYTES_WRITTEN
---------- ---------- ---------- -------------
DISK03 ASM_VOL1 372736 11745280
Or... use"asmcmd"
ASMCMD> volinfo -G DISK03 asm_vol1
Diskgroup Name: DISK03

Volume Name: ASM_VOL1
Volume Device: /dev/asm/asm_vol1-15
State: ENABLED
Size (MB): 5120
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage: ACFS
Mountpath: /oracle/product/acfsmounts/disk03_asm_vol1

ASMCMD> volstat

DISKGROUP NUMBER / NAME: 3 / DISK03
---------------------------------------
VOLUME_NAME
READS BYTES_READ READ_TIME READ_ERRS
WRITES BYTES_WRITTEN WRITE_TIME WRITE_ERRS
-------------------------------------------------------------
ASM_VOL1
416 372736 6 0
2941 11745280 242 0
that's step to test it... and thank good blog help idea.

Thursday, September 03, 2009

ASM Dynamic Volume Manager (DVM) & ACFS

The ASM Dynamic Volume Manager (DVM) is a kernel-loadable device driver that provides a standard device driver interface to clients (for example, ACFS).

after read about DVM & ACFS on 11gR2 Feature, that made my curious. so create testing... ACFS:
start to create Files using "dd":
$ dd if=/dev/zero of=/oracle/asmdisks/_file_disk5 bs=1k count=10000000
10000000+0 records in
10000000+0 records out
10240000000 bytes (10 GB) copied, 303.029 seconds, 33.8 MB/s
Associate Loop Device with the New File:
# losetup /dev/loop5 /oracle/asmdisks/_file_disk5
Create Disk on ASMLib:
# oracleasm createdisk VOL5 /dev/loop5
Create ASM Disk Group with ASM Compatibility "11.2" by "asmca":
$ asmca

create asm Disk Group "DISK03" and then create Volume "asm_vol1" from "DISK03" Disk Group:

and then create ASM Cluster File System(ACFS):

create directory for mount point ,check... and mount:
$ mkdir -p /oracle/product/acfsmounts/disk03_asm_vol1
# ls /dev/asm/asm_vol1*
/dev/asm/asm_vol1-15

# mount -t acfs /dev/asm/asm_vol1-15 /oracle/product/acfsmounts/disk03_asm_vol1
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/asm/asm_vol1-15 5242880 47512 5195368 1% /oracle/product/acfsmounts/disk03_asm_vol1

# cd /oracle/product/acfsmounts/disk03_asm_vol1

# touch file.txt
ASMCMD> volstat
DISKGROUP NUMBER / NAME: 3 / DISK03
---------------------------------------
VOLUME_NAME
READS BYTES_READ READ_TIME READ_ERRS
WRITES BYTES_WRITTEN WRITE_TIME WRITE_ERRS
-------------------------------------------------------------
ASM_VOL1
274 271360 1 0
2936 11739136 263 0
ASMCMD> volinfo -G DISK03 ASM_VOL1
Diskgroup Name: DISK03

Volume Name: ASM_VOL1
Volume Device: /dev/asm/asm_vol1-15
State: ENABLED
Size (MB): 5120
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage: ACFS
Mountpath: /oracle/product/acfsmounts/disk03_asm_vol1

11gR2 ASMCA

Oracle ASM Configuration Assistant supports installing and configuring ASM instances, disk groups, volumes, and Oracle Automatic Storage Management Cluster File System (Oracle ACFS). In addition, you can use the ASMCA command-line interface as a non-GUI utility.

On 11gR2, dbca can not support to manage ASM. Really?
$ dbca
$ asmca

Tuesday, September 01, 2009

Oracle 11gR2 (11.2.0.1.0)


Oracle 11g Release 2 (11.2.0.1.0), we can download (we can download for Linux x86 and x86-64 today)