How to find if FC-Switch using port-zoning or not Brocade FC 300 - san

I have to replace a HBA on RedHat5.3 due to card failure.
A tech guy asked me that "Check your FC-Switch Zoning Type of Port Zoning or not? , because if host accessed by WWNN, you'll need to update FC-switch config"
Is this below result on Brocade FC 300 showing Port-Zoning configuration or not?
fcsw03:admin> switchshow
switchName: xxxxx
switchType: 71.2
switchState: Online
switchMode: Native
switchRole: Principal
switchDomain: 1
switchId: fffc01
switchWwn: 10:00xxxxxxxxxxxxx
zoning: ON (zones)
switchBeacon: OFF
Index Port Address Media Speed State Proto
==============================================
0 0 011700 id N8 No_Light FC
1 1 011500 id N8 Online FC F-Port 21:00:00:24:xxxxxxxxxxxx
2 2 011300 id N8 No_Light FC
3 3 011100 id N8 No_Light FC
4 4 011600 id N8 No_Light FC
5 5 011400 id N8 No_Light FC
6 6 011200 id N8 Online FC F-Port 50:06:01:60:xxxxxxxxxxxx
7 7 011000 id N8 Online FC F-Port 50:06:01:69:xxxxxxxxxxxx
8 8 010f00 -- N8 No_Module FC (No POD License) Disabled
9 9 010d00 -- N8 No_Module FC (No POD License) Disabled
10 10 010b00 -- N8 No_Module FC (No POD License) Disabled
11 11 010900 -- N8 No_Module FC (No POD License) Disabled
12 12 010e00 -- N8 No_Module FC (No POD License) Disabled
13 13 010c00 -- N8 No_Module FC (No POD License) Disabled
14 14 010a00 -- N8 No_Module FC (No POD License) Disabled
15 15 010800 -- N8 No_Module FC (No POD License) Disabled
Thanks

Simple answer is to check zoneshow command output to list all configured zones. Zones that look like:
zone:test_1
21:00:00:24:XX:XX:XX:XX
50:06:01:60:XX:XX:XX:XX
50:06:01:69:XX:XX:XX:XX
Are using WWN addresses.
If you see something like:
zone:test_1
1,1
1,6
1,7
Then, you are using port-zoning. Here, the first 1 is the SwitchDomain ID and 1,6,7 are port numbers on that switch.
Also, zones can have a mixture of WWNs and ports definitions. Don't forget to do the same on the second Brocade switch as they are usually implementing Dual-Fabric configuration for redundancy and multi-pathing.

Related

What is a correct name for an operation that turns 3-column long table into a compact "2D" table with variable number of columns?

For example, from this table
row
col
val
0
A
32
0
B
31
0
C
35
1
A
30
1
B
29
1
C
29
2
A
15
2
B
14
2
D
18
3
A
34
3
B
39
3
C
34
3
D
35
it should produce this table:
A
B
C
D
0
32
31
35
1
30
29
29
2
15
14
18
3
34
39
34
35
Is there some official, canonical (or at least popular specific unambiguous) term for such operation (or its reverse)?
I am trying to find (or implement & publish) a tool that transforms CSV this way, but am unsure what to search for (or how to name it).
The term is pivot.
Some databases have native support for pivot, eg SQL Server's PIVOT (and even UNPIVOT) keywords.
For most databases you must craft a query that does the job.

Additional space after the end of a string in MS-SQL. Trimming does nothing [duplicate]

