Linux mount及umount相关操作命令

1.挂载命令

[root@ebs ~]# fdisk -l

Disk /dev/sdb: 536.9 GB, 536870912000 bytes

255 heads, 63 sectors/track, 65270 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0xd99a050f

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1       65270   524281243+  83  Linux

 

Disk /dev/sda: 53.7 GB, 53687091200 bytes

64 heads, 32 sectors/track, 51200 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0006df5b

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           2         513      524288   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2             514       51200    51903488   8e  Linux LVM

Partition 2 does not end on cylinder boundary.

 

Disk /dev/sdc: 536.9 GB, 536870912000 bytes

255 heads, 63 sectors/track, 65270 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_swap: 4294 MB, 4294967296 bytes

255 heads, 63 sectors/track, 522 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_root: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_usr: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_var: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_tmp: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_opt: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_home: 2684 MB, 2684354560 bytes

255 heads, 63 sectors/track, 326 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_adm: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_data_collect: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_data: 12.9 GB, 12880707584 bytes

255 heads, 63 sectors/track, 1565 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

[root@ebs ~]# fdisk /dev/sdc

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0x3e6c90e0.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won't be recoverable.

 

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

 

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

         switch off the mode (command 'c') and change display units to

         sectors (command 'u').

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-65270, default 1):

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-65270, default 65270):

Using default value 65270

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

[root@ebs ~]# fdisk -l

 

Disk /dev/sdb: 536.9 GB, 536870912000 bytes

255 heads, 63 sectors/track, 65270 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0xd99a050f

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1       65270   524281243+  83  Linux

 

Disk /dev/sda: 53.7 GB, 53687091200 bytes

64 heads, 32 sectors/track, 51200 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0006df5b

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           2         513      524288   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2             514       51200    51903488   8e  Linux LVM

Partition 2 does not end on cylinder boundary.

 

Disk /dev/sdc: 536.9 GB, 536870912000 bytes

255 heads, 63 sectors/track, 65270 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x3e6c90e0

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1               1       65270   524281243+  83  Linux

 

Disk /dev/mapper/vg_root-lv_swap: 4294 MB, 4294967296 bytes

255 heads, 63 sectors/track, 522 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_root: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_usr: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_var: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_tmp: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_opt: 2147 MB, 2147483648 bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_home: 2684 MB, 2684354560 bytes

255 heads, 63 sectors/track, 326 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_adm: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_data_collect: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/mapper/vg_root-lv_data: 12.9 GB, 12880707584 bytes

255 heads, 63 sectors/track, 1565 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

[root@ebs ~]# cat /proc/partitions

major minor  #blocks  name

 

   8       16  524288000 sdb

   8       17  524281243 sdb1

   8        0   52428800 sda

   8        1     524288 sda1

   8        2   51903488 sda2

   8       32  524288000 sdc

   8       33  524281243 sdc1

 253        0    4194304 dm-0

 253        1    2097152 dm-1

 253        2    5242880 dm-2

 253        3    5242880 dm-3

 253        4    2097152 dm-4

 253        5    2097152 dm-5

 253        6    2621440 dm-6

 253        7   10485760 dm-7

 253        8    5242880 dm-8

 253        9   12578816 dm-9

[root@ebs ~]# mkfs -t ext3 /dev/sdc1

mke2fs 1.41.12 (17-May-2010)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

32768000 inodes, 131070310 blocks

6553515 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

4000 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks:

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

        102400000

 

Writing inode tables: done                           

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

done

 

This filesystem will be automatically checked every 22 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@ebs ~]# done

