Thursday 31 July 2014

What are the functions of SAPOSCOL?

What are the functions of SAPOSCOL?

SAPOSCOL is an operating system collector. It is a standalone program that runs in operating system background.
SAPOSCOL collects data about operating system resources like
·         CPU Utilization
·         Usage of Physical Memory
·         Usage of Virtual Memory
·         Usage of file systems
·         Usage of Physical disks
·         Usage of running processes

SAPOSCOL runs exactly once per host and runs independently of the sap system.

By default, SAPOSCOL collects data every 10seconds and records it. It also records the hourly average statistics for the last 24hours in shared memory. This data will be fetched by background job “SAP_COLLECTOR_FOR_PERFORMANCE” and writes it to the MONI performance database table.


Sunday 27 July 2014

DB post steps

DB post steps:


1. Create OPS$ users

SQL> select tablespace_name,status from dba_tablespaces;

TABLESPACE_NAME         STATUS
------------------------------ ---------
SYSTEM                         ONLINE
SYSAUX                         ONLINE
PSAPUNDO                    ONLINE
PSAPTEMP                     ONLINE
PSAPCRM                       ONLINE
PSAPCRM731                 ONLINE
PSAPCRMUSR                ONLINE



SQL> create user OPS$BCRADM DEFAULT TABLESPACE PSAPCRMUSR temporary tablespace psaptemp identified externally;

User created.

SQL> create user OPS$ORABCR DEFAULT TABLESPACE PSAPCRMUSR temporary tablespace psaptemp identified externally;

User created.

SQL> grant connect, resource to ops$bcradm;

Grant succeeded.

SQL> grant sapdba to ops$orabcr;

Grant succeeded.

2. Drop exBIDing table ops$sidadm.sapuser (Source <sid>)

SQL> drop table ops$c2radm.sapuser;

Table dropped.

3. Create table ops$sidadm.sapuser (target <sid>)

SQL> create table ops$BCRadm.sapuser (userid varchar2(256), passwd varchar2(256));

Table created.

SQL> insert into ops$BCRadm.sapuser values ('SAPCRM','a234678z');

1 row created.


SQL> alter user sapcrm profile default;

User altered.

SQL> alter user system identified by a234678z;

User altered.

4. Update schema owner password using brconnect.

brconnect -u system/a234678z -f chpass -o sapcrm -p a234678z

5. Run scripts sapdba_role.sql and sapconn_role.sql

 sapdba_role.sql :

 sqlplus /nolog @sapdba_role <SAPSCHEMA_ID>
 <SAPSCHEMA_ID>: for owner SAPR3: R3, SAP<SID>: <SID>, SAP<SID>DB: <SID>DB

sapconn_role.sql :
sqlplus /nolog @sapconn_role

Starting SAP

1. Verify <sid>adm environment pinting to 11g binaries, 11g client

DIR_LIBRARY
LD_LIBRARY_PATH
TNS_ADMIN
ORACLE_HOME_PATH

2. Go to cdexe and run ldd dboraslib.so , should be able to load libraries

hostname:bcradm 11> cdexe
hostname:bcradm 12> ldd dboraslib.so
        linux-vdso.so.1 =>  (0x00007fff1e9ff000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f43e8d81000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f43e8b78000)
        libclntsh.so.11.1 => /oracle/client/10x_64/instantclient/libclntsh.so.11.1 (0x00007f43e61c2000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f43e5e21000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f43e5b1a000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f43e5896000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f43e5680000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f43e5463000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003a7b400000)
        libnnz11.so => /oracle/client/10x_64/instantclient/libnnz11.so (0x00007f43e5097000)
        libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f43e4e7e000)
        libaio.so.1 => /lib64/libaio.so.1 (0x00007f43e4c7c000)

3.Run R3trans –d using <sid>adm, return code to be 000

If return code other than 000 analyse r3trans.log
hostname:bcradm 13> R3trans -d
This is R3trans version 6.23 (release 720 - 17.09.12 - 20:12:05 ).
unicode enabled version
R3trans finished (0000).


4. Startsap and verify startup logs

Ps –eaf| grep dw
Ps –eaf| grep sap
Ps –eaf| grep ms ,
ps –eaf| grep scs,
ps –eaf| grep ers

