Increasing the Hard Limit

Set up a program to increase the hard limit.

  1. Create file_name.c, (where file_name is the name you give the file.
  2. Enter the text shown below, making the appropriate modifications for your situation. .
    Note: This is an sample script; modify it as necessary.
    #include <sys/time.h>
     #include <sys/resource.h>
     #include <sys/types.h>
     /*
     ** define MAX_CONNECTIONS to a number less than
     ** 10000. The number defined will then become the maximum
     ** number of connections allowed by an SAP ASE.
     */
     #define MAX_CONNECTIONS 9999
     extern int errno;
     
     main(argc,argv)
     char **argv;
     {
         struct rlimit rlp;
         uid_t uid;
     
         rlp.rlim_cur = MAX_CONNECTIONS;
         rlp.rlim_max = MAX_CONNECTIONS;
      /* set the number of open file descriptors to
         MAX_CONNECTIONS */
         if (setrlimit (RLIMIT_NOFILE,&rlp) == -1)
         {
            perror("setrlimit");
            exit(1);
         }
     
       /* reset the user id to disable superuser
         privileges */
         uid = getuid();
         setuid(uid);
       /* run the program indicated as arguments to
         this program */
         execv(*++argv, argv);
     }
  3. Compile the file:
    cc file_name.c -o program_name

    where program_name is the compiled file name.

  4. Change the program’s permissions and ownership:
    chmod 755 program_name 
    chown root program_name
  5. The root user can start SAP ASE with increased user connections by entering this command at the operating system prompt.
    # program_name dataserver -d master_device_name

    where master_device_name is the full path of the SAP ASE master device.Alternatively, you can add program_name preceding the dataserver command line in the SAP ASE RUN_server_name file.

    See Setting Configuration Parameters in the System Administration Guide, Volume 1.