Skip navigation.

Surachart Opun

Syndicate content
This page contains my experiences and my thoughts about Oracle and etc... about IT. Perhaps With another way in my life.
Updated: 8 hours 50 min ago

Read Oracle Linux 7 Beta 1

Wed, 2014-04-16 03:53
It might be too late posting about Oracle Linux 7 (Beta 1). Just came back from long holidays in Thailand. I think it's very interesting to learn something new in OL7. Users can download it by using OTN account.
Download.
Release Note.

After installed it, I tested some a little bit.
[root@ol7beta ~]# cat /etc/oracle-release
Oracle Linux Everything release 7.0 Beta
[root@ol7beta ~]# uname -r
3.8.13-31.el7uek.x86_64
Users can choose to start with RHCK or UEK3.
[root@ol7beta ~]#Oracle Linux 7 provides the temporary file system (tmpfs), which is configured in volatile memory and whose contents do not persist after a system reboot.
[root@ol7beta ~]# df
Filesystem          1K-blocks   Used Available Use% Mounted on
/dev/mapper/ol-root  49747968 962512  48785456   2% /
devtmpfs               886508      0    886508   0% /dev
tmpfs                  893876      0    893876   0% /dev/shm
tmpfs                  893876   2212    891664   1% /run
tmpfs                  893876      0    893876   0% /sys/fs/cgroup
/dev/sda1              487652  91380    366576  20% /boot
[root@ol7beta ~]# systemctl status  tmp.mount
tmp.mount - Temporary Directory
   Loaded: loaded (/usr/lib/systemd/system/tmp.mount; disabled)
   Active: inactive (dead)
    Where: /tmp
     What: tmpfs
     Docs: man:hier(7)
           http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
[root@ol7beta ~]# systemctl start  tmp.mount
[root@ol7beta ~]# systemctl status  tmp.mount
tmp.mount - Temporary Directory
   Loaded: loaded (/usr/lib/systemd/system/tmp.mount; disabled)
   Active: active (mounted) since Wed 2014-04-16 05:33:32 ICT; 1s ago
    Where: /tmp
     What: tmpfs
     Docs: man:hier(7)
           http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
  Process: 16209 ExecMount=/bin/mount tmpfs /tmp -t tmpfs -o mode=1777,strictati                                                                                        me (code=exited, status=0/SUCCESS)
Apr 16 05:33:32 ol7beta systemd[1]: Mounting Temporary Directory...
Apr 16 05:33:32 ol7beta systemd[1]: tmp.mount: Directory /tmp to mount over...y.
Apr 16 05:33:32 ol7beta systemd[1]: Mounted Temporary Directory.
Hint: Some lines were ellipsized, use -l to show in full.
[root@ol7beta ~]# df
Filesystem          1K-blocks   Used Available Use% Mounted on
/dev/mapper/ol-root  49747968 962344  48785624   2% /
devtmpfs               886508      0    886508   0% /dev
tmpfs                  893876      0    893876   0% /dev/shm
tmpfs                  893876   2292    891584   1% /run
tmpfs                  893876      0    893876   0% /sys/fs/cgroup
/dev/sda1              487652  91380    366576  20% /boot
tmpfs                  893876      0    893876   0% /tmpNote: After installed, Not found "ifconfig" command line.
[root@ol7beta ~]# ip addr
1: lo: mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: p2p1: mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:48:ff:7f brd ff:ff:ff:ff:ff:ff
    inet 192.168.111.20/24 scope global p2p1
    inet6 fe80::a00:27ff:fe48:ff7f/64 scope link
       valid_lft forever preferred_lft foreverThe output of the ifconfig command has changed format.
So, installed ifconfig command and tested.
[root@ol7beta ~]# rpm -qa |grep createrepo
[root@ol7beta ~]# mount /dev/cdrom /mnt
mount: /dev/sr0 is write-protected, mounting read-only
[root@ol7beta ~]# cd /mnt/Packages/
[root@ol7beta Packages]# rpm -ivh createrepo-0.9.9-21.el7.noarch.rpm
warning: createrepo-0.9.9-21.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
        deltarpm is needed by createrepo-0.9.9-21.el7.noarch
        libxml2-python is needed by createrepo-0.9.9-21.el7.noarch
        python-deltarpm is needed by createrepo-0.9.9-21.el7.noarch