This question already has answers here:
How can I make SQL Server return FALSE for comparing varchars with and without trailing spaces?
(6 answers)
Why would SqlServer select statement select rows which match and rows which match and have trailing spaces
(4 answers)
Closed 5 months ago.
What's this? The last char is a space (ascii 32), but SQL says the trimmed version is exactly the same as the not trimmed one. Moreover, it turns out that the length of the keyword corresponds to the trimmed length of the keyword and that the space comes after what SQL considers to be the last character.
Note that there are only these 143 results in a table of billions (>1,000,000,000)
select k.Keyword, len(k.Keyword) LenKeyword, trim(k.Keyword) TrimKeyword,
case when k.Keyword=trim(k.Keyword) then 1 else 0 end isSame,
len(trim(k.Keyword)) LenTrimKeyword, SUBSTRING(k.Keyword,len(k.keyword)+1,1) LastCharPlus1
, ASCII (SUBSTRING(k.Keyword,len(k.keyword)+1,1)) AsciiLastCharPlus1
from #tk AdditionalSpaceAfterEndOfString
inner join SE_Keywords k
on AdditionalSpaceAfterEndOfString.Keyword=k.Keyword and AdditionalSpaceAfterEndOfString.Lang=k.Lang and AdditionalSpaceAfterEndOfString.Country=k.Country
order by k.DateAdded desc
Keyword LenKeyword TrimKeyword isSame LenTrimKeyword LastCharPlus1 AsciiLastCharPlus1
------------------------------------------------------------------------------------------------------------------------------------------------------ ----------- ------------------------------------------------------------------------------------------------------------------------------------------------------ ----------- -------------- ------------- ------------------
bio arganöl 11 bio arganöl 1 11 32
assurance retrait de permis 27 assurance retrait de permis 1 27 32
call center, centre d'appel, algerie, alger, fran?ais, francophone, ogs, ogs, ogsolution, 89 call center, centre d'appel, algerie, alger, fran?ais, francophone, ogs, ogs, ogsolution, 1 89 32
esta 4 esta 1 4 32
google périsprit 16 google périsprit 1 16 32
huizen aanbod den bosch 23 huizen aanbod den bosch 1 23 32
recruiting pflege 17 recruiting pflege 1 17 32
test by keywords 17 test by keywords 1 17 32
employer branding pflege 24 employer branding pflege 1 24 32
employer branding pflege 24 employer branding pflege 1 24 32
lepelboom 9 lepelboom 1 9 32
sun plaisance 13 sun plaisance 1 13 32
keyboost 4 10 keyboost 4 1 10 32
morocco desert tours 20 morocco desert tours 1 20 32
vraag aanbod reclame 20 vraag aanbod reclame 1 20 32
bedrijfskleding drukwerk 24 bedrijfskleding drukwerk 1 24 32
bedrijfstuitje zeilen 21 bedrijfstuitje zeilen 1 21 32
bmw occasion 12 bmw occasion 1 12 32
marketing altenheim 19 marketing altenheim 1 19 32
marketing pflegeeinrichtung 27 marketing pflegeeinrichtung 1 27 32
marketing prijsbeker 20 marketing prijsbeker 1 20 32
... 1 41 32
abonnement culture paris 24 abonnement culture paris 1 24 32
kommunikationsagentur pflege 28 kommunikationsagentur pflege 1 28 32
personalmarketing pflege 24 personalmarketing pflege 1 24 32
personalmarketing pflege 24 personalmarketing pflege 1 24 32
salon de beauté pavillons-sous-bois 35 salon de beauté pavillons-sous-bois 1 35 32
sophos safeguard 16 sophos safeguard 1 16 32
bon achat spectacles fnac 25 bon achat spectacles fnac 1 25 32
catering alphen-aan-den-rijn 28 catering alphen-aan-den-rijn 1 28 32
drone electronics 17 drone electronics 1 17 32
pflege marketing 16 pflege marketing 1 16 32
pop! vinyl 10 pop! vinyl 1 10 32
prêt sans banque 16 prêt sans banque 1 16 32
sebastien izambard 18 sebastien izambard 1 18 32
carte scenes et sorties 23 carte scenes et sorties 1 23 32
dongen nieuws delen 19 dongen nieuws delen 1 19 32
newerkkabels 12 newerkkabels 1 12 32
quad and camel in marrakech 27 quad and camel in marrakech 1 27 32
showroom marques de luxe 24 showroom marques de luxe 1 24 32
Trimming does not help, the only thing is looking if the char after the total of the string is a space:
select Keyword, Lang, Country into #tk from se_keywords where ascii (SUBSTRING(Keyword,len(keyword)+1,1)) is not null

How do I link against the ucrt library in Visual Studio 2019?

