Chinaunix首页 | 论坛 | 博客
  • 博客访问: 650468
  • 博文数量: 168
  • 博客积分: 2928
  • 博客等级: 中校
  • 技术积分: 1904
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-04 09:56
文章分类

全部博文(168)

文章存档

2010年(168)

我的朋友

分类: Oracle

2010-11-20 11:35:48

一、安装前的准备:
配置内核参数:
kernel.shmmax=2147483648
kernel.shmall=4194304
kernel.sem = 250 32000 100 128
net.ipv4.tcp_rmem=4096 4194304 4194304
net.ipv4.tcp_wmem=98304 4194304 4194304
net.core.rmem_default=65535
net.core.wmem_default=65535
net.core.rmem_max=4194304
net.core.wmem_max=4194304
net.ipv4.tcp_window_scaling=1
建目录:
# mkdir /etc/TimesTen
# touch /etc/TimesTen/instance_info
建用户组与用户:
#groupadd dba
# groupadd ttadmin
#useradd -G ttadmin -g dba oracle
#passwd oracle
# chgrp -R ttadmin /etc/TimesTen
# chmod 770 /etc/TimesTen/
# chmod 660 /etc/TimesTen/*
环境变量:
export CLASSPATH=/home/timesten/TimesTen/tt1121/lib/ttjdbc5.jar:$CLASSPATH
export PATH=/home/timesten/TimesTen/tt1121/bin:$PATH
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:/oracle/timesten/Tim
esTen/tt70/lib:$LD_LIBRARY_PATH
二、安装timesten数据库
下载数据库包:timesten112140.linux86.tar.gz
解压:
% gunzip timestenrelease.platform.tar.gz
% tar -xf timestenrelease.platform.tar
安装:
% cd linux86
% ./setup.sh
如果要认操作系统启动时,数据库也启动。运行下面的语句:
进入ROOT用户:
[root@rac1 oracle]# cd /home/timesten/TimesTen/tt1121/bin/
[root@rac1 bin]# ./setuproot -install
下面是运行的日志:
Please run this script from the 'bin' directory of your installation.
[root@rac1 oracle]# cd /home/timesten/TimesTen/tt1121/bin/
[root@rac1 bin]# ./setuproot -install
Would you like to install the TimesTen daemon startup scripts into
/etc/init.d? [ yes ]
Copying /home/timesten/TimesTen/tt1121/startup/tt_tt1121 to /etc/init.d
Successfully installed the following scripts :
/etc/init.d/tt_tt1121
/etc/rc.d/rc0.d/K45tt_tt1121
/etc/rc.d/rc1.d/K45tt_tt1121
/etc/rc.d/rc2.d/S90tt_tt1121
/etc/rc.d/rc3.d/S90tt_tt1121
/etc/rc.d/rc5.d/S90tt_tt1121
/etc/rc.d/rc6.d/K45tt_tt1121
 
三、安装过程:
[oracle@rac1 oracle]$ su - timesten
Password:
[timesten@rac1 ~]$ ls
linux86
[timesten@rac1 ~]$ cd linux86/
[timesten@rac1 linux86]$ ls
3rdparty  doc  install.pl  LINUX86  README.html  setup.sh  uninst.sh
[timesten@rac1 linux86]$ ./setup.sh
NOTE: Each TimesTen installation is identified by a unique instance name.
      The instance name must be a non-null alphanumeric string, not longer
      than 255 characters.
Please choose an instance name for this installation? [ tt1121 ]
Instance name will be 'tt1121'.
Is this correct? [ yes ] yes
Of the three components:
  [1] Client/Server and Data Manager
  [2] Data Manager Only
  [3] Client Only
Which would you like to install? [ 1 ]
Of the following options :
  [1] /home/timesten
  [2] /home/timesten
  [3] Specify a location
  [q] Quit the installation
Where would you like to install the tt1121 instance of TimesTen? [ 1 ]
Where would you like to create the daemon home directory? [
/home/timesten/TimesTen/tt1121/info ]
The daemon logs will be located in /home/timesten/TimesTen/tt1121/info
Would you like to specify a different location for the daemon logs? [ no ]
Installing into /home/timesten/TimesTen/tt1121 ...
Uncompressing ...
NOTE: If you are configuring TimesTen for use with Oracle Clusterware, the
      daemon port number must be the same across all TimesTen installations
      managed within the same Oracle Clusterware cluster.
