Wednesday, 6 February 2013

Günün İpucu(Oracle): Oracle Backup Sql Sorgusu

Merhaba,

Günün İpucu: Oracle tarafında rman kullanarak, devam eden bir restore'unuz var ise, alttaki sql'i kullanarak restore'un devam edip etmediğini, inmekte olan datafile'ların % kaç'ının tamamlandığını alttaki sql sorgusunu kullanarak görebilirsiniz.


SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK, ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE" FROM  V$SESSION_LONGOPS WHERE OPNAME LIKE 'RMAN%' AND OPNAME NOT LIKE '%aggregate%' AND TOTALWORK != 0   AND SOFAR <> TOTALWORK;

Örnek Backup başlattığınızda:


RMAN> backup incremental level 1 for recover of copy with tag 'app_incr' database;

Starting backup at 2013-04-17:14:08:47
starting full resync of recovery catalog
full resync complete
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=33 device type=DISK
no parent backup or copy of datafile 1 found
no parent backup or copy of datafile 2 found
no parent backup or copy of datafile 5 found
no parent backup or copy of datafile 3 found
no parent backup or copy of datafile 6 found
no parent backup or copy of datafile 8 found
no parent backup or copy of datafile 7 found
no parent backup or copy of datafile 4 found
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/orcl/datafile/system.260.734893311



output file name=+FRA/orcl/datafile/system.277.812988549 tag=APP_INCR RECID=6 STAMP=812989209
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:11:06
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.261.734893313



Durumu:

SQL> r
  1* SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK, ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE" FROM  V$SESSION_LONGOPS WHERE OPNAME LIKE 'RMAN%' AND OPNAME NOT LIKE '%aggregate%' AND TOTALWORK != 0   AND SOFAR <> TOTALWORK

       SID    SERIAL#    CONTEXT      SOFAR  TOTALWORK %_COMPLETE
---------- ---------- ---------- ---------- ---------- ----------
        33       1245          1      42110      70400      59.82




Teşekkürler
Fahrettin

Tuesday, 5 February 2013

Günün İpucu(Oracle): DataGuard Status

Merhaba,

Günün ipucu: Dataguard Statusunu merak ediyorsanız,  alttaki sql ile sorgulayabilirsiniz.


SELECT DATABASE_ROLE, DB_UNIQUE_NAME INSTANCE, OPEN_MODE, PROTECTION_MODE, PROTECTION_LEVEL, SWITCHOVER_STATUS FROM V$DATABASE;

Teşekkürler
Fahrettin

Monday, 4 February 2013

Günün İpucu(Oracle) : Oracle Dataguard Db Zamanı Sorgulama

Merhaba,

Bugün vereceğim ipucu, standby database'inizin, hangi saatte olduğunu gösteriyor,  merak ediyorsanızalttaki sql işinizi görecektir...


select to_char(START_TIME,'dd.mm.yyyy hh24:mi:ss') "Recover baslangic",to_char(item)||' = '||to_char(sofar)||' '||to_char(units)||' '|| to_char(TIMESTAMP,'dd.mm.yyyy hh24:mi') "Degerler" from v$recovery_progress where start_time=(select max(start_time) from v$recovery_progress);

İyi Çalışmalar...


Thursday, 26 July 2012

Android Telefonunuzdan Mesaj Gönderme

Merhaba,

Bu yazımda Android platformunu kullanarak nasıl mesaj gönderebileceğinize değineceğim.

Alttaki kod blogu işinizi görecektir.

package com.android.Sms;

import android.app.Activity;
import android.app.PendingIntent;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.telephony.gsm.*;
import android.telephony.cdma.*;
import android.telephony.SmsManager;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
public class TSms extends Activity{
     Button btnSendSMS;
     EditText txtPhoneNo;
     EditText txtMessage;
     public ProgressDialog pd;
    
     private void sendSMS(String phoneNumber, String message)
     {       
         String SENT = "SMS_SENT";
         String DELIVERED = "SMS_DELIVERED";
 
         PendingIntent sentPI = PendingIntent.getBroadcast(this, 0,
             new Intent(SENT), 0);
 
         PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0,
             new Intent(DELIVERED), 0);
 
