Saturday, January 28, 2012

Alter database end backup

To find if database or any tablespace is in backup mode, the status in V$BACKUP is ACTIVE
SQL) select * from v$backup;

If the backup is stuck and you need to end that back up, give the below sql command :

SQL) ALTER DATABASE END BACKUP;
Database altered.

If one tries to perform shutdown of database when database is in BACKUP mode, you will receive the following error “ORA-01149″

SQL) shutdown immediate;
ORA-01149: cannot shutdown – file 1 has online backup set
ORA-01110: data file 1: ‘/oracle/SRS/sapdata1/sys_01.dbf’

If one tries to set the database that is already in backup mode, one will receive the following error “ORA-01146″

SQL) alter database begin backup;
alter database begin backup
*
ERROR at line 1:
ORA-01146: cannot start online backup – file 1 is already in backup
ORA-01110: data file 1: ‘/oracle/SRS/sapdata1/sys_01.dbf’

Thursday, January 12, 2012

Using Device Pools in SPAD

There was a requirement from customer to create a printer that saves a file at specific location and also prints simultaniously on a given printer.

In SPAD, instead of choosing it as a standard printer give Device Pool and save.
You will get a new tab Device pool where in you can define both the printers and choose option to print on both.

This works !!!:)

Kernel Downgrade

We had a requirement where customer wanted to downgrade the kernel: The kernel in sandbox system EBS was on a lower level 7.20 90 and on test system EBQ it was on a higher level 7.20 114.

Due to some project go live that was scheduled the development was working in EBS System but when it was taken to the EBQ System, it didn't work well. SAP told that this is a kernel bug.

So, customer wanted to downgrade the same.

We followed the below procedure :

1) Dowloaded SAPEXE and SAPEXEDB files of version 90 from Service Marketplace.
2) Extracted those files in the already existing kernel of EBQ /sapmnt/EBQ/exe
3) We checked for lib dbsl there are two files dbhdbsllib.so dbsdbslib.so that also came included in the SAPEXE sar file.

In nutshell, extracting SAPEXE and SAPEXEDB kernel files in /sapmnt/EBQ/exe did the trick and the kernel was successfully downgraded from "Rel 7.20 patch 114" to "Rel 7.20 patch 90" exaclty same as in EBS System.

Monday, January 9, 2012

Security parameters related to Passwords expiry and other settings

LOGIN/PASSWORD_EXPIRATION_TIME
0 (Number of days after which users will be required to change the parameters)

login/min_password_lng
6 8 Minimum password length will change from 6 to 8 characters


login/min_password_digits

0 1 Users will be required to use atleast 1 digit in their passwords


login/min_password_letters 0 1 Users will be required to use atleast 1 alphabet in their passwords


login/min_password_lowercase
0 1 Users will be required to use atleast 1 lowercase alphabet in their


login/min_password_uppercase
0 1 Users will be required to use atleast 1 uppercase alphabet in their
passwords

login/min_password_specials 0 1 Users will be required to use atleast 1 special character in their passwords

login/password_max_idle_initial 0 14 Validity of initial password 0 0 Dates until password must be changed

Oracle sql query for autoextend off

To find dba data files which are autoextensible:

$select FILE_NAME, AUTOEXTENSIBLE from dba_data_files where FILE_NAME like '%sapdata2%' and AUTOEXTENSIBLE='YES';

To turn off the auto extend for a file :

$ALTER DATABASE DATAFILE '/oracle/BIP/sapdata2/sr3usr_3/sr3usr.data3' autoextend off;

Oracle sql query to find sequence number of archive logs

Oracle sql query to find sequence number of archive logs to be applied for recovery during restoring online database:

$ Select SEQUENCE#,to_char(FIRST_TIME,'YYYY-MM-DD:HH24:MI:SS') FIRST_TIME from v$archived_log where to_char(FIRST_TIME,'YYYY-MM-DD HH24:mi:ss') between '2011-01-10 01:26:54' and '2011-01-11 21:00:00';

Index related oracle sql queries

To create index GLPCA~YG at Database level :

$create index 'GLPCA~YG' on 'GLPCA' ('RCLNT', 'KOKRS', 'RBUKRS', 'RYEAR', 'RPRCTR', 'RACCT', 'POPER') PCTFREE 01 INITRANS 002 TABLESPACE PSAPSR3 STORAGE (INITIAL 000000001 MAXEXTENTS UNLIMITED PCTINCREASE 0000 FREELISTS 001)
To display all indexes starting with the name GLPCA in database:

$select index_name from dba_indexes where index_name like 'GLPCA%';
To drop index GLPCA~YG1 in database:

$drop index sapsr3."GLPCA~YG1";

Monday, January 2, 2012

sort command in unix

To find out the biggest file in the directory in descending order

$du -sk * | sort -n

other beautiful command to find in which file the parameter is defined in directory:

$cd /sapmnt/PEP/profile
$grep "DIR_CCMS" *

ccms agent shared memory problems

During startup of CCMS agent, we were getting the shared memory errors:

$sapccm4x -DCCMS pf=/sapmnt/PEP/profile/PEP_DVEBMGS00_pep0v

INFO: use SAPLOCALHOST ew1app

INFO: CCMS agent sapccmsr working directory is /usr/sap/ccms/EW1_02/sapccmsr

INFO: CCMS agent sapccmsr config file is /usr/sap/ccms/EW1_02/sapccmsr/csmconf
INFO: Central Monitoring System is EW1. (found in config file)
INFO: additional Central Monitoring System is SMS. (found in config file)
INFO: Agent is running (actual pid file is detected)

**********************************************************
Another CCMS Agent is already running with this profile.
**********************************************************

EXITING with code 1

Executing the below command resolved this issue:

sapccm4x -initshm pf=/sapmnt/PEP/profile/PEP_DVEBMGS00_pep0v

when we started again it came up.