I am trying to understand how the linking process works for C programs in VS2019. According to Microsoft Docs, I need to pass the \MD option to link against ucrt.lib.
I wrote an empty main function and compiled+linked it to Sample.exe under two different configurations. In the default Debug configuration, the final binary produces the following output on running dumpbin /imports Sample.exe:
VCRUNTIME140D.dll
41B098 Import Address Table
41B2A4 Import Name Table
0 time date stamp
0 Index of first forwarder reference
2E __vcrt_GetModuleFileNameW
35 _except_handler4_common
48 memset
1D __current_exception_context
1C __current_exception
2F __vcrt_GetModuleHandleW
31 __vcrt_LoadLibraryExW
25 __std_type_info_destroy_list
ucrtbased.dll
41B0E8 Import Address Table
41B2F4 Import Name Table
0 time date stamp
0 Index of first forwarder reference
2EE _seh_filter_dll
545 strcat_s
2E2 _register_onexit_function
10C _execute_onexit_table
E8 _crt_atexit
E7 _crt_at_quick_exit
E0 _controlfp_s
566 terminate
3C9 _wmakepath_s
3E5 _wsplitpath_s
57F wcscpy_s
8E __stdio_common_vsprintf_s
549 strcpy_s
73 __p__commode
2FA _set_new_mode
DB _configthreadlocale
2E3 _register_thread_local_exe_atexit_callback
C5 _c_exit
CA _cexit
70 __p___argv
6F __p___argc
2F7 _set_fmode
111 _exit
476 exit
19A _initterm_e
199 _initterm
162 _get_initial_narrow_environment
196 _initialize_narrow_environment
DC _configure_narrow_argv
81 __setusermatherr
2F2 _set_app_type
2EF _seh_filter_exe
15 _CrtDbgReportW
14 _CrtDbgReport
197 _initialize_onexit_table
KERNEL32.dll
41B000 Import Address Table
41B20C Import Name Table
0 time date stamp
0 Index of first forwarder reference
345 HeapAlloc
37F IsDebuggerPresent
462 RaiseException
3EF MultiByteToWideChar
5FE WideCharToMultiByte
44D QueryPerformanceCounter
218 GetCurrentProcessId
2E9 GetSystemTimeAsFileTime
58C TerminateProcess
217 GetCurrentProcess
2AE GetProcAddress
1AB FreeLibrary
5CE VirtualQuery
2B4 GetProcessHeap
349 HeapFree
21C GetCurrentThreadId
261 GetLastError
278 GetModuleHandleW
386 IsProcessorFeaturePresent
2D0 GetStartupInfoW
56D SetUnhandledExceptionFilter
5AD UnhandledExceptionFilter
363 InitializeSListHead
Whereas, under the Release configuration, I am getting this:
VCRUNTIME140.dll
402034 Import Address Table
402608 Import Name Table
0 time date stamp
0 Index of first forwarder reference
48 memset
1D __current_exception_context
1C __current_exception
35 _except_handler4_common
KERNEL32.dll
402000 Import Address Table
4025D4 Import Name Table
0 time date stamp
0 Index of first forwarder reference
386 IsProcessorFeaturePresent
37F IsDebuggerPresent
363 InitializeSListHead
2E9 GetSystemTimeAsFileTime
21C GetCurrentThreadId
5AD UnhandledExceptionFilter
56D SetUnhandledExceptionFilter
217 GetCurrentProcess
58C TerminateProcess
218 GetCurrentProcessId
44D QueryPerformanceCounter
278 GetModuleHandleW
api-ms-win-crt-runtime-l1-1-0.dll
402060 Import Address Table
402634 Import Name Table
0 time date stamp
0 Index of first forwarder reference
44 _set_app_type
39 _initterm_e
58 exit
25 _exit
35 _initialize_narrow_environment
5 __p___argc
6 __p___argv
17 _cexit
16 _c_exit
3F _register_thread_local_exe_atexit_callback
19 _configure_narrow_argv
42 _seh_filter_exe
2A _get_initial_narrow_environment
36 _initialize_onexit_table
3E _register_onexit_function
1F _crt_atexit
1D _controlfp_s
6A terminate
38 _initterm
api-ms-win-crt-math-l1-1-0.dll
402058 Import Address Table
40262C Import Name Table
0 time date stamp
0 Index of first forwarder reference
2E __setusermatherr
api-ms-win-crt-stdio-l1-1-0.dll
4020B0 Import Address Table
402684 Import Name Table
0 time date stamp
0 Index of first forwarder reference
54 _set_fmode
1 __p__commode
api-ms-win-crt-locale-l1-1-0.dll
402050 Import Address Table
402624 Import Name Table
0 time date stamp
0 Index of first forwarder reference
8 _configthreadlocale
api-ms-win-crt-heap-l1-1-0.dll
402048 Import Address Table
40261C Import Name Table
0 time date stamp
0 Index of first forwarder reference
16 _set_new_mode
The link on top talks about how two different versions of the DLLs are used for Release and Debug configurations but here, I am linking to two different sets of DLLs. Why is this happening? The docs say that ucrt.dll is sufficient for the Standard C library functions. How do I just link to that?
Also, why do I require VCRUNTIME DLL when I am not using any C++?