-bash: syntax error near unexpected token `done'

[root@ebs ~]# ls

anaconda-ks.cfg  Documents  install.log         Music     Public     Videos

Desktop          Downloads  install.log.syslog  Pictures  Templates

[root@ebs ~]# mkdir /u02

[root@ebs ~]# ls

anaconda-ks.cfg  Documents  install.log         Music     Public     Videos

Desktop          Downloads  install.log.syslog  Pictures  Templates

[root@ebs ~]# chmod -R 777 /u02

[root@ebs ~]# mount /dev/sdc1 /u02

[root@ebs ~]# df -k

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/mapper/vg_root-lv_root

                       2064208    467724   1491628  24% /

tmpfs                 16432392      7108  16425284   1% /dev/shm

/dev/sda1               516040     96016    393812  20% /boot

/dev/mapper/vg_root-lv_data

                      12385968     18916  11739480   1% /data

/dev/mapper/vg_root-lv_home

                       2580272     69900   2379300   3% /home

/dev/mapper/vg_root-lv_opt

                       2064208     68696   1890656   4% /opt

/dev/mapper/vg_root-lv_adm

                      10321208    154240   9642680   2% /opt/adm

/dev/mapper/vg_root-lv_data_collect

                       5160576    141444   4756988   3% /opt/data_collect

/dev/mapper/vg_root-lv_tmp

                       2064208    413580   1545772  22% /tmp

/dev/mapper/vg_root-lv_usr

                       5160576   1928916   2969516  40% /usr

/dev/mapper/vg_root-lv_var

                       5160576    233492   4664940   5% /var

/dev/sdb1            515923792 176972640 312737092  37% /u01

/dev/sdc1            516054864    202652 489638152   1% /u02

[root@ebs ~]# vi /etc/fstab

#

# /etc/fstab

# Created by anaconda on Tue Jul  4 05:23:26 2017

#

# Accessible filesystems, by reference, are maintained under '/dev/disk'

# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

#

/dev/mapper/vg_root-lv_root /                       ext3    defaults        1 1

UUID=137eab7d-c3c2-4b5d-bbbe-034750c2a1e9 /boot                   ext3    defaults        1 2

/dev/mapper/vg_root-lv_data /data                   ext3    defaults        1 2

/dev/mapper/vg_root-lv_home /home                   ext3    defaults,usrquota 1 2

/dev/mapper/vg_root-lv_opt /opt                    ext3    defaults        1 2

/dev/mapper/vg_root-lv_adm /opt/adm                ext3    defaults        1 2

/dev/mapper/vg_root-lv_data_collect /opt/data_collect       ext3    defaults        1 2

/dev/mapper/vg_root-lv_tmp /tmp                    ext3    defaults        1 2

/dev/mapper/vg_root-lv_usr /usr                    ext3    defaults        1 2

/dev/mapper/vg_root-lv_var /var                    ext3    defaults        1 2

/dev/mapper/vg_root-lv_swap swap                    swap    defaults        0 0

/dev/sdb1 /u01 ext4 defaults 0 0

/dev/sdc1 /u02 ext3 defaults 0 0

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

~

~

~

~"/etc/fstab" 25L, 1488C written

[root@ebs ~]# exit

Logout

 

2.卸载挂载命令

直接fdisk /dev/sdc

然后输入d

选择出需要删除的挂载盘即可,w写入。

参考文件:

http://blog.csdn.net/tianlesoftware/article/details/5642883

https://jingyan.baidu.com/article/ab0b56307a939fc15bfa7d63.html?qq-pf-to=pcqq.c2c

保险公司CIRC报送逻辑整理

        保险行业中统信报送(CIRC)是企业很重要的一个工作内容,但此报送又十分复杂,需多个系统共同协作方能完成,主要可能涉及到的系统包括:

1. 核心业务系统;

2. 财务系统;

   财务系统中,主要分为两类:

   2.1)可通过FSG直接配置逻辑,再通过客户化程序取出相关数据;

       2.1.1)定义两套FSG行集信息,新准则指标及旧准则指标。为了程序高效执行,建议在行集中设置6项说明性弹性域,分别表示是否为快报、月报、季报、半年报、年报及决算报。这样定义的好处是每次报送时只会报送相应类型的指标取数结果,比如每月的月报只需取出百个左右的指标数据,这样可以大大节约程序的运行时间。将这两套FSG定义作为客户化程序取数的基数。行集中的项目名称为报送指标因子代码及描述,中间用空格分隔。行集中可能包括分配也可能包括计算,但不能同时存在两种取数方式;在客户化程序中,根据FSG行集维护逻辑,获取相应指标的余额数据。

    说明:并非所有的指标都能从余额表中获取,因此请往下看。

   2.2)不能通过FSG行集配置取数逻辑,则需要从日记帐明细行或者余额表中(不定义行集完全客制化)获取(需定义明细行相关的说明性弹性域)。

      2.2.1)如在定义会计科目体系时,渠道维度与统信报送中渠道相关指标口径不一致,且不能做到一一或者多对一(即不能通过设置汇总实现),只能通过从外围系统获取相应的标识,比如对保费收入科目6031需带保监统计口径的数据(个人代理、公司直销等6个CIRC渠道信息数据)。再通过客户化程序,将相应的指标(200多)数据(年初至今数据,及当起发生数加期初数)插入接口表中,最终形成统信报送的源数据,整理的渠道指标分配表如下:

          

          

      2.2.2)在统信指标中,还有一类比较特殊的指标,这部分涉及到分摊(但目前保监并未要求这类指标需要分摊后的数据,只要求满足总数满足勾稽关系即可,但是为了保证报送数据的更加准确,需按照一定规则分摊),且不能直接获取,需要通过计算,主要包括到(手续费及佣金支出-佣金a64210169-a64210173、分摊的投资收益a64340022-a64340024及业务及管理费a66010085-a66010089)三类,需给出相应的分摊逻辑即可。比如逻辑实例:

           2.2.2.1) 间佣不带险种,则根据相应的直佣比例获取数据,举例如下:

                  64210202:间佣总额

                  64210201:直佣总额

                  T1寿险;T3意外险;T5健康险

                  a64210169(手续费及佣金支出-佣金-意外伤害险) = 64210202 * {64210201.T3/(64210201.T1+T3+T51+T52)};

                  说明:如果没有发生直接佣金,则将所有佣金(包括直接+间接佣金)直接放寿险指标。

           2.2.2.2) 投资收益,以下6类科目余额数据(这6类科目必带险种,交叉验证规则)乘以投资收益6111科目取对应险种比例;

                  投资收益-6111;

                  未到期责任准备金-2701;

                  未决赔款准备金-2702;

                  寿险责任准备金-2703;

                  长期健康险责任准备金-2704;

                  保户储金及投资款-2711;

                  代理业务负债-2314; 

                  a64340023 (分摊的投资收益-健康险-短期)= 6111 * {(2711+2721+2701+2702+2703+2704+2314).T51/(2711+2721+2701+2702+2703+2704+2314)};

                  说明:如果没有发生数据,则直接指定为0。

           2.2.2.3) 业务及管理费并非所有都带险种,根据相应的业务及管理费带险种时,保费收入及保户储金年初至今发生数的比例;如果有业务及管理费数据发生,但无产品售出,则直接将所有6601科目发生数放寿险指标,举例如下:

                 业务及管理费-6601;

                 保费收入-6031;

                 保户储金及投资款-2711;

                 a66010085(业务及管理费-寿险)= 6601 * {(6031.T1+2711.T1)/(6031+2711)};

                 说明:如果发生过业务及管理费数据且未发生6031及2711的数据,即未销售产品,则直接将所有数据指定至寿险指标。这种情况可能会在新公司开业筹备期间发生。

3. 投资系统;

——未完待续。

Oracle EBS克隆可能用到的命令

克隆前需先执行预克隆命令:

在终端分别执行以下命令,来实现在数据库侧和应用服务侧的adpreclone。

以orastg用户登录,数据库侧

cd $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME

perl adpreclone.pl dbTier

以applstg用户登录,应用服务侧

cd $INST_TOP/admin/scripts

perl adpreclone.pl appsTier先后停止应用服务器和数据库服务器

以applstg用户登录应用服务器

cd $INST_TOP/admin/scripts

./adstpall.sh apps/apps

以orastg用户登录数据库服务器

cd $ORACLE_HOME/appsutil/scripts/$CONTEXT_NAME

./addlnctl.sh stop PROD

./addbctl.sh stop immediate

–打包源文件
tar -cvzf /app/stageR12/apps_20170629.tgz /app/YS/apps
tar -cvzf /data/stageR12/db_20170629.tgz /data/YS/db

拷贝远程数据:
scp -r root@10.1.1.1:apps0629.tgz /app/stageR12
scp -r root@10.1.1.2:db0629.tgz /data/stageR12

–解压远程拷贝文件
tar -xvzf /app/stageR12/db0629.tgz -C /app/CHK/
tar -xvzf /data/stageR12/apps0629.tgz -C /data/CHK/

–新增用户
useradd -g dba orachk
useradd -g dba applchk

–变更宿主
chown -hR orachk:dba /app/CHK/db
chown -hR applchk:dba /data/CHK/apps

–执行克隆
cd /data/CHK/db/tech_st/11.2.0/appsutil/clone/bin
perl adcfgclone.pl dbTier

cd /app/CHK/apps/apps_st/comn/clone/bin
perl adcfgclone.pl appsTier

IP搞错误,EXEC FND_CONC_CLONE.SETUP_CLEAN;

后autoconfig。
 

DB 11.2版本在克隆的过程中可能出现以下错误:

AutoConfig could not successfully execute the following scripts:

 Directory: /data/CHK/db/tech_st/11.2.0/perl/bin/perl -I /data/CHK/db/tech_st/11.2.0/perl/lib/5.8.3 -I /data/CHK/db/tech_st/11.2.0/perl/lib/site_perl/5.8.3 -I /data/CHK/db/tech_st/11.2.0/appsutil/perl /data/CHK/db/tech_st/11.2.0/appsutil/clone

      ouicli.pl               INSTE8_APPLY       255

Root执行:

cd /data/CHK/db/tech_st/11.2.0/perl/lib/

ln -s 5.10.0 5.8.3

cd site_perl

ln -s 5.10.0 5.8.3

Oracle EBS Report开发输出报表并下载请求结果

最近客户要求凭证打印出txt格式,且需要通过下载(非网页或者复制另存)方式实现。具体方案如下:

1.由于前台快码无法更新“CP_OUTPUT_FILE_TYPE”,于是采用后台更新需要展示的文件格式(注意插入中英文两条数据),RTZ/RTZ格式下载输出,如下图所示:

 

2.系统管理员浏览器选型
文件格式:RTZ
MIME类型:application/apps-rtz
说明:RTZ

3.并发请求定义中输出格式选择RTZ

4.结果如下图所示:

Oracle EBS查找帐套本位币及币种间汇率转换的方法

(1)获取帐套本位币

--取得当前帐套本位币
SELECT gsob.currency_code
  FROM gl_sets_of_books   gsob,
       hr_operating_units hou
 WHERE gsob.set_of_books_id = hou.set_of_books_id
   AND hou.organization_id = fnd_profile.value('ORG_ID');

(2)币种间转换

--取得指定币种(例如:HKD)当天转向当前帐套本位币(例如:CNY)的汇率
SELECT gdr.conversion_rate
  FROM gl_daily_rates_v gdr
 WHERE gdr.from_currency = 'HKD'
   AND gdr.to_currency IN (SELECT gsob.currency_code
                             FROM gl_sets_of_books   gsob,
                                  hr_operating_units hou
                            WHERE gsob.set_of_books_id = hou.set_of_books_id
                              AND hou.organization_id = fnd_profile.value('ORG_ID'))
   AND gdr.conversion_type = 'Corporate'
   AND gdr.conversion_date = trunc(SYSDATE);

(3)调用EBS的API来转换

SELECT gl_currency_api.get_rate(x_from_currency   => 'HKD',
                                x_to_currency     => 'CNY',
                                x_conversion_date => trunc(SYSDATE),
                                x_conversion_type => 'Corporate') from dual;