[root@ol7beta Packages]# cd /mnt
[root@ol7beta mnt]# createrepo .
-bash: createrepo: command not found
[root@ol7beta mnt]#
[root@ol7beta mnt]#
[root@ol7beta mnt]#  cd /mnt/Packages/
[root@ol7beta Packages]# rpm -ivh createrepo-0.9.9-21.el7.noarch.rpm deltarpm-3.6-1.el7.x86_64.rpm  libxml2-python-2.9.1-2.0.1.el7.x86_64.rpm  python-deltarpm-3.6-1.el7.x86_64.rpm
warning: createrepo-0.9.9-21.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:deltarpm-3.6-1.el7               ################################# [ 25%]
   2:python-deltarpm-3.6-1.el7        ################################# [ 50%]
   3:libxml2-python-2.9.1-2.0.1.el7   ################################# [ 75%]
   4:createrepo-0.9.9-21.el7          ################################# [100%]
[root@ol7beta Packages]# cd /mnt
[root@ol7beta mnt]# yum clean all
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 You can enable repos with yum-config-manager --enable
[root@ol7beta mnt]# yum repolist all
repolist: 0
[root@ol7beta mnt]# vi /etc/yum.repos.d/iso.repo
[root@ol7beta mnt]# cat /etc/yum.repos.d/iso.repo
[local]
name=Local CD Repo
baseurl=file:///mnt
gpgcheck=1
gpgkey=file:///mnt/RPM-GPG-KEY
[root@ol7beta mnt]# yum clean all
Cleaning repos: local
Cleaning up everything
[root@ol7beta mnt]# yum repolist all
local                                                                                                                                            | 3.6 kB  00:00:00
(1/2): local/group_gz                                                                                                                            | 112 kB  00:00:00
(2/2): local/primary_db                                                                                                                          | 4.0 MB  00:00:00
repo id                                                                   repo name                                                                       status
local                                                                     Local CD Repo                                                                   enabled: 4,628
repolist: 4,628
[root@ol7beta mnt]# yum provides */ifconfig
local/filelists_db                                                                                                                               | 3.5 MB  00:00:00
net-tools-2.0-0.13.20131004git.el7.x86_64 : Basic networking tools
Repo        : local
Matched from:
Filename    : /sbin/ifconfig
[root@ol7beta mnt]# yum install net-tools-2.0-0.13.20131004git.el7.x86_64
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.13.20131004git.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================================================================
 Package                               Arch                               Version                                               Repository                         Size
========================================================================================================================================================================
Installing:
 net-tools                             x86_64                             2.0-0.13.20131004git.el7                              local                             303 k
Transaction Summary
========================================================================================================================================================================
Install  1 Package
Total download size: 303 k
Installed size: 917 k
Is this ok [y/d/N]: y
Downloading packages:
warning: /mnt/Packages/net-tools-2.0-0.13.20131004git.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Public key for net-tools-2.0-0.13.20131004git.el7.x86_64.rpm is not installed
Retrieving key from file:///mnt/RPM-GPG-KEY
Importing GPG key 0xEC551F03:
 Userid     : "Oracle OSS group (Open Source Software group) "
 Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03
 From       : /mnt/RPM-GPG-KEY
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : net-tools-2.0-0.13.20131004git.el7.x86_64                                                                                                            1/1
  Verifying  : net-tools-2.0-0.13.20131004git.el7.x86_64                                                                                                            1/1
Installed:
  net-tools.x86_64 0:2.0-0.13.20131004git.el7
