How to preserve database user details before cloning

Hi Experts,
How to preserve database user details before cloning,
I am cloning the test database with the prod database, so my concern is how to preserve the users details which they have in TEST database( like roles, privilges, profiles , passwords, etc.....). Because that all gone after cloning from PROD.
Thanks
Sam

use the following script to take the backup of roles,pwd & other  details of DEV . after cloning  execute the scripts back in DEV to restore the old values....
set head off
set lines 200
set pages 9999
col owner for a20
col db_link for a30
col username for a15
col host for a40
col created for a12
spool db_details.lst
select * from global_name;
select * from dba_db_links;
select name from v$controlfile;
select member from v$logfile;
select file_name from dba_data_files;
select file_name from dba_temp_files;
spool off
spool create_db_links.lst
select 'create DATABASE LINK '||owner#||'.'||NAME|| ' connect to '|| userid || ' identified by '|| password || ' using '||''''|| host ||''''||'; ' FROM sys.link$ order by owner#;
select username,user_id from dba_users where user_id in (select distinct owner# from link$);
spool off
spool alter_user.lst
select ' alter user '||username||' identified by values ' || chr(39)||password||chr(39) || ';' from dba_users;
spool off
Set verify off
Set space 0
set feedback off;
set echo off;
set pages 1000;
set lines 150;
spool create_synonym.sql
Select 'CREATE SYNONYM '||owner||'.'||synonym_name||' FOR '||table_owner||'.'||table_name||'@'||db_link||';' from dba_synonyms where db_link is not null and table_owner is not null;
Select 'CREATE SYNONYM '||owner||'.'||synonym_name||' FOR '||table_name||'@'||db_link||';' from dba_synonyms where db_link is not null and table_owner is null;
spool off;
Spool profile.sql
select ' alter user '||username||' profile '||PROFILE||';' from dba_users;
spool off

Similar Messages

  • How to get the user details

    Hi All,
       I want to fetch the user ID and email address, by using user details like first name, last name and user name.
      Could you please suggest me which tables I can refer to get these data. And I tried to fetch it from the view V_USR_NAME,
      But I could not able to get the data from the view by using select query. Please suggest me. Thank you

    Hi Sriram
       Thank you for your immediate response.. I have a gone through that thread and I noticed that in that case by using the email address we are getting the userID. But in my case I need to get both userID and email address by using first name and last name. I also tried to get the person number from ADRP table by using these fields (So that I can get the email address from ADR6 table by using the person number).. but the first name and last name are not the key fields..So got stucked there. Please suggest me how to proceed.
    Thank you

  • How to get the User Details inoformation in portal?

    I had defined the user informations in "Portal User Details". But i don't know how to get it and what the user table is?
    for example: How to get the email address of user i have defined in portals?
    Tank you very much!
    Ghia Liu
    Genesyslogic.com.tw

    You would use the portal API's for this, there is one named wwsec_api.person_info that returns a record with the specified user's information, such as first name, lsat name, email, telephone, etc - a pretty long list. With release 2 of portal the data is no longer stored in the wwsec_person$ table as it was in release 1 so use the API (which actually is how I would normally do it in release 1 as well).
    To get more documentation on portal API's go to: http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/plsql/doc/astart.htm
    Hope that this helps you - enjoy the day!
    Art

  • How to synchronize database user

    Hi All
    I have a Database user A
    I want to create a Database user B
    User B is only select role
    User A is update, select, delete, etc...
    How to create user B which tables of user A and tables user B is the same.
    Any changes of user A, user B is changed too.
    Please help me!
    Thanks alot
    Thiensu2810

    If user B owns tables, then it will have select, insert, update, delete on those tables.
    Maybe user B should just have synonyms of user A tables, and select priveleges on user A tables ?

  • How to setup database user for windows NT SSO

    Hi,
    We have a scenario where we have to setup a database user so that SSO can be worked in windows environment.
    We have oracle 10g installed on UNIX server. Now we want to setup a autosys user which will also be a winows user for eg by the name kumaral and domain (which is Logon option in windows) will be FM, so eventually user name will be FM\kumaral. Autosys will be on windows machine and we have installed oracle client on this machine.
    On oracle database we have created two user by following syntax:
    (1) CREATE USER "OPS$FM\KUMARAL" IDENTIFIED EXTERNALLY;
    (2) CREATE USER "OPS$FM\kumaral" IDENTIFIED EXTERNALLY;
    Also we have provided connect grant to these users.
    GRANT CONNECT TO "OPS$FM\KUMARAL".
    GRANT CONNECT TO "OPS$FM\kumaral".
    I am login in windows through FM\kumaral user, but we are not able to connect to oracle through this user, we are trying to connect to oracle from below mentioned query:
    sqlplus /
    but we are not able to connect.
    Can someone please help me on this?
    Thanks in Advance.
    Amit.

    Check MOS note :
    WIN: Setup O/S Authentication [ID 60634.1]
    Regards
    Rajesh

  • How to Import Database user in oracle which have character set AL32UTF8?

    Hello All,
    I want export one database user which have character set in WE8MSWIN1252 and I want to Import that Database user in oracle which have character set AL32UTF8 without changing character set.
    is there any argument in import command??
    thanks

    There's no problem, export and import will take care of character set conversions, the only problem is AL32UTF8 is a variable size character set, if 'ñ' uses 1 byte in WE8MSWIN1252, in AL32UTF8 it will use 2 bytes, so it's recommended to pre-create the tables with "char" instead of "byte": create table xxx ( col1 varchar2(100 char), ... )
    Enrique

  • How to restrict database user.

    I need to create a database user who have only read only access to the 10g database. Is there any note which will help on this. Thanks in advance.
    regards,
    manish

    Hi,
    Is this an Oracle E-Business Suite database? Do you want to create a user similar to APPS with read privileges? If yes, please refer to the following link:
    Read Only Schema in Oracle APPS 11i
    http://oracle.anilpassi.com/read-only-schema-in-oracle-apps-11i-2.html
    If you want to create just a read only database user (not APPS), grant this user select privilege only on the objects you want this user to access.
    [Create Read only user for a Schema |http://arjudba.blogspot.com/2008/09/create-read-only-user-for-schema.html]
    Regards,
    Hussein

  • FDM server shutdown by some user, how to find that user details

    Hi,
    By mistake some has done sutdown FDM server(windows) instead of logoff, can any one tell me where we can find the user details, I mean any where in the logs can we find the user details. Plz help me.
    Thanks,

    If the server was shutdown, the information should be in the event log for the server. In the system events detail, you will typicallysee the following columns:
    Type, Date, Time, Source, Category, Event, User, Computer.
    The user who shutdown the server will be listed here.

  • How to monitor Database Users who ever is doing bulk transactions

    Hi All,
    We need to produce a report (daily basis ) which will provide User and Bulk Transaction details in Database to track the system.
    How to state a script to perform this monitoring ?
    RDBMS: 10.2.0.5.0 (64 bit)
    OS: RHEL-5.2
    Thanks,
    Tusar

    Hi;
    AFAIK there is no specific query for your issue. You can enable audit than can see what happen on your system
    Regard
    Helios

  • How to Change Database of Report before Exporting?

    I am having difficulties changing the database that the report should run against.
    We are using Oracle.  In the past when scheduling a report through CE, I would manipuate the Desktop.ReportLogons object.  For Oracle I simple changed the CustomServerName, CustomUserName, and CustomPassword properties.  Everything worked fine when the report was scheduled and ran.
    Now I am doing an on-demand report without an interactive viewer.  I am doing everything in code using RasAppFactory and the ReportClientDocument.
    I am looking at the DatabaseController of ReportClientDocument.  I thought I could just use the LogonEx method passing in the server, user, password, and an empty string for the database since for Oracle connections you only specify server and not database.  However, it is still trying to connect to the defined database.
    Can someone point me to an Oracle specific example of how to properly change database info when report runs?
    Do I need to be using other methods like one of the SetTableLocation methods?
    Thanks in advance for any help.

    Hello, Stephen;
    You are correct, with Oracle you do not need the Database property.
    The person logged on to Business Objects Enterprise through the RAS .NET application would need rights to make the change in database connections. Can the usr with the same logon make the change directly in Enterprise?
    The ReportClientDocument separates the Server Name and Database from the User ID and Password with the PropertyBag. The convenience methods such as LogonEx will only change the User ID and Password. To change all four properties you need the full RAS logon code.
    The full logon for RAS would use code as shown below.
    Elaine
    ==========================================
    Imports System
    Imports Microsoft.Win32
    Imports CrystalDecisions.Enterprise
    Imports CrystalDecisions.Enterprise.Desktop
    Imports CrystalDecisions.CrystalReports.TemplateEngine
    Imports CrystalDecisions.ReportAppServer.ClientDoc
    Imports CrystalDecisions.ReportAppServer.Controllers
    Imports CrystalDecisions.ReportAppServer.ReportDefModel
    Imports CrystalDecisions.ReportAppServer.DataDefModel
    Imports CrystalDecisions.ReportAppServer.CommonObjectModel
    Imports CrystalDecisions.ReportAppServer.ObjectFactory
    Partial Class Logon
        Inherits System.Web.UI.Page
        Dim mySampleReportName As String = "SimpleSetLogonInfo.rpt"
        Dim crServerName As String = "myOracle"
        Dim crDatabaseName As String = ""
        Dim databaseUserName As String = "tester"
        Dim databasePassword As String = "tester"
        Dim crDatabaseController As DatabaseController
        Dim crDatabase As Database
        Dim crTableOld, crTableNew As Table
        Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
            ConfigureCrystalReports()
        End Sub
        Private Sub ConfigureCrystalReports()
            DatabaseLogon_managedRAS()
        End Sub
        Private Sub DatabaseLogon_managedRAS()
            Dim mySessionMgr As New SessionMgr()
            Dim myEnterpriseSession As EnterpriseSession
            Dim myReportAppFactory As ReportAppFactory
            Dim myInfoStore As InfoStore
            Dim myInfoObjects As InfoObjects
            Dim myInfoObject As InfoObject
            Dim myReportClientDocument As ReportClientDocument
            Dim myEnterpriseService As EnterpriseService
            Dim myObject As Object
            myEnterpriseSession = mySessionMgr.Logon("administrator", "", "CMS_Server", "secEnterprise")
            myEnterpriseService = myEnterpriseSession.GetService("InfoStore")
            myInfoStore = New InfoStore(myEnterpriseService)
            myInfoObjects = myInfoStore.Query("Select SI_ID From CI_INFOOBJECTS Where SI_NAME='" + mySampleReportName + "' And SI_INSTANCE=0")
            myInfoObject = myInfoObjects(1)
            myObject = myEnterpriseSession.GetService("", "RASReportFactory").Interface
            myReportAppFactory = CType(myObject, ReportAppFactory)
            myReportClientDocument = myReportAppFactory.OpenDocument(myInfoObject.ID, 0)
            'Convenience methods not to change Database or Server name from what is in the report
            'myReportClientDocument.DatabaseController.logon("UID", "PWD")
            'myReportClientDocument.DatabaseController.LogonEx("myServerName", "myDatabase", "UID", "PWD")
            crDatabase = myReportClientDocument.DatabaseController.Database()
            crDatabaseController = myReportClientDocument.DatabaseController()
            ' Loop through all the tables in the main
            ' report and set their new table information.
            For Each crTableOld In crDatabase.Tables
                crTableNew = GetNewTable(crTableOld, crServerName, crDatabaseName, databaseUserName, databasePassword)
                crDatabaseController.SetTableLocation(crTableOld, crTableNew)
                crTableNew = Nothing
            Next
            crDatabase = Nothing
            crTableOld = Nothing
            myCrystalReportViewer.ReportSource = myReportClientDocument
        End Sub
        Private Function GetNewTable(ByVal crTableOld As Table, ByRef serverName As String, ByRef databaseName As String, ByRef userName As String, ByRef password As String) As Table
            ' Create crTableNew as a new table, then fill its properties.
            Dim crTableNew As New Table
            Dim crAttributes, crLogonInfo As PropertyBag
            ' Set some of the properties of the new table object.
            crTableNew.ConnectionInfo.UserName = userName
            crTableNew.ConnectionInfo.Password = password
            crTableNew.ConnectionInfo.Kind = crTableOld.ConnectionInfo.Kind()
            crTableNew.Name = crTableOld.Name
            crTableNew.Alias = crTableOld.Alias
            ' Make a copy of the connectionInfo.Attributes and apply them to the new table.
            crTableNew.ConnectionInfo.Attributes = crTableOld.ConnectionInfo.Attributes.Clone(True)
            crAttributes = crTableNew.ConnectionInfo.Attributes()
            ' Check to ensure the connection info Kind is correct then change the a
            ' appropriate properties in the PropertyBag.
            ' These will vary from report to report using ODBC, OLEDB or Native drivers
            ' To find out your properties
            ' open your report in the Crystal Reports Designer and go to Database,
            ' Set Location menu. Check the properties of your connection and note
            ' the name of the properties that will change.
    'ODBC to Oracle "Data Source Name" and "Table Name" with "Owner"
    'OLEDB to Oracle "Provider" "Data Source" and "Table Name" with "Owner"
            If crTableNew.ConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE Then
                crLogonInfo = CType(crAttributes("QE_LogonProperties"), PropertyBag)
                crLogonInfo("Data Source") = crServerName
                'MS SQL Server OLEDB
                'Leave out for Oracle
                'crLogonInfo("Initial Catalog") = crDatabaseName
            End If
            ' Adjust the qualified name, then return the new table object if the table name has changed
            crTableNew.QualifiedName = "Owner." & crTableNew.Name
            Return crTableNew
        End Function
    End Class

  • How to create Database Users in Oracle enterprise?

    Help, I am new in using oracle database. All I need to do is to connect PHP to Oracle. But it keeps saying this Error
    *Warning: oci_connect() [function.oci-connect]: ORA-28000: the account is locked in*
    Really need some help.

    Welcome to the forum. Please next time remember that your friends are "search option", google, thaiti... and of course oracle documentation. All ORA-XXXX are documented so please next time, search for them.
    run:
    select account_status, username from dba_users;
    If the status is locked:
    alter user XXXXXX account unlock;
    If also is expired:
    ALTER USER xxxxx IDENTIFIED BY password;
    HTH
    Edited by: Fran on 30-may-2012 2:16

  • How to upload database tab(ztable) before executing of report

    hi all,
            I have developed a report , in which i have a check box in selection screen, when ever i check this and give inputs to report(year, period), upto that year and period , the database table(ztable), have to be updated (the data is inturn fetched from standarad database table and inserted into my ztable)and that results from the ztable are selected in report.Can any one help me where i shoud write code for this(is it in at selection screen) or not.what commands i have to use to achieve this. Can any one suggest me how to do this, if possible with a sample code

    Kiran,
    In your report first select the data from the standard table and update the ztable and then display the output fetched from the ztable.
    I guess the selection criteria that you are using for fetching from the standard table and selection criteria that you intend to fetch from the ztable for displaying the output are the same.If it is not then do the filtering in the program as per your need and then display the output.
    By the way I didn't get why you need a ztable when already the data is available in the standard table.
    K.Kiran.

  • How to grant database user to access directory under web server

    Hi
    I'm running forms6i application on Oracle9iAS.
    This application access to several directories using WEB.SHOW_DOCUMENT procedure.
    I add this directories to UserDir directive in httpd.conf and I also made an Alias (virtual path).
    The problem is that all users can access to that directory.
    Can I eliminate access to the directories just for particulare users?
    Thank's,
    Tomaz

    Pl refer to the httpd.conf file
    and for the directory tag assign deny all,grant all will
    solve ur prob...
    if possible pl let me know..
    how u have configured ur forms appln on oracle 9iAS using apache
    server....
    i have tried but it gives me error about the forms engine..
    how do i make apache server know about the forms60/f60all.cab
    and other required configuration files
    pl let me know at the earliest
    thanks

  • How to hide database user name on report

    Hi,
    Whenever I run my report, there is a username "HTMLDB_PUBLIC_USER" displayed on the top of the report.
    Could someone tell how to hide that? If I need to chage the template for that, please guide me through the steps.
    thanks in advance.
    VJ

    Go to your page template body and remove
    &APP_USER.
    variable.
    Denes Kubicek

  • How to set database user password to never expire

    Hello all,
    I have a linux server with Oracle 11g installed which is used primarily for testing by a few developers and QA folks. I want to set the DB user password to never expire. I have run the following (which works on a windows machine) but the password still states that it will expire in 7 days. Is there something else I can do to 'force' the pw to infinity? I've tried stopping shutting down the DB, stopping / restarting listener...
    ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
    select * from dba_profiles where profile = 'DEFAULT' and resource_name LIKE 'PASSWORD_LIFE_TIME';
    "PROFILE"     "RESOURCE_NAME"     "RESOURCE_TYPE"     "LIMIT"
    "DEFAULT"     "PASSWORD_LIFE_TIME"     "PASSWORD"     "UNLIMITED"
    select profile from dba_users where username='TEST';
    "PROFILE"
    "DEFAULT"
    select username, account_status, to_char(expiry_date, 'DD-MM-YYYY') EXP_DATE from dba_users where username = 'TEST';
    "USERNAME"     "ACCOUNT_STATUS"     "EXP_DATE"
    "TEST"     "OPEN"     ""
    Help appreciated.

    With 11g, Password_life_time in DEFAULT profile is set to 180days.
    Default profile values in 11g.
    SQL> SELECT * FROM dba_profiles WHERE profile = 'DEFAULT' AND resource_type = 'PASSWORD';
    PROFILE                        RESOURCE_NAME                    RESOURCE
    LIMIT
    DEFAULT                        FAILED_LOGIN_ATTEMPTS            PASSWORD
    10
    DEFAULT                        PASSWORD_LIFE_TIME               PASSWORD
    180
    DEFAULT                        PASSWORD_REUSE_TIME              PASSWORD
    UNLIMITED
    PROFILE                        RESOURCE_NAME                    RESOURCE
    LIMIT
    DEFAULT                        PASSWORD_REUSE_MAX               PASSWORD
    UNLIMITED
    DEFAULT                        PASSWORD_VERIFY_FUNCTION         PASSWORD
    NULL
    DEFAULT                        PASSWORD_LOCK_TIME               PASSWORD
    1
    PROFILE                        RESOURCE_NAME                    RESOURCE
    LIMIT
    DEFAULT                        PASSWORD_GRACE_TIME              PASSWORD
    7
    7 rows selected.Change the password_grace_time to unlimited.
    HTH
    -Anantha

Maybe you are looking for

  • OBIEE 10g - Can I use logical SQL to set variable?

    I am trying to set value of a session variable in the Advanced tab Prefix box of a request. Assigment of absolute value like this is working good: SET VARIABLE MYVAR=1; Can I set the variable using logical SQL? Something like: SET VARIABLE MYVAR = (S

  • RosettaNet Protocol error

    Hi All, Here is the scenario. Trading Partner (TP) A is sending a RosettaNet business message (PIP3A2) to TP B. When the weblogic Integration server for TP B receives this message, I get the following error message, ####<Dec 4, 2001 4:00:33 PM PST> <

  • Insanity of upgrade process

    I recently upgraded from the free FIOS WiFi router to the Quantum Gateway. Since I wasn't convinced it would be worth it, I opted for renting at first. Now after about 6 weeks, I went online to upgrade to purchase. According to the site, two differen

  • Vision M 30GB stuck on recovery m

    My player is stuck on recovery mode. When I turn it on it comes up with "firmware problem" message for a second and went to recovery mode screen. It shows firmware v.6.0_0._.23 and clean up, format all and reload firmware. I tried all the selection a

  • Talent Analysis Periods

    Hello Experts I have a question regarding the Ehp6 Talent Analysis Periods for Performance/Potential.  We are not using the standard functionality to load performance/potential values.  We have built a custom program to load 7409/7408 due to specific