Aylar: Nisan 2015

Fixed – ORA-12560: TNS: protocol adapter error

On your Windows client, you need to specify the TNS alias @ORCL, or else it assumes you’re trying to connect to a local database running on your Windows client, which there isn’t one. Also, system as sysdba generally isn’t used, not even sure if that makes sense. SYS as sysdba and just plain system are used.

Enter user-name: system@ORCL
Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning option

If you don’t have tnsnames.ora set up on your Windows client, you can still connect via EZCONNECT string @"hayer:1522/orcl" instead of setting up tnsnames (yes, the quotes are needed).

Enter user-name: system@"hayer:1522/orcl"
Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning option




ALINTIDIR

C’de ctrl-c komutunu devre dışı bırakmak

Amaç: Konsolda çalışmakta olan bir program normalde ctrl-c’ye basıldığında kapanmaktadır. Öyle bir program tasarlansın isteniyor ki, ctrl-c’ye basıldığında kapatılamasın ve ctrl-\’ye basıldığında uyarı vererek kapansın.

#include
#include
void sigproc(void);

void quitproc(void);

main()
{ signal(SIGINT, sigproc);
signal(SIGQUIT, quitproc);
printf("ctrl-c disabled use ctrl-\\ to quit\n");
for(;;); /* infinite loop */}

void sigproc()
{ signal(SIGINT, sigproc); /* */
/* NOTE some versions of UNIX will reset signal to default
after each call. So for portability reset signal each time */

printf("you have pressed ctrl-c \n");
}

void quitproc()
{ printf("ctrl-\\ pressed to quit\n");
exit(0); /* normal exit status */
}