Tuesday, November 29, 2022

How to get the count of records in all tables of the database group by based on one single column using a single query approach.(Applicable to sql server)

 


Tried to write multiple queries into a single query with joins but none worked so ended up with below approach


SELECT 'select count(*), tenant_uuid from ' + TABLE_NAME + ' group by tenant_uuid' from (select TABLE_NAME from INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME='tenant_uuid') ab


Also one analysis about row count :


Only one query which gives the correct row count of all tables  out of many available in the net in case of SQL server is below one:


SELECT Top 4 sysobjects.[name], max(sysindexes.[rows]) AS TableRows 

  FROM sysindexes INNER JOIN sysobjects ON sysindexes.[id] = sysobjects.[id] 

WHERE sysobjects.xtype = 'U' 

GROUP BY sysobjects.[name] 

ORDER BY max(rows) DESC


Tried with cursor but it is giving some other error as pasted below


declare cnt_tables cursor fast_forward for

SELECT  tab.name AS 'Table_Name',col.name as 'column_name'

FROM sys.columns col

JOIN sys.tables  tab  ON col.object_id = tab.object_id

WHERE col.name = 'tenant_uuid' 

ORDER BY Table_Name


--select table_name from information_schema.tables

open cnt_tables

declare @tablename varchar(255)

declare @columnname varchar(255)

declare @stmt nvarchar(2000)

declare @rowcount int

fetch next from cnt_tables into @tablename,@columnname


while @@fetch_status = 0

begin

select @stmt = 'select @rowcount = count(*),tenant_uuid' + 'from ' + @tablename group by + @columnname

exec sp_executesql @stmt, N'@rowcount int output', @rowcount=@rowcount OUTPUT

print N'table: ' + @tablename + ' has ' + convert(nvarchar(1000),@rowcount) + ' rows'

fetch next from cnt_tables into @tablename

end

close cnt_tables

deallocate cnt_tables




Each GROUP BY expression must contain at least one column that is not an outer reference.



Monday, November 21, 2022

How to generate alter index rebuild statement for all index based on fragmentation index in SQL server DB

 SELECT + 'ALTER INDEX ' + Indexname + '  ON ' + TABLENAME + ' REBUILD WITH (ONLINE = ON)' from  (SELECT S.name as 'Schema', T.name as 'Tablename', I.name as 'Indexname', DDIPS.avg_fragmentation_in_percent, DDIPS.page_count FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) AS DDIPS INNER JOIN sys.tables T on T.object_id = DDIPS.object_id INNER JOIN sys.schemas S on T.schema_id = S.schema_id INNER JOIN sys.indexes I ON I.object_id = DDIPS.object_id AND DDIPS.index_id = I.index_id WHERE DDIPS.database_id = DB_ID() and I.name is not null AND DDIPS.avg_fragmentation_in_percent > 0 ) AB

Thursday, July 21, 2022

How to resolve constraint issues like ALTER TABLE statement conflicted with the FOREIGN KEY constraint

Applicable for SQL server only:


Resolve constraint violation error: 

To invalidate or disable all the constraint execute against SSMS


EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT ALL";


Check if constraint are  enabled  or not


Select 

    Schema_name(Schema_id) as SchemaName,

    object_name(Parent_object_id) as TableName,

    name as ForeignKeyConstraintName,

    Case When Is_disabled=1 Then 'No'

    ELSE 'Yes' End as IsEnabled

    from sys.foreign_keys


Validate the constraint:


EXEC sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT ALL";

It will fail

The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_PAR_CRON_TRIGGERS_CHL_CRON_TRIGGERS".

The conflict occurred in database "demo06947", table "dbo.CHL_CRON_TRIGGERS".


delete the record: 


select SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP from dbo.CHL_CRON_TRIGGERS a

where TRIGGER_NAME NOT IN(select TRIGGER_NAME from dbo.PAR_CRON_TRIGGERS)


Create backup table before deletion


select SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP INTO [demo06947].dbo.temp_constraint_CRON_TRIGGERS

from dbo.CHL_CRON_TRIGGERS a where TRIGGER_NAME NOT IN(select TRIGGER_NAME from dbo.PAR_CRON_TRIGGERS)

Some SQL server useful views:

select containment,containment_desc,is_in_standby,state_desc from sys.databases



Thursday, June 10, 2021

How to filter data based on difference of two date Column when date or timestamp values are given in Traditional Chinese format.(in Oracle)

 Some of the Chinese Date format that should be inside the column where we do the filtering.


select sysdate from dual


10-6月 -2021 is 10th of June 2021


22-10月 -20


24-9月 -20 02.42.58.000000000 上午


453642 07-12月-20 06.54.59.000000000 上午 07-12月-20 06.58.00.000000000 上午


We can filter based on the below SQL:


---One way is to convert the Traditional Chinese date to English calender date and compare.


select * from USER_DET_TABLES where  Start_Datetime between to_date('22-OCT-20','DD-MON-YY', 'NLS_DATE_LANGUAGE = ''American'' ') and to_date('25-FEB-21','DD-MON-YY', 'NLS_DATE_LANGUAGE = ''American'' ')



--Other way is to directly pass the Traditional Chinese date in To_Date() and use NLS_DATE_LANGUAGE


select * from jobstatus_users_tab where  Start_Datetime between to_date('22-10月 -20','DD-MON-YY', 'NLS_DATE_LANGUAGE = ''Traditional Chinese'' ') and to_date('24-2月 -21','DD-MON-YY', 'NLS_DATE_LANGUAGE = ''Traditional Chinese'' ')


==


Specifying NLS Parameters in SQL Functions and Valid Use case of NLS parameters in SQL functions in Oracle


NLS parameters are specified in SQL functions as 'parameter = value'. For example:


'NLS_DATE_LANGUAGE = AMERICAN'


The following NLS parameters can be specified in SQL functions:



NLS_DATE_LANGUAGE

NLS_NUMERIC_CHARACTERS

NLS_CURRENCY

NLS_ISO_CURRENCY

NLS_DUAL_CURRENCY

NLS_CALENDAR

NLS_SORT

Table: SQL Functions and Their Valid NLS Parameters shows which NLS parameters are valid for specific SQL functions.


SQL Functions and Their Valid NLS Parameters


SQL Function Valid NLS Parameters

TO_DATE              NLS_DATE_LANGUAGE, NLS_CALENDAR


TO_NUMBER      NLS_NUMERIC_CHARACTERS, NLS_CURRENCY, NLS_DUAL_CURRENCY, NLS_ISO_CURRENCY,


TO_CHAR         NLS_DATE_LANGUAGE, NLS_NUMERIC_CHARACTERS, NLS_CURRENCY, NLS_ISO_CURRENCY, NLS_DUAL_CURRENCY, NLS_CALENDAR