         //---when the SMS has been sent---
         registerReceiver(new BroadcastReceiver(){
             @Override
             public void onReceive(Context arg0, Intent arg1) {
                 switch (getResultCode())
                 {
                 case Activity.RESULT_OK:
                     Toast.makeText(getBaseContext(), "SMS sent",
                             Toast.LENGTH_SHORT).show();
                     break;
                 case SmsManager.RESULT_ERROR_GENERIC_FAILURE:
                     Toast.makeText(getBaseContext(), "Generic failure",
                             Toast.LENGTH_SHORT).show();
                     break;
                 case SmsManager.RESULT_ERROR_NO_SERVICE:
                     Toast.makeText(getBaseContext(), "No service",
                             Toast.LENGTH_SHORT).show();
                     break;
                 case SmsManager.RESULT_ERROR_NULL_PDU:
                     Toast.makeText(getBaseContext(), "Null PDU",
                             Toast.LENGTH_SHORT).show();
                     break;
                 case SmsManager.RESULT_ERROR_RADIO_OFF:
                     Toast.makeText(getBaseContext(), "Radio off",
                             Toast.LENGTH_SHORT).show();
                     break;
             }
         }
     }, new IntentFilter(SENT));
       //---when the SMS has been delivered---
         registerReceiver(new BroadcastReceiver(){
             @Override
             public void onReceive(Context arg0, Intent arg1) {
                 switch (getResultCode())
                 {
                     case Activity.RESULT_OK:
                         Toast.makeText(getBaseContext(), "SMS delivered",
                                 Toast.LENGTH_SHORT).show();
                         break;
                     case Activity.RESULT_CANCELED:
                         Toast.makeText(getBaseContext(), "SMS not delivered",
                                 Toast.LENGTH_SHORT).show();
                         break;                       
                 }
             }
         }, new IntentFilter(DELIVERED));       
 
     
         SmsManager sms = SmsManager.getDefault();
         sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI);       
     }
    
    
  public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.tabviewsms);
  
     pd = new ProgressDialog(this);
     pd.setMessage("Isleminiz Yapiliyor....");
     pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
     pd.setMax(100);
     pd.setIndeterminate(false);
     btnSendSMS = (Button)   findViewById(R.id.btnSendSMS);
        txtPhoneNo = (EditText) findViewById(R.id.txtPhoneNo);
        txtMessage = (EditText) findViewById(R.id.txtMessage);
       
        btnSendSMS.setOnClickListener(new View.OnClickListener()
        {
     public void onClick(View v)
     {
     String phoneNo =  txtPhoneNo.getText().toString();
     String message =  txtMessage.getText().toString();
   
   
     if(phoneNo.length()>0 && message.length()>0)
     {
       sendSMS(phoneNo, message);
     }
    else
      Toast.makeText(getBaseContext(), "Lutfen Gsm No veya Mesaj Alanini Bos Birakmayiniz !!!", Toast.LENGTH_SHORT).show();
    }
  });
     }
  }
Kodunuzu yazdiktan sonra AndroidManifest.xmş dosyanızda alttaki izinleri tanımlamanız gerekmektedir.

<
uses-permission android:name="android.permission.SEND_SMS"></uses-permission>

Teşekkürler
<uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>

Wednesday, 11 July 2012

Android Spinner Kullanimi

Merhaba,

Android ortamında kod yazıyorsanız, muhtemelen Spinner ( Drop Down) komponentini kullanma ihtiyacı hissedebilirsiniz.

Alttaki kod parçası ile uygulamanıza bir spinner ekleyerek, nimetlerinden faydalanabilirsiniz :)


Umarım  faydali bir makale olmuştur.

Sevgi Saygi
Fahrettin

Thursday, 17 May 2012

Weblogic Error..."got exception 'READ_ERROR_FROM_SERVER [os error=0, line 853 of ../nsapi/URL.cpp]: Unexpected EOF reading HTTP status - failover request based on Idempotent flag', referer:" error solution :)

Symptoms

Intermitent issue been logged in Apache log file. This happens with different resources from WLS - it happens with HTTP GET/PUT/POST.
"READ_ERROR_FROM_SERVER [os error=0, line 841 of ../nsapi/URL.cpp]: "Unexpected EOF reading HTTP status - failover request based on Idempotent flag"

Complete error message as below :
[Wed Dec 29 10:41:06 2010] [error] [client xxx.xxx.xx] ap_proxy: trying GET /pl at backend host 'xxx.xx.xx.xxx/9010; got exception 'READ_ERROR_FROM_SERVER [os error=0, line 841 of ../nsapi/URL.cpp]: Unexpected EOF reading HTTP status - failover request based on Idempotent flag', referer: http://xxx.xxx/2396879/zahnzusatz_160x600.swf

Weblogic : 10.3.0 - 10.3.3
Apache Verison : 2.2.3-16.29.2

Note : There wont be any exception log in the WLS log file.
Cause
Cause :

Running with old apache plugin.

Solution
Solution :

From the exception its clear that the connection is getting terminated at the backend server unexpectedly but also after a while the connection fails to be established.
Apply the latest apache plugin bundled either with 10.3.4 or 10.3.5.
or
You can also download WLSPlugin1.1-11gR1PS3.zip from http://www.oracle.com/technetwork/middleware/ias/downloads/wls-plugins-096117.html.