piątek, 10 października 2014

pljava GCJ

apt-get install gcj-jdk

Kompilacja do .class
gcj -g -C UtlDir.java

----------------
Kompilacja do .so
gcj -fPIC -shared -o UtlDir.so UtlDir.java


Plik Manifest.txt
Main-Class: UtlDir


Pakowanie do JAR
jar cfm UtlDir.jar Manifest.txt UtlDir.class


----------------
SELECT sqlj.install_jar('file:///local/css-utf8/baza/pljava/UtlDir.jar', 'utldir_jar',  true);

SELECT sqlj.set_classpath('hurt_stp', 'utldir_jar');
SELECT sqlj.set_classpath('smok', 'utldir_jar');
SELECT sqlj.set_classpath('mb', 'utldir_jar');

----
ALBo
SELECT * FROM "sqlj"."replace_jar"('file:///local/css-utf8/baza/pljava/UtlDir.jar','utldir_jar',false);
-------------------
CREATE OR REPLACE FUNCTION hurt_stp.iswindows_ (
)
RETURNS integer AS
$body$
UtlDir.IsWindows
$body$
LANGUAGE 'java'
VOLATILE
CALLED ON NULL INPUT
SECURITY INVOKER

COST 100;

---------
SELECT * FROM hurt_stp.iswindows_();

DB link in RPD

http://obiee-oracledb.blogspot.com/2014/07/using-db-link-in-obiee.html


środa, 10 września 2014

OBIEE date settings

http://locksnlatches.blogspot.com/2011/02/date-configuration-in-obiee.html


Working with dates in OBIEE

Here are several options to set date formats in OBIEE. Option #1 is the best way to work with dates and comparison of dates to strings containing dates in a particular format.

See also: http://gerardnico.com/wiki/dat/obiee/cast_as_date

The most important settings (with example values) are:
  • DATE_DISPLAY_FORMAT parameter in nqsconfig.ini: YYYY/MM/DD
  • DATESHORTFORMAT parameter in localedefinitions.xml (based on the locale set in nqsconfig.ini): M/D/YYYY
  • NLS_DATE_FORMAT parameter of the session (or database default): DD-MON-RR
Do not confuse these with parameters in dbfeatures.ini. There this format is the default for almost all database platforms in parameter DATE_FORMAT parameter.

wtorek, 29 kwietnia 2014

LVM2 - reduce

1. Unmount
Użyj innej dystrybucji np. systemrecoverycd.iso

2. df -h

3. sprawdź dysk
e2fsck -f /dev/yourVG/yourLV 

4. z flagą -r --resizefs
       Resize underlying filesystem together with the logical volume using fsadm


...zmniejszenie o 50GB
lvreduce -r -L -50G /dev/yourVG/yourLV

... zmniejszenie do wielkości 150GB
lvreduce -r -L 150G /dev/yourVG/yourLV

5. Odłączenie dysku z LVM2

... w zkrócie ...
a) pvs
wyświetli wolne dyski
... ewentualnie przenieś dane na inny dysk

b)pvmove /dev/sdb1

c) usuń z VG
vgreduce myvg /dev/sdb1

https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Cluster_Logical_Volume_Manager/disk_remove_ex.html



5.4. Removing a Disk from a Logical Volume


This example shows how you can remove a disk from an existing logical volume, either to replace the disk or to use the disk as part of a different volume. In order to remove a disk, you must first move the extents on the LVM physical volume to a different disk or set of disks.

5.4.1. Moving Extents to Existing Physical Volumes

In this example, the logical volume is distributed across four physical volumes in the volume group myvg.
[root@tng3-1]# pvs -o+pv_used
  PV         VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdb1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdc1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdd1  myvg lvm2 a-   17.15G  2.15G 15.00G
We want to move the extents off of /dev/sdb1 so that we can remove it from the volume group.
If there are enough free extents on the other physical volumes in the volume group, you can execute the pvmove command on the device you want to remove with no other options and the extents will be distributed to the other devices.
[root@tng3-1 ~]# pvmove /dev/sdb1
  /dev/sdb1: Moved: 2.0%
 ...
  /dev/sdb1: Moved: 79.2%
 ...
  /dev/sdb1: Moved: 100.0%
After the pvmove command has finished executing, the distribution of extents is as follows:
[root@tng3-1]# pvs -o+pv_used
  PV         VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1  myvg lvm2 a-   17.15G  7.15G 10.00G
  /dev/sdb1  myvg lvm2 a-   17.15G 17.15G     0
  /dev/sdc1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdd1  myvg lvm2 a-   17.15G  2.15G 15.00G
