Creating a new schema in a Logical Standby Database

Hi All,
I am experimenting with logical standby databases for the purpose of reporting, and have not been able to create a new schema in the logical standby database - one of the key features of logical standbys.
I have setup primary and logical standby databases, and they seem to be running just fine - changes are moved from the primary to the standby and queries on the standby seem to run ok.
However, If I try to create a new schema on the logical standby, that does not exist on the primary, I get "ORA-01031: insufficient privileges" errors when I try to create new objects.
Show below are the steps I have taken to create the new schema on the logical standby. Any help would be greatly appreciated.
SYS@UATDR> connect / as sysdba
Connected.
SYS@UATDR>
SYS@UATDR> select name, log_mode, database_role, guard_status, force_logging, flashback_on, db_unique_name
2 from v$database
3 /
NAME LOG_MODE DATABASE_ROLE GUARD_S FOR FLASHBACK_ON DB_UNIQUE_NAME
UATDR ARCHIVELOG LOGICAL STANDBY ALL YES YES UATDR
SYS@UATDR>
SYS@UATDR> create tablespace ts_new
2 /
Tablespace created.
SYS@UATDR>
SYS@UATDR> create user new
2 identified by new
3 default tablespace ts_new
4 temporary tablespace temp
5 quota unlimited on ts_new
6 /
User created.
SYS@UATDR>
SYS@UATDR> grant connect, resource to new
2 /
Grant succeeded.
SYS@UATDR> grant unlimited tablespace, create table, create any table to new
2 /
Grant succeeded.
SYS@UATDR>
SYS@UATDR> -- show privs given to new
SYS@UATDR> select * from dba_sys_privs where grantee='NEW'
2 /
GRANTEE PRIVILEGE ADM
NEW CREATE ANY TABLE NO
NEW CREATE TABLE NO
NEW UNLIMITED TABLESPACE NO
SYS@UATDR>
SYS@UATDR> -- create objects in schema
SYS@UATDR> connect new/new
Connected.
NEW@UATDR>
NEW@UATDR> -- prove ability to create tables
NEW@UATDR> create table new
2 (col1 number not null)
3 tablespace ts_new
4 /
create table new
ERROR at line 1:
ORA-01031: insufficient privileges
NEW@UATDR>
NEW@UATDR>

HI Daniel,
I appreciate your quick response.
My choice of name may not have been ideal, however changing new to another name - like gav - does not solve the problem.
SYS@UATDR> connect / as sysdba
Connected.
SYS@UATDR>
SYS@UATDR> select name, log_mode, database_role, guard_status, force_logging, flashback_on, db_unique_name
2 from v$database
3 /
NAME LOG_MODE DATABASE_ROLE GUARD_S FOR FLASHBACK_ON DB_UNIQUE_NAME
UATDR ARCHIVELOG LOGICAL STANDBY ALL YES YES UATDR
SYS@UATDR>
SYS@UATDR> create tablespace ts_gav
2 /
Tablespace created.
SYS@UATDR>
SYS@UATDR> create user gav
2 identified by gav
3 default tablespace ts_gav
4 temporary tablespace temp
5 quota unlimited on ts_gav
6 /
User created.
SYS@UATDR>
SYS@UATDR> grant connect, resource to gav
2 /
Grant succeeded.
SYS@UATDR> grant unlimited tablespace, create table, create any table to gav
2 /
Grant succeeded.
SYS@UATDR>
SYS@UATDR> -- show privs given to gav
SYS@UATDR> select * from dba_sys_privs where grantee='GAV'
2 /
GRANTEE PRIVILEGE ADM
GAV CREATE TABLE NO
GAV CREATE ANY TABLE NO
GAV UNLIMITED TABLESPACE NO
SYS@UATDR>
SYS@UATDR> -- create objects in schema
SYS@UATDR> connect gav/gav
Connected.
GAV@UATDR>
GAV@UATDR> -- prove ability to create tables
GAV@UATDR> create table gav
2 (col1 number not null)
3 tablespace ts_gav
4 /
create table gav
ERROR at line 1:
ORA-01031: insufficient privileges
GAV@UATDR>

