SelectEtoile : Base de connaissance SGBD

Posts Tagged 'sybase'

Quelques commandes utiles sur le RAO SYBASE

 

 

 

Les procédures stockées

ra_status : donne un état du RAO à un instant

ex :

1> ra_status
2> go
 State        Action
 ------------ -------------------------
 REPLICATING  Ready to replicate data.

ici, le RAO est en status REPLICATING,donc tout va bien, il est pret à repliquer.

 

ra_helplocator : donne un état d'avancement de la replication.

ex :

1> ra_helplocator
2> go
 Field      Hex Value       Decimal Value
 ---------- --------------- --------------
 GENID      0x0000          0
 SCN        0x04331b5b6137  4617548816695
 SCNGENID   0x0001          1
 THREAD     0x0001          1
 LSN        0x000061ed      25069
 BLKNUM     0x00082a03      535043
 BLKOFFSET  0x0010          16
 OATSCN     0x04331b59b85c  4617548707932
 LOCID      0x00000000      0

Ici , nous voyons que le RAO est entrain de repliquer le block n°535043 du LSN 25069. Le LSN étant le numéro de redo ou archive log ORACLE que le RAO est entrain de lire pour appliquer les transactions.

Pour voir combien de redo log ou archivelog il reste au RAO à repliquer, il faut lister les fichiers de l'instance ORACLE.

ex :

ls -lrt /Archivelog_Directory/
total 5588400
-rw-rw----   1 oracle   dba      512426496 Jul  4 00:44 arch_799016110_1_25062.arc
-rw-rw----   1 oracle   dba      251986432 Jul  4 00:57 arch_799016110_1_25063.arc
-rw-rw----   1 oracle   dba      527610368 Jul  4 01:12 arch_799016110_1_25064.arc
-rw-rw----   1 oracle   dba      534307328 Jul  4 01:16 arch_799016110_1_25065.arc
-rw-rw----   1 oracle   dba      513108992 Jul  4 01:26 arch_799016110_1_25066.arc
-rw-rw----   1 oracle   dba      7723008 Jul  4 01:57 arch_799016110_1_25068.arc
-rw-rw----   1 oracle   dba      512585728 Jul  4 01:57 arch_799016110_1_25067.arc

Ici, nous voyons que le numero LSN du dernier archive log est le 25067. Le RAO en est au 25069 donc il est dans les redo log et de fait n'est pas du tout en retard.

 

La suite au prochain episode....

Articles tagged

Comment renommer un serveur SYBASE ASE

Exemple : Renommage de Serveur1 en Serveur2

 

1> select * from sysservers

2> go

 srvid  srvstatus srvname                        srvnetname                       srvclass srvsecmech

 ------ --------- ------------------------------ -------------------------------- -------- ------------------------------

      0         8 Serveur1                 Serveur1                          0 NULL

      1         8 SYB_BACKUP                     Serveur1_BK                          7 NULL

 

(3 rows affected)

1> begin tran

2> update sysservers set srvname='Serveur2' where srvid=0

3> go

(1 row affected)

1> update sysservers set srvnetname='Serveur2' where srvid=0

2> go

(1 row affected)

1> select * from sysservers

2> go

 srvid  srvstatus srvname                        srvnetname                       srvclass srvsecmech

 ------ --------- ------------------------------ -------------------------------- -------- ------------------------------

      0         8 Serveur2                    Serveur2                             0 NULL

      1         8 SYB_BACKUP                     Serveur1_BK                          7 NULL

 

(3 rows affected)

1> update sysservers set srvnetname='Serveur2_BK' where srvid=1

2> go

(1 row affected)

1> select * from sysservers

2> go

 srvid  srvstatus srvname                        srvnetname                       srvclass srvsecmech

 ------ --------- ------------------------------ -------------------------------- -------- ------------------------------

      0         8 Serveur2                    Serveur2                             0 NULL

      1         8 SYB_BACKUP                     Serveur2_BK                             7 NULL

 

(3 rows affected)

1> commit

2> go


Les fichiers à renommer et à modifier sont les fichier RUN* et .cfg.

Pour info, si le port est à changer, il suffit de le changer dans le fichier interfaces.

 

Articles tagged

Présentation du site

 
Ce site a été développé afin de fournir des explications, documentations et astuces en tout genre concernant les bases de données.Ils proviennent de retour d'expériences de différents DBA.
Il est à noter que ces articles ne sont que des notes et en aucune façon des documentations officielles.
Ce site peut contenir des commandes non supportées par les différents éditeurs qui sont à utiliser avec précaution.
Bien sur, si vous constatez des erreurs ou avez des remarques sur un ou plusieurs articles, n'hésitez pas à nous en faire part, soit via l'onglet Contacts, soit via les commentaires à votre disposition à la fin de chaque article.
 
Pour ceux qui seraient intéressés pour écrire ou proposer des articles, n'hésitez pas à me contacter via 'Contacts' dans le menu du haut.
flux_rssInscrivez vous au fil d'actualité selectetoile.net flux_rss

Liste des traceflags sous SYBASE ASE

List of dbcc traceflags

 

 ExplanationSince versionUntill VersionBoot timeRun time
