EMDATABASEControl emca drop and recreate in RAC
Any body know how to drop and recreate EMDATABASEControl (emca) drop and recreate for RAC DB?
use emca -help you can get the parameters used to de-configure and re-configure the emca for RAC
$emca -help
-deleteInst (db | asm) [-silent] [parameters]: de-configure EM for a specified RAC instance
-reconfig dbcontrol -cluster [-silent] [parameters]: reconfigures RAC Database Control deployment
Similar Messages
-
Emca drop and recreate for RAC DB.
metalink notes Note:315299.1 discuss the same problem
Now question is
1-What are the steps to Recreate the Database Control configuration files:
& what -x and -r flags are doing ? can i run simple emca and do the job? I am in RAC environment.
./bin/emca -x <sid>
./bin/emca -rYou can add the -cluster parameter.
Read more about it in the documentation -
What is the best way to drop and recreate a Primary Key in the Replication Table?
I have a requirement to drop and recreate a primary key in a table which is part of Transaction replication. What is the best way to fo it other than remove it from replication and add again?
Thanks
SwapnaHi Swapna,
Unfortunately you cannot drop columns used in a primary key from articles in transactional replication. This is covered in
Make Schema Changes on Publication Databases:
You cannot drop columns used in a primary key from articles in transactional publications, because they are used by replication.
You will need to drop the article from the publication, drop and recreate the primary key, and add the article back into the publication.
To avoid having to send a snapshot down to the subscriber(s), you could specify the option 'replication support only' for the subscription. This would require the primary key be modified at the subscriber as well prior to adding the article back in
and should be done during a maintenance window when no activity is occurring on the published tables.
I suggest testing this out in your test environment first, prior to deploying to production.
Brandon Williams (blog |
linkedin) -
Synonyms cant be recompiled when the tables are dropped and recreated?
hi
i have a synonym pointing to a table .
1)when i drop and recreate a table.............
isnt it enough to recompile the synonym? do i need to drop the synonym as well and recreate again?
2) when i add new columns to a table will the synonym also show up the new column?
thanks in advance
rajRecompiled is probably not quite the correct word. Re-validated is more like it.
Notice that the synonym goes invalid when the table is dropped, but does NOT become valid when the table is recreated.
That happens the first time it's used (similar to invalid stored procedures).
SQL> drop table t;
Table dropped.
SQL> select object_name, status
2 from user_objects
3 where object_name = 'T_SYN';
OBJECT_NAME STATUS
T_SYN INVALID
SQL> create table t(c number);
Table created.
SQL> select object_name, status
2 from user_objects
3 where object_name = 'T_SYN';
OBJECT_NAME STATUS
T_SYN INVALID
SQL> select * from t_syn;
no rows selected
SQL> select object_name, status
2 from user_objects
3 where object_name = 'T_SYN';
OBJECT_NAME STATUS
T_SYN VALID -
RE: Drop and recreate user
Hi,
If we drop and recreate the oracle user in production database, what advantages we will get?
Any one help me...
DB Version:10.2.04
OS: HP-UX
Thanks,
Srini ...935930 wrote:
Hi,
If we drop and recreate the oracle user in production database, what advantages we will get?
Any one help me...
DB Version:10.2.04
OS: HP-UX
Thanks,
Srini ...The "advantage" (or "disadvantage") would depend on what you are trying to accomplish, correct? -
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 youThanks 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] -
What happens if column from idex is dropped and recreated
I have question. I need to drop one column from a table. That column is part of unique index.
If i drop a column and recreate it would it drop index also. Do i need to re-create the index also.
ThanksIs it not possible for you run a quick test on a small table to find out?
-
DROP and RECREATE TEMP TABLESPACE
Hey,
is it ok just to drop the TEMP tablespace and recreate it?
Will data get lost? Will developers kill me if I do? ;o)
Can i reuse the datafile?
Is it possible to change name on the tablespace?
Thanks
KjerstiHey there is absolutely no problem. Only ensure that only system is logged on and no other user is using the database. Best thing is to shut down the database and restart in restricted session and then create the temp tablespace. give tempfile instead of datafile.
-
How to drop and recreate dbconsole in RAC?
Hi Guys,
I might not be in the right Forum area, so apologize for that. Here is my dilemma, I restored a database (10.2.0.3 on RHEL4AS) from standalone to 2-Node RAC Cluster (10.2.0.3 on RHEL4AS) and now need to recreate dbconsole. I see quite few articles on create dbconsole on a single standalone but having hard time finding how to recreate dbconsole in RAC. Any help will be a great help to me.
Thanks,
--MMYou can check this part of Oracle Doc, use EMCA to reconfigure.
Using EMCA with Real Application Clusters
http://download.oracle.com/docs/cd/B19306_01/em.102/b40002/structure.htm#sthref80 -
drop triggers---
CREATE PROC [dbo].[SP_DropTriggers]
AS
BEGIN
DECLARE @Table_Triggers SYSNAME, @trName sysname
DECLARE Cursor_Disabletriggers CURSOR FOR
SELECT object_name(parent_id) , name
FROM sys.triggers
OPEN Cursor_Disabletriggers
FETCH NEXT FROM Cursor_Disabletriggers
INTO @Table_Triggers ,@trname
DECLARE @SQL nvarchar(max)
WHILE @@FETCH_STATUS = 0
BEGIN
SET @SQL = 'drop trigger ' + 'dbo.'+@trname + ' on dbo.'+@Table_Triggers
select @sql
EXECUTE (@SQL)
FETCH NEXT FROM Cursor_Disabletriggers INTO @Table_Triggers ,@trname
END
CLOSE Cursor_Disabletriggers
DEALLOCATE Cursor_Disabletriggers
END
I would like to recreate them in separate proc, How can I achieve this?You need a permanent table to store the trigger code in:
create table
dbo.TriggerDefinitions
(TableName nvarchar(128) not null,
TriggerName nvarchar(128) not null,
TriggerDefinition nvarchar(max) not null,
constraint PK_TriggerDefinitions primary key (TableName, TriggerName))
go
In your procedure which drops the triggers you need to add code that stores the latest trigger definitions in the table above:
create procedure dbo.DropTriggers
as
begin
declare @TableName nvarchar(128),
@TriggerName nvarchar(128),
@TriggerDefinition nvarchar(max),
@DynamicSQL nvarchar(max)
declare TriggerCursor
cursor fast_forward for
select quotename(object_schema_name(po.object_id)) + '.' + quotename(po.name),
quotename(object_schema_name(co.object_id)) + '.' + quotename(co.name),
m.definition
from sys.sql_modules as m
join sys.objects as co
join sys.objects as po
on po.object_id = co.parent_object_id
on co.object_id = m.object_id
where co.type = 'tr'
open TriggerCursor
fetch next
from TriggerCursor
into @TableName,
@TriggerName,
@TriggerDefinition
while @@fetch_status = 0
begin
if exists(select top 1 1 from TriggerDefinitions where TableName = @TableName and TriggerDefinition = @TriggerDefinition)
update TriggerDefinitions
set TriggerDefinition = @TriggerDefinition
where TableName = @TableName
and TriggerName = @TriggerName
else
insert TriggerDefinitions
values (@TableName, @TriggerName, @TriggerDefinition)
if @@rowcount = 1
begin
set @DynamicSQL = 'drop trigger ' + @TriggerName + ' on ' + @TableName
print @DynamicSQL
--execute sp_executesql
-- @DynamicSQL
end
fetch next
from TriggerCursor
into @TableName,
@TriggerName,
@TriggerDefinition
end
close TriggerCursor
deallocate TriggerCursor
end
go
Finally the procedure which will re-create the triggers will simply query the table created and populated above and execute the code contained therein.
create procedure dbo.CreateTriggers
as
begin
declare @TableName nvarchar(128),
@TriggerName nvarchar(128),
@TriggerDefinition nvarchar(max),
@DynamicSQL nvarchar(max)
declare TriggerCursor
cursor fast_forward for
select *
from dbo.TriggerDefinitions
open TriggerCursor
fetch next
from TriggerCursor
into @TableName,
@TriggerName,
@TriggerDefinition
while @@fetch_status = 0
begin
set @DynamicSQL = @TriggerDefinition
print @DynamicSQL
--execute sp_executesql
-- @DynamicSQL
fetch next
from TriggerCursor
into @TableName,
@TriggerName,
@TriggerDefinition
end
close TriggerCursor
deallocate TriggerCursor
end
go
I've commented out the code which actually runs the dynamically created SQL. You'll have to uncomment those lines for the code I've posted will work. -
SSIS Package drops and recreates constraint
My SSIS package is apparently dropping a constraint and later recreating it. So I deleted the constraint. When I reran the package the constraint was back. Somewhere in the package in a location I can't see/don't know about is the information
on the constraint. The primary purpose of the package is a number of Data Flow Tasks.I just did a search and the drop is there. And so is the code to add the constraint.
Both are in elements of <DTS:LoggingOptions>
Is there anyway to get rid of it without an XML edit?
Strange. That node describes merely some logging options for the SSIS package (like which log provider is used).
Is logging enabled in the package and what is configured over there?
MCSE SQL Server 2012 - Please mark posts as answered where appropriate. -
Emca configuration/ How i can drop existing emca and recreate it?
emca configuration/ How i can drop existing emca and recreate it?
Hmmmm?
emca is the program used to create/drop/update the em configuration. Not sure why you want to drop emca.
If you want to drop and recreate the em configuration, have you tried "emca ?" or "emca help=y" -
Hi, sometimes I have problems initialing the OEM, after a lot of tries a solution that solve my problems is:
emca -deconfig dbcontrol db -repos drop
emca -config dbcontrol db -repos create
And it works... But whats real effect of this commands?
Which data I lost dropping/recreating the repository?
Thanks.
Paulo.In short you are not losing anything important just some repository metadata, you can find out the schema and data by checking SYSMAN user's objects because that's pretty much the user got dropped and recreated.
Most useful functions and charts of OEM are driven from AWR ASH data (DBA_HIST tables) -
Rebuild Index VS Drop and Rebuild?
Hey all,
I am currently redesigning a weekly process (weekly coz we pre determined the rate of index fragmentation) for specific indexes that get massive updates. The old process has proved to be able to fix and maintain reports performance.
In this process we rebuild specific indexes using the below command:
Alter index index_name rebuild online;
This command takes around 10 min for selected indexes.
Testing the below took 2 min for 6 or 7 indexes.
Drop Index Index_Name;
Create Index Index_Name on Table_name (Col1, col, ..);
I know that indexes might not be used, and the application performance would be degraded with stale or non-existent stats. But our production and all our test DBs have procedures that daily gather stats on them.
I tested the below script to make sure that execution plan does not change:
SELECT ProductID, ProductName, MfrID FROM PRODUCT WHERE MFRID = 'Mfr1';
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
| 0 | SELECT STATEMENT | | 37 | 3737 | 13 (0)|
| 1 | TABLE ACCESS BY INDEX ROWID| PRODUCT | 37 | 3737 | 13 (0)|
| 2 | INDEX RANGE SCAN | PRODUCT_X1 | 37 | | 3 (0)|
dropping PRODUCT_X1 and recreating it only changed the cost to 12.
Gathering the stats again took the cost to 14.
No performance issues were faced and index was still used.
My question is: Is there any oracle recommendation that requires rebuilding the index instead of dropping and recreating it?
Is there any side effect to my approach that I did not consider?
Thank youCharlov wrote:
I am currently redesigning a weekly process (weekly coz we pre determined the rate of index fragmentation)Nice. Not only have you defined and located index fragmentation but have also measured the rate at which it occurs.
Could you please share your definition of index fragmentation, how you detect it, and how you measure the rate of change of this fragmentation.
I am curious about all this since it can be repeatedly shown that Oracle btree indexes are never fragmented.
http://richardfoote.files.wordpress.com/2007/12/index-internals-rebuilding-the-truth-ii.pdf
The old process has proved to be able to fix and maintain reports performance.Great so you have traces and run time statistics from before and after the rebuild that highlight this mysterious fragmentation and show how the fragmentation caused the report to be slow, details what effects the rebuild had that caused the reports to perform better.
Please share them as these would be an interesting discussion point since no one has been able to show previously how an index rebuild caused a report to run faster or even show the fragmentation that caused it to be slow in the first place.
I mean it would be a pity if the report was just slow because of an inefficient plan and compressing an index or two that probably shouldn't be used in teh first place appears to temporarily speed it up. Could you imagine rebuilding indexes every week, because some developer put the wrong hint in a query? That would be pretty funny. -
How to drop and import the tables
i got some tables that need to be dropped and recreated.It has got a PK with on delete cascade constraint.I need to drop and import those tables.How can i ddo this.
Can i diable the constraints on these tables and import?Well, in that case I would not drop the user! Another thing to consider would be an import into temp/staging tables and then merging into the target tables. You would need to order so that RI constraints would not fire. The nice thing about this is that you could still use the tables as you were loading.
Maybe you are looking for
-
Will ipod touch settings copy to a new iphone with cloud / same apple id?
My daughter has an ipod touch 4th generation. I had set the restrictions on her touch, but have since forgotten the password. We are giving her an iphone 5c for the holidays and I'm wondering if she uses the same itunes/apple account for her phone as
-
Sleep button on itouch is not working now that i have updated to 3.1.2
well i had the last update 3.1.1 and everything was working fine and now i have updated to 3.1.2 and my sleep button on the top of my Itouch 1st Gen is not working i hold it down...Nothing, tap it... Nothing. It has just stoped working. It worked rig
-
Condition Type Doesn't Appear in COMMPR01
Hello CRM Pricing Experts, I have created a custom pricing procedure called Z00001. This pricing procedure has a custom condition type called ZPR0. This in turn is based on a custom access type ZPR0 (Access=5, Table=SAP00080,E=checked, requirement=
-
hi all, while intalling ECC 5.0 i got below error an error occured during the installation of component sap ERP 2004>sap ECC 5.0 abap system>unicode>install a database instance.press the log view button to get extended error information or press ok t
-
I have a PowerBook G4 and I want to access it from my new MacBook Pro. How do I go about doing that?