包含标签 Scripts 的文章

Scripts: 查询2019年新个人所得税

昨天发工资已经试用了新的税改办法,主要采用全年的累计预扣预缴,理解起来比以往稍微复杂点,咋一看了半天还没搞懂,闲时写了个sql计算 SQL版本 with t as (select c_mon, sum_sal, case when sum_sal >= 36000 then (sum_sal * 0.03 - 0) when sum_sal >= 144000 then (sum_sal * 0.1 - 2520) when sum_sal >= 300000 then (sum_sal * 0.2 - 16920) when sum_sal >= 420000 then (sum_sal * 0.25 - 31920) when sum_sal >= 660000 then (sum_sal * 0.3 - 52920) when sum_sal >= 960000 then (sum_sal * 0.35 - 85920) else (sum_sal * 0.45 - 181920) end sum_tax from (select level c_mon, sum(&税前收入 - &五险一金 - &专项……

阅读全文

准确查询表空间使用情况

11g以前,一般查询表空间都是通过DBA_DATA_FILE和DBA_FREE_SPACE两个视图来查询。但从11g开始,如果你习惯看EM的话,会发现表空间使用率跟我们以前的sql查出来的结果有出入。这是因为EM采用了新的视图dba_tablespace_usage_metrics,针对自动扩展的表空间,得出来的结果就会不一样。 dba_tablespace_……

阅读全文

Scripts: Oracle11g自动化安装

安装脚本: https://raw.githubusercontent.com/xblvesting/oracle-install/master/auto-install.sh Readme 支持Oracle 11g和18c版本在linux6和7的安装 支持Dataguard的一键安装 部分安装日志: [root@xb ~]# wget http://127.0.0.1/soft/auto-install.sh && chmod a+x auto-install.sh && ./auto-install.sh install_db ...... SELINUX=enforcing Please input oracle's user password: (Default password: oracle): Please input oracle install PATH: (Default path: /u01/app/oracle): Please input oracle version to install [11g or 18c]: (Default version: 11g): Please input oracle_sid: (Default oracle_sid: orcl): ======================================= Now checking rpm,please wait... ======================================= binutils-2.27-34.base.0.1.el7.x86_64 compat-libcap1-1.10-7.el7.x86_64 compat-libstdc++-33-3.2.3-72.el7.x86_64 gcc-c++-4.8.5-36.0.1.el7.x86_64 gcc-gfortran-4.8.5-36.0.1.el7.x86_64 gcc-4.8.5-36.0.1.el7.x86_64 gcc-objc-4.8.5-36.0.1.el7.x86_64 gcc-objc++-4.8.5-36.0.1.el7.x86_64 gcc-gnat-4.8.5-36.0.1.el7.x86_64 gcc-c++-4.8.5-36.0.1.el7.x86_64 glibc-2.17-260.0.9.el7.x86_64 glibc-headers-2.17-260.0.9.el7.x86_64 glibc-common-2.17-260.0.9.el7.x86_64 glibc-devel-2.17-260.0.9.el7.x86_64 glibc-devel-2.17-260.0.9.el7.x86_64 ksh-20120801-139.0.1.el7.x86_64 libaio-0.3.109-13.el7.x86_64 libaio-devel-0.3.109-13.el7.x86_64 libgcc-4.8.5-36.0.1.el7.x86_64 libstdc++-4.8.5-36.0.1.el7.x86_64 libstdc++-devel-4.8.5-36.0.1.el7.x86_64 libstdc++-devel-4.8.5-36.0.1.el7.x86_64 make-3.82-23.el7.x86_64 sysstat-10.1.5-17.el7.x86_64 libXi-1.7.9-1.el7.x86_64 libXtst-1.2.3-1.el7.x86_64 ======================================= ++++++++++++++++CHECK PASS!+++++++++++++++++++++ ======================================= ######################################################### ######## Summary Info ############ Oracle Home Dir : /u01/app/oracle/product/11.2.0/dbhome_1 Oracle User Password : oracle Oracle Base Dir : /u01/app/oracle Oracle SID : orcl Oracle Version : 11g ######################################################### Press any key to start...or Press Ctrl+c to cancel……

阅读全文