100 Display a parse tree for each command        
108 Allow dynamic and host variables in create view statements 12.5      
116 Print the text of the abstract query plan. Supported by Sybase, see documentation        
200 Display messages about the before image of the query-tree        
201 Display messages about the after image of the query tree        
208 Show types of locks taken        
217 Display a warning message for using the T-SQL extension of queries with grouped aggregates and columns in the select list which are not in the GROUP BY clause. 15.0.2 ESD 2      
241 Compress all query-trees when ASE is started        
243 Do not expand select * to column names when creating a compiled object        
244 When set, the maximum length of the returned value of str_replace() is 16384, otherwise it is 255. When Msg 511 is incorrectly raised with this flag on, upgrade to 15.0.2 ESD 6.        
260 Reduce TDS (Tabular Data Stream) overhead in stored procedures. Turn off done-in-behaviour packets. See also Send doneinproc tokens.        
291 Changes the hierarchy and casting of datatypes to pre-11.5.1 behaviour. There was an issue is some very rare cases where a wrong result could occur, but that's been cleared up in 11.9.2 and above.   11.9.2    
292 Never send doneinproc tokens. See also Send doneinproc tokens.        
298 Display an error message when a query uses a correlated variable as an inner or outer member of an outer join.        
299 Do not recompile a stored procedure that inherits a temp table from a parent procedure.        
302 Print trace information on index selection, supported by Sybase, see documentation   12.5 unless using compatibility mode in ASE 15   Y
303 Display optimizer OR strategy   12.5   Y
304 Revert special "or" optimizer strategy to the strategy used in pre-System 11 (this traceflag resolved several bug issues in System 11, most of these bugs are fixed in ASE 11.0.3.2)        
310 Show the plan as choosen by the optimizer, as well as I/O costs. Supported by Sybase see documentation   12.5 unless using compatibility mode in ASE 15   Y
311 Display optimizers expected I/O cost   12.5 unless using compatibility mode in ASE 15   Y
317 Show all considered plans. Supported by Sybase, see documentation   12.5 unless using compatibility mode in ASE 15   Y
319 Display optimizer reformatting strategy   12.5 unless using compatibility mode in ASE 15.   Y
320 Turn off join order heuristics   12.5    
321 Display optimizers reformatting strategy briefly   12.5 unless using compatibility mode in ASE 15.    
324 Turn off the like optimization for ad-hoc queries using local variables   12.5    
326 Instructs the server to use arithmetic averaging when calculating density instead of a geometric weighted average when updating statistics. Useful for building better stats when an index has skew on the leading column. Use only for updating the stats of a table/index with known skewed data.   11.5    
329 Turns on a strategy for fast first row return for queries using cursors with an ORDERBY. 15.0 ESD 2   Y N
333 Disables min-max optimization   12.5    
334 Enable merge joins   12.5 unless using compatibility mode in ASE 15.    
353 Turn off transitive closure        
364 Use range density instead of total density        
370 Use min-max index as an alternative to the table scan for single table queries. Does not perform aggregation optimization for joins.        
384 Enable JTC 12.0 12.5 unless using compatibility mode in ASE 15.    
396 Use min-max optimization for single table queries.        
441 queries where literal autoparametrization applies will be processed in full compatibility mode when enabled. Supported by Sybase, see documentation 15.0.3 ESD 1      
446 Disable restricted compatibility mode. Supported by Sybase, see documentation 15.0.3 ESD 1      
450 Sort a group by operation in the order of the groups 15      
457 Try to use worktables for a select in a cursor in order to isolate the selected data from the base table (12.5 behaviour) 15.0.2 ESD 6      
467 Do not cache a statement in the statement cache when a temp tables is referenced. 15.0.2 ESD 5      
477 When using compatibility mode, print a message about the type being used. Supported by Sybase, see documentation 15.0.3 ESD 1      
516 Print mapping between xchg operators and worker processes when using parallel execution. Supported by Sybase, see documentation 15      
526 Print semi-graphical execution operator tree when showplan is enabled. Supported by Sybase, see documentation        
589 Close a cursor implicitly during a cursor fetch and after an error was hit. 15.0.2 ESD 2      
602 Prints out diagnostic information for deadlock prevention.        
603 Prints out diagnostic information when avoiding deadlock.        
615 When a read of a page does not indicate it's right identity a second read is done. When the identity is now correct the related device is suspect and ASE turns on additional diagnostic checks. The check can be turned off with the traceflag. 12.5.3 ESD 5 and 15.0 ESD 2   Y Y
625 When hitting Msg 12328, do not regenerate the row-offset table 12.5.4 ESD 10      
646 Turn off the new space allocation method as introduced in 12.5.3 for partitioned DOL tables 12.5.3      
699 Turn off transaction logging        
712 Disable procedure cache optimisation        
722 ASE (debug version) will perform additional checks on the heap memory to detect possible memory corruption. 15.0 ESD 2   Y N
833 Do not report Msg 880 "Your query is blocked because it tried to write and database '<dbname>' is in quiesce state. Your query will proceed after the DBA performs QUIESCE DATABASE RELEASE.". 15.0 ESD 2 Y N  
990 Allow only access to the server with the "sa" account. Supported by Sybase, see documentation        
1116 Suppress Msg 1131. (The OAM page does not belong to object with index.....)        
1202 Also show the blocked lock requests in master..syslocks        
1204 Print deadlock information into errorlog        
1205 Prints deadlock information by printing stacktraces.        
1206 Disable lock promotion.        
1212 Shows info about locks granted and released        
1213 Used with dbcc object_stats        
1217 Show info about locks being acquired        
1603 Turns off async i/o and forces standard unix io. Can be useful if symptoms include transient corruption errors that may be caused by bad drives or controllers.        
1605 Start secondary engines by hand        
1606 Create a debug engine start file. This allows you to start up a debug engine which can access the server's shared memory for running diagnostics.        
1608 Instructs server engine 0 to not on-line any other dataserver engines        
1610 Boot the server with TCP_NODELAY enabled.     Y  
1611 If possible, pin shared memory -- check errorlog for success/failure.        
1613 Set affinity of the ASE engine's onto particular CPUs usually pins engine 0 to processor 0, engine 1 to processor 1, etc        
1615 SGI only: turn on recoverability to filesystem devices.        
1625 Linux only: Revert to using cached filesystem I/O. By default, ASE on Linux opens filesystem devices using O_SYNC, unlike other Unix based releases, which means it is safe to use filesystems devices for production systems. 11.9.2      
1630 SuSE 32 bit Linux (SuSE 9 SP1 or later), ASE incorrectly identifies AIO to be KAIO while using Posix AIO. Can lead to ASE hang. Start with this trace flag. 12.5.3 ESD 5 and 15.0 ESD 2   Y N
1642 Reserve one third of the sockets for EJB.        
1648 Enable DIRECT IO for block devices under on Linux        
1649 (linux on Intel, amd and IBM P) When set ASE uses Linux Kernel Asynchronous IO, rather than POSIX AIO 12.5.4 ESD 10      
1656 (Sun only) ASE will not boot when Intimate Shared Memory is not available. 12.5.4 ESD 10, 15.0.2 ESD 6      
2205 Show HA debugging output, supported by Sybase see documentation        
2209 Used when upgrading ASE configured with high availability        
2511 Suppress Msg 15082 during DBCC checks 12.5.4 ESD 10      
2512 Instructs dbcc checkalloc to skip the syslogs table during processing.        
2513 Instructs dbcc checkalloc, tablealloc and indexalloc to check for whether foreign objects are stranded on a particular segment within a database. Supported by Sybase, see documentation        
2703 When using update statistics with sampling and the index/column does not have existing statistics, set join density and total density to values from the sample rather then to defaults. 15.0 ESD 2      
3100 Load a database even when the characterset or sort order of a dump file is incompatible with the server.        
3199 When ONLINE DATABASE fails with Msg 2610 (Could not find leaf row in nonclustered index partition ...) after a cross-platform database load, set the traceflag on, reload the dump and online again. 15.0 ESD 2     Y
3300 Display each log record that is being processed during recovery. You may wish to redirect stdout because it can be a lot of information.        
3500 Disable checkpointing.        
3502 Write an entry in the errorlog when a databases is checkpointed        
3601 Write a stacktrace to the errorlog every time an error is raised.        
3604 Send trace output to the session of the client. Supported by Sybase see documentation       Y
3605 Send trace output to the errorlog of the server. Supported by Sybase see documentation       Y
3607 Do not start recovery when booting ASE.     Y  
3608 Recover only the master database. Do not clear tempdb or start up checkpoint process.     Y  
3609 Recover all databases. Do not clear tempdb or start up checkpoint process.        
3610 Pre-System 10 behaviour: divide by zero to result in NULL instead of error        
3620 Do not kill infected processes.        
3637 Connection time averages for LDAPUA are printed 12.5.4 ESD 10      
3706 Performance improvement of drop table in tempdb. 15.0 ESD 2   Y Y
3710 Improve the performance of DROP INDEX and CREATE INDEX by releasing the system catalog locks when not in DDL-IN-TRAN mode after the commit of the transaction but before post commit work started. 12.5.4 ESD 10, 15.0.2 ESD 4   Y Y
4001 Display a message in the errorlog when a loginrecord is recieved        
4012 Don't spawn chkptproc.        
4013 Write a message to the errorlog when a login takes place.        
4020 Boot without recover.     Y  
4044 Allows to log into ASE when the "sa" login is locked        
4072 Disable the global login trigger 15      
4073 Export the result of certain "set" command within a login trigger to the session. 15.0 ESD 2   Y  
4080 When an UPDATE using tsequal() is done within a stored procedure, tsequal() no longer returns a timestamp value unless the trace flag is set. 12.5.3 ESD 5 + 15.0 ESD 2      
4082 When set printing messages to console is made non-blocking 12.5.4 ESD 10      
4083 Disable SQLDBGR. 12.5.4 ESD 10   Y N
4084 Console logging will be disabled if setting console to nonblocking fails. 12.5.4 ESD 10, 15.0.2 ESD 5   Y N
4413 Trace queries in a 12.5 server that are join-order dependent.        
4419 In some cases, outer join on view or derived table with CASE expression may perform slower due to view materialization.The workaround is to use traceflag 4419. 12.5.4 ESD#6      
5101 Forces all I/O requests to go through engine 0. This removes the contention between processors but could create a bottleneck if engine 0 becomes busy with non-I/O tasks.        
5102 Prevents engine 0 from running any non-affinitied tasks.        
7103 Disable table lock promotion for text columns.        
7703 When assinging a value from a table into a local variable, go through the whole resultset rather than jump to last row and assing the value once.        
7717 Disable check of client compatibility in ASE 15. See Version 15 client compatibility 15.0.1      
7738 Support plan sharing of cached statements across different users. 15.0.2 ESD 2      
7741 Avoid Msg 257 when using statement cache and a parameterized statement without "dynamic prepare" and a incompatible parameter is specified as null. 12.5.4 ESD 10      
7815 logs address connection requests and host / name lookups.        
7841 Make ASE IPv6 aware. No longer needed since 15.0.2 ESD 5   15.0.2 ESD 5    
7844 Enable/disable concurrent Kerberos authentication        
7850 When set, timeout after 60 s when no Kerberos security opaque token is received from client 12.5.4 ESD 10      
8003 prints info on RPC calls        
8203 Display statement and transaction locks on a deadlock error.        
8399 Instructs the dbcc monitor command to insert a valid description into the field_name column in the sysmonitors table. Not intended for use by users. Appears in the errorlog when sp_sysmon is used.        
9217 When set, RepAgent will not stop after reporting error 9289 due to an inconsistent log record found. Instead it will attempt to continue after reporting error 9290 in the error log. Supported by Sybase, see documentation 15.0 ESD 2      
9531 Dump expensive buffer allocation analysis 15.0.2 ESD 2      
11201 Logs client connect events, disconnect events, and attention events. Supported by Sybase, see documentation        
11202 Logs client language, cursor declare, dynamic prepare, and dynamic execute-immediate text. Supported by Sybase, see documentation        
11203 Logs client rpc events. Supported by Sybase, see documentation        
11204 Logs all messages routed to client. Supported by Sybase, see documentation        
11205 Logs all interaction with remote server. Supported by Sybase, see documentation        
11206 Show messages about query processing for file access. Supported by Sybase, see documentation        
11207 Log the processing of text and image datatypes from remote servers. Supported by Sybase, see documentation        
11208 Prevents the create index and drop table statements from being transmitted to a remote server. sysindexes is updated anyway. Supported by Sybase, see documentation        
11209 When running "update statistics" on remote tables update only the rowcount. Supported by Sybase, see documentation        
11210 Disables Component Integration Services enhanced remote query optimization.        
11211 Prevents the drop table syntax from being forwarded to remote servers if the table was created using the create table at location syntax. Supported by Sybase, see documentation        
11212 Prevents escape on underscores in table names. Supported by Sybase, see documentation        
11213 Prevents generation of column and table constraints. Supported by Sybase, see documentation        
11214 Disables Component Integration Services recovery at start-up. Supported by Sybase, see documentation     Y  
11215 Sets enhanced remote optimization for servers of class db2.        
11216 For the session, disables enhanced remote optimization. Supported by Sybase, see documentation       Y
11217 For the server, disables enhanced remote optimization. Supported by Sybase, see documentation        
11218 Any query that is part of a declare cursor command, and that references proxy tables, is read only by default. Supported by Sybase, see documentation        
11220 Disables constraint checking of remote tables on the local server. This avoids duplicate checking. Setting this trace flag on ensures that queries are not rejected by the quickpass mode because of constraints. (spid) Supported by Sybase, see documentation        
11221 Disables alter table commands to the remote server when ON. This allows users to modify type, length, and nullability of columns in a local table without changing columns in the remote table. Use trace flag 11221 with caution. It may lead to tables that are “out of sync.” (spid). Supported by Sybase, see documentation        
11223 Disables proxy table index creation during create existing table or create proxy_table command execution. If this flag is set on, no index metadata is imported from the remote site referenced by the proxy table, and no indexes for the proxy table are created. This trace flag should be used with care and turned off when no longer necessary. (global) Supported by Sybase, see documentation        
11228 A 2762 error, "CREATE TABLE command is not allowed within multiple statement transaction" may be reported when executing a SQL INSERT..SELECT from proxy table mapped to a RPC. This traceflag has to be turned on to allow CREATE TABLE command in the remote procedure (for the session) 12.5.3. ESD 5 and 15.0 ESD 2      
11229 Use pre-12.5.3 behaviour to import statistics for proxy tables. Supported by Sybase, see documentation 12.5.3      
11231 CIS: Connections to remote servers are not disconnected and remain engine affinitied until the client session terminates. The connections can now be dropped and detached from an engine after executing a statement to the remote server by enabling this flag. Exceptions are when the statement is participating in cursor, transaction or stored procedure operations; or when ASE is in either HA failover or failback states. 15.0 ESD 2      
11232 A 2762 error, "CREATE TABLE command is not allowed within multiple statement transaction" may be reported when executing a SQL INSERT..SELECT from proxy table mapped to a RPC. This traceflag has to be turned on to allow CREATE TABLE command in the remote procedure (serverwide) 12.5.3. ESD 5 and 15.0 ESD 2      
11237 Only for proxy tables to Oracle, do not append unneeded "null clause" to "alter table modify" command 12.5.4 ESD 10      
11299 Allows connection information to be logged when a connection to a remote server fails. Supported by Sybase, see documentation        
11906 Informational messages from REORG will no longer be printed to the errorlog. 15.0 ESD 2      
12628 Data insertion into DOL tables having nonclustered index will be done with the index prepend mode splits disabled, in order to improve disk space utilization. 15.0 ESD 2   Y N
15302 When a subquery appears in the ON clause of an outer join query, the performance may not be efficient. ASE will do optimization for subquery attachment to achieve more favorable performance when turned on. 15.0 ESD 2      
15303 Possible performance improvement on a SELECT statement when a BIT column is involved in the WHERE clause. 15.0 ESD 2      
15322 Use 12.5 behaviour when assigning variables in combination with subqueries. 15.0.2 ESD 6      
15371 When set, bug fix for a sub-optimal plan is chosen when the query contains a subquery from an IF EXISTS clause. 12.5.4 ESD 10      
15381 When set, the warning message 307, "Index <index_name> specified as optimizer hint in the FROM clause of table <table_name> does not exist. Optimizer will choose another index instead." is disabled. 15.0.2 ESD 4      
15382 Disable "special OR strategy" (see release notes for the fine details) 15.0.2 ESD 2      
15556 Allow dump and load in ASE cluster edition with multiple instances active cluster edition      