Complete!
[root@ol7beta mnt]# ifconfig -alo: flags=73  mtu 65536        inet 127.0.0.1  netmask 255.0.0.0        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)        RX packets 0  bytes 0 (0.0 B)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 0  bytes 0 (0.0 B)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
p2p1: flags=4163  mtu 1500        inet 192.168.111.20  netmask 255.255.255.0  broadcast 0.0.0.0        inet6 fe80::a00:27ff:fe48:ff7f  prefixlen 64  scopeid 0x20        ether 08:00:27:48:ff:7f  txqueuelen 1000  (Ethernet)        RX packets 4847  bytes 541675 (528.9 KiB)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 3591  bytes 1145806 (1.0 MiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0and Users must know about "systemctl" command.
[root@ol7beta ~]#
[root@ol7beta ~]# type systemctl
systemctl is /usr/bin/systemctl
Written By: Surachart Opun http://surachartopun.com
Categories: DBA Blogs

MapR Sandbox for Hadoop Learning

Mon, 2014-03-31 10:49
I got email about MapR Sandbox, that is a fully functional Hadoop cluster running on a virtual machine (CentOS 6.5) that provides an intuitive web interface for both developers and administrators to get started with Hadoop. I belief it's a good idea to learn about Hadoop and its ecosystem. Users can download for VMware VM or VirtualBox. I downloaded for VirtualBox and imported it. I changed about network to use "Bridged Adapter". After started... I connected it http://ip-address:8443
Then, I selected "Launch HUE" and "Launch MCS", but got some error and fixed.
Finally,  I could use HUE and MCS.


Hue is an interface for interacting with web applications that access the MapR File System (MapR-FS). Use the applications in HUE to access MapR-FS, work with tables, run Hive queries, MapReduce jobs, and Oozie workflows.

The MapR Control System (MCS) is a graphical, programmatic control panel for cluster administration that provides complete cluster monitoring functionality and most of the functionality of the command line.

After reviewing MapR Sandbox for VirtualBox, "maprdev" account is development account that can sudo to be root.
login as: maprdev
Server refused our key
Using keyboard-interactive authentication.
Password:
Welcome to your Mapr Demo virtual machine.
[maprdev@maprdemo ~]$ sudo -l
Matching Defaults entries for maprdev on this host:
    !visiblepw, always_set_home, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS", env_keep+="MAIL PS1 PS2 QTDIR USERNAME LANG
    LC_ADDRESS LC_CTYPE", env_keep+="LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES", env_keep+="LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE",
    env_keep+="LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY", secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin
User maprdev may run the following commands on this host:
    (ALL) NOPASSWD: ALL
[maprdev@maprdemo ~]$
[maprdev@maprdemo ~]$ sudo showmount -e localhost
Export list for localhost:
/mapr                *
/mapr/my.cluster.com *
[maprdev@maprdemo ~]$
Read More Written By: Surachart Opun http://surachartopun.com
Categories: DBA Blogs

Java Cookbook 3rd Edition

Sat, 2014-03-29 01:10
Java is a programming language and computing platform. There are lots of applications and websites have used it. About latest Java version, Java 8. Oracle announced Java 8 on March 25, 2014. I mention a book title - Java CookbookJava Cookbook by  Ian F. Darwin and this book covers Java 8.
 It isn't a book for someone who is new (Readers should know a bit about syntax to write Java) in Java, but It is a book that will help readers learn from real-world examples. Readers or some people who work in Java developments, that can use this book like reference or they can pick some example to use with their work. In a book, Readers will find 24 chapters - "Getting Started: Compiling, Running, and Debugging", "Interacting with the Environment", "Strings and Things", "Pattern Matching with Regular Expressions", "Numbers", "Dates and Times - New API", "Structuring Data with Java", "Object-Oriented Techniques", "Functional Programming Techniques:Functional Interfaces, Streams,Spliterators, Parallel Collections", "Input and Output", "Directory and Filesystem Operations", "Media: Graphics, Audio, Video", "Graphical User Interfaces", "Internationalization and Localization", "Network Clients", "Server-Side Java", "Java and Electronic Mail", "Database Access", "Processing JSON Data", "Processing XML", "Packages and Packaging", "Threaded Java", "Reflection, or “A Class Named Class”", "Using Java with Other Languages".

Each example is useful for learning and practice in Java programming. Everyone can read and use it, just know a bit about Java programming. Anyway, I suggest Readers should know basic with Java programming before start with this book.

Written By: Surachart Opun http://surachartopun.com
Categories: DBA Blogs

Oracle APEX Cookbook : Second Edition

Sat, 2014-03-22 05:18
 Second EditionOracle Application Express is the great tool for developing Web Application with SQL and PL/SQL. Users can develop and deploy Web based applications for desktops and mobile devices.  If We will be talking about books about APEX. I mention a book title Oracle APAC Cookbook - Second Edition by Michel Van Zoest and Marcel Van Der Plas. I had a chance as technical viewer on this book. So, I found it is interesting book about Oracle APEX. It was written to cover Oracle APEX 4.0 - 4.2 with 14 Chapters. 
  • Explore APEX to build applications with the latest techniques in AJAX and Javascript using features such as plugins and dynamic actions
  • With HTML5 and CSS3 support, make the most out of the possibilities that APEX has to offer
  • Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible

Examples in a book are very useful. Readers can follow each topic (example) and practice it. A book is for some people who are new with Oracle APEX and want to start it. For some people who know and work with Oracle APEX, they can use this book like reference and learn something new in APEX. So, I think it's a good idea to keep this book in your APEX shelf. I still believe a book is easy for reading... and learning in APEX. 
Written By: Surachart Opun http://surachartopun.com
Categories: DBA Blogs

Oracle PL/SQL Programming, 6th Edition

Sat, 2014-03-15 03:48
PL/SQL is procedural language, that's very useful when you work with Oracle Database.  As DBA, you might have to write PL/SQL to do some tasks. Developer on Oracle Database must know about PL/SQL.
This post I mention a book title - Oracle PL/SQL Programming by Steven Feuerstein (@stevefeuerstein), Bill Pribyl. This book is a new edition that covers PL/SQL on Oracle Database 12c. Readers can use examples in a book for practice and get many ideas for programming in PL/SQL.

A book is easy to read and make understand in PL/SQL. Readers can use a book as guidance and learn a lot of real-world problems with great Authors in PL/SQL. PL/SQL Developers should not miss this book.
In a book, Reader will see 28 chapters in 6 parts.
Part I: Programming in PL/SQL
Part II: PL/SQL Program Structure
Part III: PL/SQL Program Data
Part IV: SQL in PL/SQL
Part V: PL/SQL Application Construction
Part VI: Advanced PL/SQL Topics
Free Sampler.Written By: Surachart Opun http://surachartopun.com
Categories: DBA Blogs

Simple Issue with ORA-00108

Wed, 2014-02-12 12:47
My friend asked me to check about error in alert log file - "dispatcher 'D000' encountered error getting listening address". After checked, I found.
Wed Feb 12 09:46:27 2014
dispatcher 'D000' encountered error getting listening address
Wed Feb 12 09:46:27 2014
found dead dispatcher 'D000', pid = (17, 154)I checked trace file about d000 processed.
Trace file /u01/app/oracle/diag/rdbms/prod/PROD/trace/PROD_d000_31988.trc
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1
System name:    Linux
Node name:      linux-host
Release:        2.6.39-400.21.1.el6uek.x86_64
Version:        #1 SMP Thu Apr 4 03:49:00 PDT 2013
Machine:        x86_64
Instance name: PROD
Redo thread mounted by this instance: 1
Oracle process number: 17
Unix process pid: 31988, image: oracle@linux-host (D000)


*** 2014-02-12 09:57:35.577
*** CLIENT ID:() 2014-02-12 09:57:35.577
*** SERVICE NAME:() 2014-02-12 09:57:35.577
*** MODULE NAME:() 2014-02-12 09:57:35.577
*** ACTION NAME:() 2014-02-12 09:57:35.577

network error encountered getting listening address:
  NS Primary Error: TNS-12533: TNS:illegal ADDRESS parameters
  NS Secondary Error: TNS-12560: TNS:protocol adapter error
  NT Generic Error: TNS-00503: Illegal ADDRESS parameters
OPIRIP: Uncaught error 108. Error stack:
ORA-00108: failed to set up dispatcher to accept connection asynchronously

(END)I tried to find out... but no idea... So, checked /etc/hosts
[oracle@linux-host trace]$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

[oracle@linux-host trace]$ vi /etc/hosts
[oracle@linux-host trace]$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

172.30.6.10     linux-hostIssue was fixed!  Oh! no... I found out on Oracle Support & Internet, but not get solution, but issue was about hostname. - -"Written By: Surachart Opun http://surachartopun.com
Categories: DBA Blogs

Learn a bit Oracle Scheduler with BROKEN state

Mon, 2014-01-27 03:15
On Oracle Database, DBAs can check broken job for Oracle Job (dbms_job) at *_JOBS.BROKEN column. Anyway, DBAs have changed from DBMS_JOB to DBMS_SCHEDULER. So, I was curious How to check broken job for Oracle Scheduler (DBMS_SCHEDULER)? After found out... DBAs can check on *_SCHEDULER_JOBS.STATE column.

STATEVARCHAR2(15)Current state of the job:
  • DISABLED
  • RETRY SCHEDULED
  • SCHEDULED
  • RUNNING
  • COMPLETED
  • BROKEN
  • FAILED
  • REMOTE
  • SUCCEEDED
  • CHAIN_STALLED

When does Oracle Scheduler change STATE to be BROKEN?
Then, DBAs should know some columns as well.

FAILURE_COUNTNUMBERNumber of times the job has failed to runMAX_FAILURESNUMBERNumber of times the job will be allowed to fail before being marked broken
*_SCHEDULER_JOBS.STATE column will change to "BROKEN", when *_SCHEDULER_JOBS.FAILURE_COUNT value = _SCHEDULER_JOBS.MAX_FAILURES value. Really! yes... but I had some example to show about it. I tested on 11.2.0.1.
SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

SQL>
SQL>
SQL> show user;
USER is "DEMO"
SQL>
SQL> BEGIN
  2    DBMS_SCHEDULER.create_job (
  3      job_name        => 'test_my_job',
  4      job_type        => 'PLSQL_BLOCK',
  5      job_action      => 'BEGIN DBMS_STATS.gather_schema_stats(''SCOTT1''); END;',
  6      start_date      => SYSTIMESTAMP,
  7      repeat_interval => 'freq=daily',
  8      end_date        => NULL,
  9      enabled         => TRUE);
 10  END;
 11  /

PL/SQL procedure successfully completed.

SQL> select job_name, state,enabled, failure_count, max_failures from user_scheduler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    SCHEDULED       TRUE              1

SQL> exec  DBMS_SCHEDULER.run_job (job_name            => 'test_my_job',use_current_session => FALSE);

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> select job_name, state,enabled, failure_count, max_failures from user_scheduler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    SCHEDULED       TRUE              2

SQL> exec  DBMS_SCHEDULER.run_job (job_name            => 'test_my_job',use_current_session => FALSE);

PL/SQL procedure successfully completed. SQL> select job_name, state,enabled, failure_count, max_failures from user_scheduler_jobs;
JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    SCHEDULED       TRUE              3

SQL>
SQL>I created Oracle Scheduler and set max_failures attribute. First Idea: set MAX_FAILURES = FAILURE_COUNT.
 SQL> exec DBMS_SCHEDULER.set_attribute (name => 'test_my_job', attribute => 'max_failures',value => 3);

PL/SQL procedure successfully completed.

SQL> select job_name, state,enabled, failure_count, max_failures from user_sched
uler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    SCHEDULED       TRUE              3            3

SQL>
SQL> exec  DBMS_SCHEDULER.run_job (job_name            =>t 'test_my_job',use_current_session => FALSE);

PL/SQL procedure successfully completed.

SQL>  select job_name, state,enabled, failure_count, max_failures from user_sched
uler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    SCHEDULED       TRUE              3            3Case 1: set MAX_FAILURES = FAILURE_COUNT after ran JOB... Nothing change! in user_scheduler_jobs view, I checked on *_scheduler_job_log and *_scheduler_job_run_details views. Nothing change either!
I belief DBAs should disable JOB, then set MAX_FAILURE attribute and enable JOB, because after enabled... FAILURE_COUNT value will be reset to be 0.
Anyway, Tried MAX_FAILURES value = 4.
SQL> exec  DBMS_SCHEDULER.run_job (job_name           => 'test_my_job',use_current_session=> FALSE);

PL/SQL procedure successfully completed.

SQL> select job_name, state,enabled, failure_count, max_failures from user_sched
uler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    SCHEDULED       TRUE              3            3

SQL>
SQL> exec DBMS_SCHEDULER.set_attribute (name => 'test_my_job', attribute => 'max_failures',value => 4);
PL/SQL procedure successfully completed.

SQL> select job_name, state,enabled, failure_count, max_failures from user_sched
uler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    SCHEDULED       TRUE              3            4

SQL> exec  DBMS_SCHEDULER.run_job (job_name           => 'test_my_job',use_current_session ==> FALSE);

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> select job_name, state,enabled, failure_count, max_failures from user_scheduler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    BROKEN          FALSE             4            4Now!  *_SCHEDULER_JOBS.STATE = "BROKEN". How to fix "BROKEN" state? - Just enable Job.
SQL> EXEC DBMS_SCHEDULER.enable(name=> 'test_my_job');

PL/SQL procedure successfully completed.

SQL>
SQL> select job_name, state,enabled, failure_count, max_failures from user_sched
uler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    SCHEDULED       TRUE              0            4

SQL>
SQL> exec  DBMS_SCHEDULER.run_job (job_name           => 'test_my_job',use_current_session => FALSE);

PL/SQL procedure successfully completed.

SQL> select job_name, state,enabled, failure_count, max_failures from user_sched
uler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    SCHEDULED       TRUE              1            4How to unset MAX_FAILURES value?
SQL> exec DBMS_SCHEDULER.set_attribute (name => 'test_my_job', attribute => 'max_failures',value=> NULL);
BEGIN DBMS_SCHEDULER.set_attribute (name=> 'test_my_job', attribute=> 'max_failures',value=> NULL); END;

      *
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00307: too many declarations of 'SET_ATTRIBUTE' match this call
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored


SQL>
SQL>
SQL>
SQL>
SQL>
SQL> exec DBMS_SCHEDULER.set_attribute (name => 'test_my_job', attribute => 'max_failures',value=> 0);
BEGIN DBMS_SCHEDULER.set_attribute (name => 'test_my_job', attribute => 'max_failures',value => 0); END;

*
ERROR at line 1:
ORA-27465: invalid value 0 for attribute MAX_FAILURES
ORA-06512: at "SYS.DBMS_ISCHED", line 4370
ORA-06512: at "SYS.DBMS_SCHEDULER", line 2850
ORA-06512: at line 1

SQL> exec DBMS_SCHEDULER.set_attribute (name => 'test_my_job', attribute=> 'max_failures',value => '');

PL/SQL procedure successfully completed.

SQL> select job_name, state,enabled, failure_count, max_failures from user_sched
uler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    SCHEDULED       TRUE              1

SQL> exec  DBMS_SCHEDULER.run_job (job_name            => 'test_my_job',use_current_session => FALSE);

PL/SQL procedure successfully completed.

SQL> exec  DBMS_SCHEDULER.run_job (job_name            => 'test_my_job',use_current_session => FALSE);

PL/SQL procedure successfully completed.

SQL> exec  DBMS_SCHEDULER.run_job (job_name            => 'test_my_job',use_current_session => FALSE);

PL/SQL procedure successfully completed.

SQL> exec  DBMS_SCHEDULER.run_job (job_name            => 'test_my_job',use_current_session => FALSE);

PL/SQL procedure successfully completed.

SQL> select job_name, state,enabled, failure_count, max_failures from user_scheduler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    SCHEDULED       TRUE              5Just run "DBMS_SCHEDULER.set_attribute (name => 'test_my_job', attribute=> 'max_failures',value => '')".

Go back to CASE 1: ... Idea to set MAX_FAILURE attribute!
SQL> EXEC DBMS_SCHEDULER.disable(name => 'test_my_job');

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> select job_name, state,enabled, failure_count, max_failures from user_sched
uler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    DISABLED        FALSE             5

SQL> SQL> exec DBMS_SCHEDULER.set_attribute (name =>  'test_my_job', attribute =>  'max_failures',value => 5);

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> select job_name, state,enabled, failure_count, max_failures from user_scheduler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    DISABLED        FALSE             5            5

SQL>
SQL> EXEC DBMS_SCHEDULER.enable(name=> 'test_my_job');

PL/SQL procedure successfully completed.

SQL>
SQL> select job_name, state,enabled, failure_count, max_failures from user_scheduler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    SCHEDULED       TRUE              0            5

SQL> exec  DBMS_SCHEDULER.run_job (job_name            => 'test_my_job',use_current_session => FALSE);

PL/SQL procedure successfully completed.

SQL> exec  DBMS_SCHEDULER.run_job (job_name            => 'test_my_job',use_current_session => FALSE);

PL/SQL procedure successfully completed.

SQL> exec  DBMS_SCHEDULER.run_job (job_name           => 'test_my_job',use_current_session => FALSE);

PL/SQL procedure successfully completed.

SQL> exec  DBMS_SCHEDULER.run_job (job_name            => 'test_my_job',use_current_session => FALSE);

PL/SQL procedure successfully completed.

SQL> exec  DBMS_SCHEDULER.run_job (job_name            => 'test_my_job',use_current_session => FALSE);

PL/SQL procedure successfully completed.

SQL> select job_name, state,enabled, failure_count, max_failures from user_scheduler_jobs;

JOB_NAME                       STATE           ENABL FAILURE_COUNT MAX_FAILURES
------------------------------ --------------- ----- ------------- ------------
TEST_MY_JOB                    BROKEN          FALSE             5            5Read More... Oracle Document.

Written By: Surachart Opun http://surachartopun.com
Categories: DBA Blogs

Java Performance: The Definitive Guide By Scott Oaks

Wed, 2014-01-22 12:26
Java is a programming language and computing platform. You will see lots of applications and websites that are written in Java. Java is fast, secure and reliable. How about performance? Java performance is a matter of concern because lots of business software has been written in Java.

I mention a book titles - Java Performance: The Definitive Guide By Scott Oaks. Readers will learn about the world of Java performance. It will help readers get the best possible performance from a Java application.
In a book, Chapter 2 written about testing Java applications, including pitfalls of Java benchmarking, Chapter 3, talked an overview of some of the tools available to monitor Java applications.
If you are someone who are interested in Java or develop applications in Java. Performance is very important for you. This book is focused on how to best use the JVM and Java Platform APIs so that program run faster. If You are interested in improving your applications in Java. This book can help.

Written By: Surachart Opun http://surachartopun.com
Categories: DBA Blogs

Programming Elastic MapReduce Using AWS Services to Build an End-to-End Application

Fri, 2014-01-03 22:59
Amazon Elastic MapReduce (Amazon EMR) is a web service that makes it easy to quickly and cost-effectively process vast amounts of data. Amazon EMR uses Hadoop, an open source framework, to distribute your data and processing across a resizable cluster of Amazon EC2 instances.
Anyway, You are looking for a book about programming Elastic MapReduce. I mention a book titles - Programming Elastic MapReduce Using AWS Services to Build an End-to-End Application By Kevin Schmidt, Christopher Phillips.
Programming Elastic MapReduce Using AWS Services to Build an End-to-End Application By Kevin Schmidt, Christopher PhillipsThis book will give readers the best practices for using Amazon EMR and various AWS and Apache technologies. Readers will learn much more about.
  • Get an overview of the AWS and Apache software tools used in large-scale data analysis
  • Go through the process of executing a Job Flow with a simple log analyzer
  • Discover useful MapReduce patterns for filtering and analyzing data sets
  • Use Apache Hive and Pig instead of Java to build a MapReduce Job Flow
  • Learn the basics for using Amazon EMR to run machine learning algorithms
  • Develop a project cost model for using Amazon EMR and other AWS tools
 A book gives readers how to use Amazon EC2 Services Management Console and learn more about it. Readers will get good examples in a book. However, It will be good, if readers can create an AWS Account and use it with examples in a book. Illustration and example in a book, that is very helpful and make a book easy to read and follow each example.



Written By: Surachart Opun http://surachartopun.com
Categories: DBA Blogs