FW: Python: Hello world (Socratica)

From the fine folk at Socratica, Python: Hello world

Share Button

SAP Sybase IQ: How to Restore Your Backups to Another system

SAP/Sybase’s documentation isn’t very clear for new IQ dbas and developers. Once such item is sdbply restoring an IQ database on to another system. Unlike ASE, you need to specify the new file locations if they are different than the source server.

Assumptions:

  1. IQ software has been installed
  2. The new dbfile locations are symbolic links to raw partitions OR the path exists but not the files
  3. You have a valid SYSAM license for the new IQ instance.
  4. The new IQ instance name is set (via -n instance)
  5. The old directory for the .db, .log and .mir exists (use a symbolic link if you wish)

Obtain dbspace file names with sp_iqfile:

select DBFileName, Path, DBFileSize from sp_iqfile();
DBFileName	Path	DBFileSize
'IQ_SYSTEM_MAIN'	'/database/old_iq/devices/IQ_MAIN/old_iqmain001.iq'	'32G'
'IQ_USER_MAIN_FILE_01'	'/database/old_iq/devices/IQ_USER_MAIN/old_iqusermain001.iq'	'1024G'
'IQ_SYSTEM_TEMP'	'/database/old_iq/devices/IQ_TEMP/old_iqtemp001.iqtmp'	'32G'
'IQ_SYSTEM_TEMP_002'	'/database/old_iq/devices/IQ_TEMP/old_iqtemp002.iqtmp'	'32G'</code></pre>

Create a restore.sql file renaming the DBFileName to the new locations:
<pre class="prettyprint" ><code class="language-sql">restore database 'new_iq'
FROM '/backups/old_iq.20140423100111.17760.IQfullbkp'
RENAME IQ_SYSTEM_MAIN TO '/database/new_iq/devices/IQ_MAIN/new_iqmain001.iq'
RENAME IQ_SYSTEM_TEMP TO '/database/new_iq/devices/IQ_TEMP/new_iqtemp001.iq'
RENAME IQ_SYSTEM_TEMP_002 TO '/backups/new_iqtemp002.iq'
RENAME IQ_SYSTEM_MSG TO '/database/new_iq/IQLOG/new_iq.iqmsg'
RENAME IQ_USER_MAIN_FILE_01 TO '/database/new_iq/devices/IQ_USER_MAIN/new_iqusermain001.iq';

Stop the destination IQ instance if it is running and start the utility database:

stop_iq
Checking system ...

The following 1 server(s) are owned by 'sybdba'

## Owner          PID   Started  CPU Tdbe  Additional Information
-- ---------  -------  --------  --------  ------------------------------------
1: sybdba       13909     Apr24  00:43:46  SVR:new_iq DB:new_iq PORT:58116
              /database/new_iq/sybase/IQ-16_0/bin64/iqsrv16 @/database/new_iq/sybdb/new_iq.cfg /database/new_iq/sybdb/new_iq.db -gn 65 -o /database/new_iq/sybase/IQ-16_0/logfiles
${SYBASE}/IQ-16_0/bin64/start_iq -n utility_db -gu dba -c 48m -gc 20 -iqgovern 30 \
        -gd all -gl all -gm 10 -gp 4096 -ti 4400 -z -zr all -zo $SYBASE/IQ-16_0/logfiles/utility_db.out \
        -o $SYBASE/IQ-16_0/logfiles/utility_db.srvlog -iqmc 100 -iqtc 100 -x "tcpip{port=9000}"
Starting server utility_db on localhost at port 9000 (04/30 09:37:16)

Run Directory       : /database/new_iq/sybdb
Server Executable   : /database/new_iq/sybase/IQ-16_0/bin64/iqsrv16
Server Output Log   : /database/new_iq/IQLOG/utility_db.srvlog
Server Version      : 16.0.0.653/sp03 16.0.0/Linux 2.6.18-194.el5
Open Client Version : N/A
User Parameters     : '-n' 'utility_db' '-gu' 'dba' '-c' '48m' '-gc' '20' '-iqgovern' '30' '-gd' 'all' '-gl' 'all' '-gm' '10' '-gp' '4096' '-ti' '4400' '-z' '-zr' 'all' '-zo' '/database/new_iq/IQLOG/utility_db.out' '-o' '/database/new_iq/IQLOG/utility_db.srvlog' '-iqmc' '100' '-iqtc' '100' '-x' 'tcpip{port=9000}'
Default Parameters  : -gn 25
….

