ORA-01747: 열명을 올바르게 지정해 주십시오 

 

말 그대로 열명을 올바르게 하지 않은 경우인데

 

[예1]

SELECT COL1
 , COL2
 , COL3
 ,
FROM [TABLE 이름]
WHERE [조건절]

 

[예2]
SELECT COL1
 , COL2
 , , COL3
FROM [TABLE 이름]
WHERE [조건절]

 

위의 예와 같이  , 를 쓰고 열 명을 빠뜨린 경우에 난다.

Posted by like winds
,

http://www.sql-server-performance.com/linked_server.asp

여러분 링크드 서버는 넘 느려서 못써 이런 생각을 많이들 하고 있습니다.

저또한 이것을 해결 못해서 넘 느리다라는 것을 한탄 하고 있었습니다.

그러나 이것은 두 서버간의 글자셋팅과 기타 설정이 다를것을 대비한 디폴트 옵션으로 상호

두 서버간의 호환성을 체크하는 과정에서 비롯된 -_- 된장 인것으로 드러났습니다.

 ------------------------------------------------------------------------------
뿐만아니라 where 절의 조건 비교 연산을 하는 시점이 달라진다. 이 옵션이 켜져 있으면
원격서버에서 where 절에 해당하는 정보만 가지고 오게 된다 그렇지 않을경우
정렬을 맞추기 위해서 몽땅 다 들고와서 로컬에서 where 조건을 먹이게 된다.
그럼 원격서버를 이용한 부하분산 서버도 구현 가능할것 같다. ^^;
------------------------------------------------------------------------------

설정은 간단합니다.

두서버의 설정은 같다라고 설정 한번으로 퍼포먼스를 10배에서 100배 올라갑니다.

SP_SERVEROPTION "collation compatible" option to true 로 설정해 주기 바랍니다.

엔터프라이즈 링크드 서버 속성에도 설정하는 것이 있습니다.

->
다음 예에서는 SQL Server 인스턴스인 SEATTLE3에 해당하는 연결된 서버를 구성하여
SQL Server 의 로컬 인스턴스와 데이터 정렬이 호환되도록 합니다.

USE master;
EXEC sp_serveroption 'SEATTLE3', 'collation compatible', 'true';
 
sp_serveroption [@server = ] 'server'
 ,[@optname = ] 'option_name' ,[@optvalue = ] 'option_value' ;

 

--------------------------------------------------------------------------

http://www.sql-server-performance.com/linked_server.asp

Link Servers

By

Distributed transactions, over linked servers, incur more overhead than transactions occurring on the same server. This is due, in part, to the fact that more than one server is involved in the transaction and more network traffic is generated. Because of the overhead involved in distributed transactions, they should be avoided when they can be avoided. In other words, only use distributed transactions when there are no alternatives available to accomplish your goal. [6.5, 7.0, 2000, 2005] Updated 8-7-2006

*****

If you need to access data from a remote server from within a query, it is more efficient to perform a linked server query (after having created a linked server) rather than using an ad hoc query that uses the OPENROWSET or the OPENDATASOURCE functions. [7.0, 2000, 2005] Updated 8-7-2006

*****

By default, when you run a distributed query using a linked server, the query is processed locally. This may or may not be efficient, depending on how much data must be sent from the remote server to the local server for processing. Sometimes it is more efficient to pass through the query so that it is run on the remote server. This way, if the query must process many rows, it can process them on the remote server, and only return to the local server the results of the query. The OPENQUERY function is used to specify that a distributed query be processed on the remote server instead of the local server. [7.0, 2000, 2005] Updated 8-7-2006

*****

When running distributed queries on a linked server, if the linked server has the same character set and sort order (collation) as the local SQL Server, then you can reduce overhead and boost performance if you set the SP_SERVEROPTION “collation compatible” option to true. What this setting does is tell SQL Server to assume that all columns and character sets on the remote server are compatible with the local server. This same option can also be turned on for a linked server using Enterprise Manager or Management Studio.

If this option is not selected, then the distributed query being executed on the remote server must return the entire table to the local server in order for the WHERE clause to be applied. As you can imagine, this could potentially return a lot of unnecessary data over the network, slowing it down.

If the option is selected, (which is always recommended if the collations are the same on both servers), then the WHERE clause is applied on the remote server. This, of course, means that much less data is transmitted over the network, often greatly speeding up the distributed query. [7.0, 2000, 2005] Updated 8-7-2006

*****

If you run many distributed queries through linked servers, you will want to ensure that the connection between the linked servers is fast. Ideally, the linked servers should be connected to the same switch, or at least be in the same subnet. [7.0, 2000, 2005] Updated 8-7-2006

*****

In SQL Server 2000 and 2005, when creating a linked server, in the Server Options tab, there is an option called Connection Timeout and Query Timeout. The default setting for both of these options is 0, which means that there is no timeout value for either of these options. This means that long running remote queries will not time out.

If you suspect that some of the remote queries that will be run may take “too long” and unnecessarily use up too many server and network resources, you can enter a time in seconds that you are willing to wait for a remote query to run, but if the query takes longer than the amount you have specified, then it will be aborted. You can use this feature to ensure that no long running queries take up more resources than they should. [2000, 2005] Updated 8-7-2006

*****

When you create a link between two SQL Servers, SQL Server does its best to perform as much work as it can on the remote server. This way, less data has to be moved from the remote server to the local server, helping to reduce overhead and boosting performance. But for some particular operations, they have to be performed on the local server, not the remote server. Some examples of locally performed operations include:

  • Data conversion operations
  • Queries that use the bit, timestamp, or uniqueidentifier data types
  • Queries that use the TOP clause
  • INSERTS, UPDATES, or DELETES

Because of this, you may want to try to avoid performing any of the above operations using a remote linked server.

If you are running a remote query against a linked server, and you want to find out which parts are performing on the remote server and which are performing on the local server, run the query from Query Analyzer or Management Studio and take a look at the query plan. It will tell you what part of your query is running where. It should be your goal to create code that runs mostly on the remote server, not the local server. [7.0, 2000, 2005] Updated 8-7-2006

Posted by like winds
,

MS SQL Server 의 강점중에 하나가 Enterprise Management Studio 이다.
그리고, Enterprise Management Studio 을 간단하게 설치할 수 있다.

Oracle 의 경우에 golden, toad 등등의 수많은 관리툴이 있지만
MS SQL 의 경우에는 Enterprise Management Studio 가 공짜로 주어진다.

설치 iso 에 들어가 있기도 하지만,
굳이 local 의 Database Engine 을 설치하는 경우가 아니라면
Enterprise Management Studio 설치파일을 받아서 간편하게 설치할 수 있다.

정말 MS 가 이런건 잘 되어 있다.

1. MS download center 방문

http://www.microsoft.com/ko-kr/download/ 또는
http://www.microsoft.com/download/


2. 검색어 입력
- SQL Server 2012 Express 입력
- 검색 결과에서 "Microsoft SQL Server 2012 Express" 선택




3. 다운 받을 언어 선택

 


4. 사용하는 OS 64bit 가 라면 x64 를 선택


5. 사용하는 OS 64bit 가 라면 x86 를 선택

 

6. 실행후의 모습.

Posted by like winds
,