NOTE: All installations that replicate to each other must use the same daemon
      port number that is set at installation time. The daemon port number can
      be verified by running 'ttVersion'.
The default port number is 53384.
Do you want to use the default port number for the TimesTen daemon? [ yes ]
The daemon will run on the default port number (53384).
NOTE: For security, we recommend that you restrict access to the
      TimesTen installation to members of a single OS group. Only members of
      that OS group will be allowed to perform direct mode connections to
      TimesTen, and only members of that OS group will be allowed to perform
      operations that access TimesTen data stores, TimesTen files and shared
      memory. The OS group defaults to the primary group of the instance
      administrator. You can default to this group, choose another OS group
      or you can make this instance world-accessible. If you choose to make
      this instance world-accessible, all database files and shared memory
      are readable and writable by all users.
Restrict access to the the TimesTen installation to the group 'dba'? [ yes ]
NOTE: Enabling PL/SQL will increase the size of some TimesTen libraries.
Would you like to enable PL/SQL for this instance? [ yes ]
In order to use the 'In-Memory Database Cache' feature in any databases
created within this installation, you must set a value for the TNS_ADMIN
environment variable. It can be left blank, and a value can be supplied later
using /bin/ttModInstall.
Please enter a value for TNS_ADMIN (s=skip)? [  ]
Please enter a value for TNS_ADMIN (s=skip)? [  ] s 

NOTE: It appears that you are running version 3.4 or higher of the g++
      compiler. TimesTen ships with multiple sets of client libraries and
server
      binaries : one built for compatibility with g++ 3.4.6 and one with
      g++ 4.1.0. The installer has created links to the 3.4.6 library in the
      /lib directory and to the 3.4.6 server binary in the
      /bin directory. If you want to use a different compiler,
      please modify the links to point to the desired library and server
binary.
Installing server components ...
What is the TCP/IP port number that you want the TimesTen Server to listen on?
[ 53385 ]
Do you want to install QuickStart and the TimesTen Documentation? [ no ] yes
Where would you like to install the quickstart and doc directories (s=skip)? [
/home/timesten/TimesTen/tt1121 ]
The TimesTen Quickstart applications can take up to 64 Mbytes of disk space.
Depending on how your system is configured, you may not want to create the
QuickStart DemoDataStore directory in the default location,
/home/timesten/TimesTen/tt1121/info/DemoDataStore
Where would you like to create the DemoDataStore directory? [
/home/timesten/TimesTen/tt1121/info ]
Creating /home/timesten/TimesTen/tt1121/info/DemoDataStore ...
Installing client components ...
Would you like to use TimesTen Replication with Oracle Clusterware? [ no ]
NOTE: The TimesTen daemon startup/shutdown scripts have not been installed.
Run the 'setuproot' script :
        cd /home/timesten/TimesTen/tt1121/bin
        ./setuproot -install
This will move the TimesTen startup script into its appropriate location.
The startup script is currently located here :
  '/home/timesten/TimesTen/tt1121/startup/tt_tt1121'.
The Quickstart home page can be accessed here :
  '/home/timesten/TimesTen/tt1121/quickstart/index.html'
The 11.2.1.7 Release Notes are located here :
  '/home/timesten/TimesTen/tt1121/README.html'
Starting the daemon ...
TimesTen Daemon startup OK.
End of TimesTen installation.
到此安装完毕。