TO_NCHAR         NLS_DATE_LANGUAGE, NLS_NUMERIC_CHARACTERS, NLS_CURRENCY, NLS_ISO_CURRENCY, NLS_DUAL_CURRENCY, NLS_CALENDAR


NLS_UPPER              NLS_SORT


NLS_LOWER                  NLS_SORT


NLS_INITCAP                 NLS_SORT


NLSSORT                          NLS_SORT


========




Tuesday, March 23, 2021

How to resolve issues while importing a DACPAC file during cloud migration which fails with kind of error Error SQL72014: or Error SQL72045: below:

 Many of the cloud migration issues are related to dacpac import for SQL server DB be it in Azure or AWS.


Below is one of them


*** Could not deploy package.

Error SQL72014: Core Microsoft SqlClient Data Provider: Msg 15007, Level 16, State 1, Line 1 'XYZReporting' is not a valid login or you do not have permission.

Error SQL72045: Script execution error.  The executed script:

CREATE USER [XYZReporting] FOR LOGIN [XYZReporting];


Just import the data with excluding the objects using the below switch:


PS C:\Program Files\Microsoft SQL Server\140\DAC\bin> .\sqlpackage /a:Publish /sf:C:\temp\db_test.dacpac /tsn:abxyz.cvvulhyblrdi.us-west-2.rds.amazonaws.com /tdn:demofin /tu:admin /tp:******  /p:ExcludeObjectTypes='Users;Logins;DatabaseRoles;RoleMembership;ServerRoleMembership;ServerRoles'

Wednesday, January 1, 2020

How to resolve ORA-12516 TNS:listener could not find available handler with matching protocol stack?

We see the error related to Listener refused the connection with following other error message as below:

ORA-12516,TNS:listener could not find available handler with matching protocol stack.
or 
Status:Failure -Test failed:IO Error: Got minus one from read call.

Usually we face the above error when number of process is not sufficient in the initialization parameter file to create additional connections.

Resolution:

Check the current process limit in V$parameter view

Connect to the correct DB or PDB if you are running 12c or above if it is a pluggable DB;

1. Alter system set processes=<new limit> scope=spfile;

2. Bounce the DB or PDB.

3. Restart the listener services.

Tuesday, December 17, 2019

How to resolve ORA-38824: A CREATE OR REPLACE command may not change the EDITIONABLE property of an existing object.

From Oracle version 12c onwards: -

Initially It seems the problem is related to Editioning feature of the object in the db is not enable or the schema user is not created with edition enable.
However it could be a related to container and non container DB.
This issue will not come where CDB=NO
In those cases where CDB=YES it will come and seems to be a bug.

Just Check:

SQL> select name,dbid,con_dbid,cdb,con_id from v$database;


NAME            DBID   CON_DBID CDB     CON_ID
--------- ---------- ---------- --- ----------
CDB1      1000678150 1000358150 YES          0


If CDB is yes means its a container DB and installer will fail.

 SQL> select name,dbid,con_dbid,cdb,con_id from v$database;

 NAME            DBID   CON_DBID CDB     CON_ID
--------- ---------- ---------- --- ----------
ORCLXYZ  74410566 2774410566 NO           0


If CDB is NO issue will not come.

How to resolve ORA-01400: cannot insert NULL into ("ABUSER"."DOMAINS"."ID")

How to resolve ORA-01400: cannot insert NULL into ("ABUSER"."DOMAINS"."ID")
[Failed SQL: INSERT INTO ABUSER.Domains (Name, RowVersion) VALUES ('Default Domain', '1')]

If this issue is coming before Oracle 12c(11g) then it could be an issue with the sequence.
Try to create the sequnce on the right column.

Post or from Oracle 12c first check the alert log,it will throw an exception of creating temp tablespace size.
Unable to extend temp tablespace...
Initially It seems the problem is related to Domain index.
However it could be a related to container and non container DB.
This issue will not come where CDB=NO
In those cases where CDB=YES it will come and seems to be a bug.

Just Check:

SQL> select name,dbid,con_dbid,cdb,con_id from v$database;


NAME            DBID   CON_DBID CDB     CON_ID
--------- ---------- ---------- --- ----------
CDB1      1000678150 1000358150 YES          0


If CDB is yes means its a container DB and installer will fail.

 SQL> select name,dbid,con_dbid,cdb,con_id from v$database;

 NAME            DBID   CON_DBID CDB     CON_ID
--------- ---------- ---------- --- ----------
ORCLXYZ  74410566 2774410566 NO           0


If CDB is NO issue will not come.


Friday, August 23, 2019

ERROR in alert log: Shared memory area is accessible to instance startup process prior to instance startup operation

Applicable to Oracle DB  Release 12.1.0.2.0.

Developer when connecting to a PDB service through SQLdeveloper may see the error startup shutdown in progress after restart of the Database in Oracle 12c or afterwards.

Issue applicable if we don't save the state of the DB.

Usually from Oracle 12c if we don't save the state of a PDB database after the restart PDB may not come up to the same state.

In that case we may face this issue.

Resolution:

SQL> connect to the DB.


Connected.

Check the status of the PDBs.

SQL> select con_id, name, open_mode, total_size from v$pdbs;

    CON_ID NAME                           OPEN_MODE  TOTAL_SIZE
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY   838860800
         3 PDBCR                          MOUNTED             0

SQL> alter pluggable database PDB$SEED CLOSE IMMEDIATE;
alter pluggable database PDB$SEED CLOSE IMMEDIATE
                         *
ERROR at line 1:
ORA-65017: seed pluggable database may not be dropped or altered

Open the PDB database

SQL> alter pluggable database PDBCR open;

Pluggable database altered.

Again check the PDB status

SQL> select con_id, name, open_mode, total_size from v$pdbs;

    CON_ID NAME                           OPEN_MODE  TOTAL_SIZE
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY   838860800
         3 PDBCR                          READ WRITE 4229955584

Friday, December 14, 2018

How to read value from sys_refcursor variable

How to read value from sys_refcursor variable?

Developer often write functions which return type is sys_refcursor.

To directly read the value of the returned function we can use the below method:-

create or replace function TESTCALENDERDAYS return sys_refcursor is
rc sys_refcursor;
begin
open rc for select distinct ADD_MONTHS(SYSDATE, -365) as "day",
            COOL_id, COOL_name,MATION_id
            from QA.PQRS_STATS_VIEW
            union all
            select distinct ADD_MONTHS(SYSDATE, -365)+1 as "day",
            COOL_id, COOL_name,MATION_id
            from QA.PQRS_STATS_VIEW where ADD_MONTHS(SYSDATE, -365)+1 < sysdate;
return rc;
end;


create or replace function TESTCALENDERDAYS return sys_refcursor is
rc sys_refcursor;
begin
open rc for select distinct to_char(ADD_MONTHS(SYSDATE, -365)) as "day",COOL_id, COOL_name,MATION_id from TESTCALENDERDAYS_MV2
            union all
            select distinct to_char(ADD_MONTHS(SYSDATE, -365)+1) as "day",COOL_id, COOL_name,MATION_id
            from TESTCALENDERDAYS_MV2 where ADD_MONTHS(SYSDATE, -365)+1 < sysdate;
return rc;
end;

select to_date(day),COOL_ID,COOL_NAME,MATION_ID from (select * from xmltable('/ROWSET/ROW'
PASSING xmltype(TESTCALENDERDAYS())
columns
DAY date  PATH 'DAY',
COOL_ID PATH 'COOL_ID',
COOL_NAME PATH 'COOL_NAME',
MATION_ID PATH 'MATION_ID'
));

select * from  TESTCALENDERDAYS_MV2 from dual





select TESTF() from dual
select TESTCALENDERDAYS() from dual

select * from (select * from xmltable('/ROWSET/ROW'
PASSING xmltype(TESTF())
columns
ID  PATH 'ID',
COMPANY PATH 'COMPANY'
));

select * from TESTCALENDERDAYS_MV2

CREATE TABLE "SWARNASHIS"."TESTCALENDERDAYS_MV2" 
   ( "day" DATE, 
"COOL_ID" NUMBER(38,0), 
"COOL_NAME" NVARCHAR2(512), 
"MATION_ID" NUMBER(38,0)
   )
   tablespace users

insert into TESTCALENDERDAYS_MV2 values(sysdate-1,11,'ashisswarn',12);
insert into TESTCALENDERDAYS_MV2 values(sysdate-2,12,'ashisswarn',13);
insert into TESTCALENDERDAYS_MV2 values(sysdate-3,13,'ashisswarn',14);
insert into TESTCALENDERDAYS_MV2 values(sysdate-4,14,'ashisswarn',15);
insert into TESTCALENDERDAYS_MV2 values(sysdate-5,15,'ashisswarn',16);
insert into TESTCALENDERDAYS_MV2 values(sysdate-6,16,'ashisswarn',17);
insert into TESTCALENDERDAYS_MV2 values(sysdate-7,17,'ashisswarn',18);
insert into TESTCALENDERDAYS_MV2 values(sysdate-8,18,'ashisswarn',19);
insert into TESTCALENDERDAYS_MV2 values(sysdate-9,19,'ashisswarn',20);
insert into TESTCALENDERDAYS_MV2 values(sysdate-1,11,'ashisswarn',12);
insert into TESTCALENDERDAYS_MV2 values(sysdate-1,11,'ashisswarn',12);
insert into TESTCALENDERDAYS_MV2 values(sysdate-1,11,'ashisswarn',12);
insert into TESTCALENDERDAYS_MV2 values(sysdate-1,11,'ashisswarn',12);
insert into TESTCALENDERDAYS_MV2 values(sysdate-1,11,'ashisswarn',12);

commit


This works for fetching:

select extractvalue(column_value,'/ROW/day') day,
extractvalue(column_value,'/ROW/COOL_ID') COOL_id,
extractvalue(column_value,'/ROW/COOL_NAME') COOL_name,
extractvalue(column_value,'/ROW/MATION_ID') MATION_id
--     , extractvalue(column_value,'/ROW/LAST_NAME') last_name
from table(xmlsequence(TESTCALENDERDAYS()))

====

select day,COOL_id from (select extractvalue(column_value,'/ROW/day') day,
extractvalue(column_value,'/ROW/COOL_ID') COOL_id,
extractvalue(column_value,'/ROW/COOL_NAME') COOL_name,
extractvalue(column_value,'/ROW/MATION_ID') MATION_id
--     , extractvalue(column_value,'/ROW/LAST_NAME') last_name
from table(xmlsequence(TESTCALENDERDAYS()))) where COOL_id

Wednesday, September 26, 2018

How to find the list of unusable index on the full database:-

set pagesize 9000
set linesize 2000
set long 20000

select dbms_metadata.get_ddl('INDEX', index_name, owner)
from all_indexes
where owner in(SELECT OWNER from (select OWNER,INDEX_NAME,INDEX_TYPE,PARTITION_NAME,SUBPARTITION_NAME, STATUS from  (select OWNER,INDEX_NAME,INDEX_TYPE,NULL AS PARTITION_NAME,NULL AS SUBPARTITION_NAME, STATUS from dba_indexes where STATUS='UNUSABLE'
UNION ALL
select INDEX_OWNER,INDEX_NAME,NULL as INDEX_TYPE,PARTITION_NAME,NULL AS SUBPARTITION_NAME, STATUS from dba_ind_PARTITIONS where STATUS='UNUSABLE'
UNION ALL
select INDEX_OWNER,INDEX_NAME,NULL as INDEX_TYPE,NULL as PARTITION_NAME,SUBPARTITION_NAME,STATUS from dba_ind_SUBPARTITIONS where STATUS='UNUSABLE')))
AND INDEX_NAME IN(SELECT INDEX_NAME from (select OWNER,INDEX_NAME,INDEX_TYPE,PARTITION_NAME,SUBPARTITION_NAME, STATUS from  (select OWNER,INDEX_NAME,INDEX_TYPE,NULL AS PARTITION_NAME,NULL AS SUBPARTITION_NAME, STATUS from dba_indexes where STATUS='UNUSABLE'
UNION ALL
select INDEX_OWNER,INDEX_NAME,NULL as INDEX_TYPE,PARTITION_NAME,NULL AS SUBPARTITION_NAME, STATUS from dba_ind_PARTITIONS where STATUS='UNUSABLE'
UNION ALL
select INDEX_OWNER,INDEX_NAME,NULL as INDEX_TYPE,NULL as PARTITION_NAME,SUBPARTITION_NAME,STATUS from dba_ind_SUBPARTITIONS where STATUS='UNUSABLE')));

===============

Schema Wise

set pagesize 232
set linesize 232
set feedback off
set echo off
set verify off
select OWNER,INDEX_NAME,INDEX_TYPE,PARTITION_NAME,SUBPARTITION_NAME, STATUS from  (select OWNER,INDEX_NAME,INDEX_TYPE,NULL AS PARTITION_NAME,NULL AS SUBPARTITION_NAME, STATUS from dba_indexes where STATUS='UNUSABLE'
UNION ALL
select INDEX_OWNER,INDEX_NAME,NULL as INDEX_TYPE,PARTITION_NAME,NULL AS SUBPARTITION_NAME, STATUS from dba_ind_PARTITIONS where STATUS='UNUSABLE'
UNION ALL
select INDEX_OWNER,INDEX_NAME,NULL as INDEX_TYPE,NULL as PARTITION_NAME,SUBPARTITION_NAME,STATUS from dba_ind_SUBPARTITIONS where STATUS='UNUSABLE') where OWNER='&schema_name';
spool off


