SQL Authentication provider - create tables script

Hi all!
I'd like to use SQL Authentication provider for my Web application. I cannot find the script for creating users/roles tables used by the provider.
Can you suggest me a link where I can download them ?
Thanks
Frank

Hi Frank,
Configure SQL authenticator:
Start Oracle XE DB and open SQL propmt to execute below commands:
CREATE TABLE USERS (
U_NAME VARCHAR(200) NOT NULL,
U_PASSWORD VARCHAR(50) NOT NULL,
U_DESCRIPTION VARCHAR(1000))
ALTER TABLE USERS
ADD CONSTRAINT PK_USERS
PRIMARY KEY (U_NAME)
CREATE TABLE GROUPS (
G_NAME VARCHAR(200) NOT NULL,
G_DESCRIPTION VARCHAR(1000) NULL)
ALTER TABLE GROUPS
ADD CONSTRAINT PK_GROUPS
PRIMARY KEY (G_NAME)
CREATE TABLE GROUPMEMBERS (
G_NAME VARCHAR(200) NOT NULL,
G_MEMBER VARCHAR(200) NOT NULL)
ALTER TABLE GROUPMEMBERS
ADD CONSTRAINT PK_GROUPMEMS
PRIMARY KEY (
G_NAME,
G_MEMBER
ALTER TABLE GROUPMEMBERS
ADD CONSTRAINT FK1_GROUPMEMBERS
FOREIGN KEY ( G_NAME )
REFERENCES GROUPS (G_NAME)
ON DELETE CASCADE
Generally customers can add users directly in DB with help below commands:
insert into USERS (U_NAME,U_PASSWORD,U_DESCRIPTION) values('system','weblogic','admin user');
insert into GROUPS (G_NAME,G_DESCRIPTION) values('Administrators','Administrators');
insert into GROUPMEMBERS (G_NAME,G_MEMBER) values('Administrators','system');
But in this case password is not encrypted so either you can add users via console or via WLST script to store them in encrypted form.
We had executed above commands just to verify user which is directly stored in DB gets authenticated properly or not from SQL authenticator configured as below
Now start weblogic admin server and access console to create Data source by navigating Services ->JDBC -> Data sources
Create Data source named SqlDS
JNDI: SqlDS
DB type: Oracle
DB Driver: Oracle Thin XA driver
DB name: XE
DB host: <hostname>
Port: 1521
DB user: <username>
DB password: <password>
Keep rest of the configuration same and click on test Configuration. If its successful click on next and target it to "AdminServer"
Click on Finish and activate chnages
Now navigate to Security Realms -> myrealm -> Providers
Click on New and provide Name as SqlAuthenticator and select Type as SQLAuthenticator
Now click on newly created provider and make Control Flag as "Sufficient"
Navigate to provider specific page:
1. Check on Plaintext Passwords Enabled.
2. Provide Data source Name: SqlDS
Keep rest of the parameters as it is and Save this configuration. It will ask you to restart Admin server.
Now again navigate Security Realms -> myrealm -> Users & groups
Check user which was created directly in DB is listed in table with SqlAuthenticator, Once its listed go ahead and add users as below
B. Cretae users using Admin console:
Login to Admin console
Navigate to Security Realms -> myrealm -> Users & groups
Click on users tab and try creating new user
User name: <user name>
Select Authentication provider: SqlAuthenticator
User Password: <password>
Once user is created check DB table, this user musted be added with encypted password
C. Create multiple users using WLST script:
Navigave to $DOMAIN_HOME/bin folder and execute setDomainEnv file as below:
Unix: . ./setDomainEnv.sh (Do not forget to put two dots before / )
Windows: setDomainEnv.cmd
Now change below script as per your environment and execute as suggested in step 3:
connect('weblogic','weblogic123','t3://localhost:7001')
edit()
startEdit(-1,-1,'false')
serverConfig()
cd('/SecurityConfiguration/base_domain/Realms/myrealm/AuthenticationProviders')
ls()
cd('SqlAuthenticator')
cmo.createUser('vaishali','weblogic123','SQLuser')
cmo.createUser('pavashe','weblogic123','SQLuser')
edit()
stopEdit('y')
NOTE: Change user,password and ADMIN_URL in 1st line.
Replace domain name " base_domain' with your domain name in line no: 5
Chnage SQL authenticator name in line no: 6 as per your authenticator name
Next lines create users. You need to add however users you need to create programatically.
Syntax : cmo.createUser('user_name','user_password','user_description')
Now save these commands in a file with extention .py and execute as below:
# java weblogic.WLST create_user.py
If your script fails the try executing each command separately. For this start WLST session as below:
# java weblogic.WLST
Now execute commands specified in above script. You will be able to debug if anything went wrong while executing script.
Regards,
Kal

Similar Messages

  • BPM Integration with SQL Authenticator Provider in WebLogic

    Hi Gurus,
    Related to the explanation from this blog : http://orasoa.blogspot.com/2010/06/sqlauthenticator-and-human-worklist.html
    I have followed this review, I can see all user and groups from sql authenticator provider.
    And also I can assign bpm application roles to users from sql authenticator provider.
    But when I try to assign bpm application roles to groups from sql authenticator provider, the bpm application is not show from bpm workspace.
    Is there any clue to solve this problem?
    Cheers,
    Agus W

    Hi All,
    Found the reason for the exception. I was implementing the generated the CustomAuthenticatorImpl class (generated through WebLogic MBeanMaker utility) as the provider class by implementing the AuthenticationProvider interface. Keeping them separate solved the issue.
    Able to create the jar without any issues and also no error or exception after restart.
    Thanks.

  • Is there a system table that stores the "create table" scripts

    Does a Oracle system table exist that contains the "create table" scripts for tables defined under a schema?
    I know I can build this with SQL by querying the user_tab_columns, but I was wondering whether the entire DML
    statement is already stored in some other system table. In the Quest Toad software you can simply go to the "Schema Brower", "Tables",
    then select the "Script" tab and it shows you the "create table" statement for the particular table that you are
    looking at. I'm wondering whether Toad behind the scenes is building this "create table" script via the user_tab_columns
    table or using another system table.
    Thank you in advance,
    Wes

    you can use the DBMS_METADATA.GET_DDL procedure to obtain the details regarding the ddl statement used to create the table.

  • Error when generating create table script

    Hi,
    I am trying to generate create table script from an existing table. But I get the following error when doing so,
    ORA-20001: Rem Unable to generate DDL for ORA-06502: PL/SQL: numeric or value error ORA-31605: the following was returned from LpxXSLResetAllVars in routine kuxslResetParams: LPX-1: NULL pointer ORA-22921: length of input buffer is smaller than amount requested .
    Any suggestions on what could be wrong?
    Thanks.
    -B

    this is my bad, i should have updated this thread when we originally troubleshot this issue...
    that error you're getting on htmldb.oracle.com when you try to generate ddl for tables and such is a manifestation of a database bug (#3372908) that's recently been filed. checking the worklog for that bug suggests that those guys are still working out the issue. unfortunately, there's no current work-around on htmldb.oracle.com at the moment. if you want to generate ddl for your objects, you'd have to query the appropriate data dictionary views to get the info you need.
    ...i'll update the htmldb.oracle.com interface in a bit to prevent other users from hitting this issue. so you know, this is only an issue on db versions 9.2.0.3 and 9.2.0.4 running on some platforms and only (as far as i know) those using the AL32UTF8 characterset ...which does include our hosted site for now.
    hope this helps,
    raj

  • Create table script by passing value from table

    I Have a procedure to check if the table exists, if yes drop and re-create else create table.
    CREATE OR REPLACE
    PROCEDURE test_proc authid current_user
    AS
    v_cnt NUMBER:=0;
    BEGIN
    SELECT COUNT(*)
    INTO v_cnt
    FROM all_tables
    WHERE table_name='T1'
    AND owner = 'WORKSPACE';
    IF v_cnt = 1 THEN
    EXECUTE immediate 'DROP TABLE WORKSPACE.T1';
    END IF;
    EXECUTE immediate 'CREATE TABLE WORKSPACE.T1
    ITM_NBR NUMBER ,
    LCT_NBR NUMBER
    SELECT COUNT(*)
    INTO v_cnt
    FROM all_tables
    WHERE table_name='T2'
    AND owner = 'WORKSPACE';
    IF v_cnt = 1 THEN
    EXECUTE immediate 'DROP TABLE WORKSPACE.T2';
    END IF;
    EXECUTE immediate 'CREATE TABLE WORKSPACE.T2
    LCT_NBR NUMBER(5, 0) NOT NULL ,
    PRY_CD NUMBER(5, 0) NOT NULL )';
    END;
    Requirement: Instead of passing the Owner,tablename & the create table scripts directlyin the query, it should be passed from a database table which will be in given format.
    TableName Query Owner
    T1 CREATE TABLE WORKSPACE.T1(ITM_NBR NUMBER, LCT_NBR NUMBER) WORKSPACE
    T2 CREATE TABLE WORKSPACE.T2(LCT_NBR NUMBER(5, 0) NOT NULL ,PRY_CD NUMBER(5, 0) NOT NULL) WORKSPACE

    user12276240 wrote:
    Excuse all. The database columns are yet to be finalized and every time changes come in we are currently dropping and re-creating the tables which leads in changing the script, hence we are going in for this approach.
    Moreover if i am going to have this script everytime i have to drop and re-create all the tables which can be elimated by this way.So why not have a SQL script as follows?
    drop table emp purge;
    create table emp(
    create index .. on emp( .. );
    ..It drops the existing table (if exists). It then creates the table with constraints and indexes. This script is now the master definition of the table. You can slap a change log header to it. Any changes that needs the table to be redefined and recreated are done via this script. Which means it is also checked into the source code repository as it is part of the code of that system/application.
    I would however remove the drop table from it in case some developer accidentally run it at the wrong time and trash the table.
    The bottom line is that DDL code is part and parcel of the installation, configuration and setup code - and that this is as important as the source code. This code also needs to be "formalised" in proper scripts, checked into SVN/CVS/etc, and used to bootstrap the system (or parts of it), as and when needed.

  • Privilege error while running Create Table Script inside Stored Procedure.

    Hello All,
    I have Oracle 10G server and SQL Developer Client,
    I have One User with Appropriate Rights, Login with that user from SQL Developer(client),
    Within my Procedure, Dynamic SQL script is like If I pass in a TABLE NAME as parameter, It Creates that table, but now problem is It throws an error for Privilege.
    Where as if I Execute Create table script outside the procedure(as Normal SQL), it executes Ok, but why it throws Privilege error within procedure ?
    Whether any extra Rights needed for this user to execute such Create Table Dynamic SQL?
    Please Help.
    Thanks,
    j@y

    Elic
    Thanks a lot dude...
    It works now,
    regards,
    j@y

  • Does anyone have sqlmenu50 create table script

    Hi,
    I need to create the sqlmenu50 database tables, but I seem to have lost the create table script for this.
    If anyone could please help me, I would be very grateful.
    Please email to [email protected]
    Many thanks
    Tony

    Ken , many, many thanks!
    I have actually broken down the import scripts to about 5 with about 200 entries each.
    I do find that about a dozen entires have errored with parameter has wrong length, the odd thing is all the TPIMPORT statements were created from the same Excell macro. ie., the transports were sequentially entered in an excell spreadsheet to ensure the correct sequence
    I then created a macro (as recommended from this thread) that created a large script for import
    I took this one step further and split this large file into smaller files/scripts of about 200 entries. 
    I have only run the first of 5 entries, and it is puzzling to me why I get the error 'parameter has wrong length'  the statements are cookie cutter statements, exactly the same. see error below
    E:\SAP Software\SAPPHYR Transport Log\TPImport Scripts>tp import ECDK901251 ECP client=200 U126 pf=d:\usr\sap\transcopy\bin\TP_DOMAIN_ECP.PFL
    This is tp version 372.04.40 (release 700, unicode enabled)
    ERROR: : parameter U126 has wrong length
    And a successfully statement result below
    E:\SAP Software\SAPPHYR Transport Log\TPImport Scripts>tp import ECDK900229 ECP client=200 U126 pf=d:\usr\sap\transcopy\bin\TP_DOMAIN_ECP.PFL
    This is tp version 372.04.40 (release 700, unicode enabled)
    This is R3trans.exe version 6.14 (release 700 - 28.07.08 - 15:52:00).
    unicode enabled version
    R3trans.exe finished (0004).
    tp finished with return code: 4
    meaning:
      A tool used by tp produced warnings
    You can observe the statements are identical starting at "tp import ECDKxxxxx ECP etc...
    any ideas why they would error?
    Regards,
    Maria

  • Generate create table script?

    If I have a table called "customer" in my oracle database and I want to create the same table on another server. There are any way to generate Create table script to create this table?
    Thank you for your help.
    Regards,
    Kevin

    The documentation for the GET_DDL method in the DBMS_METADATA package is here
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_metad2.htm#1024701
    Basically, you'll want something like
    DECLARE
      l_clob CLOB;
    BEGIN
      l_clob := dbms_metadata.get_ddl( 'TABLE', '<<table name>>');
      <<Do something with the DDL>>
    END;Justin

  • SQL Developer  Create Table Statement to ERD Visio Diagram

    I have the following Create table statement from SQL Developer and I am trying to generate an ERD Diagram using 2003 Visio. I was wondering what I need to do to convert the Create Table to an ERD Diagram Using Visio. Thanks
    CREATE TABLE “TT_TEAM”.”HR_REVOKED_SECURITY_ORGS”
    “ID” NUMBER NOT NULL ENABLE,
    “ACAT_CODE” VARCHAR2(6 BYTE) NOT NULL ENABLE,
    “APPR_SEQ_NO” NUMBER(3,0) NOT NULL ENABLE,
    “USER_ID” VARCHAR2(30 BYTE) NOT NULL ENABLE,
    “ACTION_IND” VARCHAR2(1 BYTE) NOT NULL ENABLE,
    “ACTIVITY_DATE” DATE NOT NULL ENABLE,
    “COAS_CODE” VARCHAR2(1 BYTE),
    “ORGN_CODE” VARCHAR2(6 BYTE),
    “POSN” VARCHAR2(6 BYTE) NOT NULL ENABLE,
    “MANDATORY_APPR_IND” VARCHAR2(1 BYTE),
    “APPR_POSN” VARCHAR2(6 BYTE),
    “ORGN_MANAGER” VARCHAR2(6 BYTE) NOT NULL ENABLE;

    I'm pretty Visio is a non-Oracle product.
    In the mean-time, you can easily import a DDL script file and create a relational model/diagram using SQL Developer. Use the Import feature and point to your CREATE TABLE script(s)

  • How to see DDL script(create table) from view

    i want to view create table script(DDL command)
    can u suggest me any view for that.

    Hi
    There's no view where the DDL statement is directly available. It must be reconstructed from many views...
    If you use 9i the simpler way to do that is with DBMS_METADATA. Below and example....
    SQL&gt; SET LONG 1000000
    SQL&gt; SELECT dbms_metadata.get_ddl('TABLE','EMP') FROM dual;
    DBMS_METADATA.GET_DDL('TABLE','EMP')
    CREATE TABLE "SCOTT"."EMP"
    ( "EMPNO" NUMBER(4,0) NOT NULL ENABLE,
    "ENAME" VARCHAR2(10),
    "JOB" VARCHAR2(9),
    "MGR" NUMBER(4,0),
    "HIREDATE" DATE,
    "SAL" NUMBER(7,2),
    "COMM" NUMBER(7,2),
    "DEPTNO" NUMBER(2,0),
    CONSTRAINT "EMP_PK" PRIMARY KEY ("EMPNO")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ENABLE,
    CONSTRAINT "EMP_DEPT_FK" FOREIGN KEY ("DEPTNO")
    REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS"
    Chris

  • SQL table script ending

    I have a sql script someone else wrote and it has many create tables scripts. Some end with a semi-colon and some end with a forward slash /. What is the difference?
    I need to clean up the code and didn't know what way I should take all the create table scripts. Should I use the semi-colon after the last ) ?
    I have to run multiple scripts with sql plus eventually so I want to make sure I have the correct syntax.
    Thank you

    Alex,
    What is the preferred one to use? These scripts I'm running will be all added to one script so I can create my full database from one script. I want to make sure I do it the correct way from the start.
    Thanks for your help

  • How to create table from another in pl/sql

    Hi I need to create a table from another in pl/sql
    How can I do this

    The proper way to do this, is not to do it in PL/SQL. But do it in SQL, something like:
    create table tbl
    as
    select *
      from other_tbl;Doing it in PL/SQL is really slow compared to SQL.
    Yes, if you really want to create a table using PL/SQL then you will need to use DBMS_SQL or EXECUTE IMMEDIATE (Native Dynamic SQL) to do this.

  • Plan Table Script

    Hi,
    Please kindly send me the Plan Table CREATE TABLE script for Release 9.0.1.0.0
    Since I have only client on my machine, i have not found the script in my local folder.
    Regards
    Ashish

    Hi,
    You need to run $ORACLE_HOME/rdbms/admin/utlxplan.sql from server.
    Nicolas.

  • UCM 11g and Weblogic SQL Authenticator

    A bit lengthy question about UCM 11g using WLS Security providers for user authentication.
    There's a lot of stuff on the web about integrating UCM 11g with WLS AD/LDAP authenticators. However there's literally nothing about integrating it with SQL-based authenticators. Does it mean that using WLS's built-in providers other than AD/LDAP is not supported ?
    I tried configuring my Custom DBMS Authenticator - it works fine. I can see my users/groups and membership info read from the DB in WLS Admin Console. The users can even log in to the Content Server but their WLS groups are never mapped to UCM roles/accounts. I tried reordering the WLS authenticators so that the DBMS authenticator is at the top but this does not help. Does this mean that group -> role/account mapping works only with LDAP ?
    thanks in advance

    Hi Sirnath,
    Thanks for the prompt reply.
    I did another exercise and defined the contributor group in both the DefaultAuthenticator and the SQL Authenticator and created two users 'default' (int the DefaultAuthenticator) and 'sql' (in the SQL authenticator). Both users are members of the 'contributor' group (in the respective Authenticator). If I log in as either of the users they all have the proper principals/credentials set in the javax.security.auth.Subject instance (the 'contributor' is a principal and a credential in both cases). However UCM maps it to a role only for the 'default' user.
    Is it possible that the JPS provider somehow bypasses the javax.security.auth.Subject abstraction? Do you know of any related docs available online ?

  • Create table where table name is a variable

    I need to be able to create tables where the table name is a variable . Using PL/SQL in Oracle 9. Also need to insert and query the table.
    THANK YOU

    Use 'execute immediate' in pl/sql:
    execute immediate 'create table '||var_tablename||'...';

Maybe you are looking for

  • Where can i find setup assistant?

    I just purchased a macbook pro from bestbuy and when I started it up, no setup assistant appeared. where can i find it?

  • Defining Widening Operator And Narrowing Operator

    Here is documentation for Widening and Narrowing Operators. There is confusion. Which operator should I create for converting one class to another or one structure to other or structure to class or class to structure. Any proper example that should e

  • My laptop does not want to charge

    My laptop had started to shut off on its own. At this time the battery light and the plug light had been on. As I had went to unplugg the ac adapter from the computer the screen had started to brighten and then dim a few times. Alot like when it does

  • I  can't get the interenet when i turn on the 3G button...

    I  can't get the interenet when i turn on the 3G button. WIFI can be uesd. I put my card into other phones and then it works.

  • Thinking of upgrading to an iMac

    Hi - I currently have a 10 year old eMac Power PC G4 running OS X 10.3.9, which I'm very fond of and has never let me down, but I am thinking of upgrading to a new iMac running OS X Snow Leopard. My worry is that I have a lot of software on my exixti