Wednesday, December 25, 2019

how to check DB version using isql in sybase DB

hostname /sybase/PL6% isql -Usapsa -Ppassword -Spl6 -X
CT-LIBRARY error:
        ct_connect(): directory service layer: internal directory control layer error: Requested server name not found.
hostname /sybase/PL6% isql -Usapsa -Ppassword -SPL6 -X
1> sp_version
2> go
 Script
         Version                                                                                                                                                                                                                                                                                                                                                                                       
         Status
 --------------------------------------------------------------------
         ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
         --------------------------------
 ODBC MDA Scripts
         16.0.02.03.1016/Fri Mar 18 UTC 02:57:07 2016                                                                                                                                                                                                                                                                                                                                                 
         Complete
 OLEDB MDA Scripts
         16.0.02.00.1014/Mon Apr 06 UTC 05:23:45 2015                                                                                                                                                                                                                                                                                                                                                 
         Complete
 installcommit
         16.0 SP02 PL06 HF1/EBF 27305 SMP/P/x86_64/Enterprise Linux/ase160sp02pl
         06x/2829/64-bit/OPT/Sun Jul  9 10:37:35 2017                                                                                                                                                                                                                                                                                                                                                 
         Complete
 installdbextend
         16.0 SP02 PL06 HF1/EBF 27305 SMP/P/x86_64/Enterprise Linux/ase160sp02pl
         06x/2829/64-bit/OPT/Sun Jul  9 10:37:35 2017                                                                                                                                                                                                                                                                                                                                                 
         Complete
 installjdbc
         jConnect (TM) for JDBC(TM)/1005/Wed Sep 21 00:00:00 2016 PDT                                                                                                                                                                                                                                                                                                                                 
         Complete
 installjsdb
         16.0 SP02 PL06 HF1/EBF 27305 SMP/P/x86_64/Enterprise Linux/ase160sp02pl
         06x/2829/64-bit/OPT/Sun Jul  9 10:37:35 2017                                                                                                                                                                                                                                                                                                                                                 
         Complete
 installmaster
         16.0 SP02 PL06 HF1/EBF 27305 SMP/P/x86_64/Enterprise Linux/ase160sp02pl
         06x/2829/64-bit/OPT/Sun Jul  9 10:37:35 2017                                                                                                                                                                                                                                                                                                                                                 
         Complete
 installmodel
         16.0 SP02 PL06 HF1/EBF 27305 SMP/P/x86_64/Enterprise Linux/ase160sp02pl
         06x/2829/64-bit/OPT/Sun Jul  9 10:37:35 2017                                                                                                                                                                                                                                                                                                                                                 
         Complete
 installsecurity
         16.0 SP02 PL06 HF1/EBF 27305 SMP/P/x86_64/Enterprise Linux/ase160sp02pl
         06x/2829/64-bit/OPT/Sun Jul  9 10:37:35 2017                                                                                                                                                                                                                                                                                                                                                 
         Complete
 montables
         16.0/27305/P/x86_64/Enterprise Linux/ase160sp02pl06x/2829/64-bit/OPT/Su
         n Jul 09 10:23:44 2017                                                                                                                                                                                                                                                                                                                                                                       
         Complete

(10 rows affected)
(return status = 0)
1>

Thursday, October 11, 2018

Admin task -3: Advance backup and restore topics in sybase

Backup and Recovery:

To back up the master to a tape device, start isql


enter the command:
                                    dump database master to "tape_device"

Note:
Master database contains the information regarding the entire structure of the database.

Master database act similarly as system database in HANA database.


Automatic backup scheduling process:


command - dbcc to check the consistency and any errors prediction.

* If dbcc detects errors, correct them before dumping the database..

1. create one folder for Backup.
2. run the below commands

su - sybecd
% isql -Usapsa -PWsysmax@756 -SECD -X

1> use master
2> exec sp_config_dump @config_name='ECD', @stripe_dir = '/backup/12-10-2018.dmp' , @compression = '101' , @verify = 'header'
3> go
The change is completed. The option is dynamic and ASE need not be rebooted for
the change to take effect.
(return status = 0)

3. schedule a job in DB13.