===============
Generating the unusable command:

[oracle@xxxx swarn]$ more 2.sql
spool /u01/oracle/swarn/unusable_cmd.sql
set pagesize 232
set linesize 232
set feedback off
set echo off
set verify off
set heading off
select 'alter index '||OWNER||'.'||index_name||' unusable; 'from (select OWNER, INDEX_NAME from  (select OWNER,INDEX_NAME,INDEX_TYPE,NULL AS PARTITION_NAME,NULL AS SUBPARTITION_NAME, STATUS from dba_indexes where STATUS='UNUSABLE'
UNION ALL
select INDEX_OWNER,INDEX_NAME,NULL as INDEX_TYPE,PARTITION_NAME,NULL AS SUBPARTITION_NAME, STATUS from dba_ind_PARTITIONS where STATUS='UNUSABLE'
UNION ALL
select INDEX_OWNER,INDEX_NAME,NULL as INDEX_TYPE,NULL as PARTITION_NAME,SUBPARTITION_NAME,STATUS from dba_ind_SUBPARTITIONS where STATUS='UNUSABLE'));
spool off
====================

Sunday, June 17, 2018

How to create Bigfile tablespace for EXADATA DB MACHINES and Other high end DW systems

How to create Bigfile tablespace for EXADATA DB MACHINES and Other high end DW systems?

Traditionally we use small file tablespace which can handle data upto a maxsize of 32GB.

However Big file tablespaces are required when we want to create tablespace with more than 32 GB size.

This is very help when we work on Oracle High end Advance Database machine like Exadata and also for various DataWarehouse systems.

CREATE BIGFILE TABLESPACE EDW_DATA_EQBS DATAFILE '+DATABIPRD' SIZE 512G AUTOEXTEND ON; -- done 


CREATE BIGFILE TABLESPACE EDW_DATA_FOUNDATION DATAFILE '+DATABIPRD' SIZE 512G AUTOEXTEND ON;


CREATE BIGFILE TABLESPACE EDW_DATA_DRE DATAFILE '+DATABIPRD' SIZE 512G AUTOEXTEND ON;


CREATE BIGFILE TABLESPACE EDW_METADATA_TOOLS DATAFILE '+DATABIPRD' SIZE 128G AUTOEXTEND ON;




CREATE BIGFILE TEMPORARY TABLESPACE TEMP TEMPFILE '+DATABIPRD' SIZE 256G AUTOEXTEND ON;


CREATE BIGFILE TEMPORARY TABLESPACE TEMP1 TEMPFILE '+DATABIPRD' SIZE 256G AUTOEXTEND ON;


CREATE BIGFILE TEMPORARY TABLESPACE TEMP2 TEMPFILE '+DATABIPRD' SIZE 256G AUTOEXTEND ON;


CREATE BIGFILE TEMPORARY TABLESPACE TEMP3 TEMPFILE '+DATABIPRD' SIZE 256G AUTOEXTEND ON;


CREATE BIGFILE TEMPORARY TABLESPACE TEMP4 TEMPFILE '+DATABIPRD' SIZE 256G AUTOEXTEND ON;



ALTER TABLESPACE EDW_METADATA_TOOLS AUTOEXTEND ON NEXT 8G MAXSIZE 512G;

ALTER TABLESPACE EDW_DATA_EQBS AUTOEXTEND ON NEXT 8G MAXSIZE 1024G;

ALTER TABLESPACE EDW_DATA_FOUNDATION AUTOEXTEND ON NEXT 8G MAXSIZE 1024G;

ALTER TABLESPACE EDW_DATA_DRE AUTOEXTEND ON NEXT 8G MAXSIZE 1024G;



ALTER TABLESPACE TEMP AUTOEXTEND ON NEXT 8G MAXSIZE 512G;

ALTER TABLESPACE TEMP1 AUTOEXTEND ON NEXT 8G MAXSIZE 512G;

ALTER TABLESPACE TEMP2 AUTOEXTEND ON NEXT 8G MAXSIZE 512G;

ALTER TABLESPACE TEMP3 AUTOEXTEND ON NEXT 8G MAXSIZE 512G;

ALTER TABLESPACE TEMP4 AUTOEXTEND ON NEXT 8G MAXSIZE 512G;

Monday, June 11, 2018

How to work in Timesten Database

How to work in Times ten=>

[oracle@bbmpde01 info]$ vi sys.odbc.ini
[oracle@bbmpde01 info]$ cd bin
bash: cd: bin: No such file or directory
[oracle@bbmpde01 info]$ cd ../bin
[oracle@bbmpde01 bin]$ ./ttisql

Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.


Command> connect "DSN=cachedb1_1122";
12701: DatabaseCharacterSet attribute required for data store creation. Refer to the TimesTen documentation for information on selecting a character set.
The command failed.
Command> exit
Done.
[oracle@bbmpde01 bin]$ cd ..
[oracle@bbmpde01 tt1122]$ cd info/
[oracle@bbmpde01 info]$ ls
cluster.oracle.ini  DemoDataStore  snmp.ini  sys.odbc.ini  sys.ttconnect.ini  timestend.pid  ttcacheadvisor  ttendaemon.options  tterrors.log  ttmesg.log
[oracle@bbmpde01 info]$ vi sys.odbc.ini
[oracle@bbmpde01 info]$ cd ../bin
[oracle@bbmpde01 bin]$ ./ttisql

Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.


Command> connect "DSN=cachedb1_1122";
15105: User CACHEADM requesting database creation is not the instance administrator.  Please verify user id and password. Only the instance administrator can create a database.
The command failed.
Command>
Command> exit
Done.
[oracle@bbmpde01 bin]$ id
uid=1101(oracle) gid=54321(oinstall) groups=54321(oinstall),1000(oracle),54322(dba)
[oracle@bbmpde01 bin]$ cd ..
[oracle@bbmpde01 tt1122]$ ls
3rdparty  bin  doc  include  info  lib  mibs  network  nls  oraclescripts  PERL  plsql  quickstart  quickstart.html  README.html  startup  support  ttcacheadv  ttclasses  ttoracle_home  welcome.html
[oracle@bbmpde01 tt1122]$ cd info/
[oracle@bbmpde01 info]$ ls
cluster.oracle.ini  DemoDataStore  snmp.ini  sys.odbc.ini  sys.ttconnect.ini  timestend.pid  ttcacheadvisor  ttendaemon.options  tterrors.log  ttmesg.log
[oracle@bbmpde01 info]$ more sys.odbc.ini
# Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.

