Monday, August 7, 2017
Kernel Patching 745 to 749
Kernel Patching ... 745 to 749 .
- Download kernel files from SAP SWDC
---- Extract Kernel files
----- SAPCAR -xvf SAPEXE_xyz.SAR /sapmnt/SID/newexe (Kernel Part I DB independent)
----- SAPCAR -xvf SAPEXEDB_xyz_.SAR /sapmnt/SID/newexe (Kernel Part II DB dependent)
----- SAPCAR -xvf dw_527_xyz.sar /sapmnt/SID/newexe (disp+work package)
----- SAPCAR -xvf lib_dbsl_xyz.sar /sapmnt/SID/newexe (Database library)
Take backup of existing exe directory
Check path
login with SIDADM user and execute following command to check path
sappfpar pf=ECD_DVEBMGS00_SID.pfl
This will give you current directory path of kernel executable
Stop - SAP
/sapmnt/SID/exe/us/linuxx86_64
replace extracted files to this current kernel directories
now login as root and set premission on kernel direcoty
chown -R sidadm:sapsys /sapmnt/SID/exe/uc/linuxx86_64
and execute saproot script.
/sapmnt/SID/exe/uc/linuxx86_64/saproot.sh SID
and Start - SAP
******************************
To check patching History in System
Go to
SE16 and enter table name PATCHHIST
for details check SAP Note : 2450700
https://launchpad.support.sap.com/#/notes/2450700/E
***************************************************************
Sybase Database : Source database is larger than the target database,
You can also refer to SAP Note : 2345568
https://launchpad.support.sap.com/#/notes/2345568/E
Symptom
1) While restoring you will get error
2) System Copy fails with error "Unable to load database <SID>
Cause
- The source database, where the dump was taken, is larger than the target database , where it is loaded
- The 'create database' statements are different between source (dump) and target (load).
Resolution :
To increase target database size , we need to check source database size for this execute load command with 'listonly=create_sql" this will generate a list of DDL command that contain data file size and log file size.
load database SID from "/backup/SID.dump_file" with listonly=create_sql
go
If the database already exist first you have to drop that database and also need to drop device layout for Data & Log files.
***************
Command to drop devices
sp_dropdevice <device name>
go
i.e sp_dropdevie ECD_data_001
go
***************
Command to Check size of DB
sp_helpdb ECD
go
***************
Below DDL's are generated from commands (in purple) & execute these command by order
load databae ECD from "/backup/ecd_dump.dmp" with listonly=create_sql
go
or
go >> Script_DDL.sql
check file in /sybase/<SID>/ --- directory
***************
Command to create new devices
DISK INIT
name = 'ECD_data_001'
, physname = '/sybase/ECD/sapdata_1/ECD_data_001.dat'
, size = '108G'
, directio = true
go
DISK INIT
name = 'ECD_log_001'
, physname = '/sybase/ECD/saplog_1/ECD_log_001.dat'
, size = '10G'
, directio = true
***************
Command to create database
go
CREATE DATABASE ECD
ON ECD_data_001 = '10G'
LOG ON ECD_log_001 = '10G'
WITH lob_compression = 100
, inrow_lob_length = 2000
, compression = page
, index_compression = page
go
***************
Command to alter database
ALTER DATABASE ECD
ON ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
go
***************
other execute ables
master..sp_dboption ECD, 'abort tran on log full', true
go
master..sp_dboption ECD, 'allow nulls by default', true
go
master..sp_dboption ECD, 'allow wide dol rows', true
go
master..sp_dboption ECD, 'ddl in tran', true
go
master..sp_dboption ECD, 'deferred table allocation', true
go
master..sp_dboption ECD, 'full logging for all', true
go
master..sp_dboption ECD, 'allow incremental dumps', true
go
master..sp_dboption ECD, 'deallocate first text page', true
go
master..sp_dboption ECD, 'allow db suspect on rollback error', true
**************************************************
Apply transaction logs if required and issue database online command
https://launchpad.support.sap.com/#/notes/2345568/E
Symptom
1) While restoring you will get error
Data on dump will not fit into current database. Need <xxx> Mbyte database
2) System Copy fails with error "Unable to load database <SID>
Cause
- The source database, where the dump was taken, is larger than the target database , where it is loaded
- The 'create database' statements are different between source (dump) and target (load).
Resolution :
To increase target database size , we need to check source database size for this execute load command with 'listonly=create_sql" this will generate a list of DDL command that contain data file size and log file size.
load database SID from "/backup/SID.dump_file" with listonly=create_sql
go
If the database already exist first you have to drop that database and also need to drop device layout for Data & Log files.
***************
Command to drop devices
sp_dropdevice <device name>
go
i.e sp_dropdevie ECD_data_001
go
***************
Command to Check size of DB
sp_helpdb ECD
go
***************
Below DDL's are generated from commands (in purple) & execute these command by order
load databae ECD from "/backup/ecd_dump.dmp" with listonly=create_sql
go
or
go >> Script_DDL.sql
check file in /sybase/<SID>/ --- directory
***************
Command to create new devices
DISK INIT
name = 'ECD_data_001'
, physname = '/sybase/ECD/sapdata_1/ECD_data_001.dat'
, size = '108G'
, directio = true
go
DISK INIT
name = 'ECD_log_001'
, physname = '/sybase/ECD/saplog_1/ECD_log_001.dat'
, size = '10G'
, directio = true
***************
Command to create database
go
CREATE DATABASE ECD
ON ECD_data_001 = '10G'
LOG ON ECD_log_001 = '10G'
WITH lob_compression = 100
, inrow_lob_length = 2000
, compression = page
, index_compression = page
go
***************
Command to alter database
ALTER DATABASE ECD
ON ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
, ECD_data_001 = '1G'
go
***************
other execute ables
master..sp_dboption ECD, 'abort tran on log full', true
go
master..sp_dboption ECD, 'allow nulls by default', true
go
master..sp_dboption ECD, 'allow wide dol rows', true
go
master..sp_dboption ECD, 'ddl in tran', true
go
master..sp_dboption ECD, 'deferred table allocation', true
go
master..sp_dboption ECD, 'full logging for all', true
go
master..sp_dboption ECD, 'allow incremental dumps', true
go
master..sp_dboption ECD, 'deallocate first text page', true
go
master..sp_dboption ECD, 'allow db suspect on rollback error', true
**************************************************
Apply transaction logs if required and issue database online command
Monday, July 31, 2017
Backup / Restore Procedure on SAP ASE DB --
Backup / Restore Procedure on SAP ASE DB --
Connection with DB
login with
su - sybhdb
#Command to login with user on SID
isql -U sapsa -P password_sa_user -S SID -X
#Command to check Currently running DB
sp_helpdb
go
#Command to check Backup servers
sp_hepserver
go
#To backup transnational data you have to disable trunc.log on chkpt
***** error *** correction ...
DUMP TRANsaction to a dump device is not allowed while the trunc. log on chkpt.
option is enabled. Disable the option with sp_dboption, then use DUMP DATABASE,
before trying again.
*************************
#Use command to switch to upper level
use HDB
go
#Master command to change parameter
master..sp_dboption HDB, "trunc log on chkpt", false
go
#checkpoint command to save new value
checkpoint
go
# Now you have to take full backup and after that you can take transnational backup as well
#Command to Backup Database of DB HDB on file system
dump database HDB to "/data/backup/hdb_s1.dmp"
stripe on "/data/backup/hdb_s2.dmp" #stripe command will split db into pices
stripe on "/data/backup/hdb_s3.dmp"
with compression = 2 #compression ratio
go
#Command to Backup transactions of DB HDB on file system
dump transaction HDB to "/data/backup/hdb_trn.trn"
go
#Restore Procedure
#Command to check active connection with DB
sp_who
go
#Command to restore DB
load database HDB from "/data/backup/hdb_s1.dmp"
stripe on "/data/backup/hdb_s2.dmp"
stripe on "/data/backup/hdb_s3.dmp"
go
#Command to restore Transaction
load transaction HDB from ""/data/backup/t*.trn"
with until_time="September 28, 2012 1:02am"
go
#After Successful restore online command to set db online for user
online database HDB
Subscribe to:
Posts (Atom)