[转帖]TimesTen 的备份与恢复_MySQL, Oracle及数据库讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MySQL, Oracle及数据库讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 4752 | 回复: 0   主题: [转帖]TimesTen 的备份与恢复        下一篇 
shunzi
注册用户
等级:上尉
经验:782
发帖:133
精华:0
注册:2011-10-10
状态:离线
发送短消息息给shunzi 加好友    发送短消息息给shunzi 发消息
发表于: IP:您无权察看 2011-11-15 15:25:37 | [全部帖] [楼主帖] 楼主

先在 dsa 中创建一个表,并插入一些数据以做为后面恢复的验证:

[tt1@west-mountain ~]$ ttisql dsa
Copyright (c) 1996-2007, Oracle. All rights reserved.
Type ? or “help” for help, type “exit” to quit ttIsql.
All commands must end with a semicolon character.
connect “DSN=dsa”;
Connection successful: DSN=dsa;UID=tt1;……TimesTen/tt70/lib/libtten.so;PermSize=50;TempSize=10;TypeMode=0;
(Default setting AutoCommit=1)
Command> create table ftable(id int not null primary key, name char(10));
Command> insert into ftable values(1,’hello’);
1 row inserted.
Command> insert into ftable values(2,’world’);
1 row inserted.
Command> commit;
Command> select * from ftable;
< 1, hello >
< 2, world >
2 rows found.
Command>


然后另开一个控制台,通过ttstatus可以家查dsa的状态:

[tt1@west-mountain ~]$ ttstatus
TimesTen status report as of Sun Jul 1 21:58:29 2007
Daemon pid 4411 port 17000 instance tt70
TimesTen server pid 4424 started on port 17002
TimesTen webserver pid 4422 started on port 17004
————————————————————
Data store /home/tt1/TimesTen/tt70/info/dsa
There are no connections to the data store
Replication policy : Manual
Cache agent policy : Manual
————————————————————
Access control enabled.
End of report
[tt1@west-mountain ~]$ pwd
/home/tt1
[tt1@west-mountain ~]$ ls
Desktop install TimesTen
[tt1@west-mountain ~]$ mkdir backup
[tt1@west-mountain ~]$ cd backup


通过命令ttbackup 命令备份数据库, dir指向放置备份文件的路进,fname指定所要生成的备份文件的命名,dsn指向要备份的datastore:

[tt1@west-mountain backup]$ ttbackup -dir /home/tt1/backup -fname dsa-0701 dsn=dsa
Backup started …
Backup complete
[tt1@west-mountain backup]$ ls -al
total 11916
drwxr-xr-x 2 tt1 tta 4096 Jul 1 21:54 .
drwx—— 17 tt1 users 4096 Jul 1 21:54 ..
-rw——- 1 tt1 tta 11542528 Jul 1 21:54 dsa-0701.0.bac
-rw——- 1 tt1 tta 606208 Jul 1 21:54 dsa-0701.0.bac0
-rw——- 1 tt1 tta 676 Jul 1 21:54 dsa-0701.sta
[tt1@west-mountain backup]$


现在我们通过ttdestroy 命令 删除掉现在的dsa datastore, 首先退出已有的 ttisql 连接:

Command> exit
Disconnecting…
Done.


现在删除它:

[tt1@west-mountain ~]$ ttdestroy dsa


通过ttstatus验证确实该datastore已经不存在了,可对比前面的ttstatus的输出结果进行对比:

[tt1@west-mountain ~]$ ttstatus
TimesTen status report as of Sun Jul 1 21:58:16 2007
Daemon pid 4411 port 17000 instance tt70
TimesTen server pid 4424 started on port 17002
TimesTen webserver pid 4422 started on port 17004
————————————————————————
Access control enabled.
End of report


现在恢复它,dir指向备份文件放置的目录,noconn为恢复好后,不要自动登录该datastore:

[tt1@west-mountain ~]$ ttrestore -dir /home/tt1/backup -noconn -fname dsa-0701 dsn=dsa
Restore started …
Restore complete


现在登录上去,验证原有的数据是否存在:

[tt1@west-mountain ~]$ ttisql dsa
Copyright (c) 1996-2007, Oracle. All rights reserved.
Type ? or “help” for help, type “exit” to quit ttIsql.
All commands must end with a semicolon character.
connect “DSN=dsa”;
Connection successful: DSN=dsa;UID=tt1;……PermSize=50;TempSize=10;TypeMode=0;
(Default setting AutoCommit=1)
Command> desc ftable;
Table TT1.FTABLE:
Columns:
*ID NUMBER (38) NOT NULL
NAME CHAR (10)
1 table found.
(primary key columns are indicated with *)
Command> select * from ftable;
< 1, hello >
< 2, world >
2 rows found.
Command>


所有的数据确实已经恢复过来。




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论