Import a schema (tables, Views, Stored Procedures) on logical standby

Hi,
We have a logical standby for reporting purpose. The logical standby build through data guard
we need to import a new user in logical standby using import utility. The user dump contain tables, views, procedures, packages, roles).
The new user import has to go in users tablespace.
Is is possbile to import a new user in logical standby and what are the steps.
Thanks in advance

Hi,
Can you give me more details about your envirnoment configuration, O/S, DB version.
But generally i don't think that is this possible becuase as you know standby only for cloning the primary database, so you can import it on the production then it will be transfered to the logical standby database.
Regards;

Similar Messages

  • Crystal XI - Cannot see SQL Tables, View, Stored Procedures

    I have read a couple of similar posts but no answers.  I used to be able to see tables, view and stored procedures in Crystal XI, but suddenly I cannot.  I have spent days researching this, changing SQL security settings, checking options in Crystal, etc., etc., to no avail.  I really need an answer to this.  Does anyone know if I can call someone in support and give a credit card number for a one-time call? I don't have a support agreement.  Thank you in advance.

    Hi,
    In the data explorer, you can see the datasources such as oracle, sqlserver etc.. If you are using oracle then right click that one, you see options, a windowss opens you need to spectify the views, stored procedures etc..
    hope this helps

  • Sys Tables In Stored Procedure

    How can I use Sys Table in Stored Procedure.
    I want to use DBA_TAB_COLOUMNS, in stored procedure.
    When I used this table in stored procedure I got an error
    ORA - 00942 Table or View Does not exists.
    Thanks,
    Ahamed

    From http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_packages.htm#i1006224
    >
    Note:
    To create without errors (to compile the procedure or package successfully) requires the following additional privileges:
    The owner of the procedure or package must be explicitly granted the necessary object privileges for all objects referenced within the body of the code.
    The owner cannot obtain required privileges through roles.
    >
    You need to run
    grant select on dba_tab_columns to <owner of procedure>;

  • Drop and recreate table in stored procedure

    Hi all
    When creating tables using Transact-SQL scripts, I have always preferred to drop the table if it exists and then create it explicitly using CREATE TABLE.  For two reasons:
    1) It does not matter if it is the first time the SP is run ie. if I create the table manually in the first instance and just use TRUNCATE TABLE it could fail if the table is deleted
    2) I have control over the data types of the table fields
    Just recently though I discovered the error that can occur when dropping and creating a table in the same batch (see link below)
    Microsoft Website
    This causes me a problem when dropping and creating tables in stored procedures, as I understand that a stored procedure is in itself a single batch?
    Can I avoid this error in a stored procedure whilst continuing to drop and create tables?  Or should I be taking a different approach?
    Coding best practice advice would be greatly appreciated.
    Thank you

    Thanks Ronen
    Please see my second post immediately before your reply.
    Given that I need to store the data output in a physical table for use in QlikView, would you suggest truncating the table each time the SP runs?  And then having a script that handles both dropping and creating the physical table, and also creating
    the SP?
    >> QlikView
    QlikView is an Israeli company, right?
    In any case I am not familiar with QlikView's application, therefore I can only give you general information, based on assumptions regarding the application, and facts regarding the SQL Server.
    >> for use in QlikView
    I assume that external application use specific database structure (table
    structure) and it is change only in rare situations (for example CMS interface might change the tables if and when a module s update/install). In this case there is no need to drop the table and recreate it and TRUNCATE is the solution.
    >> would you suggest truncating the table each time the SP runs
    I am sorry but i cant recommend on TRUNCATE a table each time you execute SP, without know the exact reason for this logic. It sound to me, at this point of time (with the information that we have), that this
    is very bad logic (application architecture). As I wrote above, basing your application on TRUNCATING the table each time mean that you have problems with multi users. Thins about 2 people that try to execute the same SP at almost the same time. Think about
    locking in the SQL Server and bad data (one truncate while the other already inserted the new data and get no rows, if there is no locking).
    But TRUNCATE is much better in this case probably then DROP and DELETE, since it is faster, and locking will be shorter (hopefully the application use the correct locking). There are other reasons why TRUNCATE is better, and other people already mentioned
    most of them, but time in this scenario might be critical.
    >> having a script that handles both dropping and creating the physical table, and also creating the SP?
    I do not undestand what is this second step. we said that you truncate the table, so why do you need to
    dropping and creating the physical table and who
    creating the SP?
    Are you meaning that the application create the tables and SP?
    There are lot of application that during installation create the database structure. is this what you mean?
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Using temporary tables in stored procedures

    Suppose that I have created a temporary table in a stored procedure using an "EXECUTE IMMEDIATE" statement. When I compile the procedure, that table is not created yet, so the compiler says that the table does not exist.
    What is the way of using temporary tables in stored procedures?

    It's a good practice to avoid using DDL statements being executed from stored procedures. "Truncate Table" via dynamic SQL from stored procedure is a different story and is useful in DSS environments.
    But if you insist on "creating" tables using Dynamic SQL from Stored Procedures then you must also embed your DML statements in Dynamic SQL to avoid compilation errors.
    Example:
    Create or Replace Procedure Proc_TestDynamicSQL is
    Begin
    Execute Immediate 'Create table myTable as select * from user_tables' ;
    Execute Immediate 'Update myTable set table_name = ''Test'' ' ; --two single quotes before and after the string "Test"
    End;
    In this case, Oracle wouldn't care about the table references during compilation.

  • Documentation on table, view and procedures of the user portal

    Where can I find documentation on table, view and procedures of the portal user?
    Thanks.

    PL/SQL API doc here :
    http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1014/summary.html
    VIEWS doc here :
    http://download-uk.oracle.com/docs/cd/B14099_19/portal.1014/b14135/pdg_cm_api.htm#CHDIFAGE

  • How to do import of only table data without procedures and synonyms

    Hello All,
    I want to import only the tables of one database to a new database. I did a table level export of one schema. But along with it the stored procedures,synonyms, views etc are exported. Is there any way to stop them. Or is it possible to import only the tables from the dump created?
    Regards
    Satish

    Hi Maran,
    Thanks for the feedback. I think I didnot specify the parafile with the table list while exporting. I am redoing it now. I shall update this post within 20 minutes.
    Regards
    Satish

  • ALDSP 3.0 -- schema owner for stored procedure or SQL Statement

    Using ALDSP, I have a need to create a physical service based on a stored procedure or a SQL statement. I am wondering what will happen when I move to another deployment environment where the schema owner changes. In our QA and Prod environments, we have a different schema owner for all tables in the application (the DBAs believe this prevents unwanted updates to a prod environment). DSP elegantly supports this for normal table- and view-based physical services by mapping schemas through the DSP console after deployment. Will I get the same type of mapping capability for stored procedures and SQL statements? I noticed that I can add a SQL-based function to a physical service...is there a way to pass in the physical table name from that data service to the procedure or SQL statement?
    Thanks,
    Jeff

    Schema name substitution should work for stored procedures just like it does for tables. If it doesn't - report a bug.
    You don't get any help for sql-statement based data services - dsp doesn't parse the sql provided. One thing you could do is use the default schema (following the user of your connection pool), and not specify the schema in your sql-statement.

  • Find tables in Stored Procedures

    Hi...
    Is there a way I can find the names of stored procedures where a certain table is referenced without having to look through all of them? I tried using dba_dependencies, but it did not return any rows even when I knew the table was referenced in two stored procs. No rows were returned. This is the query I issued:
    select
    referenced_name,
    referenced_type
    from
    dba_dependencies
    where
    name LIKE '%DATA.GL_Activity_Fact%'
    Any ideas? I need to modify all the stored procs which reference this table.
    Thanks so much!

    Assuming DATA is the schema name and GL_ACTIVITY_FACT is the table name
    1) You would want to use DBA_DEPENDENCIES to search for objects that reference the table, not for objects that are referenced by the table. So you'd want to search on REFERENCED_NAME and REFERENCED_OWNER, not the other way around.
    2) Regardless of how you specify the table in your code, the owner and object name will be stored separately in the data dictionary. And both will be all upper case (unless you happen to have created tables with case sensitive names).
    So you probably want
    SELECT owner, name, type
      FROM dba_dependencies
    WHERE referenced_owner = 'DATA'
       AND referenced_name = 'GL_ACTIVITY_FACT'
       AND referenced_type = 'TABLE'Be aware that if you use dynamic SQL to reference the table, there will be no entries in DBA_DEPENDENCIES for that.
    Justin

  • Temporary Tables in Stored Procedure

    Hi,
    I am writing a stored procedure that will get data from different sources and generates a spreadsheet finally. Initial select gets the basic data and following selects merges data.
    For this I have created a table in the database, I am populating data into that table using same procedure and finally selecting data from that table to generate spreadsheet.
    Now I am planning to use TEMPORARY table instead of creating table in database. Can anyone tell me where I can view samples for temp tables?
    Which one is the better option in performance wise?
    or
    can I handle the whole scenario with cursor? any examples?

    Hi,
    Why can't you use a regular table?
    Look up [Global Temporary|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_7002.htm#sthref7247] in the diocumentation, including the SQL*Language manual, for an alternative.
    "Temporary" applies only to the data. A Global Temporary Table is created once, and stays until you DROP it, the same as any other table.
    The data in the table is temporary. If you create the table saying "ON COMMIT PRESERVE ROWS" (which sounds appropriate, based on your description) the the data will automatically be deleted when you end the database session.
    All data in Global Temporary Tables is session-specific. If two (or more) people are using the same table at the same time, each will only see the data they inserted themselves; they will never see rows inserted by the other session.
    Almost anything you can do with a regular table you can do with a Global Temporary Table. In particular, DML (such as MERGE) and cursors work exactly as they do on other tables.

  • How to view stored procedure using SQLPlus

    I have created the following stored procedure in Oracle, I would like to know how to view this stored procedure using SQLPlus:
    CREATE PROCEDURE get_product_code(prod_no IN VARCHAR2) IS
         CURSOR Getno IS
              <my_query_goes_here>
         BEGIN
              For Getno_cur IN Getno LOOP
              DBMS_OUTPUT.PUT_LINEGetno_cur.name);
              END LOOP;
         END;
    run;

    Hi,
    You can also use USER_SOURCE in place of ALL_SOURCE, for getting your own procedure code (or any pl/sql schema object).
    Regards

  • Create Dates table as stored procedure

    I want to modify this statement to use todays date as the start date and add 50 years to insert into table instead of entering a date range and execute it as a stored procedure. Can someone help me to modify this? Thanks
    /**Drop Tables*/
    DROP TABLE [dbo].[DimDate]
    GO
    /** Create Date Dimension Table **/
    /* Create First numbers table for key generation */
    CREATE TABLE Numbers_Small (Number INT);
    INSERT INTO Numbers_Small
    VALUES (0)
    ,(1)
    ,(2)
    ,(3)
    ,(4)
    ,(5)
    ,(6)
    ,(7)
    ,(8)
    ,(9);
    GO
    /* Create Second numbers table for key generation */
    CREATE TABLE Numbers_Big (Number_Big BIGINT);
    INSERT INTO Numbers_Big (Number_Big)
    SELECT (tenthousands.number * 10000 + thousands.number * 1000 + hundreds.number * 100 + tens.number * 10 + ones.number) AS number_big
    FROM numbers_small tenthousands
    ,numbers_small thousands
    ,numbers_small hundreds
    ,numbers_small tens
    ,numbers_small ones;
    GO
    /* Create Date Dimension Table */
    CREATE TABLE [dbo].[DimDate] (
    [DateKey] [int] NOT NULL
    ,[Date] [datetime] NOT NULL
    ,[Day] [char](10) NULL
    ,[DayOfWeek] [smallint] NULL
    ,[DayOfMonth] [smallint] NULL
    ,[DayOfYear] [smallint] NULL
    ,[PreviousDay] [datetime] NULL
    ,[NextDay] [datetime] NULL
    ,[WeekOfYear] [smallint] NULL
    ,[Month] [char](10) NULL
    ,[MonthOfYear] [smallint] NULL
    ,[QuarterOfYear] [smallint] NULL
    ,[Year] [int] NULL
    GO
    /* Create Date Key and Date Fields */
    INSERT INTO [DimDate] (
    DateKey
    ,DATE
    SELECT number_big
    ,DATEADD(day, number_big, '1900-01-01') AS DATE
    FROM numbers_big
    WHERE DATEADD(day, number_big, '1900-01-01') BETWEEN '1900-01-01'
    AND '2050-12-31'
    ORDER BY number_big;
    GO
    /* Update all other fields with appropriate data. */
    UPDATE [DimDate]
    SET Day = DATENAME(DW, DATE)
    ,DayOfWeek = DATEPART(WEEKDAY, DATE)
    ,DayOfMonth = DAY(DATE)
    ,DayOfYear = DATEPART(DY, DATE)
    ,PreviousDay = DATEADD(DAY, - 1, DATE)
    ,NextDay = DATEADD(DAY, 1, DATE)
    ,WeekOfYear = DATEPART(WK, DATE)
    ,Month = DATENAME(MONTH, DATE)
    ,MonthOfYear = MONTH(DATE)
    ,QuarterOfYear = DATEPART(Q, DATE)
    ,Year = YEAR(DATE);
    GO
    /* Drop Temp Tables */
    DROP TABLE Numbers_Small;
    DROP TABLE Numbers_Big;

    SQL is a database language, so why do you want to re-compute constant data over and over, hundreds of times a day for years? UGH! 
    There are 365.2422 days per year, so a century of calender data is only 36,525 rows! Maybe 40 bytes per row? About 1.5 Kbytes  total? This will fit into main storage
    What you did post was wrong. DATE is a reserved word in SQL and it is  unit of temporal measurement. You also seem to confuse columns and fields. In SQL a field is a sub-unit of a temporal measurement (YEARS, MONTH, DAY, HOUR, MINUTE, SECOND). Please
    learn the ISO-11179 rules for data element names.
    You crammed too much in the table. The new DATE data type is only 3 bytes! Your other columns are mostly redundant and have attribute splitting problems.  Try this:
    CREATE TABLE Calendar 
    (cal_date DATE NOT NULL PRIMARY KEY,
     julian_date INTEGER NOT NULL, 
     julian_business_day INTEGER NOT NULL, 
     ordinal_date CHAR(8) NOT NULL
       CHECK (ordinal_date 
           LIKE '[12][0-9][0-9][0-9]-[0-9][0-9][0-9]') NOT NULL,
     week_date CHAR(9) NOT NULL
        CHECK (week_date LIKE '[12][0-9][0-9][0-9]W[0-5][0-9]-[0-7])
    The julianized date is a sequential number over the whole calendar. It makes temporal math easier. 
    ISO-8601 week_date is the week-within-year. This format is 'yyyyWww-d' where yyyy is the year, W is a separator token, ww is (01-53) week number and d is (1-7) day of the week. 
    There are several websites with calendars you can cut & paste, but you can start your search with: http://www.calendar-365.com/week-number.html 
    The Julian business day is a good trick. Number the days from whenever your calendar starts and repeat a number for a weekend or company holiday. 
    CREATE TABLE Calendar
    (cal_date DATE NOT NULL PRIMARY KEY, 
     julian_business_nbr INTEGER NOT NULL, 
    INSERT INTO Calendar 
    VALUES ('2007-04-05', 42), 
     ('2007-04-06', 43), -- good Friday 
     ('2007-04-07', 43), 
     ('2007-04-08', 43), -- Easter Sunday 
     ('2007-04-09', 44), 
     ('2007-04-10', 45); --Tuesday
    To compute the business days from Thursday of this week to next
     Tuesdays:
    SELECT (C2.julian_business_nbr - C1.julian_business_nbr)
      FROM Calendar AS C1, Calendar AS C2
     WHERE C1.cal_date = '2007-04-05',
       AND C2.cal_date = '2007-04-10'; 
    Why store things like the month name in the table? This is a display field, not a schema column value. It is language dependent! It is only part of a scalar value, too; why not normalize? 
    But if you need them, then use computed columns that are not materialized until needed. Also, use the SUBSTRING() for things that are not numeric. Why use SMALLINT for the day of the week?  Are you going to divide Thursday by 42? It is a name, not a numeric. 
    You saw the tricks with a Series table wanted to use them, but do not  be the boy with a new hammer who thinks everything is a nail. I find that a spreadsheet is the best way to create such a calendar table because they have so many temporal options and
    functions. 
    Also, putting the comma at the start of  a line is an old punchcard trick that we do not use any more. Back in the 1960's, it let us re-arrange the deck and re-use the cards. All it cost us was readable code –- your eyes expect to see a comma after a string,
    so this makes a twitch as you read. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Form on table: Using stored procedure to update?

    I have a view which joins a handful of tables. I have a PL/SQL API that contains all the necessary business logic and translations to update the tables underlying this view.
    If I use the HTMLDB wizard to create a form on this view, it would automatically generate plain INSERT/UPDATE statements for DML against the view. How can I make it use my API instead? (Yes, I can probably plug in my API in INSTEAD OF triggers on the view, but I really dont want to do that)
    [Of course, the reason I would use the built-in form-on-table wizard is to get the automatic lost-update detection, locking, etc features]
    Help? Thanks

    The wizards are there to help you build typical pages like "form based on a table", "form on based a stored procedure".
    There is no wizard for "form based on a view, using my own API for inserts, updates and delete" - but that doesn't prevent you building such a form by hand. I have built similar forms, and found it quite easy to approach it like this:
    1) use "form based on a stored procedure" to create a form based on your API insert procedure
    2) add further buttons and processes to call your API's update and delete procedures
    3) add an "on load" process to select the row from the view and populate the form for update or delete
    You need to add some logic for context-sensitivity - e.g. Update and Delete buttons only appear when in "update mode", etc.

  • PowerPivot tables and stored procedures

    What can I use to dynamically create a PowerPivot table in excel, using a stored procedure as a data source?
    Onyx12

    Hi there
    Thank you for your response.
    Here's what I'm trying to achieve and I stand under correction. I have a stored procedure which I want to mirror it's query result as a Pivot Table in Excel, and have done so by hard coding the execution code and imported it to Excel. But now I'm trying
    to find out if there is another way to do this, in Excel though. I've been looking at solutions which include building macros, but I'm afraid SSMS does not support them. And even so, I'm not sure if building a macro is an ideal solution in this case. In essence,
    I'm trying to retrieve data using a stored procedure, through the use of TSQL code in Excel. Please see query I've provided to Excel, using PowerPivot. I hope I've articulated myself thoroughly.
    DECLARE @RC int
    DECLARE @as_at_date datetime
    DECLARE @all_versions bit
    DECLARE @include_motor bit
    DECLARE @include_reserve bit
    -- TODO: Set parameter values here.
    SET @as_at_date = GETDATE()
    SET @all_versions  = 0
    SET @include_motor  = 0
    SET @include_reserve  = 0
    EXECUTE @RC = [dbo].[usp_claims_by_reserve] 
       @as_at_date
      ,@all_versions
      ,@include_motor
      ,@include_reserve
    Onyx12

  • Allow user to select data, see the tables list but not view the table/view/stored procs definition

    Hi,
    May I know how to achieve the above ? Please enlighten me.
    TIA !

    So you want users to be able to see the name of the table, but not the definition? I am afraid that this is not possible. You can give users access to a table and hide the definition, but the name is considered part of the definition.
    Olaf mentioned VIEW DEFINITION. What he did not say is that when you have SELECT permission (or EXECUTE permission on a stored procedure), the permission VIEW DEFINITION is implied by the stronger permission. For this reason you need to explicitly DENY this
    permission as shown in the script below.
    In the script I create a user without a login and then impersonate a user. This is an excellent way to test permissions.
    [sql]
    CREATE TABLE tabbe (a int NOT NULL)
    go
    CREATE USER usse WITHOUT LOGIN
    go
    GRANT SELECT ON tabbe TO usse
    DENY VIEW DEFINITION ON tabbe TO usse
    go
    EXECUTE AS USER = 'usse'
    go
    SELECT * FROM tabbe
    go
    SELECT name FROM sys.objects WHERE type = 'U'
    EXEC sp_help tabbe
    go
    REVERT
    go
    DROP USER usse
    DROP TABLE tabbe
    {/sql]
    Note: rather than denying VIEW DEFINITION on an individual object you can leave out "ON tabbe" to deny the permission across the database.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for

  • Option button click on IE is not working

    I am trying to play around with Excel VBA code to select an option button on a webpage. For some reason the option button is not getting selected even though there is no errors when executing the code. Please share your thoughts. Excel VBA code block

  • Can't drag and drop apps in iTunes library after a restore

    Came back from an update (having transferred all new purchases off my ipod before updating) to find ipod completely empty, and needed to restore! (ipod only 2 months old) Initially couldn't drag and drop any of the library back into restored ipod, bu

  • BW as source system for 2 other BW systems

    Hi My BW1 system works as a source system for 2 other BW systems say BW2 & BW3. I would like to configure infosources in BW1 system so that infosource A would be visible only from BW2 system & infosource B would be visible only form BW2 system. Is it

  • Oracle XE on Win32 XP Pro

    Hi, I am able to install Oracle XE on win32, windows XP Professional SP3. I can access the apex home page when I am not connected to the network. I connect to a wireless network and everything works fine if I am not connected to a network. The moment

  • DNG and Camera Raw 6.1 on Windows 7/64 bit ?

    is DNG and Camra Raw availble for Windows 7/64 bit? There also seems to  "codec" that will allow raw files to show up in Windows as thumbnail images, right?