Petit guide des commandes SYBASE RSE

Guide pratique des commandes système pour Replication Server SYBASE

Sur RSSD Server :

rs_helppartition : état des partitions

rs_helpuser : listing utilisateurs


Sur Replication Server :

admin disk_space : état des espace disque

add partition rrwdev01 on /dev/rwdev01’ with size 512 : ajout partition

alter connection to ‘FP_SV_TTTT’ set parallel dsi to ‘on’ : active le parallelisme

alter connection to ‘FP_SV_TTTT’ set dsi_serialization_method ‘isolation_level_3’ :

suspend connection to ‘FP_SV_TTTT’ with nowait : desactive la connexion

resume connection to ‘FP_SV_TTTT’ : active la connexion

 sysadmin dump_queue,135,0,-1,-1,-1,client : affiche le dernier block de l'outbound queue n°135

 

Sauvegarde toute la inbound queue 103 dans le fichier queue_103.log
sysadmin dump_file, queue_103.log
sysadmin dump_queue, 103, 1, -1, 1, -2
sysadmin dump_file

 

 

 

 

 

Connection à SYBASE via PowerShell

Comment se connecter à sybase avec powershell ?

Pré-requis

  • Powershell version 2
  • Net framework version 2 minimum

 

Installation

  • Copier en local ADONET64 provenant du client sybase 15.5
  • Rajouter dans le path le répertoire ADONET64/dll
  • Aller dans le répertoire ADONET64/dll et taper la commande suivante qui installera le driver sybase ADO.NET :