4. check the dump file grow from previous backup to present one.

Allocating Physical Resources

System Administration Guide: Volume 2 > Overview of DiskResourcesto understand the kinds of disk resources required by SAP ASE. See also System Administration Guide: Volume 2 > Configuring Memory and System Administration Guide: Volume 2 > Managing Mulitprocessor Servers for information about memory and CPU resources. The following sections provide helpful pointers in determining physical resource requirements.

my doudts in sybase DB

1. what this interface files does in DB level and network level?

Wednesday, October 10, 2018

Unit -3:System Administration


Admin Task -2: performing backup and restore of sybase database

After getting the system access through Putty:

Backup:

  • login with root user.
  • The isql command for Sybase database Backup:
                         su - syb<sid>
                       
                        isql  -Usapsa -Ppassword -Ssid -X
                        dump database sid to ' /backup_folder/11-10-2018.dmp' with compression 101
                        go

Here
          sapsa  -  user with database admin privileges.
          password- password for the sapsa user.
          sid       - system id in SAP.
          101      - compression rate.
                        The advantage of compressing data backups:
                          
                               * use less disk space.
                               * complete in shorter amounts of time. 



Restore:
  • login with root user.
  • The isql command for Sybase database Restore:
                                         su - syb<sid>
                                         isql  -Usapsa -Ppassword -Ssid -X
                                         load database sid from 'file location of backup '  with compression 101
                                         go

                                    


System or stored procedures, Creating Temporary Tables,

System or stored procedures:
  • SAP system procedures are stored in the database sybsystemprocs.
  • Any time you make changes to sybsystemprocs, back up the database.


Creating Temporary Tables:

  • Create temporary tables either by preceding the table name in a create table statement with a pound sign (#), or by specifying the name prefix “tempdb..”.
  • Temporary tables created with a pound sign are accessible only by the current SAP ASE session: users on other sessions cannot access them. These nonsharable, temporary tables have destroyed at the end of each session.
  • Warning! Do not create temporary tables with the “tempdb..” prefix from inside a stored procedure unless you intend to share those tables among other users and sessions. 
  • Each time you restart SAP ASE, it copies model to tempdb, which clears the database. You cannot recover temporary tables.




                for more info:                                                                                                                                                                  


  • sybsystemdb Database
  1. The sybsystemdb database stores information about distributed transactions.                              
  2.  Information about remote servers participating in distributed transactions is stored in the syscoordinations table. 
  3. The sybsystemdb database also stores information about SYB2PC transactions that use the SAP two phase commit protocol.
  4. The spt_committab table, which storesinformation about and tracks the completion status of each two-phase commit transaction, is stored in the sybsystemdb database. 
Note:
See the Configuration Guide for your platform for information about two-phase commit transactions and how to create the sybsystemdb database.


sybmgmtdb Database:

The sybmgmtdb database stores jobs, schedules, scheduled jobs information, and data needed by the internal Job Scheduler task for processing.

pubs2 and pubs3 Sample Databases:


The pubs2 and pubs3 sample databases are provided as a learning tool for SAP ASE.

Note:
  • The sample databases are intended for training purposes only, and installing them is optional.
  •  Do not install them in an SAP ASE production environment.
  • If space is a problem, instruct users to issue the begin transaction command before updating a sample database. After the user has finished updating one of the sample databases, he or she can issue the rollback transaction command to undo the changes.
sybdiag Database:

SAP Product Support may create the sybdiag database on your system for debugging purposes. This database holds diagnostic configuration data, and should not be used by customers.

Determining the Version of the Installation Scripts:

  • sp_version lets you determine the current version of the scripts.
The syntax for sp_version is: sp_version [script_file [, “all”]]

where: 
• script_file is the name of the installation script (the default value is NULL).
 • all reports details about each script, such as the date executed, and the length of time for execution.

If you run sp_version without any parameters, it reports on all scripts


                                               sp_version null, 'all' 

This example describes what installation scripts were run, what time they were run, and what time they finished.






how to check DB version using isql in sybase DB

hostname /sybase/PL6% isql -U sapsa -Ppassword -Spl6 -X CT-LIBRARY error:         ct_connect(): directory service layer: internal directo...