ORA-12154: TNS: could not resolve the connect identifier specified(Oracle 資料錯誤 12154:TNS: 無法解析指定的連線識別元)
ORA-12154: TNS 接聽程式目前無法識別連接描述項中請求的服務
ORA-12541: TNS: 無接聽程式
ORA-12170: TNS: 發生連接逾時
透過 TNS_ADMIN 系統變量傳達 TNSNames.ora 檔案中連接詳細資訊的剩餘部分。請注意,您應將可選的服務名稱和通訊埠資訊留空,否則可能會透過複製資訊對連接產生干擾。
啟動終端機並輸入以下指令:
sudo nano /etc/launchd.conf
附註:Nano 是一種依據文字的編輯器,始終可在 Mac 電腦上找到。
提示時輸入您的密碼。
輸入以下指令:
launch setenv TNS_ADMIN /etc
啟動終端機並輸入以下指令:
export
您將看到所有系統變量的清單。尋找:
declare -x TNS_ADMIN="/etc"
步驟摘要:
sudo su tableau
cd /opt/tableau/tableau_driver/oracle
附註:環境路徑的結尾不應該有斜線;如果路徑格式不正確,使用者可能會遇到 ORA-12154 錯誤。
如果 Oracle 用戶端已安裝在您的伺服器上,tnsnames.ora 檔案可在以下目錄中找到:$ORACLE_HOME/network/admin
您可以使用以下命令來驗證該檔案是否存在:
echo $ORACLE_HOME
將列印檔案路徑。
sudo find / -iname tnsnames.ora
將列出檔案系統中任何 tnsnames.ora 檔案的位置。
附註:不必安裝 Oracle 用戶端,即可將 tnsnames.ora 與 Tableau Server 搭配使用。此步驟只是為了幫助您使用任何現有安裝。
如果此電腦沒有 tnsnames.ora 檔案,而且您沒有要從用戶端工作站複製的檔案,則可以使用文字編輯器建立一個檔案。請記住以下限制:
tnsnames.ora 檔案名稱區分大小寫,且必須為全小寫字母。
檔案不應使用 tab 間隔。
以下是一個潛在的條目範本。必須將括號中的元素取代為您從資料庫管理員取得的值。
附註:儘管 Windows 或 Mac 電腦上的 TNSNames.ora 檔案可能不需要 ADDRESS_LIST 條目,但 Linux 電腦上的 tnsnames.ora 檔案需要此變量。
[net_service_name]=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=[protocol_address_information])
)
(CONNECT_DATA=
(SERVICE_NAME=[service_name])
)
)
例如:
Production =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = prod.corp.com)(PORT = 1521)
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
(透過在 Oracle 上設定的 SSL)為 Oracle 設定 ORACLE_HOME 和 TNS_ADMIN
sudo su -l tableau
touch /var/opt/tableau/tableau_server/.config/systemd/tableau_server.conf.d/oracle.conf
echo "ORACLE_HOME=/u01/app/oracle/product/12.1.0/client_1" | tee -a /var/opt/tableau/tableau_server/.config/systemd/tableau_server.conf.d/oracle.conf
echo "TNS_ADMIN=/u01/app/oracle/product/12.1.0/client_1/network/admin" | tee -a /var/opt/tableau/tableau_server/.config/systemd/tableau_server.conf.d/oracle.conf
chmod 744 /var/opt/tableau/tableau_server/.config/systemd/tableau_server.conf.d/oracle.conf
exit
cd /opt/tableau/tableau_server/packages/scripts.near.xx.xxxx.xxxx/
sudo ./stop-administrative-services
sudo ./start-administrative-services
source /etc/profile.d/tableau_server.sh
001453730

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.