Remove the db, log and mir files:

rm instance.db instance.log instance.mir

Restore the full backup:

dbisql -c "uid=dba;pwd=sql;eng=utility_db;dbn=utility_db" -port 9000 -host $( hostname ) -nogui "restore.sql"

Restore the incremental backup(s):

dbisql -c "uid=dba;pwd=sql;eng=utility_db;dbn=utility_db" -port 9000 -host $( hostname ) -nogui "restore_incrementals.sql"

Stop the utility database:

stop_iq

Start the IQ server to ensure it comes up then shut it back down.

If the name of the server has changed (e.g. old_iq -> new_iq), then we need to update the log and mir files. First let’s find out where the log and mir files are currently set to in the db file:

dblog new_iq.db
SQL Anywhere Transaction Log Utility Version 16.0.0.653
"new_iq.db" is using log file "/database/old_iq/sybdb/old_iq.log"
"new_iq.db" is using log mirror file "/database/old_iq/sybdb/old_iq.mir"
Transaction log starting offset is 0702994164
Transaction log current relative offset is 0000397583

Set the log file to “new_iq.log”:

dblog -t new_iq.log new_iq.db
SQL Anywhere Transaction Log Utility Version 16.0.0.653
"new_iq.db" was using log file "/database/old_iq/sybdb/old_iq.log"
"new_iq.db" is using log mirror file "/database/old_iq/sybdb/old_iq.mir"
"new_iq.db" is now using log file "new_iq.log"
Transaction log starting offset is 0702994164
Transaction log current relative offset is 0000397625

We need to clear the mir file(s) before we can assign a new one:

dblog -r new_iq.db
SQL Anywhere Transaction Log Utility Version 16.0.0.653
"new_iq.db" is using log file "new_iq.log"
"new_iq.db" was using log mirror file "/database/old_iq/sybdb/db00.mir"
"new_iq.db" is now using no log mirror file
Transaction log starting offset is 0702994164
Transaction log current relative offset is 0000397625

Set the mir file:

dblog -m new_iq.mir new_iq.db
SQL Anywhere Transaction Log Utility Version 16.0.0.653
"new_iq.db" is using log file "new_iq.log"
"new_iq.db" was using no log mirror file
"new_iq.db" is now using log mirror file "new_iq.mir"
Transaction log starting offset is 0702994164
Transaction log current relative offset is 0000397625

Start your IQ instance.

Share Button

Open Watcom C/C++ & FORTRAN manuals fixed to work with tablet/phone PDF readers like Aldiko

Aldiko Book Reader Premium Full v2.2.3.apkMany PDF readers for smart phones (Android/iphone) and tablets manage the pdf files Calibre_Logobased solely on the Title and Author fields in the PDF file. While for this is fine for your average book, it is not all that helpful with manuals that tend to have abbreviated or no data in the title/author fields. In the case of the manuals for OpenWatcom C/C++ and FORTRAN, I’m unable to load the manuals as they have the same Title/Author data (WATCOM GML).

How to fix? Easy. Go get Calibre. Drop the PDF files on to the running Calibre. Edit them by hitting the E key.

In my case, I edited the “Title”, “Author”, “Tags”, “Publisher” and “Languages”:

Calibre

Calibre doesn’t modify the PDF files themselves so I will need to export the files to a custom directory. In Calibre nomenclature, this is “Saving”. Highlight all the titles you want to export and hit “S” twice. Why twice? No idea. Choose the directory.

You can now copy the exported PDF files to your phone, tablet, whatever without fear of the manuals being rejected by Aldiko.

Here are the OpenWatcom 1.8 manuals that I’ve ‘fixed’ to work with Aldiko. They are identical to the PDFs at OpenWatcom with the exception of the PDF fields I mentioned previously.