下面来看一下是不是启动好了。
[timesten@rac1 linux86]$ ps -ef |grep timesten
root      9332  8995  0 10:53 pts/2    00:00:00 su - timesten
timesten  9333  9332  0 10:53 pts/2    00:00:00 -bash
timesten 12675     1  0 11:02 ?        00:00:00
/home/timesten/TimesTen/tt1121/bin/timestend -initfd 13
timesten 12678 12675  0 11:02 ?        00:00:00
/home/timesten/TimesTen/tt1121/bin/timestensubd -verbose -userlog tterrors.log
-supportlog ttmesg.log -id 0 -facility user
timesten 12679 12675  0 11:02 ?        00:00:00
/home/timesten/TimesTen/tt1121/bin/timestensubd -verbose -userlog tterrors.log
-supportlog ttmesg.log -id 1 -facility user
timesten 12680 12675  0 11:02 ?        00:00:00
/home/timesten/TimesTen/tt1121/bin/timestensubd -verbose -userlog tterrors.log
-supportlog ttmesg.log -id 2 -facility user
timesten 12681 12675  0 11:02 ?        00:00:00
/home/timesten/TimesTen/tt1121/bin/timestensubd -verbose -userlog tterrors.log
-supportlog ttmesg.log -id 3 -facility user
timesten 12683 12675  0 11:02 ?        00:00:00
/home/timesten/TimesTen/tt1121/bin/ttcserver -verbose -userlog tterrors.log -
supportlog ttmesg.log -id 4 -p 53385 -facility user -group dba
timesten 12761  9333  0 11:04 pts/2    00:00:00 ps -ef
timesten 12762  9333  0 11:04 pts/2    00:00:00 grep timesten

下面设置环境变量:
[timesten@rac1 linux86]$ cd ..
[timesten@rac1 ~]$ ls
linux86  TimesTen
[timesten@rac1 ~]$ id
uid=505(timesten) gid=501(dba) groups=501(dba),503(ttadmin)
[timesten@rac1 ~]$ pwd
/home/timesten
[timesten@rac1 ~]$ ls
linux86  TimesTen
[timesten@rac1 ~]$ pwd
/home/timesten
[timesten@rac1 ~]$ cd TimesTen/
[timesten@rac1 TimesTen]$ ls
tt1121
[timesten@rac1 TimesTen]$ cd tt1121/
[timesten@rac1 tt1121]$ ls
3rdparty  include  mibs     oraclescripts  quickstart       startup   
ttoracle_home
bin       info     network  PERL           quickstart.html  support   
welcome.html
doc       lib      nls      plsql          README.html      ttclasses
[timesten@rac1 tt1121]$ pwd
/home/timesten/TimesTen/tt1121
[timesten@rac1 tt1121]$ cd lib/
[timesten@rac1 lib]$ ls
libodbc.so                libttclient.so         libttcrs.so     libttor.so   
 timestenjmsxla.jar
libttclassesCS.so         libttclient.so.gcc346  libttenD.so     libttplD.so  
 ttjdbc5.jar
libttclassesCS.so.gcc346  libttclient.so.gcc410  libtten.so      libttpl.so   
 ttjdbc6.jar
