Is drop user cascade DDL statement will be reflected in physical standby DB
Hi,
Oracle 10G
Physical standby database
When issuing drop user cascade in Primary DB , Will the same be reflected in physical standby ? or there is any exceptions of applying DDLs and DMLs ?
Thank you in advance,
Mohamed
Will the same be reflected in physical standby ?
Yes.
or there is any exceptions of applying DDLs and DML
No, not in a physical standby.
You do some exceptions in a logical standby.
Best Regards
mseberg
Similar Messages
-
Hi masters
I cannot drop a user cascade, i'll get that error
drop user HOMER cascade
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-24005: must use DBMS_AQADM.DROP_QUEUE_TABLE to drop queue tables
I'''ve triied the work around given in metalink but i do not have
select owner, QUEUE_TABLE from dba_queue_tables for my HOMER user is empty.
What shall i do now?ajallen wrote:
Try note 236898.1. It is for 8 and 9 but may work for you. The symptoms seem similar.
Or note 203225.1.
I had the same problem (oracle 9.2.0.5 on Windows 2003).
The table was visible in TOAD under the tables tab.
SQL> EXECUTE DBMS_AQADM.DROP_QUEUE_TABLE( queue_table => 'SYSADM.DOCDISTR_QTABLE
', FORCE => TRUE);
BEGIN DBMS_AQADM.DROP_QUEUE_TABLE( queue_table => 'SYSADM.DOCDISTR_QTABLE', FORC
E => TRUE); END;
ERROR at line 1:
ORA-24002: QUEUE_TABLE SYSADM.DOCDISTR_QTABLE does not exist
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 2973
ORA-06512: at "SYS.DBMS_AQADM", line 197
ORA-06512: at line 1
SQL> select owner, queue_table from dba_queue_tables;
OWNER QUEUE_TABLE
SYS AQ_EVENT_TABLE
SYS AQ_SRVNTFN_TABLE
SYSTEM DEF$_AQCALL
SYSTEM DEF$_AQERROR
SQL> select object_name, object_type from user_objects where object_name like 'D
OCDI%';
OBJECT_NAME OBJECT_TYPE
DOCDISTR_QTABLE TABLE
I used note 236898.1 to drop this queue table. (read the statements carefully because the names of the functions can be confused with each other: corr_aq_92.drop_corrupted_ qt 92(..) and corr_aq_92.drop_corrupted_ q 92(..)
For me, this is the solution. -
Why dropping user cascade take's more time
DROP USER EIND CASCADE;
When i tried the above query it's taking more than 1 day to drop the user.
As i check user is not locked and servers are running fine.
mostly i use to do restart the Oracle Services.
Kindly, Let me know. With out restarting the Oracle Services.How to solve the problem?leen wrote:
DROP USER EIND CASCADE;
When i tried the above query it's taking more than 1 day to drop the user.
As i check user is not locked and servers are running fine.
mostly i use to do restart the Oracle Services.
Kindly, Let me know. With out restarting the Oracle Services.How to solve the problem?enable the tracing before drop cmd and look at tracefile detail to findout where its spending time.
ALTER SESSION SET EVENTS '10046 trace name context forever, level 8';
DROP USER EIND CASCADE
ALTER SESSION SET EVENTS '10046 trace name context off'; -
Drop user cascade, does it remove jobs owned by dropped user as well?
I am attempting to remove WKSYS, someone used DBCA to create the database.
I cannot remove 2 jobs that WKSYS own, if I drop cascade WKSYS will it remove the jobs as well?s
-
Recover after DROP USER CASCADE
In our setup, we have one user as the owner of all the objects pertaining to the application database. I was just curious that, if this owner is DROPped, how do I recover all his objects, or what are medium/modes of recovery in this case.
regards,
LuckysIts very well possible as long as you valid backups and required archived logs.
This tells how important is the backup and recovery policies. One need to be carefully think of all the situation before developing any backup and recovery policies.
The finaly result from the policies is simply, minimize the recovery time and bring the database backup in acceptable time.
Jaffar -
URGENT How to recover from a drop user comand
Hi.
My database is 9i release 2. Archive is not enable. Backup: cold backup (physical and exp)
A drop user cascade command was accidentally issued.
Given the circuntances, what options do i have
- Will flashblack help
- Can i use logminer
Thanks ind advance ...!
PD. URGENT PLEASE ....!Whoever decided to run in noarchive log mode should explain that the the data is lost, but that it doesn't matter. Firm but fair.
I had to do this once. I inherited a database and only discovered that didn't have archivelogmode switched on when it crashed (it was my first DBA gig). Since then it's the first thing I check before I do anything in a production environment.
Cheers, APC -
DDL Preview doesn't work correctly - User defined DDL (2.0.0 Build 584)
After changing "User defined DDL" statement in view definitions, i imported schema metadata (File>Import>Data dictionary) and compared my datamodel with my current database schema. The changes were detected correctly and alter DDL statements for tables generated correctly also.
When i viewed the "compare models" dialog it all seemed to be all right and the modified User DDL statement for the view was marked. But when i generated DDL script, only the old DDL for this view was generated.
Even when i try to generate DDL via "DDL Preview" on object directly, the new DDL is ignored.
I couldn't find forum entries, but maybe some of you have experience about this issue or known bugs.
Edited by: Stephan Tomczik on 31.01.2011 02:26Hi,
I'm not sure if you're aware, but there is a 3.0 beta version of Data Modeler.
You can download it freely from here :
http://www.oracle.com/technetwork/developer-tools/datamodeler/overview/index.html
There are many bugs fixed there. -
Drop user taking so much time.
Hi Guys,
I have a schema containing around 1600 objects. Export dump size for the same is aroung 8 or 9MB.
When I try to drop that user, it takes atleast 5 minutes.
Details are:
Windows 2008
Oracle 11gR2
Can anybody help??Hi;
Please check below note and link:
Drop User Cascade Very Slow In 10.2.0.4 [ID 798586.1]
Also see:
Drop user take too much time
Drop user take too much time
http://www.dbasupport.com/forums/archive/index.php/t-36615.html
Regard
Helios -
Cascading Select Statements - problem with blank drop-downs
Hello,
I have posted a number of questions about Cascading Select Statements in APEX and though I've received some good information, I still get a blank drop-down when I select the first LOV.
I also found "How to test an On-Demand Process used for AJAX" on the web. Here is the link to the web page:
http://www.inside-oracle-apex.com/2006/12/how-to-test-on-demand-process.html
When I try to test the ON-DEMAND Application Process in the Address Bar of my browser by typing the following, I get an error:
http://beta.biztech.net:2020/pls/apex/f?p=4000:0:211233229176642:APPLICATION_PROCESS=CASCADING_SELECT_LIST:::P6_PROJECT_ID:CASCADING_SELECTLIST_ITEM_1
The error I get is:
Unexpected error, unable to find item name at application or page level.
ERR-1002 Unable to find item ID for item "P6_PROJECT_ID" in application "4000".
As perhaps a last ditch effort, I will post all the steps, all the code and a link to my application.
Here is a link you can visit to view my application:
http://beta.biztech.net:2020/pls/apex/f?p=112:1
You can log in with the following ID and Password
ID: tsimkiss
PW: TS92
Here are the steps that I have followed and the code that I have used.
++++++++++++++++++++++++++++++++++++++++++++++++++
1. Create an application process in Shared Components
- On Demand CASCADING_SELECT_LIST - like this:
Process Point: On Demand
Name: CASCADING_SELECT_LIST
TYPE: PL/SQL Anonymous Block
BEGIN
OWA_UTIL.mime_header ('text/xml', FALSE);
HTP.p ('Cache-Control: no-cache');
HTP.p ('Pragma: no-cache');
OWA_UTIL.http_header_close;
HTP.prn ('<select>');
HTP.prn ('<option value="' || 1 || '">' || '- select tasks -' || '</option>');
FOR c IN (SELECT newops.task_name AS task_name,
newops.task_id AS task_id
FROM NEW_OPPORTUNITIES newops
UNION
SELECT DISTINCT pt.task_name AS task_name,
pt.task_id AS task_id
FROM pa_tasks@bizdev pt,
pa.pa_projects_all@bizdev prj
WHERE prj.project_id = pt.project_id
AND prj.project_id =
CASE
WHEN TO_NUMBER(:cascading_selectlist_item_1)=1
THEN prj.project_id
ELSE TO_NUMBER(:cascading_selectlist_item_1)
END)
LOOP
HTP.prn ('<option value="' || c.task_id || '">' || c.task_name || '</option>');
END LOOP;
HTP.prn ('</select>');
END;
2. Create an application item in Shared Components:
Name: CASCADING_SELECTLIST_ITEM_1
3. Create an LOV in Shared Components
- This is the Primary LOV (name it similar to it's select list page item):
List of Values Name: PROJECT_ID
Source: Lists of Values Query
SELECT newops.CLIENT AS project_name, newops.PROJECT_ID AS project_id FROM NEW_OPPORTUNITIES newops
UNION
SELECT ppa.NAME AS project_name, ppa.PROJECT_ID AS project_id FROM pa.pa_projects_all@bizdev ppa
WHERE ppa.project_status_code='APPROVED'
AND (ppa.COMPLETION_DATE IS NULL or ppa.completion_date > sysdate)
AND (ppa.CLOSED_DATE IS NULL or ppa.closed_date > sysdate)
ORDER BY project_name asc
4. Create a javascript and put it in the header of the page where cascading drop-downs are:
<script>
function get_select_list_xml(pThis,pSelect){
var l_Return = null;
var l_Select = html_GetElement(pSelect);
var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
'APPLICATION_PROCESS=CASCADING_SELECT_LIST',0);
get.add('CASCADING_SELECTLIST_ITEM_1',pThis.value);
gReturn = get.get('XML');
if(gReturn && l_Select){
var l_Count = gReturn.getElementsByTagName("option").length;
l_Select.length = 0;
for(var i=0;i<l_Count;i++){
var l_Opt_Xml = gReturn.getElementsByTagName("option");
appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
l_Opt_Xml.firstChild.nodeValue)
get = null;
function appendToSelect(pSelect, pValue, pContent) {
var l_Opt = document.createElement("option");
l_Opt.value = pValue;
if(document.all){
pSelect.options.add(l_Opt);
l_Opt.innerText = pContent;
}else{
l_Opt.appendChild(document.createTextNode(pContent));
pSelect.appendChild(l_Opt);
</script>
5. Create two Select List page items:
P6_PROJECT_ID <-- This is the primary drop-down
P6_TASK_ID <-- This is the secondary drop-down
6. In your primary select list, put the following into HTML Form Element Attributes:
HTML Form Element Attributes: onchange="get_select_list_xml(this,'P6_TASK_ID')"
Other settings on the page:
Name: P6_PROJECT_ID
Display As: Select List
Source Used: Always, replacing any existing values in session state
Source Type: Database Column
Source value or expression: PROJECT_ID
Named LOV: PROJECT_ID <--- Choose from drop-down (this is the Application LOV created earlier)
Null display values: - select project -
Display Null: Yes
7. The second select list is based on an LOV and depends on the value of the first select list:
Name: P6_TASK_ID
Display As: Select List
Source Used: Always, replacing any existing values in session state
Source Type: Database Column
Source value or expression: TASK_ID
Null display values: - select project -
Display Null: Yes
List of values definition:
SELECT newops.task_name AS task_name,
newops.task_id AS task_id
FROM NEW_OPPORTUNITIES newops
UNION
SELECT DISTINCT pt.task_name AS task_name,
pt.task_id AS task_id
FROM pa_tasks@bizdev pt,
pa.pa_projects_all@bizdev prj
WHERE prj.project_id=pt.project_id
AND prj.project_id=:P6_PROJECT_ID
ORDER BY task_name asc
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
If you need an actual running copy of my application, I'm not sure I can upload to the Oracle APEX website since uses datalinks to some tables. If necessary, I will give you my login into if you email me directly, however.
If someone could just straighten my code out especially on the ON-DEMAND Application Process, I think that would really help me out.
Hope someone out there can help me.
Thanks
LEHSorry, looking at your code that testing URL is still incorrect. You should be passing name / value pairs in the last arguments, and your passing P6_PROJECT_ID as the name part and CASCADING_SELECTLIST_1 as the value part. In your application process you are using CASCADING_SELECTLIST_1 as the parent ID for the P6_TASK_ID dropdown, so it is this name / value pair that you'll need to test. So your URL should look something like this...
http://beta.biztech.net:2020/pls/apex/f?p=112:0:211233229176642:APPLICATION_PROCESS=CASCADING_SELECT_LIST:::CASCADING_SELECTLIST_ITEM_1:[some project id]
(Note: Where [some project id] should be an ID for a project in your database, that has tasks.)
And I'm with Dan here, I still can't access that link you provided. apex.oracle.com should be your next move if you can't resolve it, as you've got at least two people willing to go and have a look at your code.
Hope it helps,
Anthony. -
How to know which user has executed which ddl statement
Hi All,
Last week i faced some problem, like some one has truncated the table , so luckily i have the schema backup so i restored it till the last backup taken.
but i want to know who has executed this ddl statement.
i know there are some utilities are avaible with oracle, so please describe me the easiest and quickest way to get this.
Regards
AsifIn order of descending simplicity
- Use the principle of least privilege to restrict the privileges users have in the database to ensure that they cannot do things like truncating a table
- Enable auditing of potentially problematic statements. This has to be done before the damage is done, though
- Create a DDL trigger that logs when users issue DDL. This also must be done before the damage is done.
- Use LogMiner to go through the archived log files that were generated at the time the table was truncated. This assumes that the database is in ARCHIVELOG mode and that you have the archived logs from last week. Using LogMiner to track down the culprit is also likely to be relatively time-intensive
Justin -
Why Oracle does not allow rollback of DDL statements?
I have always been surprised why Oracle does a implicit commit when DDL statements (e.g create table …) are executed. DDL statements simply write information (insert, delete and update) to data dictionary, so why DDL statement cannot be rolled back. Am I missing some thing?
I was learning SQL Server few months ago and I noticed that SQL Server does allow rollback of DDL statements if I am not mistaken. It lloks like there is something in Oracle architecture which prevents rollback of DDL satements. Rollback of all staements should be allowed not just of DML statements.
Appercaite your insight.If you drop a 500 million row table (and let's assume you're not using the Recycle Bin, which is a different matter entirely), how do you propose to re-insert all 500 million rows if you were to be allowed to rollback the drop command? Same thing goes for a truncate command.
I'm not saying there aren't workarounds (the Recycle Bin is precisely one of those), but it's certainly problematic. You could very well reverse the transaction ('delete from TAB$...') quite easily... but reversing the other consequences of that transaction is a lot more awkward. Therefore, it is certainly logical to declare such transactions irreversible and thus to imply a commit, both before and after.
Or take it from another philosophical angle: a transaction that doesn't commit (or rollback) takes exclusive row-level locks that are held indefinitely and which will prevent other people from doing DML on the same rows, yes? Well, how do you fancy having an 'alter table' statement sitting around, uncommitted, in the data dictionary? Some process (or your users) are wanting to insert rows into this table, but the uncommitted alter command means that they can't acquire the shared table lock they need in order to be able to do so. One uncommitted DDL can seriously gum up the works, in short.
Dictionary tables are not like ordinary user tables, because whilst what I do in INVOICES very likely has no impact on what you do in SALARIES, what I propose to do in TAB$ very definitely impacts what you might need to do in TAB$. Under those circumstances, it's a jolly good thing that Data Dictionary DDL doesn't leave a trail of uncommitted transactions hanging around! And the mechanism to achieve that 'good thing' (i.e., auto-committing) means such transactions must be immediately irreversible.
Fair enough if other databases have chosen to handle things differently: their prerogative, of course. My point is simply that there is logic in NOT being able to roll back DDL statements, too, and it's a legitimate choice to have made to handle things in this way, too. -
Drop user command hangs on 10.2.0.1
Hi,
db version: 10.2.0.1 64 bit
os : sun 5.9
I created a sample user
$. sqlplus / as sysdba
sql> create user 'test' identified by test default tablespace tools;
granted connect and resource to the user
sql> created sample table and inserted few values in the table.
now when i try to drop the user the session hangs for ever.
sql> drop user test cascade;
is this a bug? or am I missing something?
ThanksGet SYSTEMSTATE and HANGANALYZE Dumps
This creates a large trace file in the user_dump_dest (30M or more is not unusual).
Note: the init<sid>.ora parameter MAX_DUMP_FILE_SIZE controls the maximum trace file size. Using Oradebug and setting unlimit will allow a complete dump which we will need.
Do this step for sure if the entire database is frozen or nearly frozen and if this condition came on suddenly and there are no archive errors in the alert log. Please note: As systemstate dumps are instance specific, they tend to be inconclusive with hanging problems involving Oracle Parallel Server (OPS) unless you get them from each node. You will need 3 system state dumps from each node for OPS.
NOTE: Do systemstate dump 3 times in a row, so we can determine whether
the processes are hung or active.
For Oracle 9.2.0.1 or higher
$ sqlplus /nolog
connect / as sysdba
oradebug setmypid
oradebug unlimit
oradebug hanganalyze 3
wait 90 seconds
oradebug hanganalyze 3
oradebug dump systemstate 10
wait 90 seconds
oradebug dump systemstate 10
wait 90 seconds
oradebug dump systemstate 10
metalink doc Subject: Diagnosing Database Hanging Issues
Doc ID: Note:61552.1 -
DDL statements and dynamic sql in stored procedure
I created a stored procedure to create and drop tables, using dynamic sql.
When I try to do the inserts using dynamic sql, i.e
v_string := 'INSERT statement';
EXECUTE IMMEDIATE v_string;
I get the following error message:
ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at line 63
Line 63 happens to be the line that the EXECUTE IMMEDIATE v_string; statement is in.
I am able to describe the table that the inserts are being made into, so I know that the table exists.
Any idea why I'm getting this error message would be appreciated.Yes I do and I have been able to create other tables using dynamic sql.
The table that I am having problems with SELECTs data from another table to get its column values; within the SELECT statement, the CAST function is used:
ie. CAST(CASE SUBSTR(CAST(E_MOD AS VARCHAR(7)),2,3)
WHEN 'AAA' THEN 'A55'
ELSE ............
I get the following error message:
ERROR at line 18: (this line starts the CAST statement)
ORA-06550: line 18, column 13:
PLS-00103: Encountered the symbol "AAA" when expecting one of the following:
. ( * @ % & = - + ; < / > at in is mod not rem return
returning <an exponent (**)> <> or != or ~= >= <= <> and or
like between into using || bulk
When I remove the quotes or add another single quote, the same error cascades to 'A55'.
After doing the same for the next error, I get the error message below:
ERROR at line 1: (this line has the EXECUTE IMMEDIATE statement)
ORA-00936: missing expression
ORA-06512: at line 6
Any idea what the problem could be?
Also is there another way to have DDL statements as stored procedures other than using dynamic sql or the DBMS_SQL package? -
CAN WE RECOVER A DDL STATEMENT OR DATA
HI,
CAN ANYBODY TELL ME HOW TO RECOVER A DDL STATEMENT OR DROPPED TABLE OR COMMITTED DATA....
I HAVE TRIED A LOT BUT I COULDN'T ABLE TO RECOVER THE DATA . IWAS USING INCOMPLETE MEDIA RECOVERY.EVEN THE STATEMNET WAS SUCCESSFUL BUT WHEN ICHECK OUT WHETHER I RECOVERED OR NOT THE ANSWER IS NOT.EVEN THOUGH I HAVE THE LATEST ATCHIVED LOGS.
PLS HELP ME....how you are perofrming incomplete recovery paste the workaround like here to proof you are not getting revert back table like that.
RMAN> backup database
2> ;
SQL> conn scott/tiger
Connected.
SQL> create table x as select * from all_objects
2 /
Table created.
SQL> conn sys/sys as sysdba
Connected.
SQL> alter system switch logfile
2 /
System altered.
SQL> conn scott/tiger
Connected.
SQL> select to_char(sysdate,'DD-MM-YYYY HH24:MI:SS')
2 from dual
3 /
TO_CHAR(SYSDATE,'DD
12-05-2008 17:23:59
SQL> drop table x
2 /
Table dropped.
RMAN> run
2> {
3> shutdown immediate;
4> startup mount;
5> set until time "to_date('12-05-2008 17:23:59','DD-MM-YYYY HH24:MI:SS')";
6> restore database;
7> recover database;
8> }
RMAN> alter database open resetlogs
2> ;
database opened
SQL> show user
USER is "SCOTT"
SQL> desc x
Name Null? Type
OWNER VARCHAR2(30)
OBJECT_NAME VARCHAR2(30)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NUMBER
DATA_OBJECT_ID NUMBER
OBJECT_TYPE VARCHAR2(19)
CREATED DATE
LAST_DDL_TIME DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)
SQL> Khurram -
Hey to all
I want to drop USER tablespace wid data file but as we know many oracle users Scott OE data reside in users. How can I protect their data. One method which I read on net to export and import once again is quite cumbersome I run this query
SELECT
owner
, segment_name
, segment_type
FROM
dba_segments
WHERE
tablespace_name='USERS'
it give me two user OE and SCOTT. How can I protect their data before drop the user tablespaceHi..
As you said direct load takes place, then the rows which are inserted are always inserted above the HWM.So the datafile size size kept on increasing.
i read about segment advisor i run the advisor it shrink the segment but users tablespace size on OS still 200 GB could anyone tell why??You would have run alter table <table_name> shrink space; -- This statement will procede in two steps:
- The first step makes the segment compact by moving rows further down to free blocks at the beginning of the segment.
- The second step adjusts the high watermark. For this Oracle needs an exclusive table lock,but for a very short moment only.
The HWM goes below, and table are now more well organized.This command doesn't resize the datafile at the OS level.So, the datafile sizes will remain the same.One thing which you can do is resize(decrease) the datafile.
MINIMUM DATAFILE SIZE
COLUMN block_size NEW_VALUE v_block_size
SELECT TO_NUMBER(value) AS block_size
FROM v$parameter
WHERE name = 'db_block_size';
COLUMN tablespace_name FORMAT A20
COLUMN file_name FORMAT A50
COLUMN current_bytes FORMAT 999999999999999
COLUMN shrink_by_bytes FORMAT 999999999999999
COLUMN resize_to_bytes FORMAT 999999999999999
SET VERIFY OFF
SET LINESIZE 200
SELECT a.tablespace_name,
a.file_name,
a.bytes/1024/1024 AS current_MB,
(a.bytes - b.resize_to)/1024/1024 AS shrink_by_MB,
b.resize_to/1024/1024 AS resize_to_MB
FROM dba_data_files a,
(SELECT file_id, MAX((block_id+blocks-1)*&v_block_size) AS resize_to
FROM dba_extents
GROUP by file_id) b
WHERE a.file_id = b.file_id
ORDER BY a.tablespace_name, a.file_name;Edited by: Anand... on Feb 17, 2009 12:01 PM
Maybe you are looking for
-
MB_CUR_MAX Settings in Solaris 10
Hi All - MB_CURR_MAX sets to 3 in my Solaris 10 though it is not a multi-byte machine. The Locale settings are set to en_GB.ISO8859-1. I do not know if this setting will cause some system calls, functions to behave differently. How is this set? I che
-
Why is data plan required?
I am looking at upgrading to an iphone but i cant get rid of the $30/mo data plan that i dont need. is this required? if so for how many months? thanks.
-
What does varying battery led lights indicate ??
I own a hp probook 4530s.The battery led just above the plug in in the laptopp sometimes lights up in orange colour and sometimes its white in colour ?? is this a hardware fault or does it symbolically explains something??
-
Understanding targetNamespace attribute of the service ant tag
I am using the servicegen and clientgen ant tasks provided by bea to generate the webservices rpc code for a bean client. Nested in the servicegen task, in the service tag is a targetNamespace attribute that is required http://e-docs.bea.com/wls/docs
-
HP Deskjet Ink Advantage 3515-Macbook and iPad couldn't detect my printer for AirPrint
Hello, my problem is my Macbook and my iPad couldn't suddenly detect/find my hp3515 for airprinting. I had to resort to connecting the cable to my macbook in order to print. Would appreciate any help, Thanks!