搜索""的结果
本文实例讲述了Oracle实现行列转换的方法。分享给大家供大家参考,具体如下:1、固定列数的行列转换如:?student subject grade--------- ---------- --------student1 语文 80student1 数学 70student1 英语 60student2 语文 90student2 数学 80student2 英语 100……转换为:?语文 数学 英语student1 80 70 60student2 90 80 100……语句如下:?123456select student,sum(decode(subject,'语文', grade,null)) "语文",sum(decode(subject,'数学', grade,null)) "数学",sum(decode(subject,'英语', grade,null)) "英语"from tablegroup by student;2、不定列行列转换如:?123456789c1 c2--- -----------1 我1 是1 谁2 知2 道3 不……转换为?1231 我是谁2 知道3 不这一类型的转换可以借助于PL/SQL来完成,这里给一个例子?123456789101112CREATE OR REPLACE FUNCTION get_c2(tmp_c1 NUMBER)RETURN VARCHAR2ISCol_c2 VARCHAR2(4000);BEGINFOR cur IN (SELECT c2 FROM t WHERE c1=tmp_c1) LOOPCol_c2 := Col_c2||cur.c2;END LOOP;Col_c2 := rtrim(Col_c2,1);RETURN Col_c2;END;select distinct c1 ,g...
构建MySQL-Cluster集群 MySQL集群作用:解决MySQL代理服务器的缺点单点故障和数据备份结构图如下:使用6台RHEL6.4虚拟机,如图所示sqlA和sqlB作为SQL节点,ndbA和ndbB作为数据节点,mgmd作为管理节点,这5个节点构成MySQLCluster体系;而另一台虚拟机192.168.4.120作为MySQL测试客户机。角色说明:客户端(client) :访问集群主机管理集群的主机(mgmd):管理集群中所有主机,加载自己的主配置文件,设置集群中所有主机的角色SQL结点(sql) :供用户访问和执行SQL语句,存储表结构(2台以上)数据结点(ndbd节点) :存储表中的记录(2台以上) MySQL集群提供三进程:mgmd 管理进程 运行在管理机上 config.inimysqld 数据库服务 运行在sql节点上 /etc/my.cnfndbd 数据存储服务 运行在ndbd节点 /etc/my.cnf 1、公共配置(要保留RHEL自带的mysql-libs包)A、关闭防火墙、selinux,停止mysql数据库服务,移走配置文件/etc/my.cnfB、卸载冲突的软件包(所有节点) # rpm -qa | gr...
oracle 11g rac开启修改归档模式目的:把归档模式打开并且将日志放在共享存储(ASM)上。环境信息:主机名:db1,db2 实例名:rac11,rac121.配置归档目录在db上执行 [root@db1 ~] # su - grid [grid@db11 ~]$ sqlplus / as sysasm SQL> select name from v$asm_diskgroup; NAME------------------------------ARCHCRSDATA需要将归档日志存放在ASM上。因此需要在ASM建归档路径[root@db1 ~]# su - grid[grid@db1 ~]$ asmcmdASMCMD> lsARCH/CRS/DATA/ASMCMD> cd ARCH/ASMCMD> mkdir ARCH1ASMCMD> mkdir ARCH2ASMCMD> cd ARCH2 ASMCMD> pwd+ARCH/ARCH2ASMCMD> 当然也可以采用此方法:SQL> alter diskgroup ARCH add directory '+ARCH/ARCH1';SQL> alter diskgroup ARCH add directory '+ARCH/ARCH2';修改归档参数任意一个实例,oracle用户下:SQL> alter system set log_archive_dest_1='LOCATION=+ARCH/ARCH1' scope=spfile sid='racdb11';SQL> alter system set log_archive_dest_1='LOCATION=+ARCH/ARCH2' scope=spfile sid='racdb12';这是分别将两个实例的归档目...
Oracle11gR2 11.2.0.4:Linux x86:https://updates.oracle.com/Orion/Services/download/p13390677_112040_LINUX_1of7.zip?aru=16720989&patch_file=p13390677_112040_LINUX_1of7.ziphttps://updates.oracle.com/Orion/Services/download/p13390677_112040_LINUX_2of7.zip?aru=16720989&patch_file=p13390677_112040_LINUX_2of7.ziphttps://updates.oracle.com/Orion/Services/download/p13390677_112040_LINUX_3of7.zip?aru=16720989&patch_file=p13390677_112040_LINUX_3of7.ziphttps://updates.oracle.com/Orion/Services/download/p13390677_112040_LINUX_4of7.zip?aru=16720989&patch_file=p13390677_112040_LINUX_4of7.ziphttps://updates.oracle.com/Orion/Services/download/p13390677_112040_LINUX_5of7.zip?aru=16720989&patch_file=p13390677_112040_LINUX_5of7.ziphttps://updates.oracle.com/Orion/Services/download/p13390677_112040_LINUX_6of7.zip?aru=16720989&patch_file=p13390677_112040_LINUX_6of7.ziphttps://updates.oracle.com/Orion/Services/download/p13390677_112040_LINUX_7of7.zip?aru=16720989&am...
Error in invoking target 'agent nmhs' of makefile 日志文件报错如下:# vim /u01/app/oraInventory/logs/installActions2015-01-22_09-44-33AM.logINFO: make[1]: *** [/u01/app/Oracle/product/11.2.0.3/sysman/lib/emdctl] Error 1INFO: make[1]: Leaving directory `/u01/app/oracle/product/11.2.0.3/sysman/lib'INFO: make: *** [emdctl] Error 2INFO: End output from spawned process.INFO: ----------------------------------INFO: Exception thrown from action: makeException Name: MakefileExceptionException String: Error in invoking target 'agent nmhs' of makefile '/u01/app/oracle/product/11.2.0.3/sysman/lib/ins_emagent.mk'. See '/u01/app/oraInventory/logs/installActions2015-01-22_09-44-33AM.log' for details.Exception Severity: 1解决方法:vi $ORACLE_HOME/sysman/lib/ins_emagent.mk搜索以下行:$(MK_EMAGENT_NMECTL)改变为:$(MK_EMAGENT_NMECTL) -lnnz11如图:然后点击:retry另附其他相关问题:1.1 ins_ctx.mk 问题[oracle@zhang logs]$ tail installActions2012-05-05_01-20-00PM.log ...
Oracle Database 12c Installation on CentOS 7ContentsIntroductionPrerequisitesInstallation StepsOracle Installer ScreensPost Installation TasksFirewallOracle EnvironmentLogin to the database 1. IntroductionThis guide presents how to deploy Oracle Database 12c (12.1.0.2.0) on CentOS 7.1 (64-bit) using quick installation features. Reference System: [root@centos7 ~]# hostnamectl
Static hostname: centos7.example.com
Icon name: computer
Chassis: n/a
Machine ID: 583b4d69eaea465ea4bb96ac3b891e15
Boot ID: 931ed1af622046ebbde071a87844a7d5
Virtualization: kvm
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-229.11.1.el7.x86_64
Architecture: x86_64
2. PrerequisitesAfter a successful OS installation, verify the hostname and register it in your DNS. Alternatively add your hostname/IP to the /etc/hosts. [root@centos7 ~]# cat /etc/hostname
centos7.example.com
Leave the...
最新评论