Pages

Showing posts with label Oracle. Show all posts
Showing posts with label Oracle. Show all posts

Friday, August 15, 2014

Drop all tables, constraints, and sequences within an Oracle schema


Drop all tables, constraints, and sequences within an Oracle schema.
refer link: https://snipt.net/Fotinakis/drop-all-tables-and-constraints-within-an-oracle-schema/
BEGIN

FOR c IN (SELECT table_name FROM user_tables) LOOP
EXECUTE IMMEDIATE ('DROP TABLE ' || c.table_name || ' CASCADE CONSTRAINTS');
END LOOP;

FOR s IN (SELECT sequence_name FROM user_sequences) LOOP
EXECUTE IMMEDIATE ('DROP SEQUENCE ' || s.sequence_name);
END LOOP;

END;

Tuesday, June 17, 2014

Getting a list of Security Groups and Accounts for a user through the API

link : https://blogs.oracle.com/kyle/entry/getting_a_list_of_security

eg : 
- Request:   /cs/idcplg?IdcService=GET_USER_PERMISSIONS
- Respone :
{
    "LocalData": {
        "IdcService": "GET_USER_PERMISSIONS",
        "StatusCode": "-1",
        "StatusMessage": "JSON strings must begin with a '",
        "StatusMessageKey": "!csJsonStringMustBeginWithBrace",
        "changedMonikers": "",
        "changedSubjects": "",
        "dName": "manager01",
        "dUser": "manager01",
        "idcToken": "",
        "localizedForResponse": "1",
        "refreshMonikers": "",
        "refreshSubMonikers": "",
        "refreshSubjects": ""
    },
    "ResultSets": {
        "DocumentAccounts": {
            "currentRow": 0,
            "fields": [
                {
                    "name": "dDocAccount"
                },
                {
                    "name": "privilege"
                }
            ],
            "rows": [
                [
                    "#none",
                    "7"
                ],
                [
                    "managerdir",
                    "1"
                ],
                [
                    "manager01",
                    "15"
                ],
                [
                    "managerdirbtc",
                    "15"
                ]
            ]
        },
        "SecurityGroups": {
            "currentRow": 0,
            "fields": [
                {
                    "name": "dGroupName"
                },
                {
                    "name": "privilege"
                }
            ],
            "rows": [
                [
                    "contentEditor",
                    "15"
                ],
                [
                    "BTC",
                    "15"
                ],
                [
                    "contentRepo",
                    "1"
                ],
                [
                    "Public",
                    "1"
                ]
            ]
        },
        "UserAttribInfo": {
            "currentRow": 0,
            "fields": [
                {
                    "name": "dUserName"
                },
                {
                    "name": "AttributeInfo"
                }
            ],
            "rows": [
                [
                    "manager01",
                    "account,#none,7,account,managerdir,1,account,manager01,15,account,managerdirbtc,15,role,QuanTriBTCRole,15,role,authenticated,15"
                ]
            ]
        },
        "UserSecurityFlags": {
            "currentRow": 0,
            "fields": [
                {
                    "name": "flag"
                },
                {
                    "name": "value"
                }
            ],
            "rows": [
                [
                    "IsAdmin",
                    "0"
                ],
                [
                    "AdminAtLeastOneGroup",
                    "1"
                ],
                [
                    "IsSubAdmin",
                    "0"
                ],
                [
                    "IsSysManager",
                    "0"
                ],
                [
                    "IsContributor",
                    "1"
                ],
                [
                    "ActAsAnonymous",
                    "0"
                ]
            ]
        }
    }
}

Wednesday, February 12, 2014

UCM - checkin without and hiding primary file

Doing check-ins without files in UCM
https://blogs.oracle.com/kyle/entry/check-ins_without_files_ucm

Hiding the Primary File field in UCM
https://blogs.oracle.com/kyle/entry/hiding_the_primary_file_field