system.mutations is not responding after I ran an ALTER sql on a table A. Table A is also stuck. I just want to drop Table A - clickhouse

I ran an ALTER sql on Table A. Then table A is stuck, system.mutations is not responding. I also wait 3 hours. I tried below actions,
restart Clickhouse service, reboot this Clickhouse server machine. reboot my client computer.
checked log, and found this, "Current max source part size for mutation is 0 but part size 1513. Will not mutate part all_24_24_0. "
The sql I used is like "alter table A update columnA=columnA/(select sum()....) where ...."
No other data is inserting. No recoreds in system.merges or system.replication_queue.
Table A has around 1000 records
I just want to drop this table A, then I can recreate it with the history records, but table A is not responding. Also system.mutations.

Related

Would a Temporary table be dropped automatically in Oracle?

Forgive me to ask a silly question.
Would a temporary table be dropped automatically in Oracle (12c)?
Yesterday I have executed the following DDL to create a temporary table:
Create global temporary table my_1st_t_table on commit preserve rows as
select
*
from
other_table
where
selected_col = 'T';
After that I have executed following statements:
commit;
select count(*) from my_1st_t_table;
Yesterday, the last select statement returned 2000 rows.
After that I disconnected my VPN and also switched off my client laptop.
Today I rerun the last select statement after restarted my computer and reconnected to the VPN.
It returned 0 rows. So this means the table was still there but just all rows being deleted after my session.
However, may I ask when will my temporary table be dropped?
Thanks in advance!
A temporary table in Oracle is much different than a temp table in other database platforms such as MS SQL Server, and the "temporary" nomenclature invariably leads to confusion.
In Oracle, a temporary table just like other tables, and does not get "dropped". However, the rows in the table only exist within the context of the session that inserted the rows. Once the session is terminated, assuming the session did not delete the rows, Oracle will delete the rows in the table for that session.
So bottom line, the data is temporary, the table structure is permanent, until the table is dropped.

Is there any time limit on the records in table user_tab_modifications table?

I'm using user_tab_modifications table to monitor all my table's change in DB, but sometimes the records disappeared.
For example, I updated the data in table A, and ran the following SQL to flush the table user_tab_modifications so that I can see the latest information there.
exec DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO;
Then
SELECT * FROM USER_TAB_MODIFICATIONS;
So I can see the record about table A in there.
But then I found the record about table A disappeared after about 1 minute even though I didn't do anything in Oracle.
(other records in user_tab_modifications do not change. No problems)
That's why and can I do some settings to change it (make sure the records there will not disappear)? Thank you.
From the documentation:
USER_TAB_MODIFICATIONS describes modifications to all tables owned by the current user that have been modified since the last time statistics were gathered on the tables.
You might want to check if some stat gathering process was running in the background on the concerned table between the time when the changes were done and when you saw the stat record disappear.

Cannot select Oracle table from other Server with schema name prefix

Few days ago there was network problems. Also one of the database harddisk partition storage ran out of space but it has been fixed now.
Additional note: one of the DBA compressed the archive log to spare some space during the problem happened.
One of the outcome was that now I CANNOT select one table from other Oracle database on the other server if using schema name prefix.
For example if I run query from one of the schema/user in database1 from Toad or sqlplus:
select * from office.room#database2
The query runs forever and never stops.
Usually it's not a problem. The other tables are fine; I can select them using office.*#database2 query.
The other odd thing is that if I use SYNONYM, I CAN select that table. Let's say that table has synonym 'room' on db2 database, this query is OK:
select * from room#database2
The table itself on database2 is OK, meaning that if I login to schema "office" on database database2, I can select the table data.
I still can not find out what causes this problem.
New founding, I can select the table with no hang up if I add WHERE filter or I select the columns, for example :
select * from office.room#database2 where roomnumber='A';
or
select roomname, rumnumber from office.room#database2;
But the select * from office.room#database2 still hang up.

What happened to my table in my oracle database?

I have a situation where yesterday my code was working ok, but today I find that my code fails because a SQL query fails on my Oracle database. The query fails because the table used in the query does not exists. I am no Oracle expert so I am reaching out to you Oracle experts out there. Is there a way to see in a log file or log table when my table disappeared and who dropped my table?
Thanks
Depending on previous configuration one would hope that a production database would have auditing turned on. Try
select * from sys.AUD$
The audit table can log almost every user action including dropping tables or revoking grants but has to be configured.
Assuming you have the recyclebin turned on in your database, you might be able to restore the dropped table. As the user who owns the table, you can run this query:
select * from USER_RECYCLEBIN
or if you have SYS access you can check the query:
SELECT * from DBA_RECYCLEBIN;
Then as a user owns the table, run this FLASHBACK command to restore it:
FLASHBACK TABLE <your table name> TO BEFORE DROP;
If you get ORA-38305 you might have a tablespace issue - either run it as a different user or make sure it using a locally managed tablespace.

Oracle IN Condition very slow

I am trying to execute the following statement on a table containing 10,000 rows but the query is executing forever.
delete from Table_A where col1 in ('A','B','C') and col2 in ('K','L','M') and col3 in ('H','R',D')
Please can anyone assist!
Thanks
A
It looks as if another session has locked one of the rows you'd like to delete.
Is somebody else working on the same table (with transactions that last more than a few seconds)? Or do you have another tool or session open where you haven't committed your changes?
Update:
Another problem are foreign keys that aren't properly index: If other tables have a foreign key to the table where you want to delete the rows, and if the foreign key column in those tables isn't indexed, then Oracle will try to lock those tables. This could be the cause. If this is the case, index those columns.
Another possible reason for a database to hang is if the archive log destination is full.
Query the V$SESSION_WAIT and V$SESSION_EVENT views to see what your session is waiting for.

Resources