Combine results from two SQL Server tables even if they don't have common rows

I have two tables in SQL Server:
Table 1:
Silo Material F2601 11 This Month
---------------------------------------
1 Bottle Cullet 0
2 Salt Cake 832
2 Sand 0
3 03 Soda Ash 466430
4 Fluorspar 2820
5 Barytes 2393
6 06 Borax 297405
7 Mixed Cullet 12377
8 Syenite 179880
9 09 Bottle Cullet 0
10 10 Sand 1356551
11 11 BD Lime 164171
12 12 EP Dust 13745
13 Fluorspar 14236
14 Bottle Cullet 0
15 Bottle Cullet 0
16 Syenite 0
Table 2:
Silo Material F2601 11 Last Month
---------------------------------------
1 Bottle Cullet 0
2 Sand 0
3 03 Soda Ash 467382
4 Fluorspar 3758
5 Barytes 5028
6 06 Borax 318729
7 Mixed Cullet 20955
8 Syenite 151361
9 09 Bottle Cullet 0
10 10 Sand 1393186
11 11 BD Lime 169514
12 12 EP Dust 11905
13 Fluorspar 0
14 Bottle Cullet 0
14 Bottle Cullet 14 0
15 Bottle Cullet 0
16 Syenite 0
and I am looking for a query result of...
Silo Material F2601 11 This Month F2601 11 Last Month
------------------------------------------------------------
1 Bottle Cullet 0 0
2 Salt Cake 832 0
2 Sand 0 0
3 03 Soda Ash 466430 467382
4 Fluorspar 2820 3758
5 Barytes 2393 5028
6 06 Borax 297405 318729
7 Mixed Cullet 12377 20955
8 Syenite 179880 151361
9 09 Bottle Cullet 0 0
10 10 Sand 1356551 1393186
11 11 BD Lime 164171 169514
12 12 EP Dust 13745 11905
13 Fluorspar 14236 0
14 Bottle Cullet 0 0
14 Bottle Cullet 14 0 0
15 Bottle Cullet 0 0
16 Syenite 0 0
Any help is much appreciated. It seems as though I want to combine columns but need columns that exist in one and not the other put into result set with a zero in place for the column that does not exist in that respective table.
I'm not sure of well understanding the question. But I'd go with a LEFT JOIN on the IDs, and using IFNULL.
Something like the following query will set you in the right track:
SELECT
t1.id, t1.name, t1.number, t2.number
FROM table1 t1 LEFT JOIN table2 t2 ON t1.id = t2.id
ORDER BY t1.id;
Then you can play with IFNULL() to better format the results.

Display result of query without primary key

I want to join two tables (each table has 200 columns) so the purpose of this is to have a table with 400 columns, but how do I get the result without the primary key?
id a1 a2 a3 ... a200
-----------------------
1 23 4 5 7
2 24 6 8 17
3 13 14 52 73
...
id b1 b2 b3 ... b200
-----------------------
1 53 14 15 87
2 64 16 18 87
3 73 74 12 83
...
So the sesult I want is like
a1 a2 a3 ... a200 b1 b2 b3 .... b200
--------------------------------------
23 4 5 7 53 14 15 87
24 6 8 17 64 16 18 87
13 14 52 73 73 74 12 83
...
I have this
SELECT * a as T1 join b as T2 on T1.id=T2.id;
There is no way to say SELECT (* EXCEPT some_col), sorry. However, it is quite easy to generate the list by dragging the "Columns" node for each table from Object Explorer onto the query window, and then simply remove the PK columns from the list. Click on the Columns node for a view or table, then drag it onto the query window:
Voila!
You will have to specify each individual column in the SELECT statement:
SELECT a1, a2, a3, ..., a200, b1, ..., b200
FROM T1
join T2 on T1.id = T2.id
Clearly this is overly cumbersome.
I would take a look at why you have so many columns and whether your data is properly normalised. Alternatively, is there the potential to simply use the columns you need nearer to the UI (if there is one?)

Resources