win7 装ORACLE 10g,其他包括em正常,但是PQ/SQL ORA-12154: TNS: 无法解析指定的连接标识
经本人测试win8 64位加上ORACLE11g 64位 数据库端加上ORACLE 11g 32位客户端 ,然后PQ/SQL选择本地客户端32位作为HOME
WIN7 64位 加上ORACLE10g 32位数据库端,然后PQ SQL直接连接,出现 ORA-12154: TNS: 无法解析指定的连接标识 百思不得其解,
弄了老半天,各种求教搜索,EM是能用的,所以很无助,最后将PQ SQL从programfile(x86)移除到外面,路径只要不含有(),即可搞定,神奇的世界
最近在维护数据库时,解析数据时候,数据一直不能入库。原因知道,是因为MySQL的事务产生了死锁,前几次我直接重启MySQL。
最近发现频繁的出现。所以找到一种方法。
SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX;
trx_id trx_state trx_started trx_requested_lock_id trx_wait_started trx_weight trx_mysql_thread_id trx_query trx_operation_state trx_tables_in_use trx_tables_locked trx_lock_structs trx_lock_memory_bytes trx_rows_locked trx_rows_modified trx_concurrency_tickets trx_isolation_level trx_unique_checks trx_foreign_key_checks trx_last_foreign_key_error trx_adaptive_hash_latched trx_adaptive_hash_timeouttrx_id trx_state trx_started trx_requested_lock_id trx_wait_started trx_weight trx_mysql_thread_id trx_query trx_operation_state trx_tables_in_use trx_tables_locked trx_lock_structs trx_lock_memory_bytes trx_rows_locked trx_rows_modified trx_concurrency_tickets trx_isolation_level trx_unique_checks trx_foreign_key_checks trx_last_foreign_key_error trx_adaptive_hash_latched trx_adaptive_hash_timeout
查看事件比较久的事物。如何当前时间select sysdate();AM 10:07而事物开始的时间是:AM 9:50,显示是不正常的。根据这个事物的线程ID(trx_mysql_thread_id)。
执行命令:
kill 线程ID
数据库修复正常。
查看正在锁的事务
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
查看等待锁的事务
SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;
on primary database
SQL> select database_role from v$database; DATABASE_ROLE ---------------- PRIMARY SQL> alter database commit to switchover to physical standby; Database altered. SQL> select open_mode,database_role from v$database; OPEN_MODE DATABASE_ROLE -------------------- ---------------- READ WRITE PHYSICAL STANDBY SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options [oracle@prodServer ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Tue Mar 5 15:07:41 2013 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to an idle instance. SQL> startup nomount; ORACLE instance started. Total System Global Area 835104768 bytes Fixed Size 2232960 bytes Variable Size 541068672 bytes Database Buffers 289406976 bytes Redo Buffers 2396160 bytes SQL> alter database mount standby database; Database altered. SQL> alter database recover managed standby database using current logfile disconnect from session; Database altered. SQL> select open_mode,database_role from v$database; OPEN_MODE DATABASE_ROLE -------------------- ---------------- MOUNTED PHYSICAL STANDBY
On the original standby database
SQL> select database_role from v$database; DATABASE_ROLE ---------------- PHYSICAL STANDBY SQL> SQL> SQL> alter database commit to switchover to primary; Database altered. SQL> shutdown immediate ORA-01109: database not open Database dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area 417546240 bytes Fixed Size 2228944 bytes Variable Size 192941360 bytes Database Buffers 218103808 bytes Redo Buffers 4272128 bytes Database mounted. Database opened. SQL> select database_role from v$database; DATABASE_ROLE ---------------- PRIMARY SQL> select database_role from v$database; DATABASE_ROLE ---------------- PRIMARY SQL> select database_role,switchover_status from v$database; DATABASE_ROLE SWITCHOVER_STATUS ---------------- -------------------- PRIMARY TO STANDBY