Open Watcom 1.8 – Debugger User’s Guide
Open Watcom 1.8 – FORTRAN 77 Getting Started
Open Watcom 1.8 – FORTRAN 77 Graphics Library Reference
Open Watcom 1.8 – FORTRAN 77 Language Reference
Open Watcom 1.8 – FORTRAN 77 Programmer’s Guide
Open Watcom 1.8 – FORTRAN 77 Tools User’s Guide
Open Watcom 1.8 – FORTRAN 77 User’s Guide
Open Watcom 1.8 – Graphical Tools User’s Guide
Open Watcom 1.8 – Linker User’s Guide Open Watcom
Open Watcom 1.8 – Script_GML Tutorial and Reference Manual
Open Watcom 1.8 – VI Editor Reference and User’s Guide
Open Watcom 1.8 – C Language Reference
Open Watcom 1.8 – C Library Reference
Open Watcom 1.8 – C++ Class Library Reference
Open Watcom 1.8 – C/C++ Getting Started
Open Watcom 1.8 – C/C++ Programmer’s Guide
Open Watcom 1.8 – C/C++ Tools User’s Guide
Open Watcom 1.8 – C/C++ User’s Guide

Share Button

SAP Sybase SQL Anywhere 12.0.1 manuals fixed to work with tablet/phone PDF readers like Aldiko

Aldiko Book Reader Premium Full v2.2.3.apkMany PDF readers for smart phones (Android/iphone) and tablets manage the pdf files Calibre_Logobased solely on the Title and Author fields in the PDF file. While for this is fine for your average book, it is not all that helpful with manuals that tend to have abbreviated or no data in the title/author fields. In the case of the manuals for Sybase IQ, I’m unable to load the manuals for say v11.0 and v12.0.1 as they have the same Title/Author data.

How to fix? Easy. Go get Calibre. Drop the PDF files on to the running Calibre. Edit them by hitting the E key.

In my case, I edited the “Title”, “Author”, “Tags”, “Publisher” and “Languages”:

Calibre

Calibre doesn’t modify the PDF files themselves so I will need to export the files to a custom directory. In Calibre nomenclature, this is “Saving”. Highlight all the titles you want to export and hit “S” twice. Why twice? No idea. Choose the directory.

SQL Anywhere 12.0.1 (r) Server – Database Administration – SAP, Inc_

You can now copy the exported PDF files to your phone, tablet, whatever without fear of the v12.0.1 version of the P&T Guide being rejected by Aldiko because the v12.0 version is already added.

Here are the SQL Anywhere v12.0.1 manuals that I’ve ‘fixed’ to work with Aldiko. They are identical to the PDFs on sybooks with the exception of the PDF fields I mentioned previously.

No copyright infringement is intended. SAP/Sybase, please feel free to take these and host them.

SQL Anywhere 12.0.1 (r) Server – Programming – SAP, Inc_
SQL Anywhere 12.0.1 (r) Server – Spatial Data Support – SAP, Inc_
SQL Anywhere 12.0.1 (r) Server – SQL Reference – SAP, Inc_
SQL Anywhere 12.0.1 (r) Server – SQL Usage – SAP, Inc_
SQL Anywhere 12.0.1 – Changes and Upgrading – SAP, Inc_
SQL Anywhere 12.0.1 – Error Messages – SAP, Inc_
SQL Anywhere 12.0.1 – Introduction – SAP, Inc_
SQL Anywhere 12.0.1 – MobiLinkTM – Client Administration – SAP, Inc_
SQL Anywhere 12.0.1 – MobiLinkTM – Getting Started – SAP, Inc_
SQL Anywhere 12.0.1 – MobiLinkTM – Server Administration – SAP, Inc_
SQL Anywhere 12.0.1 – MobiLinkTM – Server-Initiated Synchronization – SAP, Inc_
SQL Anywhere 12.0.1 – QAnywhereTM – SAP, Inc_
SQL Anywhere 12.0.1 – Relay Server – SAP, Inc_
SQL Anywhere 12.0.1 – SQL RemoteTM – SAP, Inc_
SQL Anywhere 12.0.1 – UltraLite(r) – .NET Programming – SAP, Inc_
SQL Anywhere 12.0.1 – UltraLite(r) – C and C__ Programming – SAP, Inc_
SQL Anywhere 12.0.1 – UltraLite(r) – Database Management and Reference – SAP, Inc_
SQL Anywhere 12.0.1 – UltraLite(r) – Java Programming – SAP, Inc_
SQL Anywhere 12.0.1 – UltraLite(r) – M-Business Anywhere Programming (deprecated) – SAP, Inc_

