A log buffer is a circular buffer in the SGA that holds information about changes made to the database. This information is stored in the redo entries. Redo entries contain the information necessary to reconstruct or redo changes made to the database by insert, update, delete, create, alter, or drop operations. Redo entries are primarily used for database recovery as necessary.

       The server processes generate redo data into the log buffer as they make changes to the data blocks in the buffer. LGWR subsequently writes entries from the redo log buffer to the online redo log.


        The redo log buffer is a RAM area (defined by the initialization parameter log_buffer) that works to save changes to data, in case something fails and Oracle has to put it back into its original state (a ?rollback?).  When Oracle SQL updates a table (a process called Data Manipulation Language, or DML), redo images are created and stored in the redo log buffer. Since RAM is faster than disk, this makes the storage of redo very fast.

The Oracle redo log buffer provides the following functions within the Oracle SGA:
  1. Serves for assistance with database recovery tasks
  2. Records all changes made to database blocks
  3. Places changes recorded to redo entries for redo logs
The database initialization parameter log_buffer defines the default size of the redo log buffer within Oracle 11g.



Oracle will eventually flush the redo log buffer to disk. This can happen in a number of special cases, but what?s really important is that Oracle guarantees that the redo log buffer will be flushed to disk after a commit operation occurs. When you make changes in the database you must commit them to make them permanent and visible to other users.

File Transfer Protocol (FTP) was widely used protocol to transfer files or data remotely in unencrypted format which is not secure way to communicate. As we all know that File Transfer Protocol is not at all secure because all transmissions happens in clear text and the data can be readable by anyone during sniffing the packets on the network. So, basically FTP can be used in limited cases or on the networks that you trust. 

SFTP (Secure File Transfer Protocol) runs over SSH protocol on standard port 22 by default to establish a secure connection. SFTP has been integrated into many GUI tools (FileZillaWinSCPFireFTP etc.).

Security Warnings: Please don’t open SSH port (Secure SHell) globally as this would be a security breaches. You can only open for specific IP from where you are going to transfer or manage files on remote system or vice versa.


This article will guide you 10 sftp command examples to use it through interactive command-line interface.

1. How to Connect to SFTP

By default, same SSH protocol is used to authenticate and establish a SFTP connection. To start an SFTP session, enter the username and remote hostname or IP address at the command prompt. Once authentication successful, you will see a shell with an sftp> prompt.
[root@tecmint ~]# sftp tecmint@27.48.137.6
Connecting to 27.48.137.6...
tecmint@27.48.137.6's password:
sftp>

2. Getting Help

Once, you in the sftp prompt, check the available commands by typing ‘?‘ or ‘help‘ at command prompt.
sftp> ?
Available commands:
cd path                       Change remote directory to 'path'
lcd path                      Change local directory to 'path'
chgrp grp path                Change group of file 'path' to 'grp'
chmod mode path               Change permissions of file 'path' to 'mode'
chown own path                Change owner of file 'path' to 'own'
help                          Display this help text
get remote-path [local-path]  Download file
lls [ls-options [path]]       Display local directory listing
ln oldpath newpath            Symlink remote file
lmkdir path                   Create local directory
lpwd                          Print local working directory
ls [path]                     Display remote directory listing
lumask umask                  Set local umask to 'umask'
mkdir path                    Create remote directory
put local-path [remote-path]  Upload file
pwd                           Display remote working directory
exit                          Quit sftp
quit                          Quit sftp
rename oldpath newpath        Rename remote file
rmdir path                    Remove remote directory
rm path                       Delete remote file
symlink oldpath newpath       Symlink remote file
version                       Show SFTP version
!command                      Execute 'command' in local shell
!                             Escape to local shell
?                             Synonym for help

3. Check Present Working Directory

The command ‘lpwd‘ is used to check the Local present working directory, whereas ‘pwd‘ command is used to check Remote working directory.
sftp> lpwd
Local working directory: /
sftp> pwd
Remote working directory: /tecmint/
  1. lpwd – print the current directory on your system
  2. pwd – print the current directory on the ftp server

4. Listing Files

Listing files and directories in local as well as remote system.
On Remote
sftp> ls
On Local
sftp> lls

5. Upload File

Put single or multiple files in remote system.
sftp> put local.profile
Uploading local.profile to /tecmint/local.profile

6. Upload Mutiple Files

Putting multiple files on in remote system.
sftp> mput *.xls

6. Download Files

