Practice: oracle timesten 11.2.2.7.0 on centos 6.5, timestencentos
Entry level, but the steps are more detailed, there is no theory, can be used as an entry manual.
**************************************** * ******************************** 1. create a user ************************************** *********************************** ----- 1. create OS user and group groupadd ttadmingroupadd timesten mkdir/etc/TimesTenmkdir-p/app/timestenchgrp-R ttadmin/etc/TimesTenchgrp-R ttadmin/app/timestenchmod 770/etc/TimesTen/chmod 770/app/timesten chmod 660/etc/TimesTen/* useradd-d /Home/ocpyang-g ttadmin-G timesten, dba ocpyangpasswd ocpyangocpyangusermod-a-G timesten, oinstall, dba ocpyang ************************************** * ********************************** 2. installation preparation for the Linux platform *********************************** * *********************************** ----------- 1. OS kernel parameter --- 1.1 shared memorary configkernel. shmmax = 68719476736kernel. shmall = 16777216/*** config 64g me Morary64 x 1024x1024x1024 = 68719476736 and 68719476736/4096 = 16777216 ***** // sbin/sysctl-p --- 1.2 HugePages configecho 32>/proc/sys/vm/nr_hugepages vi/ etc/sysctl. conf # config timesten instance 16g and huge page size is 2 MB. vm. nr_hugepages = 8192 # ttadmin group idvm. hugetlb_shm_group = 503/sbin/sysctl-p --- 1.3 Semaphores config # vi/etc/sysctl. conf #/sbin/sysctl-a | grep semkernel. sem = 400 32000 100 128/sbin/sysctl-p --- 1.4 REP and IMDB Cache1 ). configure network parameters for replication. The number of buffers sent and received over TCP must be increased to 4 MB at/etc/sysctl. add the following lines to the conf file: # vi/etc/sysctl. confnet. ipv4.tcp _ rmem = 4096 4194304 ipv4net. ipv4.tcp _ wmem = 98304 4194304 ipv4net. core. rmem_default = 65535net. core. wmem_default = 65535net. core. rmem_max = 4192134net. core. wmem_max = 4192134net. ipv4.tcp _ window_scaling = 12 ). configure the network parameters for IMDB Cache. The number of buffers sent and received over TCP must be increased. Modify/etc/sysc. Tl. add the following lines to the conf file: # vi/etc/sysctl. confnet. ipv4.tcp _ rmem = 4096 4194304 ipv4net. ipv4.tcp _ wmem = 98304 4194304 ipv4net. core. rmem_default = 262144net. core. wmem_default = 262144net. core. rmem_max = 4192134net. core. wmem_max = 4192134net. ipv4.tcp _ window_scaling = 1net. ipv4.ip _ local_port_range = 1024 65000 merge the two appeals into: ##### REP and IMDB Cachenet. ipv4.tcp _ rmem = 4096 4194304 ipv4net. ipv4.tcp _ wmem = 98304 4194304 ipv4net. cor E. rmem_default = 262144net. core. wmem_default = 262144net. core. rmem_max = 4192134net. core. wmem_max = 4192134net. ipv4.tcp _ window_scaling = 1net. ipv4.ip _ local_port_range = 1024 65000 2 ). restart the configuration to take effect or run the following command: #/sbin/sysctl-p ********************************* ************************************* 3. soft install ************************************** * ********************************* --- 3.1 install JDK Java-versionrpm -qa | grep Java $ whoamiocpyang --- 3.2 install timestencd/soft/linux8664/$. /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. # Step 1: Enter the installation instance name Please choose an instance name for this installation? [Tt1122] ttwind # enter the custom name Instance name will be 'ttwind '. Is this correct? [Yes] yes # Step 2: Install the component Of the three components: [1] Client/Server and Data Manager [2] Data Manager Only [3] Client OnlyWhich wocould you like to install? [1] 1 # Enter 1 # Step 3: installation location Of the following options: [1]/home/ocpyang [2]/soft [3] Specify a location [q] Quit the installationWhere wocould you like to install the ttwind instance of TimesTen? [1] 3 # input 3 to customize an installation directory Please specify a directory to install TimesTen? [/Home/ocpyang]/app/timesten # enter a custom installation directory Where wocould you like to create the daemon home directory? [/App/timesten/TimesTen/ttwind/info] The daemon logs will be located in/app/timesten/TimesTen/ttwind/infowowould you like to specify a different location for the daemon logs? [No] Uncompressing... NOTE: If you are using ing TimesTen for use with Oracle Clusterware, the daemon port number must be the same authentication SS 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 'ttver Sion '. # Step 4: Enter The custom master process port number the default port number is 53396. Do you want to use the default port number for The TimesTen daemon? [Yes] no # enter the no custom port Please enter a unique port number for the TimesTen daemon (<CR> = list )? [] 53355 # enter the custom port 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 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. # Step 5: Restrict access to the TimesTen installation to the group 'ttadmin' by default for restricted sessions and PL/SQL functions '? [Yes] NOTE: Enabling PL/SQL will increase the size of some TimesTen libraries. wocould you like to enable PL/SQL for this instance? [Yes] yes # Step 6: Specify the TNS_ADMIN environment variable during installation ------------------------------------------------------------------------ remember: The final tnsnames. ora needs to put a copy in this directory, otherwise the error Command> create readonly cache group cachtest> from scott. t2> (> sid int not null primary key,> sname varchar2 (10)>); Warning 5923: cache agent has deferred the create/alter cache group request because it is not connected to Oracle yet or Command> lo Ad cache group cachtest commit every 10 rows; 5056: The cache operation fails: error_type = <Oracle Error>, error_code = <12541>, error_message: ORA-12541: TNS: no listenerThe command failed. attributes In order to use the 'In-Memory Database Cache' feature in any databasescreated within this installation, you must set a value for the TN S_ADMINenvironment variable. It can be left blank, and a value can be supplied laterusing <install_dir>/bin/ttModInstall. Please enter a value for TNS_ADMIN (s = skip )? []/App/timesten/TimesTen/ttwind/# input/app/timesten/TimesTen/ttwind/nTNS_ADMIN will be set to/app/timesten/TimesTenYou can change TNS_ADMIN later by running <install_dir>/bin/ttmodinstall. NOTE: It appears that you are running version 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 G ++ 4.1.0. the installer has created links to the 4.1.0 library in the <install_dir>/lib directory and to the 4.1.0 server binary in the <install_dir>/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... # Step 7: TimesTen server port number Installing server components... what is the TCP/IP port number that You want the TimesTen Server to listen on? [53356] 53356 # Add 1Do you want to install the Quick Start Sample Programs and the TimesTen Documentation to the master process port number? [No] wocould you like to install the documentation (without the Quick Start Sample Programs )? [Yes] Where wocould you like to create the doc directory? [/App/timesten/TimesTen/ttwind/doc] The TimesTen documentation has been installed in/app/timesten/TimesTen/ttwind/doc. installing client components... wocould 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/app/timesten/TimesTen/ttwind/bin. /setuproot-installThis will move the TimesTen startup script into its appropriate location. the startup script is currently located here: '/app/timesten/TimesTen/ttwind/startup/tt_ttwind '. the 11.2.2.7 Release Notes are located here: '/app/timesten/T ImesTen/ttwind/README.html 'starting the daemon... TimesTen Daemon startup OK. End of TimesTen installation. --- 3.3 set the user variable vi ~ /. Bash_profileexport ORACLE_HOME =/u01/app/oracle/product/11.2.0/db_1export TNS_ADMIN = $ ORACLE_HOME/network/adminexport TT_HOME =/app/timesten/TimesTen/ttwind/export PATH = $ PATH: $ TT_HOME/bin: $ ORACLE_HOME/binLD_LIBRARY_PATH =/app/timesten/TimesTen/ttwind/libexport LD_LIBRARY_PATH =$ {LD_LIBRARY_PATH }:/ lib:/usr/lib: /usr/local/lib: $ ORACLE_HOME/libsource ~ /. Bash_profile --- 3.4 copy the tnsnames file cp/u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames. ora/app/timesten/TimesTen/ttwind /****************************** **************************************** ** 4. create a cache instance ************************************* ********************************** --------- 4.1 Oracle database creation related users and permissions-Step 1: create tablespace ttspace DATAFILE/u01/app/oracle/oradata/orcl/ttspace01.dbf 'size 10 M autoextend on next 10 m maxsize 30g; @ $ TT_HOME/oraclescripts/initCacheGlobalSchema. SQL "TTSPACE" alter user timesten identified by timesten; -- Step 2: create a database synchronization user create user cacheuser identified by cacheuser DEFAULT TABLESPACE TTSPACEQUOTA UNLIMITED ON TTSPACE; grant connect, resource to cacheuser; @ $ TT_HOME/oraclescripts/grantCacheAdminPrivileges "cacheuser" -- Step 3: grant the table to the cacheuser user conn scott/tigercreate table t1 (sid int not null primary key, sname varchar2 (10 )); insert into t1 values (101, 'wind '); insert into t1 values (102, 'snow'); grant select, insert, update, delete on scott. t1 to cacheuser; grant all on scott. t1 to cacheuser; ------- 4.2 create related users and permissions on timesten client ---- STEP 0: modify the DSN and set the required data directory file # vi/app/timesten/TimesTen/ttwind/info/sys. odbc. ini [ttwind] Driver =/app/timesten/TimesTen/ttwind/lib/libtten. soDataStore =/app/timesten/TimesTen/ttwind/info/datastore/ttwindPermSize = 40 TempSize = 32 PLSQL = 1 DatabaseCharacterSet = temperature = orclmkdir-p/app/timesten/TimesTen/ ttwind/info/datastore/ttwindchmod-R 770/app/timesten/TimesTen/ttwind/info/datastore/ttwind ttIsql ttwind -- Step 1: cache Management user create user cacheuser identified by cacheuser; grant create session, CACHE_MANAGER, create any table, drop any table to cacheuser; -- Step 2: cache USER create user scott identified by tiger; grant create session, adminto scott; -- Step 3: Associate the oracle cache Management User with timesten and set the username and password for the oracle connection, the cache agent will use this user name and password to read call ttcacheuidpwdset ('cacheuser', 'cacheuser') from oracle; -- Step 4: Create cache grid $ ttIsql "DSN = ttwind; UID = cacheuser; PWD = cacheuser; OraclePWD = cacheuser "Command> call ttGridCreate ('mygrid'); -- Step 5: associate the cache database with the cache grid to set the current grid to the newly created myGridCommand> call ttGridNameSet ('mygrid'); -- Step 6: Test autocommit 0; set passthrough 2; select * from v $ version; select table_name from user_tables where table_name like '% MYGRID %'; set passthrough 0; -- Step 7: test the read-only cache set $ ttIsql "DSN = ttwind; UID = cacheuser; PWD = cacheuser; OraclePWD = cacheuser "ttIsql" DSN = ttwind; UID = cacheuser; PWD = cacheuser; OraclePWD = cacheuser; Signature = orcl "call ttCacheStart; call ttCacheStop; drop Cache Group Cachtest; create readonly cache group cachtestautorefresh interval 5 secondsmode incrementalfrom scott. t1 (sid int not null primary key, sname varchar2 (10); view all user tables under the user sqltables; view all Cachecachegroups under the user; -- delete cache groupddrop Cache Group Cachtest; -- load the load cache group cachtest commit every 10 rows; **************************************** * ******************************** 5. timesten quickly loads tables and data in the oracle database ******************************* **************************************** * ttisql "DSN = ttwind; UID = cacheuser; PWD = cacheuser; "ttIsql" DSN = ttwind; UID = cacheuser; PWD = cacheuser; OraclePWD = cacheuser; OracleNetServiceName = orcl "ttIsql" DSN = ttwind; UID = cacheuser; PWD = cacheuser; OraclePWD = cacheuser; OracleId = ORCL "autocommit 0; set passthrough 2; -- generate the table structure call ttTableSchemaFromOraQueryGet ('Scott ', 'emp ', 'select * FROM scott. emp '); -- CALL ttLoadFromOracle ('Scott', 'emp', 'select * FROM scott. emp '); create table "SCOTT ". "EMP" ("EMPNO" number () not null, "ENAME" varchar2 (10 byte), "JOB" varchar2 (9 byte), "MGR" number ), "HIREDATE" date, "SAL" number (7,2), "COMM" number (7,2), "DEPTNO" number (2,0)> create readonly cache group cacheuser. empautorefresh interval 5 seconds mode incrementalfrom scott. t1 (sid int not null primary key, sname varchar2 (10 ));