Share Button

SAP SYBASE IQ 16.0 SP3 MANUALS FIXED TO WORK WITH TABLET/PHONE PDF READERS LIKE ALDIKO

Aldiko Book Reader Premium Full v2.2.3.apkMany PDF readers for smart phones (Android/iphone) and tablets manage the pdf files Calibre_Logobased solely on the Title and Author fields in the PDF file. While for this is fine for your average book, it is not all that helpful with manuals that tend to have abbreviated or no data in the title/author fields. In the case of the manuals for Sybase IQ, I’m unable to load the manuals for say v15.4 and v16.0 as they have the same Title/Author data.

How to fix? Easy. Go get Calibre. Drop the PDF files on to the running Calibre. Edit them by hitting the E key.

In my case, I edited the “Title”, “Author”, “Tags”, “Publisher” and “Languages”:

Calibre

Calibre doesn’t modify the PDF files themselves so I will need to export the files to a custom directory. In Calibre nomenclature, this is “Saving”. Highlight all the titles you want to export and hit “S” twice. Why twice? No idea. Choose the directory.

You can now copy the exported PDF files to your phone, tablet, whatever without fear of the v16.0 version of the P&T Guide being rejected by Aldiko because the v15.4 version is already added.

Here are the IQ v16.0 SP3 manuals that I’ve ‘fixed’ to work with Aldiko. They are identical to the PDFs on sybooks with the exception of the PDF fields I mentioned previously.

No copyright infringement is intended. SAP/Sybase, please feel free to take these and host them.

IQ 16.0 SP3 – Programming – SAP, Inc_
IQ 16.0 SP3 – Quick Start_ Unix_Linux – SAP, Inc_
IQ 16.0 SP3 – Reference_ Building Blocks, Tables, and Procedures – SAP, Inc_
IQ 16.0 SP3 – Reference_ Statements and Options – SAP, Inc_
IQ 16.0 SP3 – Release Bulletin_ Linux – SAP, Inc_
IQ 16.0 SP3 – SAP Sybase IQ Error Messages – SAP, Inc_
IQ 16.0 SP3 – Unstructured Data Analytics – SAP, Inc_ IQ 16.0 SP3 – User-Defined Functions – SAP, Inc_
IQ 16.0 SP3 – Utility Guide – SAP, Inc_
IQ 16.0 SP3 – Administration_ Backup, Restore, and Data Recovery – SAP, Inc_
IQ 16.0 SP3 – Administration_ Globalization – SAP, Inc_
IQ 16.0 SP3 – Administration_ In-Memory Row-Level Versioning – SAP, Inc_
IQ 16.0 SP3 – Administration_ Load Management – SAP, Inc_
IQ 16.0 SP3 – Administration_ Multiplex – SAP, Inc_
IQ 16.0 SP3 – Administration_ Spatial Data – SAP, Inc_
IQ 16.0 SP3 – Administration_ User Management and Security – SAP, Inc_
IQ 16.0 SP3 – Guide to Licensed Options – SAP, Inc_
IQ 16.0 SP3 – Introduction to SAP Sybase IQ – SAP, Inc_
IQ 16.0 SP3 – Linux Installation and Configuration Guide – SAP, Inc_
IQ 16.0 SP3 – Migration_ Unix_Linux – SAP, Inc_
IQ 16.0 SP3 – New Features Summary – SAP, Inc_
IQ 16.0 SP3 – Performance and Tuning Guide – SAP, Inc_
SAP Control Center 3.3 – Release Bulletin – SAP, Inc_
SAP Control Center for SAP Sybase IQ 3.3 – SAP, Inc_
Unified Agent and Agent Management Console 2.0.2 – User’s Guide – SAP, Inc_

Share Button