Getting single or multiple files in local system.
sftp> get SettlementReport_1-10th.xls
Fetching /tecmint/SettlementReport_1-10th.xls to SettlementReport_1-10th.xls
Get multiple files on a local system.
sftp> mget *.xls
Note: As we can see by default with get command download file in local system with same name. We can download remote file with different name specifying the name at the end. (This applies only while downloading single file).

7. Switching Directories

Switching from one directory to another directory in local and remote locations.
On Remote
sftp> cd test
sftp>
On Local
sftp> lcd Documents

8. Create Directories

Creating new directories on local and remote locations.
sftp> mkdir test
sftp> lmkdir Documents

9. Remove Directories

Remove directory or file in remote system.
sftp> rm Report.xls
sftp> rmdir sub1
Note: To remove/delete any directory from remote location, the directory must be empty.

10. Exit sFTP Shell

The ‘!‘ command drop us in local shell from where we can execute Linux commands. Type ‘exit‘ command where we can see sftp> prompt return.
sftp> !
[root@sftp ~]# exit
Shell exited with status 1
sftp>

Conclusion

The SFTP is a very useful tool for administrating servers and transferring files to and from (Local and Remote). We hope this tuts will help you to understand the usage of SFTP in some extent.

General Information:

It is an agent that can accomplish several life cycle management tasks, such as operating system monitoring, DB monitoring, system instance control and provisioning.

It is installed automatically when we install a new system of Netweaver 7.20 or higher version.

It upgrades automatically when we upgrade the system or when we patch or upgrade the kernel of existing system.

We can also upgrade the host agent individually.

The host agent starts automatically when we boot the system and it is performed using sapinst script in UNIX.

Information about different files of SAPHOSTAGENT:

With the help of host agent the SOLMAN/LVM/SAP MC … collects information of the system to monitor the system status and these are connected to host agent of a particular system using a web service Runtime.

The functionalities of host agent are performed by using the following executables.
1.      Sap Host Control
2.      Sap Host Exec
3.      Saposcol

Location of executables:
               UNIX - /usr/sap/hostctrl/exe

Functionalities of Different Executables:

SAPHOSTEXEC:

It runs under privileged user account such as root in UNIX.
It is used for host agent installation and upgrade purposes.

SAPHostControl:
               It runs under the sidadm user.
               It is the agent that monitors hosts.

Saposcol:
               It runs independent of instances and we have exactly one agent for each host.
               The data collected by Saposcol is placed in a shared memory which makes the information available to all instances in a host and to various applications.
It collects the information of following OS resources such as
                              Physical and virtual memory usage
                              CPU utilization
                              Utilization of physical disks and file systems.
                              Resources usage of running processes.

Profile file:

               It contains all the parameters required to proper functioning of host agent and it is identified as host_profile file.
               It is available under executable directory.

Log Files:

               The following files available under work directory.
               Sapstartsrv_ccms.log – log file for central monitoring and it is stored under sapccmsr directory.
               Sapstartsrv.log – developer trace of sapstratsrv.
               Dev_saphostexec – developer trace of hostexec.
               Dev_sapdbctrl – developer trace of sapdbctrl.

Symptom

In your current SAP system landscape, you have 3 systems which are development, quality and production. You have completed an upgrade of the SAP development system. Now, you are planning to upgrade the SAP quality and production system.
In the SAP development earlier, you have also generated the stack.xml file which is required during the SAP upgrade. As for SAP quality and production system, you will need the stack.xml file as well for each of the SAP system. Instead of manually generate the stack.xml file again, you are looking for another way to generate the file faster.

Solution

In the SAP Solution Manager itself, there is a report called RPT_MOPZ_COPY_STACK_XML which you can use to generate a copy / identical stack.xml file for other system (in 1 landscape). Meaning here, the other SAP system should have a same support packages / components, database and operating system.
1. Execute transaction code SE38 and run the report RPT_MOPZ_COPY_STACK_XML. Click on Upload Template Stack XML to upload the stack.xml from SAP development system. Once uploaded, enter the SID of the SAP system you which to generate the stack.xml file, example, PRD. You will also notice under System Mappings tab, the hostname of the SAP development system appear. Press Enter or Execute (F8).


2.Select the hostname of your PRD system under the System Mappings tab. Now, click on Download XML Copy to get the new stack.xml of your PRD system.



The trace and log messages contain important information about system operations. It is helpful to check and analyze them if you experience errors or undesired behavior.
The SAP MC log viewing functions allow you to:
  • View all system log and trace files
  • View developer trace files
  • Create stack traces for the processes