AseGacUtility.exe -i Sybase.AdoNet2.AseClient.dll policy.1.15.Sybase.AdoNet2.AseClient.dll policy.2.155.Sybase.AdoNet2.AseClient.dll

 

Exemple de script

# Import the Sybase dll

Add-Type -AssemblyName "Sybase.AdoNet2.AseClient, Version=2.155.1015.0, Culture=neutral, PublicKeyToken=xxxxxxxxxx"

 

# Open a connection to MySybServer,6100

$SybaseConn = New-Object Sybase.Data.AseClient.AseConnection

$SybaseConn.ConnectionString = "Data Source='machine';Port=9999;Database='master';UID='luc_riou';PWD=’*******’;"

$SybaseConn.Open()

 

# Create SybaseCommand object, define command text, and set the connection

$cmd = New-Object Sybase.Data.AseClient.AseCommand

$cmd.CommandText = $query

 

# Create SybaseDataAdapter object and set the command

$da = New-Object Sybase.Data.AseClient.AseDataAdapter

$da.SelectCommand = "SELECT * from sysobjects"

$da.SelectCommand.Connection = $SybaseConn

 

# Create and fill DataTable object

$dt = New-Object System.Data.DataTable

$da.Fill($dt) | Out-Null

 

# Close the Sybase connection

$SybaseConn.Close()

 

# Use the datatable

foreach ($dr in $dt.Rows)

{

Write-Host $dr["name"]

}

 

Pour vérifier que l'assembly SYBASE s'est bien installée, il suffit de lister les assemblies du répertoire C:\Windows\assembly

 

 

SYBASE ASE - Connection String

ASE ODBC Driver and OLE DB Provider Migration Technical Whitepaper

ASE ADO.NET Data Provider

 

Standard

Data Source='myASEserver';Port=5000;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

 

En spécifiant un fichier sql.ini :

DSURL='file://c:\sybase\ini\sql.ini?SQL_MIDOFF_OPC1';Database=myDataBase; UID=myUsername;PWD=myPassword;APP=myAppName;

 

 

Adaptive Server Anywhere OLE DB Provider

Standard

Provider=ASAProv;Data source=myASA;

 

TCP/IP

Provider=ASAProv.90;Eng=server.database_name;Uid=myUsername;Pwd=myPassword; Links=tcpip(Host=servername);

 

 

Sybase ASE OLE DB Provider

 

With Data Source .IDS file

Provider=Sybase ASE OLE DB Provider;Data source=myASE;

 

 

Adaptive Server Enterprise (ASE) alternative 1

Provider=Sybase.ASEOLEDBProvider;Srvr=myASEserver,5000;Catalog=myDataBase;User Id=myUsername;Password=myPassword;

 