libttclassesCS.so.gcc410  libttcoD.so            libttJdbcCS.so  libttutilD.so
libttclasses.so           libttcoD.so.noplsql    libttJdbc.so    libttutil.so
libttclasses.so.gcc346    libttco.so             libttjmsxla.so  orai18n.jar
libttclasses.so.gcc410    libttco.so.noplsql     libttorD.so     README.TXT
[timesten@rac1 lib]$ ls ttjdbc
ttjdbc5.jar  ttjdbc6.jar 
[timesten@rac1 lib]$ cd $HOME
[timesten@rac1 ~]$ pwd
/home/timesten
[timesten@rac1 ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
export CLASSPATH=/home/timesten/TimesTen/tt1121/lib/ttjdbc5.jar:$CLASSPATH
export PATH=/home/timesten/TimesTen/tt1121/bin:$PATH
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:/oracle/timesten/Tim
esTen/tt70/lib:$LD_LIBRARY_PATH
~
~
~
~
~
~
~
~
~
~
".bash_profile" 18L, 496C 已写入                                              
   
[timesten@rac1 ~]$ source .bash_profile

下面测试一下连接TT数据库:默认的data store是sampledb_1121
[timesten@rac1 ~]$ tts
ttschema       ttschemacs     ttsize         ttstatus       ttsyslogcheck 
[timesten@rac1 ~]$ tt
Display all 117 possibilities? (y or n)
ttadmin                ttCRSbackupservice     ttfprint               ttsize
ttAdmin                ttCRSbackupserviceCmd  ttindex                ttSize
ttAdminCmd             ttcrsdaemon            ttisql                 ttSizeCmd
ttadoptstores          ttCRSdaemon            ttIsql                 ttstatus
ttAdoptStores          ttCRSdaemonCmd         ttIsqlCmd              ttStatus
ttAdoptStoresCmd       ttcrsmaster            ttisqlcs              
ttStatusCmd
ttbackup               ttCRSmaster            ttIsqlCS              
ttsyslogcheck
ttBackup               ttCRSmasterCmd         ttIsqlCSCmd           
ttSyslogCheck
ttBackupCmd            ttcrssubscriber        ttmigrate             
ttSyslogCheckCmd
ttbulkcp               ttCRSsubscriber        ttMigrate              tttail
ttBulkCp               ttCRSsubscriberCmd     ttMigrateCmd           ttTail
ttBulkCpCmd            ttcrssubservice        ttmigratecs            ttTailCmd
ttbulkcpcs             ttCRSsubservice        ttMigrateCS            ttThunk
ttBulkCpCS             ttCRSsubserviceCmd     ttMigrateCSCmd        
tttracemon
ttBulkCpCSCmd          ttcserver              ttmkfdir              
ttTraceMon
ttcapture              ttcserver_gcc346       ttmodinstall          
ttTraceMonCmd
ttCapture              ttcserver_gcc410       ttModInstall           ttuser
ttcheck                ttcwadmin              ttpatchinst            ttUser
ttCheck                ttCWAdmin              ttrepadmin             ttversion
ttCheckCmd             ttCWAdminCmd           ttRepAdmin             ttVersion
ttcrsactiveservice     ttdaemonadmin          ttRepAdminCmd         
ttxactadmin
ttCRSactiveservice     ttDaemonAdmin          ttrestore             
ttXactAdmin
ttCRSactiveserviceCmd  ttDaemonAdminCmd       ttRestore             
ttXactAdminCmd
ttcrsagent             ttdaemonlog            ttRestoreCmd           ttxactlog
ttCRSAgent             ttDaemonLog            ttschema               ttXactLog
ttCRSAgentCmd          ttDaemonLogCmd         ttSchema              
ttXactLogCmd
ttcrsapp               ttdestroy              ttSchemaCmd            tty
ttCRSapp               ttDestroy              ttschemacs            
ttCRSappCmd            ttDestroyCmd           ttSchemaCS            
[timesten@rac1 ~]$ ttIsql
ttIsql       ttIsqlCmd    ttIsqlCS     ttIsqlCSCmd 
[timesten@rac1 ~]$ ttIsql TpcbData_tt70
Copyright (c) 1996-2010, Oracle.  All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
 
connect "DSN=TpcbData_tt70";
IM002: Data source name not found and no default driver specified
The command failed.
Done.
[timesten@rac1 ~]$ ttIsql TpcbData_tt1121
Copyright (c) 1996-2010, Oracle.  All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
 
connect "DSN=TpcbData_tt1121";
IM002: Data source name not found and no default driver specified
The command failed.
Done.
[timesten@rac1 ~]$ ttIsql sampledb_1121
Copyright (c) 1996-2010, Oracle.  All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
 
connect "DSN=sampledb_1121";
Connection successful:
DSN=sampledb_1121;UID=timesten;DataStore=/home/timesten/TimesTen/tt1121/info/D
emoDataStore/sampledb_1121;DatabaseCharacterSet=US7ASCII;ConnectionCharacterSe
t=US7ASCII;DRIVER=/home/timesten/TimesTen/tt1121/lib/libtten.so;PermSize=40;Te
mpSize=32;TypeMode=0;
(Default setting AutoCommit=1)
Command> tables;
0 tables found.
Command> create table test(id number);
Command> insert into test values(1);
1 row inserted.
Command> select * from test;
< 1 >
1 row found.
Command> rollback;
Command> select * from test;
< 1 >
1 row found.
Command> tables;
  TIMESTEN.TEST
1 table found.
Command>
阅读(2383) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~