Types of Log and Trace Files
  • Startup and control framework logs
    Contain information about the startup process. You can check these files if errors or undesired behavior occur during the startup process. By default, the data from the last three restarts is kept.
    • The developer trace files and system output of all the executables belonging to an instance are located in the directory \usr\sap\<SID>\<instance name>\work, where <SID> is the system ID (for example, CE1) and <instance name> is the instance name (for example, JC00 or SCS01).
  • AS Java logs
    The log and trace files generated by the AS Java process(es) and the applications running on top of AS Java are stored in the usr\sap\<SID>\<instance name>\j2ee\cluster\server<n>\log directory.

Procedure

Viewing Developer Trace Files
Developer traces are related to operating system processes such as icmmsg server or Abap work process belonging to an instance.
  1. To view the developer trace file of a process, in the result view, select the relevant process.
  2. From the context menu, choose Show Developer Trace. The SAP MC displays detailed information in the log file view.
  3. Optional: If the information in the developer trace is insufficient or too detailed, choose Increase/Decrease trace level to adjust the trace level to the desired level of detail.
    The following are the possible trace levels:
    • 0: No trace
    • 1: Error trace
    • 2: Complete process, short data trace
    • 3: Complete process, complete data trace
    By default, the trace level is set to 1. By choosing Increase/Decrease trace level, you move the trace level up/down by one level.
Special Logs and Traces
You can easily view special logs for both the server and instance nodes.
  1. To view the log file of the sapstartsrv service, select an instance, and from the context menu, choose Show Trace File.
  2. To view log records of all log and trace files filtered by time and severity, select an instance or system, and from the context menu, choose Analyze Log Files. The default values are 1000 lines per log file, severity error, and last 10 minutes. You can change these settings in the log view after the result is displayed.
  3. To view the configuration change logs of the SAP AS Java servers, select a system or instance and, from the context menu, choose Show Change Logs.
Dumping the Java Stack Trace
  1. To dump the server processes' Java stack trace, select the relevant server process and, from the context menu, choose Dump Stack.
    The resulting Java server stack trace is stored in the dev_server<n> file in the usr\sap\<SID>\<instance name>\work directory.
  2. To view the dump stack trace, from the context menu, choose Show Developer Trace as described above).
    Note Note
    If the file is too large, in the Open file dev_server<n> dialog box, choose the required option.
View Logs and Traces from Log Files Node
  1. To view all log and trace files of an instance, from the tree structure of the relevant instance, select the Log Files node.
  2. In the result view, select the file you want to view and, from the context menu, choose Show Log File.
  3. From the stack traces in the log files, jump to the source code (if available in workspaces).
The SAP MC displays the detailed information of the relevant log file in the log file view.
The Log File View
The log file view is located at the bottom of the SAP MC perspective. Depending on the format of the log file it will be displayed as a table or as text.
If the log file is shown in a table, you can filter the lines by providing a filter expression in the first line.
Auto Refreshing a Log File
Once the log file is shown, you can choose to update it at regular intervals. Select the Show End of Log File radio button and choose the Run button. Now new entries will be appended in accordance with the chosen update interval. The number of lines shown in the log view is limited to the Lines parameter.
Showing an Entire Log File
The default is to show only the last 1000 lines of a log file. Sometimes you would like to see a whole file. In this case, select Show Entire Log File and choose the Refresh button. If the radio button is inactive, the current content is a concatenation of log files.
Analyze Log Files
The default parameters for the analysis of log files is severity error, last 10 minutes, and a maximum of 1000 lines of each log file in the result. You can modify each of these parameters in the header of the Analyze Log File tab. Once the parameters match your needs, choose the Refresh button. The analysis will be triggered. Full text search and highlighted results for text log files are available.
Note Note
This operation is time- and resource-consuming. If you choose the parameters without care, the operation may run for a very long time, and the result might be too large to be displayed.
The Log View Tool Bar
The tool bar contains of six menu icons.
Icon
Use
Refresh
Refresh the change logs of an AS Java server
Clear
Delete the content of the currently selected tab.
Remove
Use as quick link to close all open tabs.
Lock
Lock scrolling on auto refresh.
Filter
Toggle server filtering.
Syslog
Use as quick link to display the last 1000 lines of each default AS Java trace in the whole system.
Server Log File Filtering
If the log files are too large or the Analyze Log Files returns a result that cannot be displayed, you may decide to use server filtering. Server-side filtering is only available on structured files.
  1. To set a filter, open the view menu Filters ...
  2. The available fields for the current log files are displayed in a new window.
  3. Select the desired field, for example User, and enter a search expression (wild cards are supported).
  4. Close the window.
  5. Enable the filter in the tool bar.
  6. Choose Auto refresh or refresh the log file.