Adaptive Server Enterprise (ASE) alternative 2

Provider=Sybase.ASEOLEDBProvider;Server Name=myASEserver,5000;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

 

Adaptive Server Enterprise (ASE) 12.5

Provider=Sybase.ASEOLEDBProvider.2;Server Name=myASEserver;Server Port Address=5000;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

 

Adaptive Server Enterprise (ASE) 15.0

Provider=ASEOLEDB;Data Source=myASEserver:5000;Catalog=myDataBase;User Id=myUsername;Password=myPassword;

 

Adaptive Server Enterprise (ASE) 15.0 alternative

Provider=ASEOLEDB;Data Source=myASEserver:5000;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

 

 

.NET Framework Data Provider for OLE DB

Provider=ASAProv;Data source=myASA;

 

 

 

Adaptive Server Enterprise ODBC driver

Adaptive Server Enterprise 15.0

Driver=={Adaptive Server Enterprise};app=myAppName;server=myServerAddress;port=myPortnumber; db=myDataBase;uid=myUsername;pwd=myPassword;

 

Standard Sybase System 12 Enterprise Open Client

Driver={SYBASE ASE ODBC Driver};Srvr=myServerAddress;Uid=myUsername;Pwd=myPassword;

 

Standard Sybase System 12.5 Enterprise Open Client

Driver={SYBASE ASE ODBC Driver};NA=Hostname,Portnumber;Uid=myUsername;Pwd=myPassword;

 

TDS based ODBC driver (from Sybase OCS 12.5)

Driver={Sybase ASE ODBC Driver};NetworkAddress=myServerAddress,5000;Db=myDataBase; Uid=myUsername;Pwd=myPassword;

 

Standard Sybase System 11

Driver={SYBASE SYSTEM 11};Srvr=myServerAddress;Uid=myUsername;Pwd=myPassword;Database=myDataBase;

 

 

 

Sybase SQL Anywhere (former Watcom SQL) ODBC driver

ODBC;Driver=Sybase SQL Anywhere 5.0;DefaultDir=c:\dbfolder\;Dbf=c:\mydatabase.db; Uid=myUsername;Pwd=myPassword;Dsn="";

 

 

 

.NET Framework Data Provider for ODBC

Driver=={Adaptive Server Enterprise};server=myServerAddress;port=myPortnumber; db=myDataBase;uid=myUsername;pwd=myPassword;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Mise en place d'un Replication Server SYBASE 15

Récupérer la distrib sur le site de sybase

Détarer celle-ci sur la machine dans le répertoire voulu

Modifier le fichier SYBASE.sh (ou SYBASE.csh ou SYBASE.env) pour qu'il est les bons chemins d'accès

Sourcer celui-ci : ". SYBASE.sh"

 

Pour lancer l'installation, 2 solutions s'offrent à vous :

rs_init pour le lancer en mode interactif

  • Il est conseillé de mettre à jour le fichier $SYBASE/interfaces avec les entrées du Replication Serveur et du Serveur hébergeant la base RSSD (base de repository de la réplication)
  • Voici un exemple de définition de ces serveurs
 RSServer
        master tcp ether machine 4100
        query tcp ether machine 4100


RSSDSErver
        master tcp ether machine 4101
        query tcp ether machine 4101

 
  • En fin d'installation, il est possible de générer le fichier de ressource en faisant un "ctrl+w" juste avant le message de lancement "Execute the Replication Server tasks now? y"

rs_init -r ressource_file . Ce fichier contient tous les paramétrages nécessaires à l'installation. Il est généré dans $SYBASE/REP-15_2/init/logs et se nomme 'resource.dmp'.

 

  • De la même façon que le premier point, il est obligatoire de renseigner le fichier $SYBASE/interfaces

 

Exemple de fichier de ressources avec un base RSSD sur ASA (Anywhere) :

sybinit.charset: iso_1

sybinit.language: us_english

sybinit.component_directory: $SYBASE/REP1520/REP-15_2

sybinit.release_directory: $SYBASE/REP1520

sybinit.boot_directory: $SYBASE/REP1520

sybinit.product: rs

sqlsrv.sa_password: USE_DEFAULT

sqlsrv.sa_login: USE_DEFAULT

sqlsrv.master_device_size: USE_DEFAULT

sqlsrv.master_device_physical_name: USE_DEFAULT

sqlsrv.server_name: USE_DEFAULT

sqlsrv.new_config: USE_DEFAULT

rs.rs_operation: rs_install

rs.rs_diskp_size: 2000

rs.rs_diskp_lname: logical_queue01

rs.rs_diskp_name: /rawdevice/physical-queue01

rs.rs_erssd_errorlog_dir: $SYBASE/errorlog

rs.rs_erssd_translog_dir: $SYBASE/REP-15_2/translog

rs.rs_rssd_embedded: yes

rs.rs_erssd_name: RSSDServer

rs.rs_pwd_encryption: yes

rs.rs_idserver_name: RSSERVER

rs.rs_id_server_is_rs_server: yes

rs.rs_rs_errorlog: $SYBASE/errorlog/RSSERVER.log

rs.rs_name: RSSERVER

# -END_ATTRIBUTES-

 

Une fois l'installation finie, il faut se connecter au serveur de Replication. Pour cela, il faut sourcer le fichier $SYBASE/SYBASE.sh et lancer la commande suivante :

isql -Usa -SRSServer -w500

Mot de passe : 'Touche Entrée'. Pas de mot passe à l'initialisation.

Pour le changer, une fois connecté lancer la commande :

alter user sa set password 'newpassword'

go

 

Se connecter ensuite à la base RSSD sur ASA dans notre cas :

isql -URSServer_RSSD_prim -SRSSDServer -w500 -PRSServer_RSSD_prim_ps

On peut créer un login sa sur la  avec les droits d'administration par exemple comme suit :

 grant connect to sa identified by newpwd

go

grant DBA to sa

go

 

 

 

 

 

 

 

 

 

 

 

Pb de désinstallation / installation Replication SYBASE

Si une réplication ne se désinstalle pas car il y a des queues en cours de traitement qui diffèrent le drop effectif des souscriptions

On peut procéder comme suit :

 

1/ Déterminer les queues à purger

1> admin who