#########################################################################
#
# The following are the default values for connection attributes.
# In the Data Sources defined below, if the attribute is not explicitly
# set in its entry, TimesTen 11.2.2 uses the defaults as
# specified below.  For more information on these connection attributes,
# see the accompanying documentation.
#
# Lines in this file beginning with # or ; are treated as comments.
# In _attribute_=_value_ lines, the _value_ consists of everything
# after the = to the end of the line, with leading and trailing white
# space removed.
#
#########################################################################
#
#    ** attribute **           ** default **
#
# Data store attributes
#       DataStore                 (no default)
#       DatabaseCharacterSet      (no default)
#       Description               (no default)
#       Driver                    (no default)
#       LogDir                    (Directory containing db transaction log
#                                  files)
#       Preallocate               (0 - do not preallocate disk space for the
#                                  datastore should be preallocated )
#       RangeIndexType            (1 - Range indexes are T-tree indexes)
#       ReplicationApplyOrdering  (0 - automatic parallel replication)
#       ReplicationParallelism    (1)
#       Temporary                 (0 - do not create a permanent datastore)
#       TypeMode                  (0 - Oracle types)
#
# First connection attributes
#       AutoCreate                (1)
#       CkptFrequency             (600)
#       CkptLogVolume             (0 - off)
#       CkptRate                  (0 - rate not limited)
#       Connections               (The lesser of 2000 or the number of
#                                  semaphores specified in the SEMMSL kernel
#                                  parameter)
#       ForceConnect              (0 - connection disallowed)
#       LogAutoTruncate           (1 - continue after log is truncated)
#       LogBufMB                  (64 - measured in MB)
#       LogBufParallelism         (4)
#       LogFileSize               (64 - measured in MB )
#       LogFlushMethod            (1 - Write data to transaction log files
#                                  using buffered writes.  Use explicit sync
#                                  operations as needed to sync log data to
#                                  disk)
#       LogPurge                  (1 - remove unneeded transaction log files)
#       MemoryLock                (0 - Linux, Solaris and Windows 64-bit
#                                  platforms only)
#       Overwrite                 (0 - do not overwrite the existing datastore)
#       PermSize                  (32 - measured in MB)
#       ReceiverThreads           (1)
#       RecoveryThreads           (1 - the number of threads used to rebuild
#                                  indexes during recovery)
#       CkptReadThreads           (1 - the number of threads used to read
#                                  checkpoint files at startup)
#       TempSize                  (default is derived from PermSize - measured
#                                  in MB)
#
#
# General connection attributes
#       CommitBufferSizeMax       (16 - measured in KB)
#       ConnectionName            (process argv[0])
#       DDLCommitBehavior         (0 - Oracle-style DDL commits)
#       DDLReplicationAction      (INCLUDE)
#       DDLReplicationLevel       (2 - Replication of objects enabled)
#       Diagnostics               (1 - generate base level diagnostics )
#       DuplicateBindMode         (0 - Oracle-style binding)
#       DurableCommits            (0 - do not force log to disk on transaction
#                                  commits)
#       Isolation                 (1 - read-committed)
#       LockLevel                 (0 - row-level locking)
#       LockWait                  (10 seconds)
#       MatchLogOpts              (0 - Values of Logging & LogPurge are not
#                                  ignored)
#       PermWarnThreshold         (90 - pecentage at which warnings should be
#                                  issued)
#       PrivateCommands           (0 - share commands between connections)
#       PWD                       (no default)
#       PWDCrypt                  (no default)
#       QueryThreshold            (0 - do not return an error nor throw an SNMP
#                                  trap if the query times out before executing)
#       ReplicationTrack          (no default)
#       SQLQueryTimeout           (0 - time limit in seconds for executing SQL
#                                  queries)
#       TempWarnThreshold         (90 - percentage at which out-of-memory
#                                  warnings should be issued)
#       UID                       (operating system user ID)
#       WaitForConnect            (1 - wait until connection to the datastore
#                                  is possible)
#
#
# NLS general connection attributes
#       ConnectionCharacterSet    (if DatabaseCharacterSet == TIMESTEN8
#                                  then TIMESTEN8 else US7ASCII)
#       NLS_LENGTH_SEMANTICS      (BYTE - default length semantic configuration)
#       NLS_NCHAR_CONV_EXCP       (0 - do not report data loss for data
#                                  conversion between NCHAR/NVARCHAR data and
#                                  CHAR/VARCHAR data)
#       NLS_SORT                  (BINARY - the collating sequence to use for
#                                  linguistic comparisons)
#
#
# PL/SQL first connection attibutes
#       PLSQL                     (default is installation dependent.  If
#                                  enabled at install time, default is 1)
#
#    The following Attributes are significant only when PLSQL=1
#       PLSQL_MEMORY_ADDRESS      (platform specific default; value is entered
#                                 as Hex: 20000000 means 0x20000000)
#       PLSQL_MEMORY_SIZE         (32 - measured in MB)
#
#
# PL/SQL general connection attibutes
#    The following Attributes are significant only when PLSQL=1
#       PLSQL_OPTIMIZE_LEVEL      (2)
#       PLSQL_CCFLAGS             (default is "")
#       PLSQL_CONN_MEM_LIMIT      (100 - measured in MB)
#       PLSCOPE_SETTINGS          (IDENTIFIERS:NONE)
#       PLSQL_TIMEOUT             (30 - measured in seconds)
#
#
# Oracle TimesTen Application-Tier Database Cache first connection attributes
#       CacheAWTMethod            (1 - plsql)
#
#
# Oracle TimesTen Application-Tier Database Cache database attributes
#       CacheAWTParallelism       (1 - no parallelism)
#       CacheGridEnable           (1 - All cache groups in the data store are
#                                  defined as members of a cache grid)
#       CacheGridMsgWait          (60 - seconds to wait for a cache grid
#                                  message from a remote member)
#
#
# Oracle TimesTen Application-Tier Database Cache database attributes
#       DynamicLoadEnable         (1 - Enable dynamic load of Oracle data to
#                                  dynamic cache groups for the current
#                                  connection)
#       DynamicLoadErrorMode      (0 - do not return an error on a transparent
#                                  dynamic load behavior)
#       OracleNetServiceName      (no default)
#       OraclePWD                 (no default)
#       PassThrough               (0 - SQL not passed through to Oracle)
#       RACCallback               (1 - Install the TAF and FAN callbacks)
#
#
# TimesTen Client connection attributes
#       TCP_Port                  (no default)
#       TCP_Port2                 (no default)
#       TTC_FailoverPortRange     (no default)
#       TTC_Server                (no default)
#       TTC_Server2               (no default)
#       TTC_Server_DSN            (no default)
#       TTC_Server_DSN2           (no default)
#       TTC_Timeout               (60 - seconds the client waits for a
#                                  connection)
#
#
# TimesTen Server connection attributes
#       MaxConnsPerServer         (1)
#       ServersPerDSN             (1)
#       ServerStackSize           (128 on 32-bit systems, 256 on 64-bit systems,
#                                  measured in MB)
#
#########################################################################