The Internet Communication Manager (ICM) enables communication between your SAP system and the Internet using the HTTP or HTTPS protocols for the Business Client applications.
NWBC (both the shell and most canvas types) uses HTTP to access an ABAP server. It is important that at a minimum one HTTP or HTTPS port is configured and active.
  1. From the backend system, call transaction SMICM (ICM Monitor). Navigate to   Goto   Services   to display the services configured in the ICM
    Example of services in SMICM (Example of services in SMICM)
  2. If the HTTP or HTTPS service does not yet exist or you would like to make changes, you can create or edit a service via   Service   Create   or   Service   Change   in the menu.
  3. Enable / modify the HTTP or HTTPS port settings, if necessary.
  4. Make sure your HTTP or HTTPS service is active via   Service   Activate  .
Caution Caution
Note that any changes you make here are lost when you restart. If you want to create or change a service permanently, you must do this using the profile parameter icm/server_port_<xx>.

SAP Web Dispatcher

A Web Dispatcher can be placed before the AS ABAP system(s) to function as a reverse proxy. In such cases, it is typical that the Web Dispatcher is configured to the one option only to access the server via HTTPS (for higher security) and to forward all data to the server via HTTP (for higher performance). In these scenarios, pay special attention to the configuration of the HTTPURLLOC table in accordance with the information in URL Generation in an AS-ABAP - Web Dispatcher Configuration.

Prerequisites

You have downloaded the required target release version of the SAPHOSTAGENT<SP-version>.SAR archive as described in Downloading the SAPHOSTAGENT Archive.

Procedure

  1. Log on as a user with the required authorization:
    WindowsAs a member of the local Administrators group
    UNIXAs a user with root authorization
    IBM iAs a user profile with special authorities *SECADM and *ALLOBJ, for example as user profile QSECOFR.
  2. IBM i only: Enter the command CALL PGM(QP2TERM) to start a PASE interactive terminal session.
  3. Copy the downloaded SAPHOSTAGENT<SP-version>.SAR archive to a temporary directory, for example:
    Windowsc:\temp\hostagent
    UNIX,
    IBM i
    /tmp/hostagent
  4. Extract the SAPHOSTAGENT<SP-version>.SAR archive using SAPCAR.
    Take SAP Note 212876 Information published on SAP site into account when doing so. Use the following command for extraction, and execute them in the directory of the archive:
    Windows<path to SAPCAR>\sapcar.exe -xvf <path to temporary directory>\SAPHOSTAGENT<SP-version>.SAR -manifest SIGNATURE.SMF
    UNIX,
    IBM i
    /<path to SAPCAR>/sapcar -xvf <path to temporary directory>/SAPHOSTAGENT<SP-version>.SAR -manifest SIGNATURE.SMF
    Among others, the archive contains the saphostexec program.
  5. Perform the upgrade by running the following command:
    Windows
    <path to temporary directory>\saphostexec.exe -upgrade
    recommendation
    You can use the additional parameter -verify to verify the content of the installation package against the SAP digital signature
    UNIX,
    IBM i
    /<path to temporary directory>/saphostexec -upgrade
    recommendation
    You can use the additional parameter -verify to verify the content of the installation package against the SAP digital signature
    The progress of the upgrade is displayed on the command line.
  6. After the upgrade has finished successfully, you can check the version of the upgraded host agent by executing the following command from the directory of the SAP Host Agent executables:
    Windows%ProgramFiles%\SAP\hostctrl\exe\saphostexec.exe -version
    UNIX
    • If you are logged on as a user with root authorization, the command is as follows: /usr/sap/hostctrl/exe/saphostexec -version
    • If you are logged on as a member of the sapsys group, for example <sapsid>adm, the command is as follows: /usr/sap/hostctrl/exe/hostexecstart -version
    IBM i/usr/sap/hostctrl/exe/saphostexec -version
  7. IBM i only: Leave the PASE interactive terminal session using function key F3

Next Steps

Post-requisites:
You can now delete the temporary directory with all its content.
Copyright © 2013 VENKAT SAP BASIS