def parse_sqlplus_arg(database):
    """Parses an sqlplus connection string (user/passwd@host) unpacking the user, password and host.

    :param database: sqlplus-like connection string
    :return: (?user, ?password, ?host)
    :raises: ValueError
        when database is not of the form <user>/<?password>@<host>
    """
    try:
        credentials, host = database.split('@')
        if '/' in credentials:
            user, password = credentials.split('/')
        else:
            user = credentials
            password = None
        return (user, password, host)
    except ValueError:
        raise ValueError('Invalid sqlplus connection string {}: expected <user>/?<pass>@<host>'.format(database))