Similar Messages

  • How to import schema into logical standby database

    i had created a new schema(A)in different database and exported the schema into a dmp file using export utility
    from the exported dmp file i want to import that schema(A) into logical standby database using import utility
    iam importing as system user .
    i am getting the following error
    IMP-00003: ORACLE error 1031 encountered
    ORA-01031: insufficient privileges
    can some one help what was going wrong.
    thank you in advance.
    kalyan

    Hi kalyan,
    May u plz let us know which import command you are using? kinldy check that your system user has import/export privileges?
    Thanks
    Hassan Khan

  • Create an Object in Logical standby database in Oracle 10G

    Hi,
    I have logical standby database in oracle 10g R2 for reporting purpose.Now i want to create procedure in logical standby which is use to create new temp table in logical standby and contained data generated from select operation on existing table.
    Can i create a new user in logical standby database,add new tablespace in logical standby which can insert,update and delete data in standby database base table?
    kindly provide me the steps to implement all this.What will be effect if i set guard_Status in v$database is NONE in logical standby?
    Thanks,
    Shital Patel

    Hi Shital,
    Guard_status protects the data from being changed.
    ALL- By default it is not possible for a non-privileged user to modify data on a data guard SQL apply database. This is because the database guard is automatically set to ALL.
    With this level of security, only SYS user can modify the data.
    STANDBY- When you set this level of security, users are able to modify data that is not maintained by the Logical apply engine.
    NONE permits any users to access the standby database as long as they have correct privileges. This is the normal security for all data in the database.
    You can change the guard status value from ALL to NONE in order to allow non-privileged users to modify data and Yes you can create user and extra tablespace in logical standby database..this is what the one of advantage of using Logical standby database.
    SQL> ALTER DATABASE GUARD NONE;
    Thanks

  • Creating new tables in Logical Standby database

    Hi
    I have a requirement to create new tables in logical standby database. These tables will not be present on primary database. Is it possible to do this ?
    I have a new schema already created which has the privilege to CREATE new table.
    I have stopped the logical standby apply.
    When I am now trying to create a new table but it is failing with error : insufficient privileges.
    When I am trying to run below statement on new schema it is also failing with error of insufficient privileges.
    alter session disable dataguard;
    Please help.

    user8819121 wrote:
    Thanks Mahir,
    I was able to create the table after logging in as sysdba.
    But I need my user on that table to execute DML statements. My user has privileges to insert,delete and update any table.
    I tried the following statements to disable the guard but it is sill not working
    ALTER DATABASE GUARD STANDBY.
    Do I need to skip the tables created using dbms_logstdby package to not making it part of SQL Apply ? I guess not since the table is not in primary database.
    Amit
    You can skip only on primary, your created schema on Standby is not in primary.
    Then you must change Status of data guard to NONE. NONE is means is not any security on your data.
    In Guard status NONE can change all schema data.
    Please check link: http://docs.oracle.com/cd/E11882_01/server.112/e10700/manage_ls.htm#CHDGFGHG
    Following tests on user created before guard status is change from ALL to STANDBY.
    C:\Users\Administrator>sqlplus / as sysdba
    SQL> conn test/test
    Connected.
    SQL> select table_name from user_tables;
    TABLE_NAME
    T
    SQL> insert into t values(22);
    insert into t values(22)
    ERROR at line 1:
    ORA-16224: Database Guard is enabled
    SQL> conn / as sysdba
    Connected.
    SQL> select guard_Status from  v$database;
    GUARD_S
    ALL
    SQL> alter  database guard standby;
    Database altered.
    SQL> conn test/test
    Connected.
    SQL> insert into t values(1);
    insert into t values(1)
    ERROR at line 1:
    ORA-16224: Database Guard is enabled
    SQL> conn / as sysdba
    Connected.
    SQL> select guard_Status from  v$database;
    GUARD_S
    STANDBY
    SQL> alter  database guard none;
    Database altered.
    SQL> select guard_Status from  v$database;
    GUARD_S
    NONE
    SQL> conn test/test
    Connected.
    SQL> insert into t values(1);
    1 row created.
    SQL> commit;
    Commit complete.And Now I want share with you new tests :)
    Now user creating when after guard status change
    SQL> drop  user test cascade;
    User dropped.
    SQL> select guard_status from v$database;
    GUARD_S
    STANDBY
    SQL> create user test identified by test;
    User created.
    SQL> grant create session,  resource, create table to test;
    Grant succeeded.
    SQL> conn test/test
    Connected.
    SQL> create table t (n number);
    Table created.
    SQL> insert into t values(1);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>It means when guard status is ALL then all of user created guarding.
    When you changed status to STANDBY then Logical Standby guard only primary schema and created schema before change.
    NONE is not guard any schema. it means you can delete standby schema data too.
    Regards
    Mahir M. Quluzade
    Edited by: Mahir M. Quluzade on Apr 19, 2013 4:07 PM

  • Creating triggers in a logical standby database

    Does anyone know if its possible to create and enable a trigger in a logical standby database on a 'guarded' table? I've been able to create the trigger (as an after insert trigger) and it appears to be valid but it never seems to fire, despite inserts taking place. Are there any other steps involved to activate this, or is it just plain not possible in a logical standby? My primary and logical standby databases are 10.2.0.3

    HI Daniel,
    I appreciate your quick response.
    My choice of name may not have been ideal, however changing new to another name - like gav - does not solve the problem.
    SYS@UATDR> connect / as sysdba
    Connected.
    SYS@UATDR>
    SYS@UATDR> select name, log_mode, database_role, guard_status, force_logging, flashback_on, db_unique_name
    2 from v$database
    3 /
    NAME LOG_MODE DATABASE_ROLE GUARD_S FOR FLASHBACK_ON DB_UNIQUE_NAME
    UATDR ARCHIVELOG LOGICAL STANDBY ALL YES YES UATDR
    SYS@UATDR>
    SYS@UATDR> create tablespace ts_gav
    2 /
    Tablespace created.
    SYS@UATDR>
    SYS@UATDR> create user gav
    2 identified by gav
    3 default tablespace ts_gav
    4 temporary tablespace temp
    5 quota unlimited on ts_gav
    6 /
    User created.
    SYS@UATDR>
    SYS@UATDR> grant connect, resource to gav
    2 /
    Grant succeeded.
    SYS@UATDR> grant unlimited tablespace, create table, create any table to gav
    2 /
    Grant succeeded.
    SYS@UATDR>
    SYS@UATDR> -- show privs given to gav
    SYS@UATDR> select * from dba_sys_privs where grantee='GAV'
    2 /
    GRANTEE PRIVILEGE ADM
    GAV CREATE TABLE NO
    GAV CREATE ANY TABLE NO
    GAV UNLIMITED TABLESPACE NO
    SYS@UATDR>
    SYS@UATDR> -- create objects in schema
    SYS@UATDR> connect gav/gav
    Connected.
    GAV@UATDR>
    GAV@UATDR> -- prove ability to create tables
    GAV@UATDR> create table gav
    2 (col1 number not null)
    3 tablespace ts_gav
    4 /
    create table gav
    ERROR at line 1:
    ORA-01031: insufficient privileges
    GAV@UATDR>

  • Creating logical standby database

    Hi all,
    10.2.0.1
    Following this link
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/create_ls.htm
    Where do i need to issue these statements:
    SQL> EXECUTE DBMS_LOGSTDBY.BUILD;
    SQL> ALTER DATABASE RECOVER TO LOGICAL STANDBY db_name;
    on physical standby or primary database.
    I issued the first stament on primary and second on physical standby .
    IN the alert log of standby,i have the following entries.
    Wed Jan 20 15:34:28 2010
    Converting standby mount to primary mount.
    Wed Jan 20 15:34:28 2010
    ACTIVATE STANDBY: Complete - Database mounted as primary (treasury)
    *** DBNEWID utility started ***
    DBID will be changed from 306589979 to new DBID of 330710340 for database
    .........................I am trying to create a logical standby database after creating a physical standby database.
    It seems standby changed to primary which was not desired.
    Thanks

    Not tried myself, but you might want to have a look at this URL.
    It appears to suggest that you need to change names of datafiles as well as value db_name explcitly on standby.

  • Create table on Logical Standby Database

    Dear DBAs,
    here is my situation;
    1. My primary database (where the tables' owner is "ICC" having a DBA) is used for insert/update transactions.
    2. The logical stdby DB (dataguard structure with MAX availability) is used to generate reports, after updating some tables owned by the same user "ICC". note that these tables are excluded from the replication.
    3. The developers might need to create this kind of tables to generate another kind of reports.
    The issue is that when the standby apply is enabled or disabled, the user ICC is not able to create a new table, it gives ORA-01031: insufficient privileges. note that it's not practical to ask the DBA to disable the "APPLY" at any table creation.
    Do you have an idea about how to resolve.
    My database is 10gR2 path.10.2.0.4.0 on Windows 2003
    Thank you in advance

    If you stop applying log on the logical standby you can easily create a table over there. See oracle docs. The following list shows >how to re-create a table and restart SQL Apply on that table:
    >
    Stop SQL Apply:
    SQL> ALTER DATABASE STOP LOGICAL STANDBY APPLY;
    Ensure no operations are being skipped for the table in question by querying the DBA_LOGSTDBY_SKIP view:
    SQL> SELECT * FROM DBA_LOGSTDBY_SKIP;
    ERROR STATEMENT_OPT OWNER NAME PROC
    N SCHEMA_DDL HR EMPLOYEES
    N DML HR EMPLOYEES
    N SCHEMA_DDL OE TEST_ORDER
    N DML OE TEST_ORDER
    Because you already have skip rules associated with the table that you want to re-create on the logical standby >database, you must first delete those rules. You can accomplish that by calling the DBMS_LOGSTDBY.UNSKIP >procedure. For example:
    SQL> EXECUTE DBMS_LOGSTDBY.UNSKIP(stmt => 'DML', -
    schema_name => 'HR', - object_name => 'EMPLOYEES');SQL> EXECUTE DBMS_LOGSTDBY.UNSKIP(stmt >=> 'SCHEMA_DDL', -
    schema_name => 'HR', - object_name => 'EMPLOYEES');
    Re-create the table HR.EMPLOYEES with all its data in the logical standby database by using the >DBMS_LOGSTDBY.INSTANTIATE_TABLE procedure. For example:
    SQL> EXECUTE DBMS_LOGSTDBY.INSTANTIATE_TABLE(shema_name => 'HR', -
    object-_name => 'EMPLOYEES', -
    dblink => 'BOSTON');
    Start SQL Apply:
    SQL> ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;Regards.

  • Creating a new schema

    This may sound really simple, but I would like to create a new
    schema within my 9i database. How do you do that? I have found
    how to add just about everything else, but not schemas.
    Thanks

    Hi,
    For create a new user....
    You must have privileges to create a user or you must connect to SYSTEM or SYS user.
    Regards,
    Sailaja

  • Creating a new schema or adding some more tables in existing schema ??

    Hi All,
    We have a new requirement from the client asking us to include a few new functionalities(pages--- all together a new application has to be embedded into our application) in our application. By adding these new functionalities, the number of hits to our application can be doubled.
    As per the above requirement, I would like to know that whether to create a new schema or to create some new tables in the existing database for the new functionalities.
    By what way, can I handle the number of requests in a better way? by creating the new schema or by creating the new tables for the new functionalities.
    Also I would like like to know what kind of factors will differ between creating a new schema or creating new tables for the new functionalities in the existing schema.
    FYI... We are using Cold Fusion as front-end and Oracle 9i for back-end

    This the forum for Oracle's SQL Developer tool. You will get better answers in the Database - General forum.
    The short answer is that from a performance point of view there will be no difference. The issues are more to do with maintenance.

  • RMAN script problem to create logical standby database !

    Dear Friends ,
    I am using Oracle10g database . I want to create a logical standby database . I create two database :
    Primary : orcl
    standby : orclsby1
    Every steps I followed successfully , but when I am going to create "standby database" from "primary database" using rman then I found the following error :
    The script is below which I have to run in Primary (orcl) database :
    Script :
    run {
    allocate channel prmy1 type disk;
    allocate channel prmy2 type disk;
    allocate channel prmy3 type disk;
    allocate channel prmy4 type disk;
    allocate auxiliary channel stby type disk;
    duplicate target database for standby from active database
    spfile
    parameter_value_convert 'orcl','orclsby1'
    set db_unique_name='orclsby1'
    set db_file_name_convert='/orcl/','/orclsby1/'
    set log_file_name_convert='/orcl/','/orclsby1/'
    set control_files='/u01/app/oracle/oradata/orclsby1.ctl'
    set log_archive_max_processes='5'
    set fal_client='orclsby1'
    set fal_server='orcl'
    set standby_file_management='AUTO'
    set log_archive_config='dg_config=(orcl,orclsby1)'
    set log_archive_dest_1='service=orcl ASYNC
    valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=orcl'
    Problem which I got :
    [oracle@localhost DG]$ rman target sys/sys123@orcl auxiliary sys/sys123@orclsby1
    Recovery Manager: Release 10.2.0.1.0 - Production on Mon Oct 19 15:58:17 2009
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database: ORCL (DBID=1227832857)
    connected to auxiliary database: ORCLSBY1 (not mounted)
    RMAN> @cr_phys_sby1.txt
    RMAN> run {
    2> allocate channel prmy1 type disk;
    3> allocate channel prmy2 type disk;
    4> allocate channel prmy3 type disk;
    5> allocate channel prmy4 type disk;
    6> allocate auxiliary channel stby type disk;
    7> duplicate target database for standby from
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "from": expecting one of: "dorecover, db_file_name_convert, nofilenamecheck, ;"
    RMAN-01007: at line 7 column 39 file: cr_phys_sby1.txt
    I try to edit the above script using 'nofilenamecheck' 'dorecover' etc. , but cannot resolve the problem . Would u plz help me .... where the problem is .
    Both databases are running on Oracle10g platform .
    Waiting for ur kind reply .. ...

    You need to:
    - create a SPFILE manually for standby database
    - use the RMAN command: DUPLICATE TARGET DATABASE FOR STANDBY
    - remove all SPFILE statements from RMAN script.

  • How to create logical standby database without using Oracle Grid Control

    Hi All,
    I want to create Logical standby database on 11gr2 on RHEL 5 without using oracle Grid Control.
    I already have a primary database as well as physical standby database.
    What i want to create a logical standby database as well on the same machine where physical standby database is running.
    So anyone of you help me out to do that
    Thanks in advance

    Hi,
    Creating a Logical Standby Database
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/create_ls.htm#SBYDB00300
    Regards,
    Tom

  • How to create logical standby database?

    Hi,
    can i created logical standby database without creating physical stanby database? is it possible?
    Thanks,

    Hi,
    Creating a Logical Standby Database
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/create_ls.htm#SBYDB00300
    Regards,
    Tom

  • Steps on Creating a Logical Standby Database

    Hi,
    I want to create a Logical Standby Database using 9.2.0.6. Anybody having steps of creating the same?
    Regards,
    Tushar

    A good start from here
    http://download-uk.oracle.com/docs/cd/A97630_01/server.920/a96653/createls.htm
    Cheers
    http://fiedizheng.blogspot.com/

  • Creating standby or logical standby database manually?

    Hi,
    I have to create 4 logical standby databases on a Linux Red Hat 64-bits server.
    The primary databases reside on another Linux Red Hat 64-bits server.
    The oracle database version is 10.2.0.3.
    The question is as follows:
    Should I create the logical standby databases manually or should I do it with the Oracle EM Grid Control?
    I have read that the creation of standby databases with the Grid Control is very straightforward, but I really want to read of some of your experiences.
    I have read that there are some problems in Grid Control with the test of Failover and Switchover.
    Please advice.

    Hi,
    It all depends.
    I assume you don't backup your database to tape using RMAN.
    Do you backup your database to disk using RMAN?
    You would need to set up NFS links from your standby server to the primary server.
    For this purpose, in 9i, I made sure my disk backup ended up in <directory>/backup/<nodename>, so I could easily set up a NFS link.
    If you do it manually, you need to have made a full database RMAN backup first.
    Probably Grid Control is taking care of this for you.
    I have done it once using database control in 10g. It is really simple, and you just have to click a few buttons and sit back.
    Doing it manually is slightly more work: you need to make sure parameters are correct and you need to write a (generic) script of less than 10 lines.
    You probably do have more control over it, though RMAN's duplicate database command is robust and can be restarted easily.
    I can't answer your last remark.
    Hth
    Sybrand Bakker
    Senior Oracle DBA

  • Add new datafile to logical standby database but not in primary

    Hi,
    Is it ok to add a new datafile to the SYSAUX tablespace on the logical standby database but not on primary? We are running out of disk space on the partition where SYSAUX01.dbf resides so we want to add a new SYSAUX02.dbf in another partition which has space. but this will only be on the logical standby not on primary, there is still lots of space in primary. standby_file_management is MANUAL and this is LOGICAL STANDBY not PHYSICAL.
    Is this possible or where there be any issues?
    Thanks.

    Logical Standby can differ from Primary, it can have extra tablespaces, datafiles, tables, indexes, users ...
    HTH
    Enrique

Maybe you are looking for

  • Is there a plug-in to write track contents to Di

    Is there a plug-in to write track contents to disc using the SB Audigy 2 ZS Pro?

  • 13 character limit on network passwords in Windows?

    We are Mac folks with a wireless airport extreme setup which we love. Our guests, in the guest house out back are trying to connect with a PC. We have a closed network as we live in a city (SF) where hacking is a hugs issue, so we are trying to add t

  • Delete albums in PSE 11

    How do I delete albums in Ps11 organizer?? < thread title edited by forum host >

  • Process chainTransport requests

    hi all, can you plz. clarify these doubts: 1. If i activate a process chain, a request will be created. In this req. will all the objects(i.e. process) collected ? when we move it will all the objects move? 2. whenever i make changes( modify or add n

  • Stracture of CI_vkkvkp

    Hi, Good day experts,   I have custom screen which is having the Max.salary Deduction  field . it has 14 length of char with conversion routine in data element level. But i need to be chage the data element which is 16 lenght of numaric field. Actual