[ODBC Data Sources]
TT_1122=TimesTen 11.2.2 Driver
sampledb_1122=TimesTen 11.2.2 Driver
cachedb1_1122=TimesTen 11.2.2 Driver
repdb1_1122=TimesTen 11.2.2 Driver
repdb2_1122=TimesTen 11.2.2 Driver
sampledbCS_1122=TimesTen 11.2.2 Client Driver
cachedb1CS_1122=TimesTen 11.2.2 Client Driver
repdb1CS_1122=TimesTen 11.2.2 Client Driver
repdb2CS_1122=TimesTen 11.2.2 Client Driver

#####################################################################
# Instance-Specific System Database
#
# A predefined instance-specific database reserved for system use.
# It provides a well-known database for use when a connection
# is required to execute commands.
#
#####################################################################

[TT_1122]
Driver=/u01/oracle/products/timesten/TimesTen/tt1122/lib/libtten.so
DataStore=/u01/oracle/products/timesten/TimesTen/tt1122/info/TT_1122
DatabaseCharacterSet=US7ASCII

#####################################################################
# Data source for Sample programs
#
# This database is used by the Quick Start sample programs.
# The sample database (sampledb) must be created prior to
# running the sample programs. The PermSize and TempSize attributes
# can be adjusted depending on the options used in running the
# sample benchmark programs.
#
#####################################################################

[sampledb_1122]
Driver=/u01/oracle/products/timesten/TimesTen/tt1122/lib/libtten.so
DataStore=/u01/oracle/products/timesten/TimesTen/tt1122/info/DemoDataStore/sampledb_1122
PermSize=40
TempSize=32
PLSQL=1
DatabaseCharacterSet=US7ASCII

#####################################################################
# Sample Data source for Quick Start Oracle TimesTen Application-Tier Database Cache tutorial
#
# This database is used by the Quick Start Oracle TimesTen Application-Tier Database Cache tutorial.
# Before using the cachedb1 DSN, uncomment both the
# DatabaseCharacterSet and OracleNetServiceName attributes and insert
# the appropriate values for the database character set of your
# Oracle database and the TNS service name for your Oracle database
#####################################################################

[cachedb1_112]
Driver=/u01/oracle/products/timesten/TimesTen/tt1122/lib/libtten.so
DataStore=/u01/oracle/products/timesten/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122
PermSize=40
TempSize=32
PLSQL=1
#DatabaseCharacterSet=AL32UTF8
#OracleNetServiceName=MyOrclDB

#####################################################################
# Sample Data source for Quick Start Replication tutorial
#
# This database is used by the Quick Start Active Standby tutorial
#####################################################################

[repdb1_1122]
Driver=/u01/oracle/products/timesten/TimesTen/tt1122/lib/libtten.so
DataStore=/u01/oracle/products/timesten/TimesTen/tt1122/info/DemoDataStore/repdb1_1122
PermSize=40
TempSize=32
PLSQL=1
DatabaseCharacterSet=AL32UTF8

#####################################################################
# Sample Data source for Quick Start Replication tutorial
#
# This database is used by the Quick Start Active Standby tutorial
#####################################################################

[repdb2_1122]
Driver=/u01/oracle/products/timesten/TimesTen/tt1122/lib/libtten.so
DataStore=/u01/oracle/products/timesten/TimesTen/tt1122/info/DemoDataStore/repdb2_1122
PermSize=40
TempSize=32
PLSQL=1
DatabaseCharacterSet=AL32UTF8


#####################################################################
#
# New data source definitions can be added below.
#
#####################################################################

[cachedb1_1122]
Driver=/u01/oracle/products/TimesTen/tt1122/lib/libtten.so
DataStore=/u01/oracle/products/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122
PermSize=40
TempSize=32
PLSQL=1
UID=cacheadm
PWD=...................
OraclePWD=...........cacheadm
DatabaseCharacterSet=AL32UTF8
OracleNetServiceName=OFSDB


########################################################################
# This following sample definitions should be in the .odbc.ini file
# that is used for the TimesTen 11.2.2 Client.
# The Server Name is set in the TTC_SERVER attribute.
# The Server DSN is set in the TTC_SERVER_DSN attribute.
#########################################################################


[sampledbCS_1122]
TTC_SERVER=ttLocalHost_tt1122
TTC_SERVER_DSN=sampledb_1122

[cachedb1CS_1122]
TTC_SERVER=ttLocalHost_tt1122
TTC_SERVER_DSN=cachedb1_1122

[repdb1CS_1122]
TTC_SERVER=ttLocalHost_tt1122
TTC_SERVER_DSN=repdb1_1122

[repdb2CS_1122]
TTC_SERVER=ttLocalHost_tt1122
TTC_SERVER_DSN=repdb2_1122

[oracle@bbmpde01 info]$
[oracle@bbmpde01 info]$
[oracle@bbmpde01 info]$ cd ../bin
[oracle@bbmpde01 bin]$ pwd
/u01/oracle/products/timesten/TimesTen/tt1122/bin
[oracle@bbmpde01 bin]$ ./ttisql

Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.


Command> connect "DSN=sampledb_1122";
Connection successful: DSN=sampledb_1122;UID=oracle;DataStore=/u01/oracle/products/timesten/TimesTen/tt1122/info/DemoDataStore/sampledb_1122;DatabaseCharacterSet=US7ASCII;ConnectionCharacterSet=US7ASCII;DRIVER=/u01/oracle/products/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=40;TempSize=32;TypeMode=0;
(Default setting AutoCommit=1)
Command> exit
Disconnecting...
Done.
[oracle@bbmpde01 bin]$ cd ../info/
[oracle@bbmpde01 info]$ ls
cluster.oracle.ini  DBI5ac22dcf.0  DemoDataStore  snmp.ini  sys.odbc.ini  sys.ttconnect.ini  timestend.pid  ttcacheadvisor  ttendaemon.options  tterrors.log  ttmesg.log
[oracle@bbmpde01 info]$ vi sys.odbc.ini
[oracle@bbmpde01 info]$ cd bin
bash: cd: bin: No such file or directory
[oracle@bbmpde01 info]$ cd ../bin
[oracle@bbmpde01 bin]$ ./ttisql

Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.


Command> connect "DSN=cachedb1_1122";
  830: Cannot create data store file. OS-detected error: No such file or directory
The command failed.
Command> exit
Done.
[oracle@bbmpde01 bin]$ cd ../info/
[oracle@bbmpde01 info]$ vi sys.odbc.ini
[oracle@bbmpde01 info]$ cd ../bin
[oracle@bbmpde01 bin]$ ./ttisql

Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.


