Monday, February 8, 2016

Caffe Nero yiyecekleri kalori bilgileri


Caffe Nero yiyecek kalori değerleri

No
Ürün Adı
Kalori(kcal)
1
Fit Meyveli Musli
371
2
Akdenizli Salata
168
3
Fit Havuçlum
245
4
Tam Buğdaylı Poğaça
132
5
Tahıllı Sandviç
267
6
Espresso Brownie
246 
7
Avokadolu Meksika Fasulyesi Salatası
247 
8
Limon Fit Cheesecake
249 
9
Izgara Hindi Salata
306 
10
Portakal ve Böğürtlenli Müsli Yoğurt
326
11
Granola bar
180
12
Kepekli kraker
189
13
Keten tohumlu kraker
189
14
Domatesli Çorba
160
15
Arabiata wrap
331
16
Somonlu wrap
217
17
Pestolu tavuklu panini
306
18
Hindili fit panini
298
19
Kahvaltılık panini
234


Friday, February 5, 2016

Oracle package compile hangs problem

How to Determine if a Package that is About to be Compiled is Being Used Currently:

When you try to compile an oracle package or procedure, it will hang if it is used by another session. You have to find the session that uses this package and kill it. 

For this purpose, you need to create a package called "who_is_using". To download this oracle package log on to MOS, navigate to doc 1054939.6. 

After creating this package login to sqlplus as sysdba:

$ sqlplus /nolog

SQL> connect / as sysdba

SQL> set serveroutput on

SQL> exec who_is_using('my_funct%');

(1-198) - WEBUSER

PL/SQL procedure successfully completed.



You should replace ('my_funct%') with your package name. 

After finding the session, which uses this package, you can kill it or wait for it to finish.


If the above query returns null than you can succesfully compile your procedure or package.



Tuesday, February 2, 2016

How to create a clone database from physical standby database backup

Cloning a standby database for test instance:

If you want to use the server resources of standby database, you may need to clone the standby database to create test instances. By this way, you don't touch the primary instace (production), you just use the standby environment resources for backup and restore.

The problem of cloning standby database is that, you can't use rman duplicate feature. Let's get started with taking backup of standby database.

Connect to PROD catalog on standby side:

$ rman catalog oracle/oracle@catalog target /



RMAN> backup database plus archivelog;


Go to the primary side for only one time to take controlfile backup and copy this backup to standby side.


On primary RMAN;
run
{
allocate channel c1 device type disk;
backup current controlfile;
} 


On standby side start an instance on nomount mode:


export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1
export ORACLE_SID=TEST1


$ sqlplus / as sysdba

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 4275781632 bytes
Fixed Size                  2260088 bytes
Variable Size             738198408 bytes
Database Buffers         3523215360 bytes
Redo Buffers               12107776 bytes




Switch to rman and restore controlfile from backup taken on primary side:


$ rman target /

RMAN> restore controlfile from '/u01/backup/PROD/c-809882354-20150723-03';

Starting restore at 23-JUL-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=522 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=+DATAC1/TEST/controlfile/cntrl01.dbf
output file name=+RECOC1/TEST/controlfile/cntrl02.dbf
Finished restore at 23-JUL-15


Let's mount the database:



RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1




Catalog all backup files taken on first step.



RMAN> catalog start with '/u01/backup/PROD';





Restore the database similar to following script


run
{
allocate channel dc1 device type disk;
allocate channel dc2 device type disk;
allocate channel dc3 device type disk;
allocate channel dc4 device type disk;
set newname for datafile 1 to '+DATAC1/TEST/datafile/system.dbf';
set newname for datafile 2 to '+DATAC1/TEST/datafile/sysaux.dbf';
set newname for datafile 3 to '+DATAC1/TEST/datafile/undotbs1.dbf';
set newname for datafile 4 to '+DATAC1/TEST/datafile/undotbs2.dbf';
set newname for datafile 5 to '+DATAC1/TEST/datafile/users.dbf';
set newname for datafile 6 to '+DATAC1/TEST/datafile/apps_ts_archive.dbf';
set newname for datafile 7 to '+DATAC1/TEST/datafile/apps_ts_interface.dbf';
set newname for datafile 8 to '+DATAC1/TEST/datafile/apps_ts_media.dbf';
restore database;
switch datafile all;
recover database;
}




After restore completes, start the database with open resetlogs;


RMAN> alter database open resetlogs;

Database altered.


After restoring the database, you may need to change the SID, considering it's name is still PROD.

For this purpose;

Mount the database;


SQL> startup mount;


Run the following command.

nid target=/ dbname=TEST setname=y logfile=new_name.log



Start the database on nomount mode:

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1353551872 bytes
Fixed Size                  2252704 bytes
Variable Size            1107296352 bytes
Database Buffers          100663296 bytes
Redo Buffers              143339520 bytes

SQL> show parameter db_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      PROD


SQL> alter system set db_name=TEST scope=spfile;

System altered.








Tuesday, January 26, 2016

How to enable HugePages on Linux

How to Configure HugePages on RedHat Enterprise Linux 5?



  • First check whether it is enabled:


[root@nestrac1 ~]# grep Huge /proc/meminfo
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     2048 kB


HugePages is not enabled...



  • Use the following script to obtain the value for "vm.nr_hugepages" . To use this scipt, insert into a file, make it executable and run it with oracle user:


