Saturday, August 27, 2011

Deploying OpenStack by Ken Pepple

I believe many people knew about Cloud Computing or heard Rackspace Cloud or Amazon Web Services. If you are looking open source software for building private and public clouds. OpenStack!!! What is OpenStack?

OpenStack is a global collaboration of developers and cloud computing technologists producing the ubiquitous open source cloud computing platform for public and private clouds. The project aims to deliver solutions for all types of clouds by being simple to implement, massively scalable, and feature rich. The technology consists of a series of interrelated projects delivering various components for a cloud infrastructure solution. You can read more.

If you want to learn or deploy OpenStack. You can find out on this link.
However, You want to save time, you can check this book - "Deploying OpenStack Creating Open Source Clouds" book by Ken Pepple. This book shows you how to obtain and deploy OpenStack software in a few controlled scenarios.
- Learn about OpenStack Compute (known as “Nova”), OpenStack Object Store ("Swift"), and OpenStack Image Service ("Glance")
- Understand common pitfalls in architecting, deploying, and implementing your cloud infrastructure with OpenStack
- Determine which version of the OpenStack code base best suits your deployment needs
- Define your deployment scenario and finalize key design choices
- Install Nova on a single node with either the StackOps distro or an Ubuntu package
- Be familiar with important configuration options and important administrative commands

You will learn Logical Architecture about Swift, Glance and Nova. It's easy to understand. You will see planning, installing, Using and administering Nova. When you read this book, you will be able understand What the OpenStack Project and projects within OpenStack? I mean Swift/Glance/Nova. After you read it, you should be able to install Nova by using StackOps or install Nova from Packages.

In book, Author used pictures to explain about Architecture and Planning Installation, that's useful easy to understand for readers.

About Ken Pepple
Ken currently serves as the Director of Cloud Development at Internap, where he leads the engineering of their OpenStack-based cloud service. Previously, he held technical leadership positions at Sun Microsystems and Oracle, including Chief Technologist for their Systems Line of Business and Technical Director for their Asia Pacific consulting organization. You can contact Ken and see his current work at his blog (http://ken.pepple.info).
@ken_pepple

Just learned - Real-Time SQL Monitoring

I interest some topic in "Oracle Database 11g Performance Tuning Recipes A Problem-Solution Approach" book. Real-Time SQL Monitoring. How? This is 11g feature.
SQL monitoring is automatically started when a SQL statement runs parallel or when it has consumed at least 5 seconds of CPU or I/O time.
Before you will use this feature, your database have to have "statistics_level" = TYPICAL or ALL, "control_management_pack_access"=DIAGNOSTIC+TUNING
SQL> show parameter statistics_level

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
statistics_level string TYPICAL

SQL> show parameter control_management_pack_access

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_management_pack_access string DIAGNOSTIC+TUNING
When you need to test Real-Time SQL Monitoring, you can use HINTS:
MONITOR : To force real-time SQL monitoring
Or if
NO_MONITOR : To prevent the query from being monitored

How to monitor?
You can use V$SQL_MONITOR and V$SQL_PLAN_MONITOR views to monitor the statistics.
The V$SQL_MONITOR view contains a subset of the statistics available in V$SQL.
The V$SQL_PLAN_MONITOR view contains plan level monitoring statistics for each SQL statement in V$SQL_MONITOR.

What should you know from both views?
KEY NUMBER : Artificial join key to efficiently join V$SQL_MONITOR with its corresponding plan level monitoring statistics stored in V$SQL_PLAN_MONITOR.

STATUS : SQL execution status. Values are below :
■ EXECUTING - SQL statement is still executing
■ DONE (ERROR) - Execution terminated with an error
■ DONE (FIRST N ROWS) - Execution terminated by the application before all rows were fetched
■ DONE (ALL ROWS) - Execution terminated and all rows were fetched
■ DONE - Execution terminated (parallel execution)

Tested!!!
- On some session:
SQL> select /*+ MONITOR */ * from TB_TEST;
During SQL statement is still executing
- Find information from SQL statement
select key, status, username, module ,service_name, sql_text, cpu_time, buffer_gets from v$sql_monitor where status = 'EXECUTING'
/
- Find Execution Plan
select plan_line_id id, lpad (' ', plan_depth) || plan_operation operation , plan_options , plan_object_name , plan_cardinality card, plan_cost from v$sql_monitor q, v$sql_plan_monitor p where q.key = p.key and q.key = &KEY order by id
/
KEY= 158913789964
However, If You checked by "dbms_sqltune.report_sql_monitor"
SQL> select dbms_sqltune.report_sql_monitor from dual;
REPORT_SQL_MONITOR
---------------------------------------------------------------------------------------------------------------------------------
SQL Monitoring Report

SQL Text
------------------------------
select /*+ MONITOR */ * from TB_TEST

Global Information
------------------------------
Status : EXECUTING
Instance ID : 1
Session : DEMO (36:327)
SQL ID : 45fs1021jz1dg
SQL Execution ID : 16777219
Execution Started : 08/27/2011 17:38:05
First Refresh Time : 08/27/2011 17:38:05
Last Refresh Time : 08/27/2011 17:38:06
Duration : 2s
Module/Action : SQL*Plus/-
Service : SYS$USERS
Program : sqlplus@linuxtest01 (TNS V1-V3)
Fetch Calls : 244

Global Stats
=================================================
| Elapsed | Cpu | Other | Fetch | Buffer |
| Time(s) | Time(s) | Waits(s) | Calls | Gets |
=================================================
| 0.08 | 0.06 | 0.02 | 244 | 290 |
=================================================

SQL Plan Monitoring Details (Plan Hash Value=1092599453)
==============================================================================================================================
| Id | Operation | Name | Rows | Cost | Time | Start | Execs | Rows | Activity | Activity Detail |
| | | | (Estim) | | Active(s) | Active | | (Actual) | (%) | (# samples) |
==============================================================================================================================
| 0 | SELECT STATEMENT | | | | | | 1 | | | |
| -> 1 | TABLE ACCESS FULL | TB_TEST | 162K | 597 | 2 | +0 | 1 | 0 | | |
==============================================================================================================================
This is just sample for manually tuning SQL idea. If you need to monitor your SQL. Use it MONITOR hint -)

Friday, August 26, 2011

Upgraded - APEX 3.2 ->4.1

I posted about APEX 4.1 was released & sample - install & configure with Embedded PL/SQL Gateway. I was curious to upgrade APEX on Oracle 11.2.0.2(version: 3.2.1.00.12).
SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

SQL> select version from dba_registry where comp_id='APEX';
VERSION
------------------------------
3.2.1.00.12

SQL> create tablespace APEX datafile '+DATA' size 200M autoextend on next 20M maxsize unlimited;

Tablespace created.

SQL> @apexins APEX APEX TEMP /i/

Session altered.

. ____ ____ ____ ____
. / \ | \ /\ / | /
.| || / / \ | | |
.| ||--- ---- | | |--
.| || \ / \ | | |
. \____/ | \/ \ \____ |____ \____
.
. Application Express (APEX) Installation.
..........................................
.
... Checking prerequisites
.
.
.
-- Now beginning upgrade. This will take several minutes.-------
-- Ensuring template names are unique -------
-- Migrating metadata to new schema -------
-- Switching builder to new schema -------
-- Migrating SQL Workshop metadata -------
-- Upgrading new schema. -------
-- Copying preferences to new schema. -------
-- Upgrading Websheet objects. -------
Upgrade completed successfully no errors encountered.
-- Upgrade is complete -----------------------------------------
timing for: Upgrade Elapsed: 00:02:41.37
.
.
.
...Compiled 690 out of 2826 objects considered, 0 failed compilation 10:36:24
...247 packages
...239 package bodies
...436 tables
...12 functions
...19 procedures
...3 sequences
...438 triggers
...1238 indexes
...184 views
...0 libraries
...6 types
...0 type bodies
...0 operators
...0 index types
...Begin key object existence check 10:36:24
...Completed key object existence check 10:36:24
...Setting DBMS Registry 10:36:24
...Setting DBMS Registry Complete 10:36:24
...Exiting validate 10:36:24
timing for: Validate Installation
Elapsed: 00:02:44.86
timing for: Development Installation
Elapsed: 00:18:19.60

SQL> select version from dba_registry where comp_id='APEX';

VERSION
------------------------------
4.1.0.00.32

SQL> @apxchpwd
Enter a value below for the password for the Application Express ADMIN user.

Enter a password for the ADMIN user []

Session altered.

...changing password for ADMIN

PL/SQL procedure successfully completed.

Commit complete.

SQL> @apex_epg_config /tmp

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Directory created.

PL/SQL procedure successfully completed.

Commit complete.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

timing for: Load Images
Elapsed: 00:02:09.27

Session altered.

PL/SQL procedure successfully completed.

Commit complete.

Session altered.

Directory dropped.

SQL> ALTER USER ANONYMOUS ACCOUNT UNLOCK;

User altered.

SQL> SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;

GETHTTPPORT
-----------
0

SQL> EXEC DBMS_XDB.SETHTTPPORT(8080);

PL/SQL procedure successfully completed.

SQL> !lsnrctl status | grep 8080
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mytest)(PORT=8080))(Presentation=HTTP)(Session=RAW)
*** then you can run script to Enable Network Services in Oracle Database 11g ****
DECLARE
ACL_PATH VARCHAR2(4000);
ACL_ID RAW(16);
BEGIN
-- Look for the ACL currently assigned to '*' and give APEX_040100
-- the "connect" privilege if APEX_040100 does not have the privilege yet.

SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;

-- Before checking the privilege, ensure that the ACL is valid
-- (for example, does not contain stale references to dropped users).
-- If it does, the following exception will be raised:
--
-- ORA-44416: Invalid ACL: Unresolved principal 'APEX_040100'
-- ORA-06512: at "XDB.DBMS_XDBZ", line ...
--
SELECT SYS_OP_R2O(extractValue(P.RES, '/Resource/XMLRef')) INTO ACL_ID
FROM XDB.XDB$ACL A, PATH_VIEW P
WHERE extractValue(P.RES, '/Resource/XMLRef') = REF(A) AND
EQUALS_PATH(P.RES, ACL_PATH) = 1;

DBMS_XDBZ.ValidateACL(ACL_ID);
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040100',
'connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
'APEX_040100', TRUE, 'connect');
END IF;

EXCEPTION
-- When no ACL has been assigned to '*'.
WHEN NO_DATA_FOUND THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
'ACL that lets power users to connect to everywhere',
'APEX_040100', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/
COMMIT;

DECLARE
ACL_PATH VARCHAR2(4000);
ACL_ID RAW(16);
BEGIN
-- Look for the ACL currently assigned to 'localhost' and give APEX_040100
-- the "connect" privilege if APEX_040100 does not have the privilege yet.
SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = 'localhost' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;

-- Before checking the privilege, ensure that the ACL is valid
-- (for example, does not contain stale references to dropped users).
-- If it does, the following exception will be raised:
--
-- ORA-44416: Invalid ACL: Unresolved principal 'APEX_040100'
-- ORA-06512: at "XDB.DBMS_XDBZ", line ...
--

SELECT SYS_OP_R2O(extractValue(P.RES, '/Resource/XMLRef')) INTO ACL_ID
FROM XDB.XDB$ACL A, PATH_VIEW P
WHERE extractValue(P.RES, '/Resource/XMLRef') = REF(A) AND
EQUALS_PATH(P.RES, ACL_PATH) = 1;

DBMS_XDBZ.ValidateACL(ACL_ID);
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_041000',
'connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
'APEX_040100', TRUE, 'connect');
END IF;

EXCEPTION
-- When no ACL has been assigned to 'localhost'.
WHEN NO_DATA_FOUND THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('local-access-users.xml',
'ACL that lets power users to connect to everywhere',
'APEX_040100', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users.xml','localhost');
END;
/
COMMIT;
Tested !!!


APEX 4.1 was released & sample - install & configure with Embedded PL/SQL Gateway

Oracle Application Express Release 4.1 was released on August 24, 2011. You can download
and read more New Features in Release 4.1. Documentation and Tutorials
I would like to install NEW!!! with it (APEX 4.1) and configure Embedded PL/SQL Gateway (just test ... install and use it with Embedded PL/SQL Gateway. not connect to anywhere)
$ ls apex_4.1.zip
apex_4.1.zip
$ unzip apex_4.1.zip
$ cd apex
$ ls
apex_epg_config_core.sql apxchpwd.sql apxldimg.sql apxxemig.sql coreins.sql load_trans.sql
apex_epg_config.sql apxconf.sql apxremov.sql apxxepwd.sql devins.sql owa
apexins.sql apxdevrm.sql apxrtins.sql builder endins.sql utilities
apexvalidate.sql apxdvins.sql apxsqler.sql core images
- Installed APEX 4.1 Full development environment.
SQL> @apexins APEX APEX TEMP /i/
Session altered.

. ____ ____ ____ ____
. / \ | \ /\ / | /
.| || / / \ | | |
.| ||--- ---- | | |--
.| || \ / \ | | |
. \____/ | \/ \ \____ |____ \____
.
. Application Express (APEX) Installation.
..........................................
.
... Checking prerequisites
.
.
.
...Compiled 623 out of 2826 objects considered, 0 failed compilation 00:26:08
...247 packages
...239 package bodies
...436 tables
...12 functions
...19 procedures
...3 sequences
...438 triggers
...1238 indexes
...184 views
...0 libraries
...6 types
...0 type bodies
...0 operators
...0 index types
...Begin key object existence check 00:26:08
...Completed key object existence check 00:26:08
...Setting DBMS Registry 00:26:08
...Setting DBMS Registry Complete 00:26:08
...Exiting validate 00:26:08
timing for: Validate Installation
Elapsed: 00:10:47.71
timing for: Development Installation
Elapsed: 00:27:43.38
- Checked schemas in database.
SQL> select username from dba_users where CREATED > sysdate - 1/12;

USERNAME
------------------------------
APEX_PUBLIC_USER
APEX_040100
FLOWS_FILES
APEX_040100 - The account that owns the Oracle Application Express schema and metadata. FLOWS_FILES - The account that owns the Oracle Application Express uploaded files. APEX_PUBLIC_USER - The minimally privileged account used for Oracle Application Express configuration with Oracle Application Express Listener or Oracle HTTP Server and mod_plsql.

- Changed ADMIN password.
SQL> @apxchpwd
Enter a value below for the password for the Application Express ADMIN user.

Enter a password for the ADMIN user []

Session altered.

...changing password for ADMIN

PL/SQL procedure successfully completed.

Commit complete
- Configured the Embedded PL/SQL Gateway (It's new Installation. So, used apex_epg_config.sql script)
SQL> @apex_epg_config /home/oracle

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Directory created.

PL/SQL procedure successfully completed.

Commit complete.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

timing for: Load Images
Elapsed: 00:02:54.75

Session altered.

PL/SQL procedure successfully completed.

Commit complete.

Session altered.

Directory dropped.
- Unlocked ANONYMOUS ACCOUNT
SQL> ALTER USER ANONYMOUS ACCOUNT UNLOCK;

User altered.
- Check Oracle XML DB HTTP Server
SQL> SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;

GETHTTPPORT
-----------
8080

SQL> !lsnrctl status | grep 8080
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linuxtest01)(PORT=8080))(Presentation=HTTP)(Session=RAW))
*** not run about access list, because this test (APEX) not connect to anywhere ***

- Tested http://IP_ADDRESS:8080/apex
A. admin page
B. Workspace page
If You are installing or upgrading it... Enjoy -)

Thursday, August 25, 2011

Oracle Linux 6 - Problem resizing tmpfs ???

I installed Oracle Linux 6.1 and I was curious about resizing tmpfs (when I rebooted). It's fixed at 50% of memory???
[root@mytest ~]# grep shm /etc/fstab
tmpfs /dev/shm tmpfs defaults 0 0

[root@mytest ~]# df -h | grep shm
tmpfs 903M 176M 728M 20% /dev/shm

[root@mytest ~]# grep shm /etc/fstab
tmpfs /dev/shm tmpfs size=2g 0 0
Tested to reboot!!!
[root@mytest ~]# df -h | grep shm
tmpfs 903M 0 903M 0% /dev/shm

[root@mytest ~]# grep shm /etc/fstab
tmpfs /dev/shm tmpfs size=2g 0 0
Oops!!! not affect, after rebooted. What wrong? I read this link for idea.
So, I fixed /etc/rc.d/rc.sysinit file.
[root@mytest ~] cp -a /etc/rc.d/rc.sysinit /etc/rc.d/rc.sysinit.org
[root@mytest ~] vi /etc/rc.d/rc.sysinit
******************************************************
- mount -f /dev/shm >/dev/null 2>&1
+ #mount -f /dev/shm >/dev/null 2>&1
******************************************************
if [ "$READONLY" != "yes" ] ; then
- action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
+ action $"Mounting local filesystems: " mount -a -t tmpfs,nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
******************************************************
After I changed rc.sysinit file.
[root@mytest ~]# diff /etc/rc.d/rc.sysinit.org /etc/rc.d/rc.sysinit
504c504
< mount -f /dev/shm >/dev/null 2>&1
---
> # mount -f /dev/shm >/dev/null 2>&1
512c512
< action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
---
> action $"Mounting local filesystems: " mount -a -t tmpfs,nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
[root@mytest ~]# df -h | grep shm
tmpfs 903M 176M 728M 20% /dev/shm

