Skip to content

Instantly share code, notes, and snippets.

@ThiefMaster

ThiefMaster/data.sql Secret

Last active Jan 3, 2016
Embed
What would you like to do?
OpenLDAP not working..
-- ----------------------------
-- Records of LDAP_ATTR_MAPPINGS
-- ----------------------------
INSERT INTO "ldap_attr_mappings" VALUES ('1', '1', 'cn', 'user_id', null, 'JACOW.user_person_profiles', null, null, null, '0', '0');
INSERT INTO "ldap_attr_mappings" VALUES ('2', '1', 'telephoneNumber', 'phone_number', null, 'JACOW.user_person_profiles', null, null, null, '0', '0');
INSERT INTO "ldap_attr_mappings" VALUES ('3', '1', 'givenName', 'fname', null, 'JACOW.user_person_profiles', null, null, null, '0', '0');
INSERT INTO "ldap_attr_mappings" VALUES ('4', '1', 'sn', 'lname', null, 'JACOW.user_person_profiles', null, null, null, '0', '0');
INSERT INTO "ldap_attr_mappings" VALUES ('5', '1', 'userPassword', 'password', null, 'JACOW.user_person_profiles', 'JACOW.user_person_profiles.password is not null', null, null, '0', '0');
INSERT INTO "ldap_attr_mappings" VALUES ('12', '1', 'company', 'TRIM(affil_name1)', null, 'JACOW.user_person_profiles', null, null, null, '0', '0');
INSERT INTO "ldap_attr_mappings" VALUES ('6', '1', 'mail', 'email_address', null, 'JACOW.user_person_profiles', null, null, null, '0', '0');
INSERT INTO "ldap_attr_mappings" VALUES ('7', '1', 'facsimileTelephoneNumber', 'fax_number', null, 'JACOW.user_person_profiles', null, null, null, '0', '0');
INSERT INTO "ldap_attr_mappings" VALUES ('8', '1', 'ou', 'TRIM(affil_name1)', null, 'JACOW.user_person_profiles', null, null, null, '0', '0');
INSERT INTO "ldap_attr_mappings" VALUES ('9', '1', 'countryName', 'TRIM(country_code)', null, 'JACOW.user_person_profiles', null, null, null, '0', '0');
INSERT INTO "ldap_attr_mappings" VALUES ('10', '1', 'localityName', 'TRIM(town)', null, 'JACOW.user_person_profiles', null, null, null, '0', '0');
INSERT INTO "ldap_attr_mappings" VALUES ('11', '1', 'streetAddress', 'TRIM(addr_search_test)', null, 'JACOW.user_person_profiles', null, null, null, '0', '0');
INSERT INTO "ldap_attr_mappings" VALUES ('20', '2', 'cn', 'TRIM(affil_search_text)', null, 'JACOW.user_person_profiles', null, null, null, '0', '0');
-- ----------------------------
-- Records of LDAP_ENTRY_OBJCLASSES
-- ----------------------------
INSERT INTO "ldap_entry_objclasses" VALUES ('1', 'dcObject');
INSERT INTO "ldap_entry_objclasses" VALUES ('4', 'referral');
-- ----------------------------
-- Records of LDAP_GROUPS
-- ----------------------------
INSERT INTO "ldap_groups" VALUES ('1', 'group1');
INSERT INTO "ldap_groups" VALUES ('2', 'group2');
-- ----------------------------
-- Records of LDAP_OC_MAPPINGS
-- ----------------------------
INSERT INTO "ldap_oc_mappings" VALUES ('1', 'inetOrgPerson', 'JACOW.user_person_profiles', 'person_id', null, null, '0');
INSERT INTO "ldap_oc_mappings" VALUES ('2', 'organization', 'affiliations', 'affiliation_id', null, null, '0');
INSERT INTO "ldap_oc_mappings" VALUES ('3', 'groupOfNames', 'ldap_groups', 'group_id', null, null, '0');
-- ----------------------------
-- Records of LDAP_REFERRALS
-- ----------------------------
INSERT INTO "ldap_referrals" VALUES ('4', 'ldap://localhost:9012/');
# only sql related entries
dn_match_cond "UPPER(ldap_entries.dn)=UPPER(?)"
subtree_cond "UPPER(ldap_entries.dn) LIKE CONCAT('%',UPPER(?))"
children_cond "UPPER(ldap_entries.dn) LIKE UPPER('%,'||?)"
oc_query "SELECT id,name,keytbl,keycol,create_proc,delete_proc,expect_return FROM ldap_oc_mappings"
at_query "SELECT name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return,sel_expr_u FROM ldap_attr_mappings WHERE oc_map_id=?"
insentry_stmt "INSERT INTO ldap_entries (id,dn,oc_map_id,parent,keyval) VALUES (ldap_entry_ids.nextval,?,?,?,?)"
delentry_stmt "DELETE FROM ldap_entries WHERE id=?"
renentry_stmt "UPDATE ldap_entries SET dn=?,parent=?,keyval=? WHERE id=?"
delobjclasses_stmt "DELETE FROM ldap_entry_objclasses WHERE entry_id=?"
upper_func UPPER
concat_pattern "?||?"
has_ldapinfo_dn_ru no
52d3e85f ==>backsql_load_schema_map()
52d3e85f backsql_load_schema_map(): oc_query "SELECT id,name,keytbl,keycol,create_proc,delete_proc,expect_return FROM ldap_oc_mappings"
52d3e85f objectClass: id="1" name="inetOrgPerson" keytbl="JACOW.user_person_profiles" keycol="person_id" create_proc="" create_keyval="" delete_proc="" expect_return="0"create_hint=""
52d3e85f backsql_load_schema_map(): objectClass "inetOrgPerson":
keytbl="JACOW.user_person_profiles" keycol="person_id"
52d3e85f expect_return: add=0, del=0; attributes:
52d3e85f objectClass: id="2" name="organization" keytbl="affiliations" keycol="affiliation_id" create_proc="" create_keyval="" delete_proc="" expect_return="0"create_hint=""
52d3e85f backsql_load_schema_map(): objectClass "organization":
keytbl="affiliations" keycol="affiliation_id"
52d3e85f expect_return: add=0, del=0; attributes:
52d3e85f objectClass: id="3" name="groupOfNames" keytbl="ldap_groups" keycol="group_id" create_proc="" create_keyval="" delete_proc="" expect_return="0"create_hint=""
52d3e85f backsql_load_schema_map(): objectClass "groupOfNames":
keytbl="ldap_groups" keycol="group_id"
52d3e85f expect_return: add=0, del=0; attributes:
52d3e85f backsql_load_schema_map(): at_query "SELECT name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return,sel_expr_u FROM ldap_attr_mappings WHERE oc_map_id=?"
52d3e85f backsql_oc_get_attr_mapping(): executing at_query
"SELECT name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return,sel_expr_u FROM ldap_attr_mappings WHERE oc_map_id=?"
for objectClass "groupOfNames"
with param oc_id=3
52d3e85f backsql_oc_get_attr_mapping(): error executing at_query
"SELECT name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_return,sel_expr_u FROM ldap_attr_mappings WHERE oc_map_id=?"
for objectClass "groupOfNames"
with param oc_id=3
52d3e85f Return code: -1
52d3e85f <==backsql_load_schema_map()
52d3e85f backsql_db_open(): schema mapping failed, exiting
52d3e85f backend_startup_one (type=sql, suffix="dc=jacow,dc=org"): bi_db_open failed! (1)
-- ----------------------------
-- Table structure for LDAP_ATTR_MAPPINGS
-- ----------------------------
CREATE TABLE "ldap_attr_mappings" (
"id" NUMBER NOT NULL ,
"oc_map_id" NUMBER NOT NULL ,
"name" VARCHAR2(255 BYTE) NOT NULL ,
"sel_expr" VARCHAR2(255 BYTE) NOT NULL ,
"sel_expr_u" VARCHAR2(255 BYTE) NULL ,
"from_tbls" VARCHAR2(255 BYTE) NOT NULL ,
"join_where" VARCHAR2(255 BYTE) NULL ,
"add_proc" VARCHAR2(255 BYTE) NULL ,
"delete_proc" VARCHAR2(255 BYTE) NULL ,
"param_order" NUMBER NOT NULL ,
"expect_return" NUMBER NOT NULL
)
LOGGING
NOCOMPRESS
NOCACHE
;
-- ----------------------------
-- Table structure for LDAP_ENTRY_OBJCLASSES
-- ----------------------------
CREATE TABLE "ldap_entry_objclasses" (
"entry_id" NUMBER NOT NULL ,
"oc_name" VARCHAR2(64 BYTE) NULL
)
LOGGING
NOCOMPRESS
NOCACHE
;
-- ----------------------------
-- Table structure for LDAP_GROUPS
-- ----------------------------
CREATE TABLE "ldap_groups" (
"group_id" NUMBER NOT NULL ,
"name" VARCHAR2(255 BYTE) NOT NULL
)
LOGGING
NOCOMPRESS
NOCACHE
;
-- ----------------------------
-- Table structure for LDAP_OC_MAPPINGS
-- ----------------------------
CREATE TABLE "ldap_oc_mappings" (
"id" NUMBER NOT NULL ,
"name" VARCHAR2(64 BYTE) NOT NULL ,
"keytbl" VARCHAR2(64 BYTE) NOT NULL ,
"keycol" VARCHAR2(64 BYTE) NOT NULL ,
"create_proc" VARCHAR2(255 BYTE) NULL ,
"delete_proc" VARCHAR2(255 BYTE) NULL ,
"expect_return" NUMBER NOT NULL
)
LOGGING
NOCOMPRESS
NOCACHE
;
-- ----------------------------
-- Table structure for LDAP_REFERRALS
-- ----------------------------
CREATE TABLE "ldap_referrals" (
"entry_id" NUMBER NOT NULL ,
"url" VARCHAR2(1023 BYTE) NOT NULL
)
LOGGING
NOCOMPRESS
NOCACHE
;
-- ----------------------------
-- View structure for LDAP_ENTRIES
-- ----------------------------
CREATE FORCE VIEW "ldap_entries" AS
SELECT 1, 'dc=jacow,dc=org', 2, 0, 1 FROM JACOW.user_person_profiles WHERE JACOW.user_person_profiles.person_id=1
UNION
SELECT (100000000+JACOW.user_person_profiles.person_id),
'cn=' || JACOW.user_person_profiles.user_id || ',ou=people,dc=jacow,dc=org',
1,1,JACOW.user_person_profiles.person_id FROM JACOW.user_person_profiles WHERE JACOW.user_person_profiles.user_id is not null and JACOW.user_person_profiles.email_address is not null
UNION
SELECT (200000000+ldap_groups.group_id),
'cn=' || ldap_groups.name || ',ou=groups,dc=jacow,dc=org',
3,1,ldap_groups.group_id FROM ldap_groups;
-- ----------------------------
-- Indexes structure for table LDAP_ATTR_MAPPINGS
-- ----------------------------
-- ----------------------------
-- Checks structure for table LDAP_ATTR_MAPPINGS
-- ----------------------------
ALTER TABLE "ldap_attr_mappings" ADD CHECK ("id" is not null);
ALTER TABLE "ldap_attr_mappings" ADD CHECK ("oc_map_id" is not null);
ALTER TABLE "ldap_attr_mappings" ADD CHECK ("name" is not null);
ALTER TABLE "ldap_attr_mappings" ADD CHECK ("sel_expr" is not null);
ALTER TABLE "ldap_attr_mappings" ADD CHECK ("from_tbls" is not null);
ALTER TABLE "ldap_attr_mappings" ADD CHECK ("param_order" is not null);
ALTER TABLE "ldap_attr_mappings" ADD CHECK ("expect_return" is not null);
-- ----------------------------
-- Primary Key structure for table LDAP_ATTR_MAPPINGS
-- ----------------------------
ALTER TABLE "ldap_attr_mappings" ADD PRIMARY KEY ("id");
-- ----------------------------
-- Checks structure for table LDAP_ENTRY_OBJCLASSES
-- ----------------------------
ALTER TABLE "ldap_entry_objclasses" ADD CHECK ("entry_id" is not null);
-- ----------------------------
-- Indexes structure for table LDAP_GROUPS
-- ----------------------------
-- ----------------------------
-- Checks structure for table LDAP_GROUPS
-- ----------------------------
ALTER TABLE "ldap_groups" ADD CHECK ("group_id" is not null);
ALTER TABLE "ldap_groups" ADD CHECK ("name" is not null);
-- ----------------------------
-- Primary Key structure for table LDAP_GROUPS
-- ----------------------------
ALTER TABLE "ldap_groups" ADD PRIMARY KEY ("group_id");
-- ----------------------------
-- Indexes structure for table LDAP_OC_MAPPINGS
-- ----------------------------
-- ----------------------------
-- Uniques structure for table LDAP_OC_MAPPINGS
-- ----------------------------
ALTER TABLE "ldap_oc_mappings" ADD UNIQUE ("name");
-- ----------------------------
-- Checks structure for table LDAP_OC_MAPPINGS
-- ----------------------------
ALTER TABLE "ldap_oc_mappings" ADD CHECK ("id" is not null);
ALTER TABLE "ldap_oc_mappings" ADD CHECK ("name" is not null);
ALTER TABLE "ldap_oc_mappings" ADD CHECK ("keytbl" is not null);
ALTER TABLE "ldap_oc_mappings" ADD CHECK ("keycol" is not null);
ALTER TABLE "ldap_oc_mappings" ADD CHECK ("expect_return" is not null);
-- ----------------------------
-- Primary Key structure for table LDAP_OC_MAPPINGS
-- ----------------------------
ALTER TABLE "ldap_oc_mappings" ADD PRIMARY KEY ("id");
-- ----------------------------
-- Checks structure for table LDAP_REFERRALS
-- ----------------------------
ALTER TABLE "ldap_referrals" ADD CHECK ("entry_id" is not null);
ALTER TABLE "ldap_referrals" ADD CHECK ("url" is not null);
-- ----------------------------
-- Foreign Key structure for table "LDAP_ATTR_MAPPINGS"
-- ----------------------------
ALTER TABLE "ldap_attr_mappings" ADD FOREIGN KEY ("oc_map_id") REFERENCES "ldap_oc_mappings" ("id");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment