10 2017 档案
摘要:Python 输出文件内容到网络端口 返回: Python基础 索引页 $ cat mySocketTest.py import sysimport timeimport socket if __name__ == "__main__":if len(sys.argv) < 4:print >> s
阅读全文
摘要:Spark读取网络输入的例子: 返回: 大数据索引页 参考如下的URL进行试验 https://stackoverflow.com/questions/46739081/how-to-get-record-in-string-format-from-sockettextstreamhttp://ww
阅读全文
摘要:Spark程序在运行的时候,总是输出很多INFO级别内容 查看了网上的一些文章,进行了试验。 发现在 /etc/spark/conf 目录下,有一个 log4j.properties.template $cp log4j.properties.template log4j.properties 然后
阅读全文
摘要:非交互式运行Spark Application 的例子 $ cat Count.py import sysfrom pyspark import SparkContext if __name__ == "__main__": sc = SparkContext()logfile = sys.argv
阅读全文
摘要:Flume 与 Kakfa结合例子(Kakfa 作为flume 的sink 输出到 Kafka topic) 进行准备工作: 编辑 flume的配置文件: $ cat /home/tester/flafka/spooldir_kafka.conf # Name the components on t
阅读全文
摘要:返回: 大数据索引页 [Flume]使用 Flume 来传递web log 到 hdfs 的例子: 在 hdfs 上创建存储 log 的目录: $ hdfs dfs -mkdir -p /test001/weblogsflume 指定log 输入的目录: $ sudo mkdir -p /flume
阅读全文
摘要:Flume 启动例子: flume-ng agent --conf /etc/flume-ng/conf --conf-file /etc/flume-ng/conf/flume.conf --name agent1 \ -Dflume.root.logger=INFO,console
阅读全文
摘要:[Spark][kafka]kafka 生产者,消费者 互动例子 # pwd/usr/local/kafka_2.11-0.10.0.1/bin 创建topic:# ./kafka-topics.sh --create --zookeeper localhost:2181 --replication
阅读全文
摘要:kafka 的topic 创建和删除试验 zookeeper和kafka 的安装,参考: http://www.cnblogs.com/caoguo/p/5958608.html 参考上述URL后,在个人的伪分布式环境下,安装了kafka 确认 zookeeper 为运行状态: $ service
阅读全文
摘要:[Spark][Python][RDD][DataFrame]从 RDD 构造 DataFrame 例子 from pyspark.sql.types import * schema = StructType( [ StructField("age",IntegerType(),True), Str
阅读全文
摘要:[Spark][Python][DataFrame][RDD]DataFrame中抽取RDD例子 sqlContext = HiveContext(sc) peopleDF = sqlContext.read.json("people.json") peopleRDD = peopleDF.map(
阅读全文
摘要:[Spark][Python][DataFrame][RDD]从DataFrame得到RDD的例子 $ hdfs dfs -cat people.json $pyspark sqlContext = HiveContext(sc) peopleDF = sqlContext.read.json("p
阅读全文
摘要:[Spark][Python][DataFrame][Write]DataFrame写入的例子 $ hdfs dfs -cat people.json $pyspark sqlContext = HiveContext(sc) peopleDF = sqlContext.read.json("peo
阅读全文
摘要:[Spark][Python][DataFrame][SQL]Spark对DataFrame直接执行SQL处理的例子 $cat people.json $ hdfs dfs -put people.json $pyspark sqlContext = HiveContext(sc)peopleDF
阅读全文
摘要:[Spark][Hive][Python][SQL]Spark 读取Hive表的小例子$ cat customers.txt 1 Ali us 2 Bsb ca 3 Carls mx $ hive hive> > CREATE TABLE IF NOT EXISTS customers( > cus
阅读全文
摘要:[Spark][Python]DataFrame的左右连接例子 $ hdfs dfs -cat people.json $ hdfs dfs -cat pcodes.json $pyspark sqlContext = HiveContext(sc)peopleDF = sqlContext.rea
阅读全文
摘要:[Oracle]OWI学习笔记--001 在 OWI 的概念里面,最为重要的是 等待事件 和 等待时间。 等待事件发生时,需要通过 P1,P2,P3 查看具体的资源。 可以通过 v$session_wait / v$session 或 trace 文件来进行观察。 如 db file sequent
阅读全文
摘要:[Oracle]快速构造大量数据的方法:返回:Oracle 索引页 create table tab001(id integer primary key, val varchar2(100));insert into tab001 select i+j,rpad(to_char(i+j),100,'
阅读全文
摘要:[training@localhost ~]$ hdfs dfs -cat people.json {"name":"Alice","pcode":"94304"}{"name":"Brayden","age":30,"pcode":"94304"}{"name":"Carla","age":19,
阅读全文
摘要:[Spark][Python]DataFrame中取出有限个记录的例子 的 继续 [15]: myDF=peopleDF.where("age>21") In [16]: myDF.limit(2).show() + + + + +|age| name|pcode|pcoe|+ + + + +| 3
阅读全文
摘要:[Spark][Python]DataFrame中取出有限个记录的 继续 In [4]: peopleDF.select("age","name") In [11]: myDF=peopleDF.select("age","name") In [14]: myDF.limit(2).show() +
阅读全文
摘要:[Spark][Python]DataFrame中取出有限个记录的例子 的 继续 In [4]: peopleDF.select("age")Out[4]: DataFrame[age: bigint] In [5]: myDF=people.select("age") NameError Trac
阅读全文
摘要:[Spark][Python]DataFrame中取出有限个记录的例子: sqlContext = HiveContext(sc) peopleDF = sqlContext.read.json("people.json") peopleDF.limit(3).show() [training@lo
阅读全文
摘要:返回 Oracle 索引页 当Oracel的一个新功能出来的时候,我们可能不知道所有与此功能关联的数据字典名称,那么如何才能得到这些 meta data 的 meta data 呢?可以通过 dicitonary 来查看:例如,查找所有 名字里带有 memory 的 数据字典名字列表:SQL> co
阅读全文
摘要:[Oracle][Standby][PDB]在PDB中修改参数,设置范围为 SPFILE,报 ORA-65099错误 在Data Gaurd 的 Standby (或 CDB 是 Read Only )中,在PDB下,执行如下SQL 出错:SQL> ALTER SYSTEM SET SGA_TARG
阅读全文
摘要:[Oracle][OnlineREDO]数据库无法启动时的对应策略: 返回:Oracle 索引页 1. Start with mount. SQL> conn / as sysdba SQL> startup mount 2. Check the redo log in which v $ log
阅读全文
摘要:[Oracle]TM lock (DML enqueue) 的相容性RS(SS): 行共享 LMODE =2RX(SX): 行独占 LMODE =3S: 共享 LMODE=4SRX(SSX): 共享排他 LMODE=5X: 排他 LMODE=6左边是已经取得的锁, 右边是要求的锁。"可" 表示可以取
阅读全文
摘要:对于Partition表而言,是否Global Index 和 Local Index 可以针对同一个字段建立?实验证明,对单独的列而言,要么建立 Global Index, 要么建立 Local Index。不能既建立 Global Index, 又建立 Local Index Test Case
阅读全文
摘要:[Oacle][Partition]Partition操作与 Index, Global Index 的关系:■ Regarding the local index and the global index,In the case of "alter table add partition"Even
阅读全文
摘要:Partition 操作是否和 Controlfile有关?通过实验来判断: 对比 Partition 前后的操作,看看controlfile 的dump 信息中是否有记录,结果发现没有记录在 controlfile 中的信息。#### Testcase-0810-1Operations relat
阅读全文
摘要:[Oracle]如何观察Table 的各种Lock 之间的冲突 举例:Session#15 创建表:SID 15 create table t1 (c1 number)partition by range(c1)(partition p1 values less than('11'),partiti
阅读全文
摘要:[Oralce][InMemory]如何确定一个表已经被Populate 到In Memory 中?以如下方法来查看 POPULATE_STATUS 是不行的。SQL> select inst_id, 2 pool 3 ,alloc_bytes/1024/1024 alloc_mb 4 ,used_
阅读全文
摘要:[Spark][Python]spark 从 avro 文件获取 Dataframe 的例子 从如下地址获取文件: https://github.com/databricks/spark-avro/raw/master/src/test/resources/episodes.avro 导入到 hdf
阅读全文
摘要:[Spark][Python]Spark 访问 mysql , 生成 dataframe 的例子: mydf001=sqlContext.read.format("jdbc").option("url","jdbc:mysql://localhost/loudacre")\ .option("dbt
阅读全文
摘要:Catalog DB resync error:1, setting on the server that starts the RMAN client$ Export EVENT_10928 = 1$ Rman target <username> / <password> @ <connectio
阅读全文
摘要:“The more you praise and celebrate your life, the more there is in life to celebrate.” - Oprah Winfrey
阅读全文
摘要:需要参考: [Oracle]Recovering the primary database's datafile using the physical standby, and vice versa (Doc ID 453153.1)
阅读全文
摘要:为了调查Oracle 的故障,可以通过设置event ,来了解详细的状况。方法如下:■ 如果使用 SPFILE, To enable it:1. Check the current event setting status:SQL> show parameter event;2. Add an ev
阅读全文
摘要:[Oracle]为何Archivelog 没有马上被删除客户设置了 Archivelog 的 deletion policy 是 CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY; 所以,他认为只要在Standby 端提交了
阅读全文
摘要:外部文件导入到Hive的例子: [training@localhost ~]$ cd ~[training@localhost ~]$ pwd/home/training[training@localhost ~]$ [training@localhost ~]$ vim customers.txt
阅读全文
摘要:[Spark][Hive]Hive的命令行客户端启动: [training@localhost Desktop]$ chkconfig | grep hive hive-metastore 0:off 1:off 2:off 3:on 4:on 5:on 6:offhive-server2 0:of
阅读全文
摘要:[Spark][python]以DataFrame方式打开Json文件的例子: [training@localhost ~]$ cat people.json{"name":"Alice","pcode":"94304"}{"name":"Brayden","age":30,"pcode":"943
阅读全文