Use the vgreduce command to remove the physical volume /dev/sdb1 from the volume group.
[root@tng3-1 ~]# vgreduce myvg /dev/sdb1
  Removed "/dev/sdb1" from volume group "myvg"
[root@tng3-1 ~]# pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/sda1  myvg lvm2 a-   17.15G  7.15G
  /dev/sdb1       lvm2 --   17.15G 17.15G
  /dev/sdc1  myvg lvm2 a-   17.15G 12.15G
  /dev/sdd1  myvg lvm2 a-   17.15G  2.15G
The disk can now be physically removed or allocated to other users.

środa, 9 kwietnia 2014

Debian + Oracle Java instalacja

http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html



Install Oracle Java 7 (JDK7 and JRE7) in Debian


To add the WebUpd8 Oracle Java PPA repository to the Software Sources in Debian (tested on Debian Squeeze, but it should work with any Debian version), use the following commands:
su -
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install oracle-java7-installer
exit

Crunchbang users: it seems Crunchbang has an old Oracle Java 7 Installer in its repositories and because it uses a higher priority, trying to install the package from our PPA doesn't work and instead you get the old version from Crunchbang (7u7). To force the installation of the latest version, use the following command (example for Oracle JDK 7u51, replace "7u51" with the latest JDK version):
apt-get install oracle-java7-installer=7u51-0~webupd8~1
Alternatively, you can give the WebUpd8 Java PPA a priority higher than 1001.

oracle java 7 debian

oracle java 7 debian

And that's it, Oracle Java 7 (both JDK7 and JRE7) should now be installed and you should receive automatic updates with future Oracle Java 7 versions, under Debian.

Update: the installer now requires you accept the Oracle license before the installation begins. This is only required once. If for some reason you need the installation to be automated, you can run the following command to automatically accept the Oracle license:
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections


Setting Java environment variables


To automatically set up the Java 7 environment variables, you can install the following package:
sudo apt-get install oracle-java7-set-default

If you've already installed oracle-java6-set-default or oracle-java8-set-default, they will be automatically removed when installing oracle-java7-set-default (and the environment variables will be set for Oracle Java 7 instead).


For installing Oracle Java 7 in Ubuntu, see: Install Oracle Java 7 in Ubuntu via PPA Repository

czwartek, 13 lutego 2014

LVM - manage

http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/

W skrócie

Nowy dysk
fdisk /dev/sdq
n
p
1
t 8e
w
-
pvcreate /dev/sdq1

vgdisplay
vgextend vgpool /dev/sdq1

lvextend -L+10G /dev/lvpool/root      ....  plus 10GB
lvextend -l +100%FREE /dev/lvpool/root   ..... cale wolne miejsce
resize2fs /dev/lvpool/root


In our previous article we told you what LVM is and what you may want to use it for, and today we are going to walk you through some of the key management tools of LVM so you will be confident when setting up or expanding your installation.
As stated before, LVM is a abstraction layer between your operating system and physical hard drives. What that means is your physical hard drives and partitions are no longer tied to the hard drives and partitions they reside on. Rather, the hard drives and partitions that your operating system sees can be any number of separate hard drives pooled together or in a software RAID.
To manage LVM there are GUI tools available but to really understand what is happening with your LVM configuration it is probably best to know what the command line tools are. This will be especially useful if you are managing LVM on a server or distribution that does not offer GUI tools.
Most of the commands in LVM are very similar to each other. Each valid command is preceded by one of the following:
  • Physical Volume = pv
  • Volume Group = vg
  • Logical Volume = lv

wtorek, 4 lutego 2014

Oracle metadata expdp & impdp

http://navi-matharoo.blogspot.com/2012/01/for-metadata-expdp-impdp.html


take export of metadata of schema only using expdp

>expdp directory=exp_dp dumpfile=j.dmp content=metadata_only schemas=

after that create sqlfile using impdp -

>impdp directory=exp_dp dumpfile=j.dmp logfile=imp_j.log sqlfile=j.sql include=view

You can filter the views only like above, you can get everything in the schema as follows:

>impdp directory=exp_dp dumpfile=j.dmp logfile=imp_j.log sqlfile=j.sql

Ginekolog dr n. med. Piotr Siwek

Gabinet ginekologiczny specjalista ginekolog - położnik dr n. med. Piotr Siwek