Command> connect "DSN=cachedb1_1122";
Connection successful: DSN=cachedb1_1122;UID=oracle;DataStore=/u01/oracle/products/timesten/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;DRIVER=/u01/oracle/products/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=40;TempSize=32;TypeMode=0;OracleNetServiceName=OFSDB;
(Default setting AutoCommit=1)
Command> CREATE USER testuser IDENTIFIED BY mypsswrd;

User created.

Command> drop user testuser;

User dropped.

Command> CREATE USER cacheadm IDENTIFIED BY cacheadm;

User created.

Command> GRANT ADMIN, DDL TO cacheadm
       > ;
15111: Invalid privilege: DDL.  Roles are not supported.
The command failed.
Command> GRANT ADMIN to cacheadm;
Command>
Command>
Command>
Command>
Command>
Command> connect "DSN=cachedb1_1122";
Connection successful: DSN=cachedb1_1122;UID=oracle;DataStore=/u01/oracle/products/timesten/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;DRIVER=/u01/oracle/products/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=40;TempSize=32;TypeMode=0;OracleNetServiceName=OFSDB;
(Default setting AutoCommit=1)
con1: Command> GRANT ADMIN to cacheadm;
15140: GRANT failed: User CACHEADM already has system privilege ADMIN
The command failed.
con1: Command>
con1: Command>
con1: Command>
con1: Command> connect cacheadm
             > ;
S1000: Error opening ODBCINI file /var/TimesTen/sys.odbc.ini: Permission denied
The command failed.
none: Command> exit
Disconnecting from cachedb1_1122...
Disconnecting from con1...
Done.
[oracle@bbmpde01 bin]$ cd /var/
[oracle@bbmpde01 var]$ ls
account  cache  crash  cvs  db  empty  games  lib  local  lock  log  mail  mpi-selector  nis  opt  preserve  run  spool  TimesTen  tmp  www  yp
[oracle@bbmpde01 var]$ cd TimesTen/
bash: cd: TimesTen/: Permission denied
[oracle@bbmpde01 var]$ ls
account  cache  crash  cvs  db  empty  games  lib  local  lock  log  mail  mpi-selector  nis  opt  preserve  run  spool  TimesTen  tmp  www  yp
[oracle@bbmpde01 var]$ ls -lrt
total 84
drwxr-xr-x.  2 root root 4096 Nov  1  2011 preserve
drwxr-xr-x.  2 root root 4096 Nov  1  2011 opt
drwxr-xr-x.  2 root root 4096 Nov  1  2011 nis
drwxr-xr-x.  2 root root 4096 Nov  1  2011 local
drwxr-xr-x.  2 root root 4096 Nov  1  2011 games
drwxr-xr-x.  2 root root 4096 Oct 11  2013 cvs
lrwxrwxrwx.  1 root root   10 Feb 20  2014 mail -> spool/mail
drwxr-xr-x.  3 root root 4096 Feb 20  2014 empty
drwxr-xr-x.  2 root root 4096 Feb 20  2014 account
drwxr-xr-x.  3 root root 4096 Jul 23  2014 yp
drwxr-xr-x. 17 root root 4096 Jul 23  2014 cache
drwxr-xr-x.  4 root root 4096 Jul 23  2014 db
drwxr-xr-x   3 root root 4096 Jul 23  2014 mpi-selector
drwxr-xr-x.  2 root root 4096 Sep 30  2014 crash
drwxr-xr-x   7 root root 4096 Aug 24  2015 www
drwxr-xr-x. 14 root root 4096 May  4  2017 spool
drwxr-xr-x. 39 root root 4096 May  8  2017 lib
drwxr-xr-x. 31 root root 4096 Feb  2 10:58 run
drwxr-x---   3 root root 4096 Mar  6 11:04 TimesTen
drwxr-xr-x. 15 root root 4096 Apr  1 03:11 log
drwxrwxr-x.  5 root lock 4096 Apr  2 03:48 lock
drwxrwxrwt.  3 root root 4096 Apr  2 10:26 tmp
[oracle@bbmpde01 var]$ date
Mon Apr  2 16:38:44 EAT 2018
[oracle@bbmpde01 var]$ pwd
/var
[oracle@bbmpde01 var]$ more /var/TimesTen/sys.odbc.ini
/var/TimesTen/sys.odbc.ini: Permission denied
[oracle@bbmpde01 var]$
[oracle@bbmpde01 var]$
[oracle@bbmpde01 var]$ exit
exit
[Dbhavsar@bbmpde01 etc]$ sudo su - root
[sudo] password for vvvvvsar:
[root@bbmpde01 ~]# cd /var
[root@bbmpde01 var]# ls -lrt
total 84
drwxr-xr-x.  2 root root 4096 Nov  1  2011 preserve
drwxr-xr-x.  2 root root 4096 Nov  1  2011 opt
drwxr-xr-x.  2 root root 4096 Nov  1  2011 nis
drwxr-xr-x.  2 root root 4096 Nov  1  2011 local
drwxr-xr-x.  2 root root 4096 Nov  1  2011 games
drwxr-xr-x.  2 root root 4096 Oct 11  2013 cvs
lrwxrwxrwx.  1 root root   10 Feb 20  2014 mail -> spool/mail
drwxr-xr-x.  3 root root 4096 Feb 20  2014 empty
drwxr-xr-x.  2 root root 4096 Feb 20  2014 account
drwxr-xr-x.  3 root root 4096 Jul 23  2014 yp
drwxr-xr-x. 17 root root 4096 Jul 23  2014 cache
drwxr-xr-x.  4 root root 4096 Jul 23  2014 db
drwxr-xr-x   3 root root 4096 Jul 23  2014 mpi-selector
drwxr-xr-x.  2 root root 4096 Sep 30  2014 crash
drwxr-xr-x   7 root root 4096 Aug 24  2015 www
drwxr-xr-x. 14 root root 4096 May  4  2017 spool
drwxr-xr-x. 39 root root 4096 May  8  2017 lib
drwxr-xr-x. 31 root root 4096 Feb  2 10:58 run
drwxr-x---   3 root root 4096 Mar  6 11:04 TimesTen
drwxr-xr-x. 15 root root 4096 Apr  1 03:11 log
drwxrwxr-x.  5 root lock 4096 Apr  2 03:48 lock
drwxrwxrwt.  3 root root 4096 Apr  2 10:26 tmp
[root@bbmpde01 var]# chown oracle:oinstall TimesTen
[root@bbmpde01 var]# chmod 777 TimesTen/
[root@bbmpde01 var]# chmod 777 -R TimesTen/
[root@bbmpde01 var]# chown oracle:oinstall TimesTen -R
[root@bbmpde01 var]# cd TimesTen/
[root@bbmpde01 TimesTen]# ls
sys.odbc.ini  sys.ttconnect.ini  tt1122
[root@bbmpde01 TimesTen]# ls -lrt
total 12
-rwxrwxrwx 1 oracle oinstall  441 Mar  6 11:04 sys.ttconnect.ini
-rwxrwxrwx 1 oracle oinstall 1000 Mar  6 11:04 sys.odbc.ini
drwxrwxrwx 2 oracle oinstall 4096 Mar  6 11:04 tt1122
[root@bbmpde01 TimesTen]# more sys.odbc.ini
# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.

