所有由小潘发布的文章

喜欢分享的小潘.

Linux mount及umount相关操作命令

1.卸载挂载命令

[root@fin-db-bak ~]# fdisk -l

Disk /dev/ram0: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram1: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram2: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram3: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram4: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram5: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram6: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram7: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram8: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram9: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram10: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram11: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram12: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram13: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram14: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram15: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/xvda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 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: 0x0009aac3

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2              64        6528    51915776   8e  Linux LVM

Disk /dev/xvde: 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/VolGroup-lv_root: 47.8 GB, 47789899776 bytes
255 heads, 63 sectors/track, 5810 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/VolGroup-lv_swap: 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

[root@fin-db-bak ~]# fdisk /dev/xvde
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xb7c0464c.
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@fin-db-bak ~]# fdisk -l

Disk /dev/ram0: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram1: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram2: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram3: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram4: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram5: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram6: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram7: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram8: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram9: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram10: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram11: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram12: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram13: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram14: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/ram15: 16 MB, 16777216 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000


Disk /dev/xvda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 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: 0x0009aac3

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2              64        6528    51915776   8e  Linux LVM

Disk /dev/xvde: 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: 0xb7c0464c

    Device Boot      Start         End      Blocks   Id  System
/dev/xvde1               1       65270   524281243+  83  Linux

Disk /dev/mapper/VolGroup-lv_root: 47.8 GB, 47789899776 bytes
255 heads, 63 sectors/track, 5810 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/VolGroup-lv_swap: 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

[root@fin-db-bak ~]# cat /proc/partitions
major minor  #blocks  name

   1        0      16384 ram0
   1        1      16384 ram1
   1        2      16384 ram2
   1        3      16384 ram3
   1        4      16384 ram4
   1        5      16384 ram5
   1        6      16384 ram6
   1        7      16384 ram7
   1        8      16384 ram8
   1        9      16384 ram9
   1       10      16384 ram10
   1       11      16384 ram11
   1       12      16384 ram12
   1       13      16384 ram13
   1       14      16384 ram14
   1       15      16384 ram15
 202        0   52428800 xvda
 202        1     512000 xvda1
 202        2   51915776 xvda2
 202       64  524288000 xvde
 202       65  524281243 xvde1
  11        0    1048575 sr0
 251        0   46669824 dm-0
 251        1    5242880 dm-1
[root@fin-db-bak ~]# mkfs -t ext4 /dev/xvde1
mke2fs 1.43-WIP (20-Jun-2013)
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
32768000 inodes, 131070310 blocks
6553515 blocks (5.00%) reserved for the super user
第一个数据块=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

Allocating group tables: 完成                            
正在写入inode表: 完成                            
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成     

[root@fin-db-bak ~]# mkdir /u01
[root@fin-db-bak ~]# chmod -R 777 /u01
[root@fin-db-bak ~]# df -k
Filesystem           1K-blocks    Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      45805980 4507252  38948856  11% /
tmpfs                  3943868      72   3943796   1% /dev/shm
/dev/xvda1              487652  110106    347850  25% /boot
[root@fin-db-bak ~]# mount /dev/xvde1 /u01
[root@fin-db-bak ~]# df -k
Filesystem           1K-blocks    Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      45805980 4507252  38948856  11% /
tmpfs                  3943868      72   3943796   1% /dev/shm
/dev/xvda1              487652  110106    347850  25% /boot
/dev/xvde1           515923792   71448 489621900   1% /u01
[root@fin-db-bak ~]# vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Fri Sep  8 16:02:15 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
#
UUID=d7f678b2-e53e-4fa8-8887-b9cadc8f5955 /boot                   ext4    defaults        1 2
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
# Created by anaconda on Fri Sep  8 16:02:15 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/VolGroup-lv_root /                       ext4    defaults        1 1
UUID=d7f678b2-e53e-4fa8-8887-b9cadc8f5955 /boot                   ext4    defaults        1 2
/dev/mapper/VolGroup-lv_swap swap                    swap    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
"/etc/fstab" 17L, 858C written
[root@fin-db-bak ~]# df -k
Filesystem           1K-blocks    Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      45805980 4507252  38948856  11% /
tmpfs                  3943868      72   3943796   1% /dev/shm
/dev/xvda1              487652  110106    347850  25% /boot
/dev/xvde1           515923792   71448 489621900   1% /u01
 

[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

有三种方法可以对Swap 分区进行扩展:

一、扩展正在使用的Swap 分区的逻辑卷(Recommended);

二、新建Swap 分区;

三、新建swap file。

具体步骤如下:

一、扩展正在使用的Swap 分区的逻辑卷

设定用作Swap 分区的逻辑卷为:/dev/VolGroup00/LogVol01

#swapoff -v /dev/VolGroup00/LogVol01    //关闭该卷的Swap分区

# lvm lvresize /dev/VolGroup00/LogVol01 -L +1024M    //为该卷的容量增加1024M

# mkswap /dev/VolGroup00/LogVol01    //格式化Swap分区

# swapon -va    //启用Swap分区

# free    //验证结果

二、新建Swap 分区

设定新建的Swap 分区的逻辑卷为:/dev/VolGroup00/LogVol02

# lvm lvcreate VolGroup00 -n LogVol02 -L 1024M    //新建一个1024M大小的逻辑卷

# mkswap /dev/VolGroup00/LogVol02    //格式化成Swap分区

#/dev/VolGroup00/LogVol02 swap swap defaults 0 0    //将这个分区信息写进fstab文件(相当于分区表)

# swapon -va    //启动Swap分区

# free    //验证结果

三、新建swapfile

通过此种方式进行Swap 的扩展,首先要计算出block的数目。具体为根据需要扩展的swapfile的大小,以M为单位。block=swap分区大小*1024, 例如,需要扩展1024M的swapfile,则:block=1024*1024=1048576。

然后做如下步骤:

#dd if=/dev/zero of=/swapfile bs=1024 count=1048576

#mkswap /swapfile   //使该文件成为Swap配置文件

#swapon /swapfile   //启用swapfile

#/swapfile swap swap defaults 0 0   //使该文件加入开机启动项并写入fstab文件

#free   //验证结果 

总结:三种方法都能对Swap分区进行扩展,但是推荐使用第一种方法。

保险公司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)};

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

                  同时,需要在FSG定义直接佣金的逻辑,最终与间接佣金合并。

           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;