Si eres Administrador SAP, y te dedicas a la instalación de sistemas nuevos, ¡esta entrada es la respuesta a todas tus plegarias!
Seamos sinceros, cada vez que llega el momento de dar nombre a una nueva criatura, sólo se te ocurren nombres de la lista reservada, u otro tipo de nombres inconvenientes como GOD, PIS o ZAS…
¡La solución a todos tus problemas! Un script en Python que genera aleatoriamente un nombre de sistema, teniendo en cuenta las excepciones:
#!/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 .
import random
leters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
exception = ['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']
sid = 'ADD'
while sid in exception:
sid = ''.join([leters[random.randrange(0,len(leters))] for i in range(3)])
print sid