########################################################################
# This following sample definitions should be in the .odbc.ini file
# that is used for the TimesTen 11.2.2 Client.
# The Server Name is set in the TTC_SERVER attribute.
# The Server DSN is set in the TTC_SERVER_DSN attribute.
#########################################################################

[ODBC Data Sources]
#sampledbCS_1122=TimesTen 11.2.2 Client Driver
#cachedb1CS_1122=TimesTen 11.2.2 Client Driver
#repdb1CS_1122=TimesTen 11.2.2 Client Driver
#repdb2CS_1122=TimesTen 11.2.2 Client Driver

#[sampledbCS_1122]
#TTC_SERVER=biappdev01.ebsafrica.com
#TTC_SERVER_DSN=sampledb_1122

#[cachedb1CS_1122]
#TTC_SERVER=biappdev01.ebsafrica.com
#TTC_SERVER_DSN=cachedb1_1122

#[repdb1CS_1122]
#TTC_SERVER=biappdev01.ebsafrica.com
#TTC_SERVER_DSN=repdb1_1122

#[repdb2CS_1122]
#TTC_SERVER=biappdev01.ebsafrica.com
#TTC_SERVER_DSN=repdb2_1122

[root@bbmpde01 TimesTen]# cd tt1122/
[root@bbmpde01 tt1122]# ls
[root@bbmpde01 tt1122]# ls -lrt
total 0
[root@bbmpde01 tt1122]# ls -lrt
total 0
[root@bbmpde01 tt1122]# exit
logout
[Dbhavsar@bbmpde01 etc]$ su oracle
Password:
[oracle@bbmpde01 etc]$ cd /u01/oracle/products/timesten/TimesTen/tt1122/info
[oracle@bbmpde01 info]$ cd bin
bash: cd: bin: No such file or directory
[oracle@bbmpde01 info]$ cd ../bin
[oracle@bbmpde01 bin]$ ./ttisql

Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.


Command> connect cacheadm;
IM002: Data source name not found and no default driver specified
The command failed.
Command> connect "DSN=cachedb1_1122";
Connection successful: DSN=cachedb1_1122;UID=oracle;DataStore=/u01/oracle/products/timesten/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;DRIVER=/u01/oracle/products/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=40;TempSize=32;TypeMode=0;OracleNetServiceName=OFSDB;
(Default setting AutoCommit=1)
Command>
Command>
Command> connect cacheadm;
IM002: Data source name not found and no default driver specified
The command failed.
none: Command>
none: Command>
none: Command>
none: Command> connect cacheadm/cacheadm
             > ;
S1000: Data Source Name must not consist solely of blanks or contain "[]{}(),;?*=!@\/" characters
The command failed.
none: Command>
none: Command>
none: Command>
none: Command>
none: Command> connect "DSN=cachedb1_1122";
Connection successful: DSN=cachedb1_1122;UID=oracle;DataStore=/u01/oracle/products/timesten/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;DRIVER=/u01/oracle/products/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=40;TempSize=32;TypeMode=0;OracleNetServiceName=OFSDB;
(Default setting AutoCommit=1)
con1: Command>
con1: Command>
con1: Command>
con1: Command>  connect "DSN=cachedb1_1122";
Connection successful: DSN=cachedb1_1122;UID=oracle;DataStore=/u01/oracle/products/timesten/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;DRIVER=/u01/oracle/products/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=40;TempSize=32;TypeMode=0;OracleNetServiceName=OFSDB;
(Default setting AutoCommit=1)
con2: Command>
con2: Command>
con2: Command> grant admin to cacheadm;
15140: GRANT failed: User CACHEADM already has system privilege ADMIN
The command failed.
con2: Command>
con2: Command>
con2: Command>
con2: Command>
con2: Command>
con2: Command>
con2: Command>
con2: Command> grant DDL to cacheadm;
15111: Invalid privilege: DDL.  Roles are not supported.
The command failed.
con2: Command>
con2: Command>
con2: Command>
con2: Command> exit
Disconnecting from cachedb1_1122...
Disconnecting from con1...
Disconnecting from con2...
Done.
[oracle@bbmpde01 bin]$ cd ../info/
[oracle@bbmpde01 info]$ ls
cluster.oracle.ini  DBI5ac22dcf.0  DBI5ac230a1.2  DemoDataStore  snmp.ini  sys.odbc.ini  sys.ttconnect.ini  timestend.pid  ttcacheadvisor  ttendaemon.options  tterrors.log  ttmesg.log
[oracle@bbmpde01 info]$ vi sys.odbc.ini
[oracle@bbmpde01 info]$ cd ../bin
[oracle@bbmpde01 bin]$ ./ttisql

Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.


Command> connect "DSN=cachedb1_1122";
Connection successful: DSN=cachedb1_1122;UID=cacheadm;DataStore=/u01/oracle/products/timesten/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;DRIVER=/u01/oracle/products/timesten/TimesTen/tt1122/lib/libtten.so;PermSize=40;TempSize=32;TypeMode=0;OracleNetServiceName=OFSDB;
(Default setting AutoCommit=1)
Command> exit
Disconnecting...
Done.
[oracle@bbmpde01 bin]$
[oracle@bbmpde01 bin]$
[oracle@bbmpde01 bin]$
[oracle@bbmpde01 bin]$
[oracle@bbmpde01 bin]$
[oracle@bbmpde01 bin]$ cd ../infOracleId=swarn
bash: cd: ../infOracleId=swarn: No such file or directory
[oracle@bbmpde01 bin]$ cd ../info
[oracle@bbmpde01 info]$ vi sys.odbc.ini
[oracle@bbmpde01 info]$ cd ../bin/
[oracle@bbmpde01 bin]$ ./ttisql

Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.


Command> connect "DSN=cachedb1_1122";
Connection successful: DSN=cachedb1_1122;UID=cacheadm;DataStore=/u01/oracle/products/timesten/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;DRIVER=/u01/oracle/products/timesten/TimesTen/tt1122/lib/libtten.so;OracleId=swarn;PermSize=40;TempSize=32;TypeMode=0;OracleNetServiceName=OFSDB;
(Default setting AutoCommit=1)
Command> select * from dual;
< X >
1 row found.
Command>