近公司打算在下一代计费系统里面使用内存数据库的技术,所以作为公司的设计人员之一的我,在oracle网上下了个TimesTen,安装在我们的测试服务器上面aix5,这篇短文主要是我操作数据库的一个笔记.
最近公司打算在下一代计费系统里面使用内存
数据库
的技术,所以作为公司的设计人员之一的我,在Oracle
网上下了个TimesTen
,安装在我们的测试服务器上面aix5,这篇短文主要是我操作数据库
的一个笔记,下一篇打算发一个c程序的例子和我测试的结果,后续可能还会使用TimesTen
cache of Oracle
这个产品,陆续也会发一下这方面的笔记上来,希望对有这方面需求的朋友有所帮助。
1 建立.odbc.ini文件在登陆目录下
[ODBC Data Sources]
myTimesTen
=TimesTen
6.0 Driver
[DemoDataStore]
DataStore=/home/fee/TimesTen
6/DemoDataStore
DurableCommits=0
PermSize=16
2 连接数据源,并创建表
[31 machine]/home/fee>ttIsql
Copyright (c) 1996-2006, Oracle
. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
All commands must end with a semicolon character.
Command> connect "DSN=DemoDataStore";
IM002: Data source name not found and no default driver specified
The command failed.
Command> connect "DSN=DemoDataStore";
Connection successful: DSN=DemoDataStore;UID=fee;DataStore=/home/fee/TimesTen
6/DemoDataStore;PermSize=16;
(Default setting AutoCommit=1)
Command> create table customer
> (cust_number integer not null primary key,
> first_name char(12) not null,
> last_name char(12) not null,
> address varchar (100) not null);
Command> describe customer;
Table FEE.CUSTOMER:
Columns:
*CUST_NUMBER INTEGER NOT NULL
FIRST_NAME CHAR (12) NOT NULL
LAST_NAME CHAR (12) NOT NULL
ADDRESS VARCHAR (100) INLINE NOT NULL
1 table found.
(primary key columns are indicated with *)
Command> create table ref_products
> (prod_number char(10) not null primary key,
> prod_name varchar(100) not null,
> price decimal(6,2) not null);
Command> create table orders
> (order_number integer not null,
> cust_number integer not null,
> prod_name char(10) not null,
> order_date date not null);
Command> host ttSchema DemoDataStore;
create table FEE.CUSTOMER (
CUST_NUMBER INTEGER not null,
FIRST_NAME CHAR(12) not null,
LAST_NAME CHAR(12) not null,
ADDRESS VARCHAR(100) inline not null,
primary key (CUST_NUMBER));
create table FEE.ORDERS (
ORDER_NUMBER INTEGER not null,
CUST_NUMBER INTEGER not null,
PROD_NAME CHAR(10) not null,
ORDER_DATE DATE not null);
create table FEE.REF_PRODUCTS (
PROD_NUMBER CHAR(10) not null,
PROD_NAME VARCHAR(100) inline not null,
PRICE DECIMAL(6,2) not null,
primary key (PROD_NUMBER));
Command> exit
Disconnecting...
Done.
3 通过文件导入数据
[31 machine]/home/fee/TimesTen
6/DemoDataStore>ls -al
total 32
drwxrwxrwx 2 fee dba 256 Oct 24 17:25 ./
drwxr-xr-x 3 fee dba 4096 Oct 24 17:25 ../
-r--r--r-- 1 fee dba 1565 Oct 24 17:24 customer.dat
-r--r--r-- 1 fee dba 1591 Oct 24 17:24 orders.dat
-r--r--r-- 1 fee dba 967 Oct 24 17:24 ref_products.dat
[31 machine]/home/fee/TimesTen
6/DemoDataStore>pwd
/home/fee/TimesTen
6/DemoDataStore
[31 machine]/home/fee/TimesTen
6/DemoDataStore>cat customer.dat
3700,"Peter","Burchard","882 Osborne Avenue, Boston, MA 02122"
1121,"Saul","Mendoza","721 Stardust Street, Mountain View, CA 94043"
1278,"Mary","Behr","2233 Emerson Road, Vancouver, WA 98663"
1868,"Paul","Tu","308 Bowman Court, Palo Alto, CA 94309"
3645,"John","Silva","3329 Taffy Lane, Atlanta, GA 30314"
1935,"Sandra","Lao","115 Spangler Avenue, San Jose, CA 95112"
1002,"Marco","Mueller","40 East 5th Avenue, New York, NY 10009"
2364,"Karen","Johnson","3971 Hill Road, Chicago, IL 60608"
2655,"Linda","Garcia","7599 Clark Road, Denver, CO 80210"
1077,"Gautam","Mudunuri","16 Welsley Avenue, Fremont, CA 94555"
3864,"Ruth","Silver","88 West 65th Street, New York, NY 10009"
1010,"Fatima","Borba","6868 Bascom Avenue, San Jose, CA 95128"
2300,"Pavel","Popov","233 Loredo Street, Dallas, TX 75210"
1001,"Steven","McPhee","72 Vine Street, San Jose, CA 95125"
3525,"Anthony","Bianchi","122 Fuller Avenue, Patchogue, NY 11772"
2826,"Mary","Anderson","6363 Bjorn Road, Minneapolis, MN 55417"
2435,"Juanita","Dawes","733 Valdosta Avenue, Baton Rouge, LA 70816"
1224,"Abdul","Aziz","6793 Bird Avenue, San Jose, CA 95126"
3611,"Katherine","McKenzie","54 East 21st Avenue, New York, NY 10009"
1900,"Patricia","Levesque","658 Aristotle Road, Palo Alto, CA 94305"
3290,"Paula","Rossi","21 West 54th Street, New York, NY 10009"
1665,"David","Singh","4001 West Hedding, San Jose, CA 95216"
3098,"Cynthia","Stewart","333 East Palm Street, Miami, FL 33150"
1133,"Kerri","Haas","68 East San Fernando, San Jose, CA 95113"
2555,"Bo","Smith","124 North 1st Street, Dallas, TX 75210"
[31 machine]/home/fee/TimesTen
6/DemoDataStore>ttBulkCp -i -d warn DSN=DemoDataStore fee.customer customer.dat
customer.dat:
25 rows inserted
25 rows total
[31 machine]/home/fee/TimesTen
6/DemoDataStore>ttBulkCp -i -d warn DSN=DemoDataStore fee.orders orders.dat
orders.dat:
43 rows inserted
43 rows total
[31 machine]/home/fee/TimesTen
6/DemoDataStore>ttBulkCp -i -d warn DSN=DemoDataStore fee.ref_products ref_products.dat
ref_products.dat:
15 rows inserted
15 rows total
4 查询导入的数据
[31 machine]/home/fee/TimesTen
6/DemoDataStore>ttIsql
Copyright (c) 1996-2006, Oracle
. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
All commands must end with a semicolon character.
Command> connect "DSN=DemoDataStore";
Connection successful: DSN=DemoDataStore;UID=fee;DataStore=/home/fee/TimesTen
6/DemoDataStore;PermSize=16;
(Default setting AutoCommit=1)
Command> select * from customer;
< 3700, Peter , Burchard , 882 Osborne Avenue, Boston, MA 02122 >
< 1121, Saul , Mendoza , 721 Stardust Street, Mountain View, CA 94043 >
< 1278, Mary , Behr , 2233 Emerson Road, Vancouver, WA 98663 >
< 1868, Paul , Tu , 308 Bowman Court, Palo Alto, CA 94309 >
< 3645, John , Silva , 3329 Taffy Lane, Atlanta, GA 30314 >
< 1935, Sandra , Lao , 115 Spangler Avenue, San Jose, CA 95112 >
< 1002, Marco , Mueller , 40 East 5th Avenue, New York, NY 10009 >
< 2364, Karen , Johnson , 3971 Hill Road, Chicago, IL 60608 >
< 2655, Linda , Garcia , 7599 Clark Road, Denver, CO 80210 >
< 1077, Gautam , Mudunuri , 16 Welsley Avenue, Fremont, CA 94555 >
< 3864, Ruth , Silver , 88 West 65th Street, New York, NY 10009 >
< 1010, Fatima , Borba , 6868 Bascom Avenue, San Jose, CA 95128 >
< 2300, Pavel , Popov , 233 Loredo Street, Dallas, TX 75210 >
< 1001, Steven , McPhee , 72 Vine Street, San Jose, CA 95125 >
< 3525, Anthony , Bianchi , 122 Fuller Avenue, Patchogue, NY 11772 >
< 2826, Mary , Anderson , 6363 Bjorn Road, Minneapolis, MN 55417 >
< 2435, Juanita , Dawes , 733 Valdosta Avenue, Baton Rouge, LA 70816 >
< 1224, Abdul , Aziz , 6793 Bird Avenue, San Jose, CA 95126 >
< 3611, Katherine , McKenzie , 54 East 21st Avenue, New York, NY 10009 >
< 1900, Patricia , Levesque , 658 Aristotle Road, Palo Alto, CA 94305 >
< 3290, Paula , Rossi , 21 West 54th Street, New York, NY 10009 >
< 1665, David , Singh , 4001 West Hedding, San Jose, CA 95216 >
< 3098, Cynthia , Stewart , 333 East Palm Street, Miami, FL 33150 >
< 1133, Kerri , Haas , 68 East San Fernando, San Jose, CA 95113 >
< 2555, Bo , Smith , 124 North 1st Street, Dallas, TX 75210 >
25 rows found.
5 sql操作
Command> insert into customer
> values(1365,"Josephine","Rogers","2100 Augustine Drive, Santa Clara, CA 95054");
1 row inserted.
Command> select * from customer where cust_number=1365;
< 1365, Josephine , Rogers , 2100 Augustine Drive, Santa Clara, CA 95054 >
1 row found.
6 备份数据库
[31 machine]/home/fee/TimesTen
6>mkdir backup
[31 machine]/home/fee/TimesTen
6>ls
DemoDataStore/ DemoDataStore.ds1 DemoDataStore.res0 DemoDataStore.res2
DemoDataStore.ds0 DemoDataStore.log0 DemoDataStore.res1 backup/
[31 machine]/home/fee/TimesTen
6>ttBackup -dir /home/fee/TimesTen
6/backup "DSN=DemoDataStore";
Backup started ...
Backup complete
[31 machine]/home/fee/TimesTen
6>cd backup
[31 machine]/home/fee/TimesTen
6/backup>ls
DemoDataStore.0.bac DemoDataStore.0.bac0 DemoDataStore.sta
[31 machine]/home/fee/TimesTen
6/backup>ll
total 29592
-rw------- 1 fee dba 14549816 Oct 24 17:44 DemoDataStore.0.bac
-rw------- 1 fee dba 589824 Oct 24 17:44 DemoDataStore.0.bac0
-rw------- 1 fee dba 688 Oct 24 17:44 DemoDataStore.sta
7 删除和恢复数据库
[31 machine]/home/fee/TimesTen
6/backup>ttstatus
TimesTen
status report as of Tue Oct 24 17:47:25 2006
Daemon pid 782504 port 16001 instance TimesTen
6
TimesTen
server pid 774300 started on port 16003
No TimesTen
webserver running
------------------------------------------------------------------------
Data store /home/fee/TimesTen
6/DemoDataStore
There are no connections to the data store
Replication policy : Manual
Cache agent policy : Manual
------------------------------------------------------------------------
End of report
[31 machine]/home/fee/TimesTen
6/backup>ttDestroy /home/fee/TimesTen
6/DemoDataStore
[31 machine]/home/fee/TimesTen
6/backup>ttstatus
TimesTen
status report as of Tue Oct 24 17:51:59 2006
Daemon pid 782504 port 16001 instance TimesTen
6
TimesTen
server pid 774300 started on port 16003
No TimesTen
webserver running
------------------------------------------------------------------------
End of report
[31 machine]/home/fee/TimesTen
6/DemoDataStore>ttRestore -dir /home/fee/TimesTen
6/backup "DSN=DemoDataStore";
Restore started ...
Restore complete
[31 machine]/home/fee/TimesTen
6>ttstatus
TimesTen
status report as of Tue Oct 24 17:53:46 2006
Daemon pid 782504 port 16001 instance TimesTen
6
TimesTen
server pid 774300 started on port 16003
No TimesTen
webserver running
------------------------------------------------------------------------
Data store /home/fee/TimesTen
6/DemoDataStore
There are no connections to the data store
Replication policy : Manual
Cache agent policy : Manual
------------------------------------------------------------------------
End of report
分享到:
相关推荐
最近公司打算在下一代计费系统里面使用内存数据库的技术,所以作为公司的设计人员之一的我,在oracle网上下了个TimesTen,安装在我们的测试服务器上面aix5,这篇短文主要是我操作数据库的一个笔记,下一篇打算发一个...
Oracle 内存数据库 TimesTen 是 Oracle 公司推出的一款高性能、低延迟的内存数据库系统,设计用于处理实时、高吞吐量的应用场景。TimesTen 的核心特性在于它能够在内存中存储和管理数据,大大减少了传统磁盘I/O的...
总的来说,Oracle TimesTen内存数据库为开发者提供了高效、实时的数据处理能力。通过了解其特性和开发方式,开发者可以充分利用TimesTen的优势,构建高性能的应用系统。在实际应用中,还需要根据具体需求进行调优和...
内存数据库Oracle TimesTen是Oracle公司推出的一款高性能、全内存的关系型数据库管理系统,专门设计用于处理实时的在线事务处理(OLTP)和分析工作负载。它将数据存储在内存中,从而实现了极快的数据读取速度和低...
文档的描述中提到“Oracle TimesTen In-Memory Database SQL Reference Guide Release 7.0”,指出这是一份关于Oracle公司TimesTen内存数据库版本7.0的SQL语言参考。标签“内存数据库 timesten SQL 指南”进一步强化...
标题:“Oracle Timesten内存数据库介绍” 描述:“内存数据库应用介绍,不错的东西,请大家赶紧下载呀” 标签:“数据库 内存 Oracle” 知识点详述: ### 一、内存数据库概述 内存数据库是一种主要或完全依赖...
Oracle Timesten 数据库是一款高性能的内存数据库系统,被广泛应用于需要高速数据处理的应用场景中。该数据库提供了对 Java 开发者的支持,并为此发布了一份详细的《Java 开发者与参考指南》(以下简称“手册”)。...
Oracle Timesten是一款高效、高性能的内存数据库系统,由甲骨文公司开发,主要用于实时应用程序。它设计的目标是提供亚毫秒级的数据访问速度,从而极大地提升了数据处理的速度和响应时间。以下是对每个文档的详细...
本文将围绕“深入Oracle内存数据库”的主题,详细介绍内存数据库的基本概念、应用场景以及Oracle TimesTen内存数据库的具体解决方案。 #### 二、内存数据库简介 内存数据库是一种主要或完全依赖于计算机主内存...
Oracle TimesTen是一款高性能的内存数据库系统,设计用于实时数据处理和快速查询响应。它被广泛应用于交易处理、实时分析和其他对速度有极高要求的应用场景。以下是对TimesTen安装配置的详细步骤和涉及的知识点: 1...
综上所述,Oracle Timesten内存数据库是为需要快速响应和高性能的实时应用而设计的。其独特的优势在于其内存优化的设计,能够提供比传统磁盘数据库更快的处理速度和更高的可伸缩性。由于其易安装、易配置的特点,...
使用java连接timesten数据库是要用到的包
Oracle TimesTen是一款高性能的内存数据库系统,由Oracle公司开发,主要设计用于实时应用程序,提供亚毫秒级的数据处理速度。这款数据库系统将数据完全存储在内存中,从而实现了极快的查询性能,特别适合需要快速...
Oracle TimesTen 7.0 操作、管理和编程笔记
Oracle TimesTen深入内存数据库培训PPT,深入介绍Oracle TimesTen内存数据库
timesten内存数据库,全称为Oracle TimesTen In-Memory Database,是由Oracle公司推出的一款高性能、低延迟的内存数据库系统。其核心设计理念在于缩短数据库层面的响应时间,通过将所有相关数据存储于计算机内存中,...
TimesTen内存数据库是一款由Oracle公司开发的高性能、实时的列式内存数据库系统。它专为需要高速数据处理和低延迟的应用场景设计,如金融交易、电信、物联网(IoT)和大数据分析。以下是对TimesTen内存数据库的详细...
Oracle Timesten内存数据库自动数据清理机制探究.pdf