2> go

 Spid Name       State                Info

 ---- ---------- -------------------- ----------------------------------------

   89 DIST       Awaiting Wakeup      177 LDS_MABASE.ldb_MABASE

   51 SQT        Awaiting Wakeup      177:1  DIST LDS_MABASE.ldb_MABASE

   48 SQM        Awaiting Message     177:1 LDS_MABASE.ldb_MABASE

   65 SQM        Awaiting Message     177:0 LDS_MABASE.ldb_MABASE

   38 DSI EXEC   Active               178(1) IQ_MABASE.IQ_MABASE2

  139 DSI        Awaiting Command     178 IQ_MABASE.IQ_MSBASE2

  127 SQM        Awaiting Message     178:0 IQ_MABASE.IQ_MSBASE2

   94 DSI EXEC   Awaiting Command     179(1) DATASERVER.MABASE

   79 DSI        Awaiting Message     179 DATASERVER.MABASE

      REP AGENT  Down                 DATASERVER.MABASEB

   13 DSI EXEC   Awaiting Command     101(1) RSSDSERVER.RSSD

    9 DSI        Awaiting Message     101 RSSDSERVER.RSSD

    8 SQM        Awaiting Message     101:0 RSSDSERVER.RSSD

   10 dSUB       Sleeping

    6 dCM        Awaiting Message

    7 dAIO       Awaiting Message

   11 dREC       Sleeping             dREC

   12 dSTATS     Sleeping

   14 USER       Active               sa

    5 dALARM     Awaiting Wakeup

1> admin quiesce_check

2> go

Msg 6145, Level 12, State 0:

Server 'RSSDSERVER':

Can't Quiesce. Queue 178:0 has not been read out. Write=77.40 Read=41.35 Reader=178:0  DSI 178 IQ_MABASE.IQ_MABASE2

1> shutdown

2> go

CT-LIBRARY error:

        ct_results(): network packet layer: internal net library error: Net-Library operation terminated due to disconnect

 

 

2/ Redémarrer le replication server en mode maintenance

cd $SYBASE/REP-12_6/install

startserver –f RUN_RSSDSERVER_Maint

Ce fichier RUNSERVER possède le flag –M de maintenance.

 

3/ Purger la queue de la réplication

1> sysadmin sqm_purge_queue, 178, 0

2> go

1> shutdown

2> go

 

4/ Redémarrer le replication server en mode normal

 

5/ Relancer la désinstallation de la réplication

 

 

Problème de drop connexion et de purge d'une queue

Avant toute chose, stopper et supprimer l’agent sur le Serveur Primaire
sp_stop_rep_agent
Se le serveur RS :   
Sysadmin dropdb, DATASERVER1,MABASE   
Sysadmin dropdb, DATASERVER2,MABASE   
Sysadmin dropldb, LDS_MABASE, ldb_MABASE   
Shutdown   
Start RS   
Drop connection to DATASERVER2.MABASE   
Drop connection to DATASERVER1.MABASE  
Drop connection to LDS_MABASE.ldb_MABASE

 

Puis, vérifier que les stable queues sont bien vides

 

On peut alors réinstaller la repli

 

 

 Purge d'une queue à la sauvage :

 

1> sysadmin hibernate_on

2> go

The Replication Server has now entered hibernation mode.

1> sysadmin sqm_purge_queue,120,0

2> go

1> sysadmin hibernate_off

2> go

 

 

 

 

 

SYBASE IQ - Migration 12.7 vers 15.3