#!/bin/bash
#
# hugepages_settings.sh
#
# Linux bash script to compute values for the
# recommended HugePages/HugeTLB configuration
#
# Note: This script does calculation for all shared memory
# segments available when the script is run, no matter it
# is an Oracle RDBMS shared memory segment or not.
# Check for the kernel version
KERN=`uname -r | awk -F. '{ printf("%d.%d\n",$1,$2); }'`
# Find out the HugePage size
HPG_SZ=`grep Hugepagesize /proc/meminfo | awk {'print $2'}`
# Start from 1 pages to be on the safe side and guarantee 1 free HugePage
NUM_PG=1
# Cumulative number of pages required to handle the running shared memory segments
for SEG_BYTES in `ipcs -m | awk {'print $5'} | grep "[0-9][0-9]*"`
do
   MIN_PG=`echo "$SEG_BYTES/($HPG_SZ*1024)" | bc -q`
   if [ $MIN_PG -gt 0 ]; then
      NUM_PG=`echo "$NUM_PG+$MIN_PG+1" | bc -q`
   fi
done
# Finish with results
case $KERN in
   '2.4') HUGETLB_POOL=`echo "$NUM_PG*$HPG_SZ/1024" | bc -q`;
          echo "Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL" ;;
   '2.6') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
    *) echo "Unrecognized kernel version $KERN. Exiting." ;;
esac

# End



  • Script output should be like the following:


$ ./hugepages_setting.sh 

Recommended setting: vm.nr_hugepages = 14462



  • Add this result value to /etc/sysctl.conf file


vm.nr_hugepages=14462



  • Reboot server..




  • After reboot HugePages is used as follows:


[root@exafkmdbadm01 ~]# grep Huge /proc/meminfo
HugePages_Total:   14462
HugePages_Free:     3736
HugePages_Rsvd:     3736
HugePages_Surp:        0
Hugepagesize:       2048 kB




** Make sure you have memlock values at /etc/security/limits.conf. For example If you have 64G RAM you should set it to slightly lesser values.


oracle   soft   memlock    60397977

oracle   hard   memlock    60397977


** Make sure you set the database parameters memory_% to "0" and use SGA, PGA values instead.

SQL> show parameter target

NAME                                 TYPE          VALUE
----------------------              ---------      -------
memory_max_target                    big integer      0
memory_target                        big integer      0
pga_aggregate_target                 big integer      1300M
sga_target                           big integer      3000M












Friday, January 15, 2016

ERROR: sending message to MANAGER (Timeout waiting for message)

On GoldenGate  11.1 when you try to stop the manager it may get timeout message as follows:


GGSCI (prod.com) 23> stop mgr
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)? y

Sending STOP request to MANAGER ...

ERROR: sending message to MANAGER (Timeout waiting for message).


Check it from ggsci, manager still alive:


GGSCI (prod.com) 38> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     STOPPED     PSSS        00:00:00      00:00:12    
EXTRACT     STOPPED     XSSS        00:05:47      00:00:11    
REPLICAT    ABENDED     RLLL        00:00:00      00:48:55    
REPLICAT    STOPPED     RTTT        00:01:13      00:00:09    


The only solution is to find the sid of linux and kill the process:


$ ps -ef|grep ocfsmnt

 oraprod     3931     1  0 17:09 ?        00:00:00 ./mgr PARAMFILE /ocfsmnt/gg/dirprm/mgr.prm REPORTFILE /ocfsmnt/gg/dirrpt/MGR.rpt PROCESSID MGR PORT 7809


$ kill -9 3931    

Let's check the status:


GGSCI (prod.com) 42> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     STOPPED                                           
EXTRACT     STOPPED     PSSS        00:00:00      00:00:12    
EXTRACT     STOPPED     XSSS        00:05:47      00:00:11    
REPLICAT    ABENDED     RLLL        00:00:00      00:48:55    
REPLICAT    STOPPED     RTTT        00:01:13      00:00:09 


Thursday, January 14, 2016

OGG-00918 Oracle GoldenGate Delivery for Oracle, XXX.prm: Key column COLUMN_NAME is missing from map

On Goldengate 11.1,  Replicat PROCESS ABENDING and gives following error on ggserr.log when you try to start it: 

OGG-00918  Oracle GoldenGate Delivery for Oracle, XXX.prm:  Key column COLUMN_NAME is missing from map

When you look at the ggsci with info all:

GGSCI (prod1.com) 2> info all

Program     Status      Group       Lag           Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     XPPP        00:00:02      00:00:09    
REPLICAT    ABENDED     RTTT        00:00:00      00:57:46    
REPLICAT    RUNNING     RSSS        00:00:00      00:00:02    


This error occured because Replicat abends when trying to replicate a table with NLS (e.g. Turkish) characters like "Ş" in a column name.

GoldenGate 11.1 does not support non-ASCII characters in the column name. 

You have to either upgrade to OGG version 11.2.1 or change the column name  to a valid name with NLS characters. 

You can find details on 
Doc ID 1325109.1

However, changing the column_name on extract does not help to start abending replicat. Because non-ASCII column_name is still exist on target. You can put a line on parameter file to skip this problematic table as follows.


MAPEXCLUDE SHEMA_NAME.PROBLEM_TABLE; 


Other solution may probably changing the column name to a ASCII character on target side.
I did not tried that solution yet, but it should help.