GenerateSID: Generador Aleatorio de Nombres de Sistema SAP (v2.0)

[xtrasgu.org]Si te gustó el Generador Aleatorio de Nombres de Sistema SAP, ¡aquí tienes la versión definitiva!

Esta nueva versión incluye todas las condiciones que impone SAP:

  • Is unique throughout your organization. Do not use an existing <SAPSID> when installing a new SAP system.
  • Consists of exactly three alphanumeric characters
  • Contains only uppercase letters
  • Has a letter for the first character
  • Does not include any of the following, which are reserved IDs:
    ADD ALL AMD AND ANY ARE ASC AUX AVG BIT CDC COM CON DBA END EPS FOR GET GID
    IBM INT KEY LOG LPT MAP MAX MIN MON NIX NOT NUL OFF OLD OMS OUT PAD PRN RAW
    REF ROW SAP SET SGA SHG SID SQL SUM SYS TMP TOP UID USE USR VAR
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# GenerateSID - Let ramdom choose an SAP SID for you.  
#
# Copyright (c) 2010, Pablo López Cienfuegos 
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see .

"""Make sure that your SAP system ID:

· Is unique throughout your organization. Do not use an existing  when installing a new SAP system.
· Consists of exactly three alphanumeric characters
· Contains only uppercase letters
· Has a letter for the first character
· Does not include any of the following, which are reserved IDs:
  ADD ALL AMD AND ANY ARE ASC AUX AVG BIT CDC COM CON DBA END EPS FOR GET GID
  IBM INT KEY LOG LPT MAP MAX MIN MON NIX NOT NUL OFF OLD OMS OUT PAD PRN RAW
  REF ROW SAP SET SGA SHG SID SQL SUM SYS TMP TOP UID USE USR VAR"""

import random

alfa='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
alfanum=alfa+'0123456789'
existingSIDs=[] # Add your existing system landscape SIDs
exceptionSIDs=['ADD', 'ALL', 'AND', 'ANY', 'ASC', 'AUX', 'COM', 'CON', 'DBA',
               'END', 'EPS', 'FOR', 'GID', 'IBM', 'INT', 'KEY', 'LOG', 'LPT',
               'MON', 'NIX', 'NOT', 'NUL', 'OFF', 'OMS', 'PRN', 'RAW', 'ROW',
               'SAP', 'SET', 'SGA', 'SHG', 'SID', 'SQL', 'SYS', 'TMP', 'UID',
               'USR', 'VAR']+existingSIDs

sid='ADD'
while sid in exceptionSIDs:
    sid=''.join((alfa[random.randrange(0,len(alfa))],
                 alfanum[random.randrange(0,len(alfanum))],
                 alfanum[random.randrange(0,len(alfanum))]))

print sid

Úsalo con cuidado, que engancha…

Deja un Comentario