[root@mytest ~]# grep shm /etc/fstab
tmpfs /dev/shm tmpfs size=2g 0 0

Tested to reboot!!! again -)
[root@mytest ~]# df -h | grep shm
tmpfs 2.0G 655M 1.4G 32% /dev/shm

Wednesday, August 24, 2011

Oracle Restart - Installation and... SILENT Mode

I interested to Install Grid Infrastructure for standalone server + Database and Create database by SILENT mode (Oracle Restart ) So, I just tested it.
A. Created Groups/Users and checked Preinstallation (don't write more, please check on Oracle Document)
[root@mytest ~]# groupadd -g 1000 oinstall
[root@mytest ~]# groupadd -g 1031 dba
[root@mytest ~]# groupadd -g 1020 asmadmin
[root@mytest ~]# groupadd -g 1021 asmdba
[root@mytest ~]# groupadd -g 1022 asmoper
[root@mytest ~]# groupadd -g 1032 oper
[root@mytest ~]# useradd -u 1100 -g oinstall -G asmadmin,asmdba grid
[root@mytest ~]# useradd -u 1101 -g oinstall -G dba,oper,asmdba oracle
[root@mytest ~]# passwd grid
Changing password for user grid.
New password:
BAD PASSWORD: it is too short
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@mytest ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.

[root@mytest ~]# mkdir -p mkdir -p /u01/app/oracle/11.2.0/grid
[root@mytest ~]# chown -R grid:oinstall /u01
[root@mytest ~]# mkdir -p /u01/app/oracle
[root@mytest ~]# chown oracle:oinstall /u01/app/oracle
[root@mytest ~]# chmod -R 775 /u01
[root@mytest ~]# su - grid

B. Installed Grid Infrastructure for standalone server (SILENT Mode) *** In /u01/SRC/grid PATH (Source)***
[grid@mytest grid]$ ./runInstaller -silent -ignoreSysPrereqs -ignorePrereq -responseFile /u01/SRC/grid/response/grid_install.rsp ORACLE_BASE="/u01/app/oracle" ORACLE_HOME="/u01/app/oracle/11.2.0/grid" oracle.install.option="HA_CONFIG" oracle.install.asm.OSDBA=asmdba oracle.install.asm.OSOPER=asmoper oracle.install.asm.OSASM=asmadmin INVENTORY_LOCATION="/u01/app/oraInventory" oracle.install.asm.diskGroup.name=DATA oracle.install.asm.diskGroup.redundancy=NORMAL oracle.install.asm.diskGroup.diskDiscoveryString="/dev/raw/raw*" oracle.install.asm.diskGroup.disks="/dev/raw/raw1,/dev/raw/raw2" oracle.install.asm.SYSASMPassword=password oracle.install.asm.monitorPassword=password
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB. Actual 15170 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4098 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-08-23_06-04-15PM. Please wait ...You can find the log of this install session at: /u01/app/oraInventory/logs/installActions2011-08-23_06-04-15PM.log

As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/oracle/11.2.0/grid/root.sh

As install user, execute the following script to complete the configuration.
1. /u01/app/oracle/11.2.0/grid/cfgtoollogs/configToolAllCommands

Note:
1. This script should be run in the same environment from where the installer has been run.
2. This script needs a small password properties file for configuration assistants that require passwords (refer to install guide documentation).

Successfully Setup Software.

C. Go to "root" user and executed the following script(s)
[root@mytest ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.

*** I tested in Oracle Linux 6.1. so, below "Adding daemon to inittab" message, it's wrong!!! Because Oracle Linux 6.* not support inittab file (It uses UpStart). I created "/etc/init/init-orahas.conf" file, before executed "root.sh" ***
[root@mytest ~]# cat /etc/init/init-orahas.conf
#start oracle
start on runlevel [35]
stop on runlevel [016]
respawn
exec /etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null
[root@mytest ~]# /u01/app/oracle/11.2.0/grid/root.sh
Check /u01/app/oracle/11.2.0/grid/install/root_mytest_2011-08-24_10-51-18.log for the output of root script

[root@mytest ~]# cat /u01/app/oracle/11.2.0/grid/install/root_mytest_2011-08-24_10-51-18.log
Running Oracle 11g root script...

The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/oracle/11.2.0/grid
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/oracle/11.2.0/grid/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node mytest successfully pinned.
Adding daemon to inittab
ACFS-9459: ADVM/ACFS is not supported on this OS version: 'error: file /etc/SuSE-release: No such file or directory'

mytest 2011/08/24 10:52:08 /u01/app/oracle/11.2.0/grid/cdata/mytest/backup_20110824_105208.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server

D. Executed configToolAllCommands script.
[grid@mytest grid]$ cat /u01/SRC/grid/cfgrsp.properties
oracle.assistants.asm|S_ASMPASSWORD=password
oracle.assistants.asm|S_ASMMONITORPASSWORD=password
[grid@mytest grid]$ /u01/app/oracle/11.2.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/u01/SRC/grid/cfgrsp.properties
Setting the invPtrLoc to /u01/app/oracle/11.2.0/grid/oraInst.loc

perform - mode is starting for action: configure

Aug 24, 2011 12:06:00 PM oracle.install.driver.oui.config.GenericInternalPlugIn invoke
INFO: Executing ASMCA
Aug 24, 2011 12:06:00 PM oracle.install.driver.oui.config.GenericInternalPlugIn invoke
INFO: Command /u01/app/oracle/11.2.0/grid/bin/asmca -silent -oui_internal -configureASM -diskString '/dev/raw/raw*' -diskGroupName DATA -diskList /dev/raw/raw1,/dev/raw/raw2 -redundancy NORMAL
Aug 24, 2011 12:06:00 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: ... GenericInternalPlugIn.handleProcess() entered.
Aug 24, 2011 12:06:00 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: ... GenericInternalPlugIn: getting configAssistantParmas.
Aug 24, 2011 12:06:00 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: ... GenericInternalPlugIn: checking secretArguments.
Aug 24, 2011 12:06:00 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: ... GenericInternalPlugIn: starting read loop.
Aug 24, 2011 12:06:06 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Read: SYS_PASSWORD_PROMPT
Aug 24, 2011 12:06:06 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Processing: SYS_PASSWORD_PROMPT for argument tag -sysAsmPassword
Aug 24, 2011 12:06:06 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Read: ASMSNMP_PASSWORD_PROMPT
Aug 24, 2011 12:06:06 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Processing: ASMSNMP_PASSWORD_PROMPT for argument tag -asmMonitorPassword
Aug 24, 2011 12:06:06 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: End of argument passing to stdin
Aug 24, 2011 12:06:07 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Read:
Aug 24, 2011 12:06:07 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Read: An ASM Instance with SID +ASM is already detected. ASM failed to start.
Check /u01/app/oracle/cfgtoollogs/asmca/asmca-110824PM120601.log for details.
Aug 24, 2011 12:06:07 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Read:
perform - mode finished for action: configure

You can see the log file: /u01/app/oracle/11.2.0/grid/cfgtoollogs/oui/configActions2011-08-24_12-05-51-PM.log

[grid@mytest grid]$ cat /u01/app/oracle/11.2.0/grid/cfgtoollogs/oui/configActions2011-08-24_12-05-51-PM.log
###################################################
The action configuration is performing
.
.
.
------------------------------------------------------
------------------------------------------------------
The plug-in Automatic Storage Management Configuration Assistant is running

The plug-in Automatic Storage Management Configuration Assistant has failed its perform method
------------------------------------------------------
The action configuration has failed its perform method
###################################################
*** had to create ASM by manual ***

E. Created (ASM) by Manual!!!

[grid@mytest grid]$ crsctl status res
NAME=ora.LISTENER.lsnr
TYPE=ora.listener.type
TARGET=ONLINE
STATE=ONLINE on mytest

NAME=ora.cssd
TYPE=ora.cssd.type
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.diskmon
TYPE=ora.diskmon.type
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.evmd
TYPE=ora.evm.type
TARGET=ONLINE
STATE=ONLINE on mytest

NAME=ora.ons
TYPE=ora.ons.type
TARGET=OFFLINE
STATE=OFFLINE

[grid@mytest grid]$ crsctl start res ora.cssd
CRS-2672: Attempting to start 'ora.cssd' on 'mytest'
CRS-2672: Attempting to start 'ora.diskmon' on 'mytest'
CRS-2676: Start of 'ora.diskmon' on 'mytest' succeeded
CRS-2676: Start of 'ora.cssd' on 'mytest' succeeded
[grid@mytest grid]$ crsctl status res ora.cssd
NAME=ora.cssd
TYPE=ora.cssd.type
TARGET=ONLINE
STATE=ONLINE on mytest

[grid@mytest admin]$ srvctl add asm -l LISTENER -p /u01/app/oracle/11.2.0/grid/dbs/init+ASM.ora -d '/dev/raw/raw*'
[grid@mytest admin]$ srvctl start asm

F. Created ASM Disk Group
[grid@mytest admin] export ORACLE_SID=+ASM
[grid@mytest admin] export ORACLE_HOME=/u01/app/oracle/11.2.0/grid
[grid@mytest admin] sqlplus / as sysasm

SQL> create diskgroup DATA normal redundancy disk '/dev/raw/raw*' ATTRIBUTE 'compatible.asm' = '11.2.0.0.0';

Diskgroup created.

SQL> create pfile='/tmp/pfile' from memory;

File created.

G. Modified '/tmp/pfile' file and create spfile in ASM Disk Group

SQL> create spfile='+DATA' from pfile='/tmp/pfile';

File created.

SQL> shutdown
ASM instance shutdown
SQL> startup
ASM instance started

Total System Global Area 283930624 bytes
Fixed Size 2225792 bytes
Variable Size 256539008 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> SQL> show parameter spfile

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATA/asm/asmparameterfile/registry.253.760018979

However, don't miss!!!
[grid@mytest dbs]$ orapwd file=/u01/app/oracle/11.2.0/grid/dbs/orapw+ASM password=password

H. Installed Oracle Database (Software Only) *** su - oracle ***
[oracle@mytest database]$ ./runInstaller -silent -ignoreSysPrereqs -ignorePrereq -ignoreInternalDriverError -responseFile /u01/SRC/database/response/db_install.rsp ORACLE_BASE=/u01/app/oracle ORACLE_HOME=/u01/app/oracle/11.2.0/dbhome_1 ORACLE_HOME_NAME=OraDbHome1 oracle.install.option=INSTALL_DB_SWONLY oracle.install.db.InstallEdition=EE oracle.install.db.DBA_GROUP=dba oracle.install.db.OPER_GROUP=oper DECLINE_SECURITY_UPDATES=true
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB. Actual 14549 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4099 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-08-24_04-05-49PM. Please wait ...
[WARNING] [INS-30060] Check for group existence failed.
CAUSE: Unexpected error occurred while trying to check for group existence.
ACTION: Refer to the logs or contact Oracle Support Services. Note for advanced users: Launch the installer by passing the following flag ''-ignoreInternalDriverError''.
You can find the log of this install session at:
/u01/app/oraInventory/logs/installActions2011-08-24_04-05-49PM.log

As a root user, execute the following script(s):
1. /u01/app/oracle/11.2.0/dbhome_1/root.sh

Successfully Setup Software

I. Go to "root" user and executed the following script
[root@mytest SRC]# /u01/app/oracle/11.2.0/dbhome_1/root.sh
Check /u01/app/oracle/11.2.0/dbhome_1/install/root_mytest_2011-08-24_16-13-58.log for the output of root script

*** checked " /u01/app/oracle/11.2.0/dbhome_1/install/root_mytest_2011-08-24_16-13-58.log " and no error ***
- Created Database
[oracle@mytest ~]$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName orcl -sid orcl -SysPassword password -SystemPassword password -emConfiguration NONE -redoLogFileSize 100 -recoveryAreaDestination DATA -storageType ASM -asmSysPassword password -diskGroupName DATA -characterSet AL32UTF8 -nationalCharacterSet AL16UTF16 -totalMemory 800
Copying database files
1% complete
3% complete
10% complete
17% complete
24% complete
31% complete
35% complete
Creating and starting Oracle instance
37% complete
42% complete
47% complete
52% complete
53% complete
56% complete
58% complete
Registering database with Oracle Restart
64% complete
Completing Database Creation
68% complete
71% complete
75% complete
85% complete
86% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.

[oracle@mytest ~]$ cat /u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log
Copying database files
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 3%
DBCA_PROGRESS : 10%
DBCA_PROGRESS : 17%
DBCA_PROGRESS : 24%
DBCA_PROGRESS : 31%
DBCA_PROGRESS : 35%
Creating and starting Oracle instance
DBCA_PROGRESS : 37%
DBCA_PROGRESS : 42%
DBCA_PROGRESS : 47%
DBCA_PROGRESS : 52%
DBCA_PROGRESS : 53%
DBCA_PROGRESS : 56%
DBCA_PROGRESS : 58%
Registering database with Oracle Restart
DBCA_PROGRESS : 64%
Completing Database Creation
DBCA_PROGRESS : 68%
DBCA_PROGRESS : 71%
DBCA_PROGRESS : 75%
DBCA_PROGRESS : 85%
PRCR-1079 : Failed to start resource ora.orcl.db
CRS-5010: Update of configuration file "/u01/app/oracle/11.2.0/dbhome_1/srvm/admin/oratab.bak.mytest" failed: details at "(:CLSN00011:)" in "/u01/app/oracle/11.2.0/grid/log/mytest/agent/ohasd/oraagent_grid/oraagent_grid.log"
ORA-01031: insufficient privileges
CRS-5017: The resource action "ora.orcl.db start" encountered the following error:
ORA-01031: insufficient privileges


CRS-2674: Start of 'ora.orcl.db' on 'mytest' failed
ORA-01031: insufficient privileges
DBCA_PROGRESS : 86%
ORA-01034: ORACLE not available
DBCA_PROGRESS : 96%
DBCA_PROGRESS : 100%
Database creation complete. For details check the logfiles at:
/u01/app/oracle/cfgtoollogs/dbca/orcl.
Database Information:
Global Database Name:orcl
System Identifier(SID):orcl
Error:
PRCR-1079 : Failed to start resource ora.orcl.db
CRS-5010: Update of configuration file "/u01/app/oracle/11.2.0/dbhome_1/srvm/admin/oratab.bak.mytest" failed: details at "(:CLSN00011:)" in "/u01/app/oracle/11.2.0/grid/log/mytest/agent/ohasd/oraagent_grid/oraagent_grid.log"
ORA-01031: insufficient privileges
CRS-5017: The resource action "ora.orcl.db start" encountered the following error:
ORA-01031: insufficient privileges

CRS-2674: Start of 'ora.orcl.db' on 'mytest' failed
ORA-01031: insufficient privileges
DBCA_PROGRESS : 86%
ORA-01034: ORACLE not available
J. Tested by SQL*Plus
[oracle@mytest dbs]$ export ORACLE_SID=orcl
[oracle@mytest dbs]$ export ORACLE_HOME=/u01/app/oracle/11.2.0/dbhome_1
[oracle@mytest dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Wed Aug 24 16:53:54 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 835104768 bytes
Fixed Size 2231088 bytes
Variable Size 490734800 bytes
Database Buffers 335544320 bytes
Redo Buffers 6594560 bytes
Database mounted.
Database opened.

*** OK ... this issue depended on Grid Infrastructure ***

K. Fixed issue... CRS-5010
just bug. checked PRCR-1079 ORA-01031 CRS-2674 SRVCTL Fails to Start Database in Oracle Restart Job Role Separation Environment [ID 985743.1]
TEST: ...
[oracle@mytest dbhome_1]$ /u01/app/oracle/11.2.0/dbhome_1/bin/osdbagrp
dba
*** Add "grid" user to "dba" group ***
[root@mytest dbhome_1]# groups grid
grid : oinstall asmadmin asmdba
[root@mytest dbhome_1]# usermod -G asmadmin,asmdba,dba grid
[root@mytest dbhome_1]# groups grid
grid : oinstall dba asmadmin asmdba
[root@mytest dbhome_1]# su - grid
[grid@mytest ~]$ srvctl start database -d orcl
[grid@mytest ~]$ srvctl status database -d orcl
Database is running.

L. Checked ... again
[grid@mytest ~]$ crsctl stat res
NAME=ora.DATA.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE on mytest

NAME=ora.LISTENER.lsnr
TYPE=ora.listener.type
TARGET=ONLINE
STATE=ONLINE on mytest

NAME=ora.asm
TYPE=ora.asm.type
TARGET=ONLINE
STATE=ONLINE on mytest

NAME=ora.cssd
TYPE=ora.cssd.type
TARGET=ONLINE
STATE=ONLINE on mytest

NAME=ora.diskmon
TYPE=ora.diskmon.type
TARGET=ONLINE
STATE=ONLINE on mytest

NAME=ora.evmd
TYPE=ora.evm.type
TARGET=ONLINE
STATE=ONLINE on mytest

NAME=ora.ons
TYPE=ora.ons.type
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.orcl.db
TYPE=ora.database.type
TARGET=ONLINE
STATE=ONLINE on mytest
This was just my test... wishes it's useful for someone.

Related Posts:
Install Grid Infra - clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory
ETC...

Tuesday, August 23, 2011

Install Grid Infra - clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory

Nothing special, I just installed Grid Infrastructure on Oracle Linux 6 update 1. I found error during run "root.sh":
clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory
# /u01/app/oracle/11.2.0/grid/root.sh
Check /u01/app/oracle/11.2.0/grid/install/root_mytest_2011-08-23_18-29-38.log for the output of root script
# cat /u01/app/oracle/11.2.0/grid/install/root_mytest_2011-08-23_18-29-38.log

Running Oracle 11g root script...

The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/oracle/11.2.0/grid
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/oracle/11.2.0/grid/crs/install/crsconfig_params
/u01/app/oracle/11.2.0/grid/bin/clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory
Failed to create keys in the OLR, rc = 127, 32512
/u01/app/oracle/11.2.0/grid/perl/bin/perl -I/u01/app/oracle/11.2.0/grid/perl/lib -I/u01/app/oracle/11.2.0/grid/crs/install /u01/app/oracle/11.2.0/grid/crs/install/roothas.pl execution failed
Check on My Oracle Support for Idea. Clscfg.bin Error While Loading Shared Libraries: libcap.so.1 [ID 952051.1]. Need to install libcap1 and libcap2 packages.
# uname -r
2.6.32-100.34.1.el6uek.x86_64
So, need libcap1 and libcap2 packages for 2.6.32-100.34.1.el6uek.x86_64
# yum list | grep libcap
compat-libcap1.i686 1.10-1 @ol6_ga_base
libcap.i686 2.16-5.2.el6 @ol6_ga_base
libcap.x86_64 2.16-5.2.el6 @anaconda-OracleLinuxServer-201102031546.x86_64/6.0
libcap-devel.i686 2.16-5.2.el6 @ol6_ga_base
libcap-devel.x86_64 2.16-5.2.el6 @ol6_ga_base
libcap-ng.x86_64 0.6.4-3.el6_0.1 @ol6_u1_base
compat-libcap1.x86_64 1.10-1 ol6_ga_base
libcap-ng.i686 0.6.4-3.el6_0.1 ol6_u1_base
libcap-ng-devel.i686 0.6.4-3.el6_0.1 ol6_u1_base
libcap-ng-devel.x86_64 0.6.4-3.el6_0.1 ol6_u1_base
libcap-ng-python.x86_64 0.6.4-3.el6_0.1 ol6_u1_base
libcap-ng-utils.x86_64 0.6.4-3.el6_0.1 ol6_u1_base
Installed...
# yum install libcap.x86_64
Setting up Install Process
Package libcap-2.16-5.2.el6.x86_64 already installed and latest version
Nothing to do
libcap2 package installed, so install libcab1.
# yum install compat-libcap1.x86_64
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package compat-libcap1.x86_64 0:1.10-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================
Installing:
compat-libcap1 x86_64 1.10-1 ol6_ga_base 17 k

Transaction Summary
=========================================================================================================================
Install 1 Package(s)

Total download size: 17 k
Installed size: 29 k
Is this ok [y/N]: y
Downloading Packages:
compat-libcap1-1.10-1.x86_64.rpm | 17 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : compat-libcap1-1.10-1.x86_64 1/1

Installed:
compat-libcap1.x86_64 0:1.10-1

Complete!
OK ... run "root.sh" again.
# /u01/app/oracle/11.2.0/grid/crs/install/roothas.pl -deconfig
Using configuration parameter file: /u01/app/oracle/11.2.0/grid/crs/install/crsconfig_params
# rm /etc/oracle/olr.loc
# /u01/app/oracle/11.2.0/grid/root.sh
...One thing on Oracle Linux 6. It's not support inittab file. You can create file /etc/init/*.conf (created before or modified has script )
#start oracle
start on runlevel [35]
stop on runlevel [016]
respawn
exec /etc/init.d/init.ohasd run > /dev/null 2>&1 < /dev/null
Thank You for Oracle Linux 6.1 And libcap.so.1: cannot open shared object
I learned more...

TEST!!! - kdump on Oracle Linux (Unbreakable Enterprise Kernel)

I posted Just learn Kdump. That is how to setup kdump on linux. Today, I installed Oracle Linux 6.1 and It's Unbreakable Enterprise Kernel (2.6.32-100.34.1.el6uek.x86_64), then I tested kdump.
[root@mytest ~]# rpm -q kexec-tools
kexec-tools-2.0.0-188.0.2.el6.x86_64
[root@mytest ~]# grep CONFIG_KEXEC /boot/config-2.6.32-100.34.1.el6uek.x86_64
CONFIG_KEXEC=y
[root@mytest ~]# grep CONFIG_CRASH_DUMP /boot/config-2.6.32-100.34.1.el6uek.x86_64
CONFIG_CRASH_DUMP=y
[root@mytest ~]# cat /etc/grub.conf | grep `uname -r`
title Oracle Linux Server (2.6.32-100.34.1.el6uek.x86_64)
kernel /boot/vmlinuz-2.6.32-100.34.1.el6uek.x86_64 ro root=UUID=f52aec57-89fc-40b9-a8a8-1bf32694d05f rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
initrd /boot/initramfs-2.6.32-100.34.1.el6uek.x86_64.img
Changed to set crashkernel.
[root@mytest ~]# cat /etc/grub.conf | grep `uname -r`
title Oracle Linux Server (2.6.32-100.34.1.el6uek.x86_64)
kernel /boot/vmlinuz-2.6.32-100.34.1.el6uek.x86_64 ro root=UUID=f52aec57-89fc-40b9-a8a8-1bf32694d05f rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet crashkernel=128M@16M
initrd /boot/initramfs-2.6.32-100.34.1.el6uek.x86_64.img

[root@mytest ~]# runlevel
N 3
[root@mytest ~]# chkconfig --level 3 kdump on
[root@mytest ~]# reboot
After rebooted.
[root@mytest ~]# cat /proc/cmdline
ro root=UUID=f52aec57-89fc-40b9-a8a8-1bf32694d05f rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet crashkernel=128M@16M
[root@mytest ~]# /etc/init.d/kdump status
Kdump is not operational
[root@mytest ~]# /etc/init.d/kdump start
Starting kdump: [FAILED]
[root@mytest ~]# dmesg | grep -i crashkernel
Command line: ro root=UUID=f52aec57-89fc-40b9-a8a8-1bf32694d05f rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet crashkernel=128M@16M
crashkernel reservation failed - memory is in use
Kernel command line: ro root=UUID=f52aec57-89fc-40b9-a8a8-1bf32694d05f rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet crashkernel=128M@16M
Minimum value for crashkernel option is 128M@16M ??? Yes, but not for Unbreakable Enterprise Kernel. It needs Higher memory!!! Increased the second value (32M). OK... changed 16M to 32M and rebooted.
[root@mytest ~]# /etc/init.d/kdump status
Kdump is not operational
[root@mytest ~]# /etc/init.d/kdump start
Starting kdump: [FAILED]
Still not work!!! Increased the second value (64M) for Unbreakable Enterprise Kernel (2.6.32-100.34.1.el6uek.x86_64), then rebooted
[root@mytest ~]# /etc/init.d/kdump status
Kdump is operational
[root@mytest ~]# cat /proc/cmdline
ro root=UUID=f52aec57-89fc-40b9-a8a8-1bf32694d05f rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet crashkernel=128M@64M
It's work!!! If You would like to use KDUMP with Unbreakable Enterprise Kernel. look at crashkernel=128M@64M. then TEST!!!
[root@mytest ~]# echo c > /proc/sysrq-trigger
System panic and rebooted. (TEST ON TEST SYSTEM ONLY)
[root@mytest ~]# last
reboot system boot 2.6.32-100.34.1. Tue Aug 23 10:47 - 10:48 (00:00)
[root@mytest ~]# ls -l /var/crash/127.0.0.1-2011-08-23-10\:46\:22/vmcore
-rw-------. 1 root root 34659098 Aug 23 10:46 /var/crash/127.0.0.1-2011-08-23-10:46:22/vmcore
Read it (vmcore file), but had to download 2 packages:
[root@mytest ~]# ls kernel-uek-debuginfo-*
kernel-uek-debuginfo-2.6.32-100.35.1.el6uek.x86_64.rpm
kernel-uek-debuginfo-common-2.6.32-100.35.1.el6uek.x86_64.rpm
Because I didn't see kernel-uek-debuginfo-2.6.32-100.35.1.el6uek.x86_64* at http://oss.oracle.com/ol6/debuginfo
[root@mytest ~]# crash /usr/lib/debug/lib/modules/2.6.32-100.35.1.el6uek.x86_64/vmlinux /var/crash/127.0.0.1-2011-08-23-10\:46\:22/vmcore
crash 5.1.1-2.el6
Copyright (C) 2002-2011 Red Hat, Inc.
Copyright (C) 2004, 2005, 2006 IBM Corporation
Copyright (C) 1999-2006 Hewlett-Packard Co
Copyright (C) 2005, 2006 Fujitsu Limited
Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
Copyright (C) 2005 NEC Corporation
Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
This program is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions. Enter "help copying" to see the conditions.
This program has absolutely no warranty. Enter "help warranty" for details.

GNU gdb (GDB) 7.0
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu"...

KERNEL: /usr/lib/debug/lib/modules/2.6.32-100.35.1.el6uek.x86_64/vmlinux
DUMPFILE: /var/crash/127.0.0.1-2011-08-23-10:46:22/vmcore [PARTIAL DUMP]
CPUS: 2
DATE: Tue Aug 23 10:45:06 2011
UPTIME: 00:05:17
LOAD AVERAGE: 0.06, 0.09, 0.04
TASKS: 109
NODENAME: mytest.surachartopun.com
RELEASE: 2.6.32-100.34.1.el6uek.x86_64
VERSION: #1 SMP Wed May 25 17:46:45 EDT 2011
MACHINE: x86_64 (1994 Mhz)
MEMORY: 1.9 GB
PANIC: "Oops: 0002 [#1] SMP " (check log for details)
PID: 1769
COMMAND: "bash"
TASK: ffff8800767982c0 [THREAD_INFO: ffff88007678c000]
CPU: 0
STATE: TASK_RUNNING (PANIC)

crash> log > log.txt
crash> exit
[root@mytest ~]# ls -ltr log.txt
-rw-r--r--. 1 root root 48084 Aug 23 10:51 log.txt
OK. I didn't write how to read it (vmcore file). I just posted "crashkernel" value, when you need to use KDUMP on Unbreakable Enterprise Kernel.

Related Post:
Just learn Kdump...

Monday, August 22, 2011

TEST!!! - _optimizer_cartesian_enabled and _optimizer_mjc_enabled

After I posted Just learn more from V$LOCK and Excessive waited 'SQL*Net message from client' - when query V$LOCK. I found "MERGE JOIN CARTESIAN" in Explain Plan, that made excessive response time from V$LOCK.
I learned some idea from My Oracle Support to eliminate the merge join cartesian Rule. Set both "_optimizer_cartesian_enabled" and "_optimizer_mjc_enabled" hidden parameters.
SQL> SELECT ksppinm name,
2 ksppstvl value,
3 ksppdesc description
4 FROM x$ksppi x, x$ksppcv y
5 WHERE (x.indx = y.indx)
6 AND x.inst_id=userenv('instance')
7 AND x.inst_id=y.inst_id
8 AND ksppinm LIKE '\_optimizer\_cartesian\_enabled' ESCAPE '\'
9 /

NAME VALUE DESCRIPTION
---------------------------------------- ---------- --------------------------------------------------------------------------------
_optimizer_cartesian_enabled TRUE optimizer cartesian join enabled

SQL> SELECT ksppinm name,
2 ksppstvl value,
3 ksppdesc description
4 FROM x$ksppi x, x$ksppcv y
5 WHERE (x.indx = y.indx)
6 AND x.inst_id=userenv('instance')
7 AND x.inst_id=y.inst_id
8 AND ksppinm LIKE '\_optimizer\_mjc\_enabled' ESCAPE '\'
9* ORDER BY name
SQL> /

NAME VALUE DESCRIPTION
---------------------------------------- ---------- --------------------------------------------------------------------------------
_optimizer_mjc_enabled TRUE enable merge join cartesian
Test it... more
Case1: No change anything
SQL> show parameter "_optimizer_cartesian_enabled"
SQL> show parameter "_optimizer_mjc_enabled"
SQL> explain plan for select * from v$lock;

Explained.

SQL> select * from table(dbms_xplan.display());

PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 554400005
-------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 144 | 1 (100)| 00:00:01 |
|* 1 | HASH JOIN | | 1 | 144 | 1 (100)| 00:00:01 |
| 2 | VIEW | GV$_LOCK | 10 | 680 | 0 (0)| 00:00:01 |
| 3 | UNION-ALL | | | | | |
|* 4 | FILTER | | | | | |
| 5 | VIEW | GV$_LOCK1 | 2 | 136 | 0 (0)| 00:00:01 |
| 6 | UNION-ALL | | | | | |
|* 7 | FIXED TABLE FULL| X$KDNSSF | 1 | 94 | 0 (0)| 00:00:01 |
|* 8 | FIXED TABLE FULL| X$KSQEQ | 1 | 94 | 0 (0)| 00:00:01 |
|* 9 | FIXED TABLE FULL | X$KTADM | 1 | 94 | 0 (0)| 00:00:01 |
|* 10 | FIXED TABLE FULL | X$KTATRFIL | 1 | 94 | 0 (0)| 00:00:01 |
|* 11 | FIXED TABLE FULL | X$KTATRFSL | 1 | 94 | 0 (0)| 00:00:01 |
|* 12 | FIXED TABLE FULL | X$KTATL | 1 | 94 | 0 (0)| 00:00:01 |
|* 13 | FIXED TABLE FULL | X$KTSTUSC | 1 | 94 | 0 (0)| 00:00:01 |
|* 14 | FIXED TABLE FULL | X$KTSTUSS | 1 | 94 | 0 (0)| 00:00:01 |
|* 15 | FIXED TABLE FULL | X$KTSTUSG | 1 | 94 | 0 (0)| 00:00:01 |
|* 16 | FIXED TABLE FULL | X$KTCXB | 1 | 94 | 0 (0)| 00:00:01 |
| 17 | MERGE JOIN CARTESIAN | | 100 | 7600 | 0 (0)| 00:00:01 |
|* 18 | FIXED TABLE FULL | X$KSUSE | 1 | 30 | 0 (0)| 00:00:01 |
| 19 | BUFFER SORT | | 100 | 4600 | 0 (0)| 00:00:01 |
| 20 | FIXED TABLE FULL | X$KSQRS | 100 | 4600 | 0 (0)| 00:00:01 |
-------------------------------------------------------------------------------------

SQL> select * from v$lock;
.
.
.
Elapsed: 00:00:00.94
Case 2: Disabled merge join cartesian
SQL> alter system set "_optimizer_cartesian_enabled"=FALSE;

System altered.

SQL> alter system set "_optimizer_mjc_enabled" = FALSE;

System altered.

SQL> explain plan for select * from v$lock;

Explained.

SQL> select * from table(dbms_xplan.display());

PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 3634456900
-------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 144 | 1 (100)| 00:00:01 |
|* 1 | HASH JOIN | | 1 | 144 | 1 (100)| 00:00:01 |
| 2 | VIEW | GV$_LOCK | 10 | 680 | 0 (0)| 00:00:01 |
| 3 | UNION-ALL | | | | | |
|* 4 | FILTER | | | | | |
| 5 | VIEW | GV$_LOCK1 | 2 | 136 | 0 (0)| 00:00:01 |
| 6 | UNION-ALL | | | | | |
|* 7 | FIXED TABLE FULL| X$KDNSSF | 1 | 94 | 0 (0)| 00:00:01 |
|* 8 | FIXED TABLE FULL| X$KSQEQ | 1 | 94 | 0 (0)| 00:00:01 |
|* 9 | FIXED TABLE FULL | X$KTADM | 1 | 94 | 0 (0)| 00:00:01 |
|* 10 | FIXED TABLE FULL | X$KTATRFIL | 1 | 94 | 0 (0)| 00:00:01 |
|* 11 | FIXED TABLE FULL | X$KTATRFSL | 1 | 94 | 0 (0)| 00:00:01 |
|* 12 | FIXED TABLE FULL | X$KTATL | 1 | 94 | 0 (0)| 00:00:01 |
|* 13 | FIXED TABLE FULL | X$KTSTUSC | 1 | 94 | 0 (0)| 00:00:01 |
|* 14 | FIXED TABLE FULL | X$KTSTUSS | 1 | 94 | 0 (0)| 00:00:01 |
|* 15 | FIXED TABLE FULL | X$KTSTUSG | 1 | 94 | 0 (0)| 00:00:01 |
|* 16 | FIXED TABLE FULL | X$KTCXB | 1 | 94 | 0 (0)| 00:00:01 |
| 17 | NESTED LOOPS | | 100 | 7600 | 0 (0)| 00:00:01 |
|* 18 | FIXED TABLE FULL | X$KSUSE | 1 | 30 | 0 (0)| 00:00:01 |
| 19 | FIXED TABLE FULL | X$KSQRS | 100 | 4600 | 0 (0)| 00:00:01 |
-------------------------------------------------------------------------------------

SQL> select * from v$lock;
.
.
.
Elapsed: 00:00:01.26
Response time from both cases, not different. see "NESTED LOOPS" from both "FIXED TABLE FULL" (X$KSUSE) and "FIXED TABLE FULL" (X$KSQRS). It's bad!!! So, back to using ORDERED hint again.
SQL> explain plan for select /*+ ordered */ * from v$lock;

Explained.

SQL> select * from table(dbms_xplan.display());

PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 3524752130
--------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 144 | 1 (100)| 00:00:01 |
|* 1 | HASH JOIN | | 1 | 144 | 1 (100)| 00:00:01 |
|* 2 | HASH JOIN | | 1 | 98 | 1 (100)| 00:00:01 |
| 3 | VIEW | GV$_LOCK | 10 | 680 | 0 (0)| 00:00:01 |
| 4 | UNION-ALL | | | | | |
|* 5 | FILTER | | | | | |
| 6 | VIEW | GV$_LOCK1 | 2 | 136 | 0 (0)| 00:00:01 |
| 7 | UNION-ALL | | | | | |
|* 8 | FIXED TABLE FULL| X$KDNSSF | 1 | 94 | 0 (0)| 00:00:01 |
|* 9 | FIXED TABLE FULL| X$KSQEQ | 1 | 94 | 0 (0)| 00:00:01 |
|* 10 | FIXED TABLE FULL | X$KTADM | 1 | 94 | 0 (0)| 00:00:01 |
|* 11 | FIXED TABLE FULL | X$KTATRFIL | 1 | 94 | 0 (0)| 00:00:01 |
|* 12 | FIXED TABLE FULL | X$KTATRFSL | 1 | 94 | 0 (0)| 00:00:01 |
|* 13 | FIXED TABLE FULL | X$KTATL | 1 | 94 | 0 (0)| 00:00:01 |
|* 14 | FIXED TABLE FULL | X$KTSTUSC | 1 | 94 | 0 (0)| 00:00:01 |
|* 15 | FIXED TABLE FULL | X$KTSTUSS | 1 | 94 | 0 (0)| 00:00:01 |
|* 16 | FIXED TABLE FULL | X$KTSTUSG | 1 | 94 | 0 (0)| 00:00:01 |
|* 17 | FIXED TABLE FULL | X$KTCXB | 1 | 94 | 0 (0)| 00:00:01 |
|* 18 | FIXED TABLE FULL | X$KSUSE | 1 | 30 | 0 (0)| 00:00:01 |
| 19 | FIXED TABLE FULL | X$KSQRS | 100 | 4600 | 0 (0)| 00:00:01 |
--------------------------------------------------------------------------------------

SQL> select /*+ ordered */ * from v$lock;
.
.
.
Elapsed: 00:00:00.06
So, Don't need to use both hidden parameters. just know both _optimizer_cartesian_enabled and _optimizer_mjc_enabled hidden parameter be able to eliminate the merge join cartesian Rule. & ORDERED hint still work -)

Related Posts:
Just learn more from V$LOCK
Excessive waited 'SQL*Net message from client' - when query V$LOCK


Sunday, August 21, 2011

Just learn more from V$LOCK

I posted Excessive waited 'SQL*Net message from client' - when query V$LOCK. Thank You for first comment (Marcus). He figured me out about STATE and reviewed EXPLAIN PLAN!!! I want to test it more...

CASE 1: SELECT * FROM V$LOCK
SQL> EXPLAIN PLAN FOR SELECT * FROM V$LOCK;

Explained.

SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY());

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 554400005
-------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 156 | 1 (100)| 00:00:04 |
|* 1 | HASH JOIN | | 1 | 156 | 1 (100)| 00:00:04 |
| 2 | VIEW | GV$_LOCK | 10 | 760 | 0 (0)| 00:00:01 |
| 3 | UNION-ALL | | | | | |
|* 4 | FILTER | | | | | |
| 5 | VIEW | GV$_LOCK1 | 2 | 152 | 0 (0)| 00:00:01 |
| 6 | UNION-ALL | | | | | |
|* 7 | FIXED TABLE FULL| X$KDNSSF | 1 | 102 | 0 (0)| 00:00:01 |
|* 8 | FIXED TABLE FULL| X$KSQEQ | 1 | 102 | 0 (0)| 00:00:01 |
|* 9 | FIXED TABLE FULL | X$KTADM | 1 | 102 | 0 (0)| 00:00:01 |
|* 10 | FIXED TABLE FULL | X$KTATRFIL | 1 | 102 | 0 (0)| 00:00:01 |
|* 11 | FIXED TABLE FULL | X$KTATRFSL | 1 | 102 | 0 (0)| 00:00:01 |
|* 12 | FIXED TABLE FULL | X$KTATL | 1 | 102 | 0 (0)| 00:00:01 |
|* 13 | FIXED TABLE FULL | X$KTSTUSC | 1 | 102 | 0 (0)| 00:00:01 |
|* 14 | FIXED TABLE FULL | X$KTSTUSS | 1 | 102 | 0 (0)| 00:00:01 |
|* 15 | FIXED TABLE FULL | X$KTSTUSG | 1 | 102 | 0 (0)| 00:00:01 |
|* 16 | FIXED TABLE FULL | X$KTCXB | 1 | 102 | 0 (0)| 00:00:01 |
| 17 | MERGE JOIN CARTESIAN | | 100 | 8000 | 0 (0)| 00:00:01 |
|* 18 | FIXED TABLE FULL | X$KSUSE | 1 | 32 | 0 (0)| 00:00:01 |
| 19 | BUFFER SORT | | 100 | 4800 | 0 (0)| 00:00:01 |
| 20 | FIXED TABLE FULL | X$KSQRS | 100 | 4800 | 0 (0)| 00:00:01 |
-------------------------------------------------------------------------------------
CASE 2: SELECT /*+ PARALLEL */ * FROM V$LOCK
SQL> EXPLAIN PLAN FOR SELECT /*+ PARALLEL */ * FROM V$LOCK;

Explained.

SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY());

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 1453144240
--------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 156 | 1 (100)| 00:00:01 |
|* 1 | HASH JOIN | | 1 | 156 | 1 (100)| 00:00:01 |
|* 2 | HASH JOIN | | 1 | 108 | 1 (100)| 00:00:01 |
|* 3 | FIXED TABLE FULL | X$KSUSE | 1 | 32 | 0 (0)| 00:00:01 |
| 4 | VIEW | GV$_LOCK | 10 | 760 | 0 (0)| 00:00:01 |
| 5 | UNION-ALL | | | | | |
|* 6 | FILTER | | | | | |
| 7 | VIEW | GV$_LOCK1 | 2 | 152 | 0 (0)| 00:00:01 |
| 8 | UNION-ALL | | | | | |
|* 9 | FIXED TABLE FULL| X$KDNSSF | 1 | 102 | 0 (0)| 00:00:01 |
|* 10 | FIXED TABLE FULL| X$KSQEQ | 1 | 102 | 0 (0)| 00:00:01 |
|* 11 | FIXED TABLE FULL | X$KTADM | 1 | 102 | 0 (0)| 00:00:01 |
|* 12 | FIXED TABLE FULL | X$KTATRFIL | 1 | 102 | 0 (0)| 00:00:01 |
|* 13 | FIXED TABLE FULL | X$KTATRFSL | 1 | 102 | 0 (0)| 00:00:01 |
|* 14 | FIXED TABLE FULL | X$KTATL | 1 | 102 | 0 (0)| 00:00:01 |
|* 15 | FIXED TABLE FULL | X$KTSTUSC | 1 | 102 | 0 (0)| 00:00:01 |
|* 16 | FIXED TABLE FULL | X$KTSTUSS | 1 | 102 | 0 (0)| 00:00:01 |
|* 17 | FIXED TABLE FULL | X$KTSTUSG | 1 | 102 | 0 (0)| 00:00:01 |
|* 18 | FIXED TABLE FULL | X$KTCXB | 1 | 102 | 0 (0)| 00:00:01 |
| 19 | FIXED TABLE FULL | X$KSQRS | 100 | 4800 | 0 (0)| 00:00:01 |
--------------------------------------------------------------------------------------
He told me review "MERGE JOIN CARTESIAN", it can make Excessive fetch data. OK test test test it. then I found out V$LOCK!!!
SQL> SELECT VIEW_DEFINITION FROM V$FIXED_VIEW_DEFINITION WHERE VIEW_NAME='V$LOCK';

VIEW_DEFINITION
-----------------------------------------------------------------------------------------------------------------------------------------------
select ADDR , KADDR , SID , TYPE , ID1 , ID2 , LMODE , REQUEST , CTIME , BLOCK from GV$LOCK where inst_id = USERENV('Instance')

SQL> SELECT VIEW_DEFINITION FROM V$FIXED_VIEW_DEFINITION WHERE VIEW_NAME='GV$LOCK';

VIEW_DEFINITION
-----------------------------------------------------------------------------------------------------------------------------------------------
select s.inst_id,l.laddr,l.kaddr,s.ksusenum,r.ksqrsidt,r.ksqrsid1,r.ksqrsid2,l.lmode,l.request,l.ctime,decode(l.lmode,0,0,l.block) from v$_lock l, x$ksuse s, x$ksqrs r where l.saddr=s.addr and concat(USERENV('Instance'),l.raddr)=concat(r.inst_id,r.addr)
So, SQL statement for V$LOCK!!!
select s.inst_id,l.laddr,l.kaddr,s.ksusenum,r.ksqrsidt,r.ksqrsid1, r.ksqrsid2,l.lmode,l.request,l.ctime,decode(l.lmode,0,0,l.block) from v$_lock l, x$ksuse s, x$ksqrs r where l.saddr=s.addr and concat(USERENV('Instance'),l.raddr)=concat(r.inst_id,r.addr) and s.inst_id = USERENV('Instance');

and tested more ... with this sql statement.
SQL> explain plan for select s.inst_id,l.laddr,l.kaddr,s.ksusenum,r.ksqrsidt,r.ksqrsid1, r.ksqrsid2,l.lmode,l.request,l.ctime,decode(l.lmode,0,0,l.block) from v$_lock l, x$ksuse s, x$ksqrs r where l.saddr=s.addr and concat(USERENV('Instance'),l.raddr)=concat(r.inst_id,r.addr) and s.inst_id = USERENV('Instance');

Explained.

SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY());