Il existe plusieurs façons de migrer une instance SYBASE IQ 12.7 (ou 12.6 d'ailleurs) vers une 15. La bonne et la mauvaise !!! HUMOUR  !!!!

On peut soit utiliser l'utilitaire iqunload, soit procéder sur une nouvelle instance en version cible (15.3 par exemple) et recréer puis alimenter les tables.

 

Migration avec l'utilitaire iqunload (option -au)

Post Migration

Nous avons donc une instance 12.7 que l'on nommera MONASIQ127 pour notre exemple et que l'on va migrer en 15.3.

Il nous faut une distrib 15.3 installée sur la même machine que la 12.7. (Distrib /sybase/product/IQ153)

Infos divers sur la 12.7 :

1> select @@servername
2> go
 @@servername
 --------------------------------------------------------------------------------------------------------------------------------
 MONASIQ127

(1 row affected)

1> select @@version
2> go
 @@version
 --------------------------------------------------------------------------------------------------------------------------------
 Sybase IQ/12.7.0/090824/P/ESD 7/Enterprise Linux64 - amd64,Opteron64,X86_64/2.4.21-27.0.1.ELsmp/64bit/2009-08-24 16:32:40

(1 row affected)

1> sp_iqdbspace
2> go
 Name
         Path                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
         SegmentType RWMode Usage  DBSSize Reserve StripeSize
         BlkTypes                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
         FirstBlk             LastBlk
 --------------------------------------------------------------------------------------------------------------------------------
         --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
         ----------- ------ ------ ------- ------- ----------
         --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
         -------------------- ------------------------
 IQ_SYSTEM_MAIN
         /sybase/MONASIQ127/device/mainspace1.iq                                                                                                                                                                                                                                                                                                                                                                                                                        
         MAIN        RW          1 500M    0B      8K
         1H,64F,32D,128M                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                            1                    64000
 IQ_SYSTEM_TEMP
         /sybase/MONASIQ127/device/tempspace1.iqtemp                                                                                                                                                                                                                                                                                                                                                                                                                    
         TEMPORARY   RW          1 200M    0B      8K
         1H,64F,16A                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                            1                    25600

(2 rows affected)
(return status = 0)
 

 

Avant de commencer la migration, il faut stopper l'instance 12.7.

Mise en place de l'environnement 15.3 pour lancer l'utilitaire iqunload :

export SYBASE=/sybase/product/IQ153
. $SYBASE/IQ-15_3/IQ-15_3.sh
     Sourcing SYBASE.sh

 

Lancement de la migration

se placer dans le répertoire contenant le .db de l'instance à migrer et lancer la commande suivante  :

  • iqunload  -au -c"log=iqunload.log;DBF=MONASIQ127.db;uid=sa;pwd=XXXXXX"

 

Sybase IQ Unload Utility Version 15.3.0.6056
Connecting and initializing


=============================================================
IQ server starting with:
      1 connections         (       -gm )
     26 cmd resources       ( -iqgovern )
    447 threads             (     -iqmt )
    512 Kb thread stack size   (   -iqtss  )
  228864 Kb thread memory size ( -iqmt * -iqtss )
      8 IQ number of cpus  ( -iqnumbercpus )
      0 MB maximum size of IQMSG file ( -iqmsgsz )
      0 copies of IQMSG file archives ( -iqmsgnum )
=============================================================



=============================================================
IQ server starting with:
      1 connections         (       -gm )
     26 cmd resources       ( -iqgovern )
    447 threads             (     -iqmt )
    512 Kb thread stack size   (   -iqtss  )
  228864 Kb thread memory size ( -iqmt * -iqtss )
      8 IQ number of cpus  ( -iqnumbercpus )
=============================================================

Wrapping iqmsg: Disabled.
Wrapping iqmsg: Disabled.


=============================================================
IQ server starting with:
      1 connections         (       -gm )
     26 cmd resources       ( -iqgovern )
    447 threads             (     -iqmt )
    512 Kb thread stack size   (   -iqtss  )
  228864 Kb thread memory size ( -iqmt * -iqtss )
      8 IQ number of cpus  ( -iqnumbercpus )
      0 MB maximum size of IQMSG file ( -iqmsgsz )
      0 copies of IQMSG file archives ( -iqmsgnum )
=============================================================

2011-10-06 10:26:57 Unloading user and group definitions
2011-10-06 10:26:57 Unloading table definitions
2011-10-06 10:26:58 Unloading index definitions
2011-10-06 10:26:58 Unloading functions
2011-10-06 10:26:58 Unloading view definitions
2011-10-06 10:26:58 Unloading procedures
2011-10-06 10:26:58 Unloading triggers
2011-10-06 10:26:58 Unloading SQL Remote definitions
2011-10-06 10:26:58 Unloading MobiLink definitions
2011-10-06 10:26:58 Creating new database
Warning: Using default value for -iqmc or -iqtc is insufficient for most applications
Warning: Using default value for -iqmc or -iqtc is insufficient for most applications
Using licenses from: /sybase/product/IQ153/SYSAM-2_0/licenses/*.lic:/sybase/MONASIQ127/device/*.lic
Checked out graced license for 8 IQ_CORE (2011.0506) will expire Sat Nov  5 00:00:00 2011.
Failed to obtain license(s) for IQ_CORE feature from License Server 27002@adbprdlm02.
Insufficient IQ_CORE CPU licenses. Sybase IQ requires 8 IQ_CORE ("DT") CPU licenses for use on this machine but only 2 could be obtained. Check whether additional licenses are available at the Sybase Product Download Center.
License feature name:  IQ_CORE
License search path:   /sybase/product/IQ153/SYSAM-2_0/licenses/*.lic:/sybase/MONASIQ127/device/*.lic:
FLEXnet Licensing error:-4,132
For further information, refer to the Sybase Software Asset Management website at http://www.sybase.com/sysam
WARNING: Sybase IQ functionality that requires the IQ_CORE license will be disabled on Sat Nov  5 00:00:00 2011, unless a suitable IQ_CORE license is obtained before that date.
2011-10-06 10:27:11 Reloading user and group definitions
2011-10-06 10:27:11 Reloading table definitions
2011-10-06 10:27:11 Reloading index definitions
2011-10-06 10:27:11 Reloading functions
2011-10-06 10:27:11 Reloading view definitions
2011-10-06 10:27:11 Reloading procedures
2011-10-06 10:27:11 Reloading triggers
2011-10-06 10:27:11 Reloading SQL Remote definitions
2011-10-06 10:27:11 Reloading MobiLink definitions
Successfully backed up file "/sybase/MONASIQ127/device/MONASIQ127.db" by renaming it to "/sybase/MONASIQ127/device/MONASIQ127.db.before_schema_reload".
Successfully backed up file "/sybase/MONASIQ127/log/MONASIQ127.iqmsg" by renaming it to "/sybase/MONASIQ127/log/MONASIQ127.iqmsg.before_schema_reload".
Successfully reloaded schema of database "/sybase/MONASIQ127/device/MONASIQ127.db".

Checked in graced license for IQ_CORE (2012.06110).
 

 

Validation de la migration

L'instance est maintenant migrée mas arrêtée. Nous allons repositionner les variables d'environnement pour pointer vers la 15 puis démarrer l'instance.

Mise en place de l'environnement 15.3 et lancement de la commande suivante :

  • start_iq @/sybase/MONASIQ127/cfg/MONASIQ127.cfg /sybase/MONASIQ127/device/MONASIQ127.db

Starting server MONASIQ127 on moineau at port 11021 (10/06 10:43:32)

Run Directory       : /sybase/MONASIQ127/device
Server Executable   : /sybase/MONASIQ127/product/IQ-15_3/bin64/iqsrv15
Server Output Log   : /sybase/MONASIQ127/log/MONASIQ127.0002.srvlog
Server Version      : 15.3.0.6056/GA
Open Client Version : N/A
User Parameters     : '@/sybase/MONASIQ127/cfg/MONASIQ127.cfg' '/sybase/MONASIQ127/device/MONASIQ127.db'
Default Parameters  :
 

 

=============================================================
IQ server starting with:
     50 connections         (       -gm )
     26 cmd resources       ( -iqgovern )
    496 threads             (     -iqmt )
    512 Kb thread stack size   (   -iqtss  )
  253952 Kb thread memory size ( -iqmt * -iqtss )
      8 IQ number of cpus  ( -iqnumbercpus )
      0 MB maximum size of IQMSG file ( -iqmsgsz )
      0 copies of IQMSG file archives ( -iqmsgnum )
=============================================================

I. 10/06 10:43:33.      Sybase IQ
I. 10/06 10:43:33.       Version 15.3
I. 10/06 10:43:33.        (64bit mode)
I. 10/06 10:43:33. Copyright 1992-2011 by Sybase, Inc. All rights reserved
I. 10/06 10:43:33.
I. 10/06 10:43:33. 8 logical processor(s) on 2 physical processor(s) detected.
I. 10/06 10:43:33. Maximum number of physical processors the server will use: 2
I. 10/06 10:43:33. Running Linux 2.6.18-194.11.4.el5 #1 SMP Fri Sep 17 04:57:05 EDT 2010 on X86_64
I. 10/06 10:43:33. Server built for X86_64 processor architecture
I. 10/06 10:43:33. 49152K of memory used for caching
I. 10/06 10:43:33. Minimum cache size: 49152K, maximum cache size: 262144K
I. 10/06 10:43:33. Using a maximum page size of 4096 bytes
I. 10/06 10:43:34. Starting database "MONASIQ127" (/sybase/MONASIQ127/device/MONASIQ127.db) at Thu Oct 06 2011 10:43
I. 10/06 10:43:35. Transaction log: MONASIQ127.log
I. 10/06 10:43:35. Starting checkpoint of "MONASIQ127" (MONASIQ127.db) at Thu Oct 06 2011 10:43
I. 10/06 10:43:35. Finished checkpoint of "MONASIQ127" (MONASIQ127.db) at Thu Oct 06 2011 10:43
I. 10/06 10:43:37. Database "MONASIQ127" (MONASIQ127.db) started at Thu Oct 06 2011 10:43
I. 10/06 10:43:37. IQ Server MONASIQ127.
I. 10/06 10:43:37. Database server started at Thu Oct 06 2011 10:43
I. 10/06 10:43:37. Trying to start SharedMemory link ...
I. 10/06 10:43:37.     SharedMemory link started successfully
I. 10/06 10:43:37. Trying to start TCPIP link ...
I. 10/06 10:43:37. Starting on port 11021
New process id is 7782
I. 10/06 10:43:42.     TCPIP link started successfully
I. 10/06 10:43:42. Now accepting requests

Server started successfully



Vérification de la version de l'instance MONASIQ127 et lancement d'un checkdb :

 iqisql -U sa -w500 -S MONASIQ127

Password:
1> select @@servername
2> go
 @@servername
 --------------------------------------------------------------------------------------------------------------------------------
 MONASIQ127


(1 row affected)
1> select @@version
2> go
 @@version
 --------------------------------------------------------------------------------------------------------------------------------
 Sybase IQ/15.3.0.6056/110506/P/GA/Enterprise Linux64 - x86_64 - 2.6.9-67.0.4.ELsmp/64bit/2011-05-06 13:27:43

1> checkpoint
2> go

1> sp_iqcheckdb 'verify database'
2> go
 

Vérifier qu'il n'y a pas d'erreur(s) dans le rapport du checkdb.

 

Post Migration

Durant la migration, l'utilitaire iqunload renomme le dbspace IQ_SYSTEM_MAIN en iq_main et crée un nouveau IQ_SYSTEM_MAIN.Il est d'ailleurs possible de préciser le nom du nouveau fichier pour le dbspace IQ_SYSTEM_MAIN (-ms_filename)

Toutes les données "applicatives" sont maintenant sur iq_main. SYBASE recommande depuis la SYBASE IQ 15 de séparer les données applicatives et systèmes.

Les données système reste sur IQ_SYSTEM_MAIN et les données applicatives sur iq_main. D'ailleurs, il est souhaitable de placer les options suivante sur SYBASE 15 pour une bonne gestion de ces dbspaces :

1> REVOKE CREATE ON IQ_SYSTEM_MAIN FROM PUBLIC;
2> go
1> GRANT CREATE ON iq_main to PUBLIC;
2> go
1> SET OPTION PUBLIC.DEFAULT_DBSPACE = 'iq_main';
2> go
1> SET option PUBLIC.MINIMIZE_STORAGE='On'
2> go

 

 

Migration vers un SYBASE IQ 15 différent (voire distant)

 

Introduction

Nous allons utiliser l'utilitaire iqunload (option -n) pour extraire du serveur SYBASE IQ 12.7 la structure des objets, les options, les logins vers un script SQL.

Nous lancerons ce script sur l'instance IQ 15.3 pour recréer les objets. Évidemment, au préalable, nous avons créer la database comme souhaitée. Comme évoqué au dessus, SYBASE recommande de créer un dbspace différent de IQ_SYSTEM_MAIN et définir par défaut celui-ci pour PUBLIC.

Il faudra enfin alimenter les tables en utilisant INSERT LOCATION.

Dans notre exemple, nous avons une instance MONASIQ127 que l'on va migrer vers une instance MONASIQ153 sur la même machine. Bien sur il est très simple de faire la même chose sur une instance SYBASE IQ 15 distante.

 

Post Migration

Nous avons donc :

  • une instance SYBASE IQ 12.7 nommée MONASIQ127 (SYBASE : /sybase/MONASIQ127/product)
  • une instance 15.3 nommée MONASIQ153 (SYBASE : /sybase/MONASIQ153/product)

Sourcer l'environnement SYBASE IQ 15

export SYBASE=/sybase/product/IQ153
. $SYBASE/IQ-15_3/IQ-15_3.sh
     Sourcing SYBASE.sh

Dans ce cas, il ne faut pas arrêter l'instance SYBASE IQ 12.7

Il faut déplacer les fichiers (opttemp.sql,optdeflt.sql,unload.sql,unloadold.sql) permettant l'extraction des objets de la 15 vers la 12.7.

De /sybase/MONASIQ153/product/IQ-15_3/unload vers /sybase/MONASIQ127/product/ASIQ-12_7/scripts

 

Extraction du script reload.sql

Lancer la commande suivante  :

  • iqunload -n -c "UID=DBA;PWD=SQL;DBF=/sybase/MONASIQ127/device/MONASIQ127.db;ENG=MONASIQ127;links=tcpip(host=machine;port=9999)" -r "/sybase/MONASIQ153/log/reload.sql"

Exemple de ce que contient le fichier reload.sql :

[...]

-------------------------------------------------
--   Create tables
-------------------------------------------------


message dateformat( now(), 'yyyy-mm-dd hh:nn:ss' ) || ' ' || lang_message( 18478 ) type info to client;

CREATE TABLE "sa"."ta" (
    "c1"                             varchar(3000) NOT NULL
   ,"c2"                             char(3000) NOT NULL
)
go

commit work
go


-------------------------------------------------
--   Create indexes
-------------------------------------------------


message dateformat( now(), 'yyyy-mm-dd hh:nn:ss' ) || ' ' || lang_message( 18480 ) type info to client;

commit work
go

[...]

 

Création de la structure des objets, des options et des logins sur le serveur SYBASE IQ 15.3

Vérifier que les variables d'environnement sont bien celles de SYBASE IQ 15 et donc que vous pointez bien vers MONASIQ153.

 dbisql -c "uid=DBA;pwd=SQL" "select @@servername"

 @@servername
---------------------------------------------------------
MONASIQ153

 

Lancer la commande dbisql suivante :

dbisql -c "uid=DBA;pwd=sql" reload.sql |tee -a reload.log

2011-10-07 11:50:55 Reloading user and group definitions
7 row(s) affected
2011-10-07 11:50:55 Reloading table definitions
2011-10-07 11:50:55 Reloading index definitions
2011-10-07 11:50:55 Reloading functions
2011-10-07 11:50:55 Reloading view definitions
2011-10-07 11:50:55 Reloading procedures
1 row(s) affected
2011-10-07 11:50:55 Reloading triggers
2011-10-07 11:50:56 Reloading SQL Remote definitions
2011-10-07 11:50:56 Reloading MobiLink definitions
Execution time: 1.564 seconds

 

Toute la structure de la base de données IQ 12.7 est maintenant créée sur l'instance IQ 15.3

 

 

Chargement des données via INSERT LOCATION