5. Login to SAP via sapgui and apply sap license

Record hardware key to generate saplicense via sap market place
hostname:bcradm 16> saplicense -get
saplicense: HARDWARE KEY = xxxxxxxxxxx

6. Set below paaremter to login with user sap* 000 client

DEFAULT.PFL:login/no_automatic_user_sapstar = 0
Set below paramters relevant to transport

Example:
BIR_DVEBMGS01_sapbirci:DIR_EPS_ROOT = /usr/sap/trans/isu/BIR/EPS
BIR_DVEBMGS01_sapbirci:DIR_TRANS = /usr/sap/trans/isu/BIR

7. Reinitialize TMS after DB copy

logon to 000  as DDIC
Run transaction SE06 -->database copy or database migration
Reinstall CTS -->  yes
change original <S_System <SID>>to <T_System <SID>> -->yes
cts not configured --> ok
delete the TMS Configuration --> yes
delete all versions of transports --> yes
delete transport routs --> yes
Configure TMS

Logon to 000 Client with user DDIC and password

Go to STMS and configure TMS as self domain, verify domain.cfg tp_domain.PFl creation at right location at OS level.

Go to system overview, create a virtual system
Go to transport routes and add routes, adjust and dBIRribute

8. Suspend background jobs, run report BTCTRNS1

9. Configure SAP Profile Parameter Files

After the database restore, the active profiles lBIRed in the SAP system will be from the old hostname.  These profiles need to be deleted and the profiles from the OS need to be re-imported.  Proceed as follows:

Run transaction RZ10.

Delete source system profiles:

Click the Profile drop-down box and choose a profile (this process must be done for each profile).
Select menu items: Profile -> Delete -> All versions of a profile.

Click Yes to first prompt to update the database

Click No to delete the files from the OS Level

Click green check on all versions deleted screen

Repeat steps 1-3 for all source system profiles lBIRed in the Profile drop-down lBIR.

Import all profiles from UNIX by selecting menu items: Utilities -> Import Profiles -> of active servers.

Green back arrow.

10. Fix Logon Group Names

Run transaction SMLG

Add the newly added systems to exBIRing LOGON groups.
Highlight the New Hostname Entries.
Click the Assign Group button and assign the Logon groups respectively.
Highlight the Old Hostname Entries.
Click the Delete button.
Save.  

Note: Do not delete the groups instead of that delete only instances assigned. If you delete the groups both the groups and instances will be deleted.

Re-execute transaction SMLG once again and validate the logon group configuration.


11.Fix RFC Server Group

Run transaction RZ12
Add the newly added systems to exBIRing server groups.
Click create assignment provide exBIRing server group name and hostname
Choose apply current quotos and save


12. Configure Op Modes

After the database restore, the target system will contain Operation Modes from the old hostname.  These Op Modes need to be deleted and the correct Op Modes need to be imported.  Proceed as follows:
Run transaction RZ04
Choose exiting operation mode and delete
Click create operation mode
Select a server name and press SHIFT F2.
Do this for each source system op mode lBIRed.
Click the SAVE button and provide day mode
Click yes to add other operation mode (night), select no and save.

13. Create RFC’s between CRM, ISU and BW systems

CRM --> ISU & ISU --> CRM
Use user rfcuser or copy rfcuser with in the rfc and maintain the rfc’s, perform authorization test
CRM --> BW & ISU --> BW
Use user KIWALE with in the rfc connections
BW --> CRM & BW -->ISU
Use user BIWREMOTE, ALEREMOTE or rfcuser relevant to system

14. Logical system conversion

Go to SCC4 and record the logical system

Go to WE20 and record logical systems relevant to ISU, CRM and BW
      
1. Disconnect from previously connected BWR (EX : BWR – source , BWS – target) 

(For all systems that are source systems of BW: ISU, CRM)
Run Transaction SE37
Enter RSAP_BIW_DISCONNECT
Hit Test/Execute (F8)
Enter data into the following fields:
I_BIW_LOGSYS:  BWRCLNT500
I_OLTP_LOGSYS: <Logical system for your Production System>
I_FORCE_DELETE: X
Hit execute (F8)