PLAN_TABLE_OUTPUT
-----------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 554400005
-------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 156 | 1 (100)| 00:00:04 |
|* 1 | HASH JOIN | | 1 | 156 | 1 (100)| 00:00:04 |
| 2 | VIEW | GV$_LOCK | 10 | 760 | 0 (0)| 00:00:01 |
| 3 | UNION-ALL | | | | | |
|* 4 | FILTER | | | | | |
| 5 | VIEW | GV$_LOCK1 | 2 | 152 | 0 (0)| 00:00:01 |
| 6 | UNION-ALL | | | | | |
|* 7 | FIXED TABLE FULL| X$KDNSSF | 1 | 102 | 0 (0)| 00:00:01 |
|* 8 | FIXED TABLE FULL| X$KSQEQ | 1 | 102 | 0 (0)| 00:00:01 |
|* 9 | FIXED TABLE FULL | X$KTADM | 1 | 102 | 0 (0)| 00:00:01 |
|* 10 | FIXED TABLE FULL | X$KTATRFIL | 1 | 102 | 0 (0)| 00:00:01 |
|* 11 | FIXED TABLE FULL | X$KTATRFSL | 1 | 102 | 0 (0)| 00:00:01 |
|* 12 | FIXED TABLE FULL | X$KTATL | 1 | 102 | 0 (0)| 00:00:01 |
|* 13 | FIXED TABLE FULL | X$KTSTUSC | 1 | 102 | 0 (0)| 00:00:01 |
|* 14 | FIXED TABLE FULL | X$KTSTUSS | 1 | 102 | 0 (0)| 00:00:01 |
|* 15 | FIXED TABLE FULL | X$KTSTUSG | 1 | 102 | 0 (0)| 00:00:01 |
|* 16 | FIXED TABLE FULL | X$KTCXB | 1 | 102 | 0 (0)| 00:00:01 |
| 17 | MERGE JOIN CARTESIAN | | 100 | 8000 | 0 (0)| 00:00:01 |
|* 18 | FIXED TABLE FULL | X$KSUSE | 1 | 32 | 0 (0)| 00:00:01 |
| 19 | BUFFER SORT | | 100 | 4800 | 0 (0)| 00:00:01 |
| 20 | FIXED TABLE FULL | X$KSQRS | 100 | 4800 | 0 (0)| 00:00:01 |
-------------------------------------------------------------------------------------
How to avoid "MERGE JOIN CARTESIAN", tried to use ORDERED hint - The ORDERED hint instructs Oracle to join tables in the order in which they appear in the FROM clause.
When you omit the ORDERED hint from a SQL statement requiring a join, the optimizer chooses the order in which to join the tables. You might want to use the ORDERED hint to specify a join order if you know something that the optimizer does not know about the number of rows selected from each table. Such information lets you choose an inner and outer table better than the optimizer could.
SQL> explain plan for select /*+ ordered */ s.inst_id,l.laddr,l.kaddr,s.ksusenum,r.ksqrsidt,r.ksqrsid1, r.ksqrsid2,l.lmode,l.request,l.ctime,decode(l.lmode,0,0,l.block) from v$_lock l, x$ksuse s, x$ksqrs r where l.saddr=s.addr and concat(USERENV('Instance'),l.raddr)=concat(r.inst_id,r.addr) and s.inst_id = USERENV('Instance');

