DB2 Table and Index Commands

DB2 Table and Index Commands

Look at columns and data types of a table
db2 describe table schema.tabelename
Look at one column's data type.
db2 "describe select <colname> from schema.tablename"
Look at indexes on a table
db2 describe indexes for table schema.tablename
Export data to a file in ixf format
db2 export to tablename.ixf of ixf messages tablename.txt select * from SCHEMA.TABNAME
Import data from an ixf file
db2 import from filename.ixf of ixf messages tablename.txt insert into SCHEMA.TABNAME
Import using Load which is faster (doesn't check constraints) and NONRECOVERABLE doesn't log anything
db2 load from filename.ixf of ixf insert into SCHEMA.TABNAME nonrecoverable;
Build a file to set integrity on all tables that are in set integrity pending state

db2 "select 'set integrity for '||tabschema||'.'||tabname ||' immediate checked;' from syscat.tables where type = 'T' and status = 'C'" > file.out

DB2 Security Commands

DB2 Security Commands

Build a script to grant user execute privilege on all packages.
db2 "select 'db2 grant execute on package '||pkgschema||'.'||pkgname||' to user <user>;' from syscat.packages where pkgschema = 'NULLID'" > output.file

Security Notes
dbadm auth must be revoked before any other database privlege

create_not_fenced_routine must be revoked before create_external_routine

DB2 Backup and Restore Commands

DB2 Backup and Restore Commands

Take an OFFLINE backup
db2 connect to <dbname>
db2 quiesce database immediate force connections
db2 connect reset
db2 backup database <dbname> to <path> compress without prompting
after backup completes:
db2 connect to <dbname>
db2 unquiesce database
db2 connect reset
Take an ONLINE Backup
db2 backup db <dbname> to <path> online compress
or use a background process on a linux/unix machine
nohup db2 backup db <dbname> to <path> online compress &
List recent backups and where they are stored
db2 list history backup all for <dbname>
Check the integrity of a backup image
db2ckbkp <image name>
Restore from Incremental Backup Automatic
db2 restore db <dbname> incremental automatic taken at <timestamp>
If you need to restore an incremental backup manually this command will give you the required previous backups.

db2ckrst -d <dbname> -t <timestamp of image>

DB2 Commands Home

Basic Commands
Size of your database : 
db2 'call get_dbsize_info(?,?,?,0)'
Version of DB2 you are running:
db2level
Stop the db2 instance:
db2stop
Stop an instance that has current connections
db2 force applications all
db2 deactivate db <dbname>
db2 terminate
db2stop force
ipclean
Start the db2 instance:
db2start
Kill a hung instance (last resort):
db2_kill -all
List the databases in an instance:
db2 list db directory
List the cataloged nodes:
db2 list node directory
Show the database manager configuration settings:
db2 get dbm cfg
Show the database level configuration settings:
db2 get db cfg for <dbname>
Activate a database:
db2 activate db <dbname>
Deactivate a database:
db2 deactivate db <dbname>
View the DB2 License:
db2licm -l
To switch between partitions: 
db2 terminate; export DB2NODE=<new-node-num>

New Forum Saptecharena

Some of the standard programs in SAP

RSTXCNVR Converting a SAPscript Standard Text to RAW or ITF Format and Download the File

RSTXCPDF Routines for Converting OTF Format to PDF Format
RSTXDBUG Activate/Deactivate Form Debugger
RSTXFDEL Delete and Repair the Forms
RSTXHTML Conversion of SAPscript Texts (ITF) to HTML
RSTXLDMC Uploading TIFF Files to SAPscript Texts
RSTXSCRP SAPscript Export to Dataset / SAPscript Import from Dataset
RSTXSITF Report For Unloading an ITF Format to a Dataset
RSTXFCAT Find Forms
RSTXSCAT Find Styles
RSTXTCAT Find Standard Texts
RSTXTRAN Transfer of SAPscript Texts to a Correction
RSTXSCPY Copy Styles Between Clients
RSTXICON List of SAP icons and their names and SAP numbers

SAP BASIS Tricks and Tips

Tips and Tricks

This space is for those bits of information that can save you a lot of time and trouble and usually are hard to find in the documentation. 
  1. Problems with username/passwords while setting JCO's?... try with the password in UPPERCASE.
  2. Going home in a hurry?, use transaction /nex to close all your sessions at the same time in specific application server you are logged-in.
  3. In an R/3 screen, use %pc to download any TCode full page in any format you want.(.htm, .txt etc). Also use TCode /nSO21 to specify the default download location (this is very useful as saving all files to the sapworkdir can be little annoying at times)
  4. Show Work Process usage over time by running SM50 -> List -> CPU. This shows CPU usage in minutes since startup. If all of your DIA WP's show time, then consider adding more.
  5. If you want to select text on your SAP screen and if you are not able to do it. use Ctrl+Y and then you can select text. 
  6. To acces history of Tcodes used, click on the Tcode command field and use UP and DOWN arrow keys.
  7. To display the checked object when not authorized call transaction SU53. It reports the last objects verified and also the respective values. Incase missing authorization through pop-up then close it (click cross mark) instead of continue it. Then run SU53 immediately either in same session (/nSU53) or in new session (/oSU53).
  8. Use ctrl+? to go to the tcode command field on SAP screen.
  9. Enter /i on tcode field to delete the current session.
  10. Enter /nend to cancel all SAP sessions and log off.
  11. Use ALT+F+W and ALT+F+U in SAP Easy Access Screen to download and upload the user favourites within/across systems.
  12. Check the child page added to this page for a handy way to open sap notes from SAP OSS Portal.
  13. To send a SAP messge to an other person use Function Module TH_POPUP from transactino SE37.
  14. Ctrl & + to open new SAP session
  15. ctrl+shift+F8  System Administration information.
  16. ctrl+shift+F8 Manul entery of Transation Code.
  17. ctrl+shift+F5 Create folder in Favorite list.
  18. ctrl+shift+F7  Add additional object
  19. ctrl+shift+F12  Direct go to Role maintenance
  20. Change application server in SM51 by double clicking on application server you want to get in.
  21. Note 757964 - Additional information in the SAP GUI window title a must, if you have several systems open at the same time
  22. Note 205487 - Own text on SAPGui logon screen very usefull for messages like "(at)1D(at) Do not login, ..." or "Last clientcopy was on ..."
    Substitute (at) with "at"-char
  23. ALT + F12              Calls the menu pop up for Customizing of local layout
  24. CTRL + Shift + P   Makes a Hard copy which shows no menu pop up and can also contain status texts and modal pop ups
  25. CTRL + /                Cursor jumps directly to the OK-Code field
  26. CTRL + I                Cursor jumps to the first focusable field or control
  27. CTRL + ;                Creates Sap shortcut
  28. To change transport job class to "A": Run report RDDNEWPP from transaction SE38 in the client 000.
  29. multiple logons on AS ABAP system are stored in table: USR41_MLD

How to Install SAP GUI for Mac OS




This guide is written with an intention to help those who are trying to Install SAP GUI 7.30 in Mac OS X 10.9 Mavericks platform and ended up with installing Windows OS in Mac machines due to limited information availability related to Mac & Java configuration.


Requirements:



Steps:

  1. Uninstall the currently installed Java version from mac OS X Mavericks
  2. Restart mac and follow given instructions
  3. Open ‘system preferences’ > ‘user & groups’ > create ‘new account’
  4. Logon to the new user.
  5. Download the mentioned version of “Java for OS X 10.9 OR above
  6. Close all running applications/browser
  7. Install downloaded Java 7
  8. Install SAP GUI (SAPGUI for Java 7.30)
  9. Restart your mac
  10. Logon to the ‘new user’
  11. Launch the ‘SAPGUI 7.30app’