Difference between PFILE and SPFILE? What are their advantages?

Difference between PFILE and SPFILE? What are their advantages?

 PFILE

Until Oracle 8i, we were using a text file called the PFILE (parameter file) for setting the database initialization parameters. This PFILE is read at instance startup time to get specific instance characteristics. The PFILE is text based, and can be edited in an editor like vi on UNIX or Notepad on Windows. Any changes that were made in PFILE would only take effect when the database is restarted,
Since SAP/Oracle recommends using SPFILE over PFILE, I will provide some details on SPFILE to answer your question in more detail.

SPFILE

In Oracle9i, a new feature called SPFILE (server parameter file) was introduced. SPFILE is a binary file that contains the same information as the old PFILE. SPFILE permits dynamic changes without requiring you to restart that instance.

By default, if you do not specify PFILE in your STARTUP command, Oracle will use server parameter file (SPFILE). If you choose to use the traditional text initialization parameter file (PFILE), you must specify the PFILE clause when issuing the STARTUP command.

The SPFILE is different from the PFILE in that it cannot be directly edited. This is because it has a header and footer that contain binary values. Since you cannot change a SPFILE directly, Oracle allows you to manage the SPFILE via the ALTER SYSTEM command.

When you execute the ALTER SYSTEM command, the parameter change is validated immediately, which helps avoid errors associated with entering an incorrect parameter name or an invalid value. In addition, the ALTER SYSTEM allows you to specify whether you want to update the parameter immediately, update just the SPFILE, or both. All these features help avoid human error associated with manually updating a PFILE.

The following example shows how to change the current value of SESSIONS and store the value in the SPFILE.

SQL> ALTER SYSTEM SET SESSIONS=200 SCOPE=SPFILE;

The new part in this command is the parameter SCOPE. You have the following options for this.
SCOPE = SPFILE

(For both static and dynamic parameters, changes are recorded in the spfile, and will take effect in the next restart.)

SCOPE = MEMORY

(For dynamic parameters, changes are applied in memory only. No static parameter change is allowed.)

SCOPE = BOTH

For dynamic parameters, the change is applied in both the server parameter file (SPFILE) and memory. No static parameter change is allowed.)
For dynamic parameters, we can also specify the DEFERRED keyword. When specified, the change is effective only for future sessions.

Now for the first part of your question. Since you are using Oracle 10G, you have to use the ALTER SYSTEM command to change the Oracle parameters as recommended by the SAP Early Watch Alert.

To Enable and Disable Archive logs in System

To Enable and Disable Archive logs in System

Enable:
hostname:oracs5 55>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sat Apr 19 10:53:48 2014
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data mining and Real Application Testing options

SQL>shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL>select status from v$instance;
select status from v$instance
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 19669
Session ID: 405 Serial number: 49


SQL>startup mount;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 4777603072 bytes
Fixed Size                  2236008 bytes
Variable Size            2332033432 bytes
Database Buffers         2298478592 bytes
Redo Buffers              144855040 bytes
Database mounted.

SQL>alter database archivelog;

Database altered.

SQL>alter database open;

Database altered.

SQL>archive log list;
Database log mode           Archive Mode
Automatic archival             Enabled
Archive destination            /oracle/CS5/oraarch/CS5arch
Oldest online log sequence     6394
Next log sequence to archive   6397
Current log sequence           6397
SQL>


Disable:


hostname:oracs5 55>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sat Apr 19 10:53:48 2014
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data mining and Real Application Testing options

SQL>shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL>select status from v$instance;
select status from v$instance
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 19669
Session ID: 405 Serial number: 49


SQL>startup mount;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 4777603072 bytes
Fixed Size                  2236008 bytes
Variable Size            2332033432 bytes
Database Buffers         2298478592 bytes
Redo Buffers              144855040 bytes
Database mounted.

SQL>alter database Noarchivelog;

Database altered.

SQL>alter database open;

Database altered.

SQL>archive log list;
Database log mode           No Archive Mode
Automatic archival             Enabled
Archive destination            /oracle/CS5/oraarch/CS5arch
Oldest online log sequence     6394
Next log sequence to archive   6397
Current log sequence           6397
SQL>