Explained.

SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY());

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 3524752130
--------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 156 | 1 (100)| 00:00:07 |
|* 1 | HASH JOIN | | 1 | 156 | 1 (100)| 00:00:07 |
|* 2 | HASH JOIN | | 1 | 108 | 1 (100)| 00:00:04 |
| 3 | VIEW | GV$_LOCK | 10 | 760 | 0 (0)| 00:00:01 |
| 4 | UNION-ALL | | | | | |
|* 5 | FILTER | | | | | |
| 6 | VIEW | GV$_LOCK1 | 2 | 152 | 0 (0)| 00:00:01 |
| 7 | UNION-ALL | | | | | |
|* 8 | FIXED TABLE FULL| X$KDNSSF | 1 | 102 | 0 (0)| 00:00:01 |
|* 9 | FIXED TABLE FULL| X$KSQEQ | 1 | 102 | 0 (0)| 00:00:01 |
|* 10 | FIXED TABLE FULL | X$KTADM | 1 | 102 | 0 (0)| 00:00:01 |
|* 11 | FIXED TABLE FULL | X$KTATRFIL | 1 | 102 | 0 (0)| 00:00:01 |
|* 12 | FIXED TABLE FULL | X$KTATRFSL | 1 | 102 | 0 (0)| 00:00:01 |
|* 13 | FIXED TABLE FULL | X$KTATL | 1 | 102 | 0 (0)| 00:00:01 |
|* 14 | FIXED TABLE FULL | X$KTSTUSC | 1 | 102 | 0 (0)| 00:00:01 |
|* 15 | FIXED TABLE FULL | X$KTSTUSS | 1 | 102 | 0 (0)| 00:00:01 |
|* 16 | FIXED TABLE FULL | X$KTSTUSG | 1 | 102 | 0 (0)| 00:00:01 |
|* 17 | FIXED TABLE FULL | X$KTCXB | 1 | 102 | 0 (0)| 00:00:01 |
|* 18 | FIXED TABLE FULL | X$KSUSE | 1 | 32 | 0 (0)| 00:00:01 |
| 19 | FIXED TABLE FULL | X$KSQRS | 100 | 4800 | 0 (0)| 00:00:01 |
--------------------------------------------------------------------------------------
Good!!! joining changed!!! Test more...
SQL> select /*+ ordered */ s.inst_id,l.laddr,l.kaddr,s.ksusenum,r.ksqrsidt,r.ksqrsid1, r.ksqrsid2,l.lmode,l.request,l.ctime,decode(l.lmode,0,0,l.block) from v$_lock l, x$ksuse s, x$ksqrs r where l.saddr=s.addr and concat(USERENV('Instance'),l.raddr)=concat(r.inst_id,r.addr) and s.inst_id = USERENV('Instance');
.
.
.
807 rows selected.

Elapsed: 00:00:00.09
It's faster than....
I posted about 'SQL*Net message from client' wrong.... because "MERGE JOIN CARTESIAN" made excessive response time. So, I use : select /*+ ordered */ * from v$lock !!!
select /*+ ordered */ INST_ID, SID, TYPE, ID1, ID2, LMODE, REQUEST, CTIME, BLOCK from gv$lock where (ID1,ID2,TYPE) in (select ID1,ID2,TYPE from gv$lock where request>0) ORDER BY id1, request;
This may work for me... but not someone. But I learned "Check More EXPLAIN PLAN!!!, don't just say it's slowly".

Related Post:
Excessive waited 'SQL*Net message from client' - when query V$LOCK