Skipping dependent Tables in Logical Standby
Hello DBAs
I need your expertise here. Let me explain the scenario. Suppose a table is skipped in a logical standby. This table is referred by other tables and there are dependencies on this table. Now my question is what happens when a transaction is committed at the primary which is dependent on this table ?
Does the transaction go through even though that table is not replicated. What happens to data integrity ?
I appreciate your help. Thanks.
Have a go at
[The Documentation...|http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/manage_ls.htm#SBYDB00800]
Similar Messages
-
Audit DBA Activity, skip table from logical standby!
Dear All,
My database is 10gR2 on windows 2003 server.
I want to know if I can put some audit on the commands: execute dbms_logstdby.skip() to skip tables from Logical standby and also the same on unskipping the objects exec dbms_logstdby.unskip.
Thanks, ImranHi,
Given that your Database is 10g, the auditing options were extended to included DML from only SELECT in 9i, but not audit on procedures. You could double check the Fine Grained Auditing options in 10g, but I don't think this extends to DBMS_ packages.
I would consider writing a trigger or a small job that monitors the DBA_LOGSTDBY_SKIP view for additional entries. This is the only workaround that I can suggest that might fit your needs. -
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 -
Skip archive log on logical standby
hi ,
I want to skip archive log from nmber 1150 to 1161 on logical standby dtbs.
I knw , we can skip ddl , dml on logical standby .
How can archive this ??
(oracle 10g entreprise edition )Hello;
I do not believe this is an option. The closest to this would be "applying modifications to specific tables"
See :
9.4.3 Using DBMS_LOGSTDBY.SKIP to Prevent Changes to Specific Schema Objects
Data Guard Concepts and Administration 10g Release 2 (10.2) B14239-05
While this is not the answer you want the skip Archive would create a Gap and cause many other issues you don't want.
Best Regards
mseberg -
How to skip DELETE command on logical standby?
IBM AIX 5.3
Oracle DB version 10.2.0.3
Can I skip just delete or update on the standy instead of all DML's on particular object using dbms_logstdby.skip,
e.g this will skip all DMLs on the test object.
exec dbms_logstdby.skip(statement => 'DML',schema_name => 'SCOTT', object_name => 'TEST');
Can I use 'DELETE' as a statement type in dbms_logstdby.skip to just skip delete on object.
exec dbms_logstdby.skip(statement => 'DELETE',schema_name => 'SCOTT', object_name => 'TEST');You can not skip all deletions on a particular table with a statement such as this....
You can use SKIP_TRANSACTION to skip a transaction or even multiple transactions but the Oracle documentation states:
is an inherently dangerous operation. Do not invoke this procedure unless you have examined the transaction in question through the V$LOGMNR_CONTENTS view and have taken compensating actions at the logical standby database.
SKIP_TRANSACTION Procedure
Specifies transactions that should not be applied on the logical standby database. Be careful in using this procedure, because not applying specific transactions may cause data corruption at the logical standby database.
Regards
Tim Boles -
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 advanceIf 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. -
Updating tables in logical standby database
Dear DBAs,
Is it possible to update non replicated tables in the logical standby database, but have the same schema name?
"Alter session disable guard" works only for the current session, in fact i want it for all connected users whithout stopping the standby apply ?hi,
Let's say in the primary database i have 10 tables, and using the RMAN i have created a Ph. standby database and then converted to a logical.
so now i have the same schema and the same tables in these servers.
the fact of using logical stdby is to be able to make DML transactions.
so the issue is that from the 10 tables i need 9 tables to be replicated and the last one will not be replicated, so the application connected to the log. stdby will use only this table to update the user record(login date, logout date...bla bla bla).
the problem is that when the user will connect to the database the application will insert a record like "insert into SCHEMANAME.tablename....."
the problem is that the schema name is added into the insert statement.
Thank you in advance -
Issue while Instantiating a table in logical standby
I am trying to instantiate the tables in my logical standby and i am getting this error
ORA-39006: internal error
ORA-06512: at "SYS.DBMS_LOGSTDBY", line 636
ORA-06512: at line 1
i used the below command to instantiate the table
EXECUTE DBMS_LOGSTDBY.INSTANTIATE_TABLE('FLXUSER','JOB_ACTION', 'NGMES_PROD')
i have also provide all the required privilege i.e LOGSTDBY_ADMINISTRATOR and DBA.still i am getting the error.
In alertlog i found the Import struck warning as the job is getting struck.
The value (30) of MAXTRANS parameter ignored.
kupprdp: master process DM00 started with pid=31, OS id=4648
to execute - SYS.KUPM$MCP.MAIN('SYS_IMPORT_TABLE_01', 'LH137', 'KUPC$C_1_20131218044529', 'KUPC$S_1_20131218044529', 0);
Wed Dec 18 04:47:54 2013
The value (30) of MAXTRANS parameter ignored.
kupprdp: master process DM00 started with pid=51, OS id=3076
to execute - SYS.KUPM$MCP.MAIN('SYS_IMPORT_TABLE_01', 'LH137', 'KUPC$C_1_20131218044754', 'KUPC$S_1_20131218044754', 0);
Wed Dec 18 04:49:41 2013
The value (30) of MAXTRANS parameter ignored.
kupprdp: master process DM00 started with pid=52, OS id=4128
to execute - SYS.KUPM$MCP.MAIN('SYS_IMPORT_TABLE_01', 'FLXUSER', 'KUPC$C_1_20131218044941', 'KUPC$S_1_20131218044941', 0);
which i think are just warning.
kindly help me outYes that could very well be the reason. You can try recompiling. If it does not fix, you can reload the whole datapump utility by using following metalink note:
How To Reload Datapump Utility EXPDP/IMPDP (Doc ID 430221.1) -
Logical standby issue after adding a new user at production db server
Hello Experts,
I am facing a issue related to logical standby db server where after adding a new user at production db server logical standby has stopped sql apply. Can anybody give some idea to find out the root cause and give some tips to resolve the issue.
tried below .....
SELECT EVENT_TIME, STATUS, EVENT FROM DBA_LOGSTDBY_EVENTS
ORDER BY EVENT_TIMESTAMP, COMMIT_SCN, CURRENT_SCN;
got error
ORA-16227: DDL skipped due to missing object
ORA-01403: no data found
ORA-00942: table or view does not exist
OS : RHEL 4 (IBM P5)
DB : Oracle 10g (10.2.0.1)
AchyotPlease let me know if can skip the DDL at which it is failing.
ALTER DATABASE STOP LOGICAL STANDBY APPLY;
Use EXECUTE DBMS_LOGSTDBY.SKIP
ALTER DATABASE START LOGICAL STANDBY APPLY;
Thanks,
Renu -
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 PatelHi 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 -
Resynchronization in logical standby db
hi,
i am new in oracle 10g logical standby database.
last night i have updated some new tables & views on primary database. but new tables & views are not showing at logical standby database for last 20 hours.
please tell how can i retrieve new tables on logical standby serverHi;
For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Database » Data Guard which you can get more quick response
Regard
Helios -
Skip the DELETE command on logical standby
Hi All,
I want to skip the DELETE command on logical standby.
DB Version - 10.2
OS - Linux
Primary DB and logical standby DB .
In our DB schema some transaction tables. We delete data from those tables by delete commands.
Delete command, also delete data from logical standby DB. But we want to skip on logical standby DB .
I use following for that and get error.
ALTER DATABASE STOP LOGICAL STANDBY APPLY;
EXECUTE DBMS_LOGSTDBY.SKIP (stmt =>'DELETE TABLE', schema_name =>'TEST',object_name =>'TRANS',proc_name => null);
ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
But I got error
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'SKIP'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
When I change stmt =>'DELETE TABLE' to stmt =>'DML', no error happen
Please help me to solve this issue . This is urgent.
Thanks in advance.
RegardsDear aditi2,
Actually it is so simple to understand the problem. Please read the following documentation and try to understand the SKIP procedure.
http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/d_lsbydb.htm#997290
*SKIP Procedure*
Use the SKIP procedure to define filters that prevent the application of SQL statements on the logical standby database.
By default, all SQL statements executed on a primary database are applied to a logical standby database.
If only a subset of activity on a primary database is of interest for application to the standby database,
you can use the SKIP procedure to define filters that prevent the application of SQL statements on the logical standby database.
While skipping (ignoring) SQL statements is the primary goal of filters,
it is also possible to associate a stored procedure with a DDL filter so that runtime determinations can be made whether to skip the statement,
execute this statement, or execute a replacement statement.
Syntax
DBMS_LOGSTDBY.SKIP (
stmt IN VARCHAR2,
schema_name IN VARCHAR2,
object_name IN VARCHAR2,
proc_name IN VARCHAR2,
use_like IN BOOLEAN,
esc IN CHAR1);Hope That Helps.
Ogan
Edited by: Ogan Ozdogan on 30.Tem.2010 13:03 -
[Logical Standby] Which table/SQL caused paging-out
We have a Primary-Logical DR configuration.
Recently, it has a problem with the logical: it's continuously paging out data from some transactions:
SELECT SUBSTR(name, 1, 40) AS NAME, SUBSTR(value,1,32) AS VALUE FROM GV$LOGSTDBY_STATS;
number of preparers 3
number of appliers 18
maximum SGA for LCR cache 4095
parallel servers in use 24
maximum events recorded 1000000
preserve commit order TRUE
transaction consistency FULL
record skip errors Y
record skip DDL Y
record applied DDL N
record unsupported operations Y
coordinator state IDLE
transactions ready 7
transactions applied 0
coordinator uptime 9646
realtime logmining Y
apply delay 0
Log Miner session ID 1
txns delivered to client 1068651
DML txns delivered 1017135
DDL txns delivered 15
CTAS txns delivered 0
Recursive txns delivered 51501
Rolled back txns seen 23463
LCRs delivered to client 11682189
bytes of redo processed 14475529508
bytes paged out 1482524624
seconds spent in pageout 8922
bytes checkpointed 0
seconds spent in checkpoint 0
bytes rolled back 7500032
seconds spent in rollback 90
seconds system is idle 0
SELECT SID, SERIAL#, SPID, TYPE, HIGH_SCN, STATUS_CODE, STATUS
FROM GV$LOGSTDBY_PROCESS
ORDER BY TYPE, SPID;
ANALYZER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
APPLIER 16116 ORA-16116: no work available
BUILDER 16243 ORA-16243: paging out 4752 bytes of memory to disk
COORDINATOR 16116 ORA-16116: no work available
PREPARER 16127 ORA-16127: stalled waiting for additional transactions to be applied
PREPARER 16127 ORA-16127: stalled waiting for additional transactions to be applied
PREPARER 16127 ORA-16127: stalled waiting for additional transactions to be applied
READER 16127 ORA-16127: stalled waiting for additional transactions to be applied
select xidusn, xidslt, xidsqn, count(*) from system.logmnr_spill$
group by xidusn, xidslt, xidsqn;
996 46 249 254
710 37 838 825
623 3 706 254
478 7 42564 254
765 38 649 824
42 6 415494 3729
264 35 4817 3738
How can we identify the table/SQL to skip & instantiate it later so the logical DB will not being lag far behind.
Thank you.Hi,
Best way to find SQL is to mine the current archive log getting applied on standby and check for the SQL, you might not get the exact SQL, but you will get the object which is getting updated.
Or
You can use AWR report from logical standby of this time to find the update statement which is resource extensive.
There is no way to find the exact SQL on primary which is causing the issue on standby.
Regards
Anudeep -
Data Guard Logical Standby Skip Handler bug
Does anyone know of a documented bug concerning the skip handler not skipping a grant on a view in a schema with a SCHEMA_DDL skip handler defined?
Here is my test case.
On Primary:
Create table scott.junk (x number) tablespace users; (created successfully on logical standby)
On logical standby:
exec dbms_logstdby.skip('SCHEMA_DDL','SCOTT','%'null,true,'\'); (created skip handler on all SCOTT objects)
On Primary:
grant select on scott.junk to public; (successfully skipped due to missing object)
On Primary:
create view scott.v_junk as select * from scott.junk; (successfully skipped on logical standby)
On Primary:
grant select on scott.v_junk to public; (received 'ora-00942 table or view does not exist' on logical standby and SQL Apply stopped).
I'm running version 10.2.0.4 but have not applied the recommended patch bundle for logcal standby #7937113.8.
If anyone knows whether this has been documented or not, please let me know. If not, I will submit an SR to get this documented.
Thanks,
Michael Anderson
OCP - Bank of the WestWhen I look at the syntax for the package
http://www.morganslibrary.org/reference/dbms_logstdby.html
what I see is:
dbms_logstdby.skip(
stmt IN VARCHAR2,
schema_name IN VARCHAR2 DEFAULT NULL,
object_name IN VARCHAR2 DEFAULT NULL,
proc_name IN VARCHAR2 DEFAULT NULL,
use_like IN BOOLEAN DEFAULT TRUE,
esc IN CHAR1 DEFAULT NULL);So looking at your code:
exec dbms_logstdby.skip('SCHEMA_DDL','SCOTT','%'null,true,'\'); (created skip handler on all SCOTT objects)
'SCHEMA_DDL' is your statement.
'SCOTT' is your schema name.
'%' indicates all objects
and ... shouldn't there be a comma before the NULL?
In the future don't provide values where the default's will suffice. It makes thing's far simpler. -
Manual update tables on 11g Logical Standby
Dear all,
I got one physical primary DB and one logical standby DB running 11.2.0.2 and SQL apply. Same configuration (32bit DB, same server spec) and same settings for both DB servers.
I don't know but for some reason, a table in the logical standby DB (which also exists in the primary DB) cannot be updated properly, a delete statement for a single row can end up generating ORA-4030 and there is no reason primary can complete the task but the logical cannot. Finally, I skipped the table in SQL apply.
As the table is a monthly statistics table computed from another daily statistics table, and it is so large that I dont want to re-instatiate the table via the network, nor re-program the queries.
Therefore I decide to trigger the computation on the logical side.
My question is, given that I skipped the table in SQL, will the manual update create trouble for the SQL apply process? I wonder how the redo procedure handles both tables under SQL apply and those under manual update.
BKNo!
One of the main benefits of a logical standby database would be the option of creating a local dataset.
See: ( Oracle® Data Guard Concepts and Administration 11g Release 2 (11.2) E10700-02 )
10.5 Customizing a Logical Standby Database
10.5.5 Adding or Re-Creating Tables On a Logical Standby Database
A materialized view may also be an option.
Best Regards
mseberg
Maybe you are looking for
-
I'm having an issue where the display fails after boot, and displays only a fixed noise pattern. The screen looks completely normal through POST, GRUB, and when initially loading the kernel, when the display is still in a text mode. After that, the s
-
BT broadband and lack of service
Hi have been having problems for about 5 weeks first three no internet over 1 meg all the time. After various phone calls to BT and line resets, tests etc managed to get OK speed through the day but still the same in evening and weekends, engineer ca
-
How to stop a process (that is executing)
Hi all my question is How to stop a process that is executing ? some other languages has a function called yield() in java how I can do it. thanks
-
Installing own kernel...
I have no problem git cloning my kernel of choice and configuring. My question is when compiling a new video drivers or any other package that might be dependent on Linux sources. I usually use the /usr/src directory. I am having trouble with the PKG
-
Please Help me! ThankYou and Happy New Year!